#include <qtoqsapi.h> int qtoq_accept( int socket_descriptor, int req_type, struct sockaddr *address, int *address_length, qos_req *qos_data, unsigned int *qos_session, int *qos_descriptor, )
The qtoq_accept() API provides simplified Quality of Service support for connection-oriented sockets communications between RSVP aware applications on a client and server. The standard accept() sockets call can be replaced with this API.
An opened socket descriptor that has been bound to the IP address and port from which the application will accept connection requests.
The type of QoS service being requested. The possible values are:
REQ_SIGNAL_RET_EVENTS (1) | Use normal RSVP signaling and return RSVP events to the calling program. |
REQ_SIGNAL_NORET_EVENTS (2) | Use normal RSVP signaling without returning events to the calling program. |
REQ_NOSIGNAL (3) | See if the RSVP rule for the requested connection has been defined as "no signaling." If yes, then load the requested rule. |
Pointer to a sockaddr structure where the IP address and port of the client requesting the connection will be stored.
Pointer to an integer where the size of the address variable is given to the API and the length of the returned client address will be stored.
Pointer to a qos_req data structure that defines the type of service being requested and the source and destination addresses of the request.
The qos_req data structure is defined as follows:
typedef struct { int service; /* Values can be GUARANTEED_SERV (2) or CONTROLLED_LOAD_SERV (5) */ union { struct CL_spec /* Controlled-Load service */ { float TB_Tspec_r; /* token bucket rate in bytes/sec */ float TB_Tspec_b; /* token bucket depth in bytes */ float TB_Tspec_p; /* token bucket peak in bytes/sec */ unsigned long TB_Tspec_m; /* min policed unit in bytes */ unsigned long TB_Tspec_M; /* max packet size in bytes */ } CL_spec; struct Guar_spec /* Guaranteed service */ { float Guar_R; /* guaranteed rate in bytes/sec */ unsigned long Guar_S; /* slack term in microsecs */ } Guar_spec; } spec_u; } qos_spec_t; typedef struct { struct sockaddr dest; /* Destination address/port */ int d_length; /* Destination address length*/ struct sockaddr source; /* Source address/port */ int s_length; /* Source address length */ int style; /* Style of Reservation. */ qos_spec_t Spec; /* Flow info */ unsigned char result; /* API status */ } qos_req; /* End of QoS request structure */\
Pointer to an integer value where the unique QoS session ID can be stored. This ID is required for all future QoS API calls.
Pointer to an integer where the value of the descriptor that the application can wait on for RSVP events is stored. This value is set to NULL if it is not used.
None.
0 | if successful. |
-1 | if function failed. Errno indicates error reason. |
When qtoq_accept() fails errno can be set to one of the following:
Descriptor not valid.
Bad address.
Connection ended abnormally. An accept() was issued on a socket for which receives have been disallowed (due to a shutdown() call).
This also could be encountered if time elapsed since a successful Rbind() is greater than the margin allowed by the associated SOCKS server.
Bad address. System detected an address that was not valid while attempting to access the address or address_length parameters.
Interrupted function call.
Parameter not valid. This error code indicates one of the following:
Input/output error.
Too many descriptions for this process.
Too many descriptions in system.
There is not enough buffer space for the requested operation.
The specified descriptor does not reference a socket.
Operation not supported. The socket_descriptor parameter references a socket that does not support the accept(). The accept() is valid only on sockets that are connection-oriented (for example, type of SOCK_STREAM).
The protocol required to support the specified address family is not available at this time.
Unknown system state.
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPFA081 E | Unable to set return value or error code. |
For a description of the RSVP protocol, see RFC 2205 on the RFC Pages for The Internet Engineering Task Force.
Top | UNIX-Type APIs | APIs by category |