qtoq_ioctl()--Set QoS Sockets Control Options API


  Syntax
 #include <qtoqsapi.h>

 int qtoq_ioctl(
               int               descriptor,
               int               req_type,
               qos_req           *qos_data,
               unsigned int      *qos_session,
               int               *qos_descriptor,
               )

  Service Program Name: QSYS/QTOQSAPI

  Default Public Authority: *EXCLUDE

  Threadsafe: Yes

The qtoq_ioctl() API provides simplified Quality of Service functionality for connectionless sockets communications between RSVP aware applications on a client and server. This API can be used to initiate RSVP signaling, as well as to determine the status of the RSVP connection. The NO SIGNALLING option for loading RSVP rules also is supported.


Parameters

descriptor
(Input) Required

An opened socket descriptor that has been bound to the IP address and port that the application will use for connectionless communications.

req_type
(Input) Required

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) Load specified QoS policy if admission control allows it.
REQ_GET_RSVP_DATA(4) Get the RSVP flowspec that has been returned as the result of an RSVP event. This request is valid only if a previous REQ_SIGNAL_RET_EVENTS request has been sent to the server.

qos_data
(Input) Required

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 below:

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 */

qos_session
(Output) Required

Pointer to an integer value where the unique QoS session ID can be stored. This ID is required for all future QoS API calls.

qos_descriptor
(Output) Optional

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.


Authorities

None.


Return Values

0 if successful.
-1 if function failed. Errno indicates error reason.


Error Conditions

When this function call fails, the errno value is set to one of the following:

[EACCES]

Permission denied. This error code indicates one of the following:


[EADDRINUSE]

Address already in use. This error code indicates one of the following:


[EADDRNOTAVAIL]

Address not available. This error code indicates one of the following:


[EAFNOSUPPORT]

The type of socket is not supported in this protocol family. The address family specified in the address structure pointed to by destination_address parameter cannot be used with the socket pointed to by the socket_descriptor parameter. This error also will be reported if the API is called with a socket type that is not AF_INET and SOCK_DGRAM or SOCK_STREAM.

[EALREADY]

Operation already in progress. A previous connect() function had already been issued for the socket pointed to by the socket_descriptor parameter, and has yet to be completed. This error code is returned only on sockets that use a connection-oriented transport service.

[EBADF]

Descriptor not valid.

[ECONNREFUSED]

The destination socket refused an attempted connect operation. This error occurs when there is no application that is bound to the address specified by the destination_address parameter.

[EFAULT]

Bad address. The system detected an address which was not valid while attempting to access the destination_address parameter.

[EHOSTUNREACH]

A route to the remote host is not available.

[EINPROGRESS]

Operation in progress. The socket_descriptor parameter points to a socket that is marked as non blocking and the connection could not be completed immediately. This error code is returned only on sockets that use a connection-oriented transport service.

[EINTR]

Interrupted function call.

[EINVAL]

Parameter not valid. This error code indicates one of the following:


[EIO]

Input/output error.

[EISCONN]

A connection has already been established.

This error code is returned only on sockets that use a connection-oriented transport service.

[ENETUNREACH]

Cannot reach the destination network. This error code indicates the following:


[ENOBUFS]

There is not enough buffer space for the requested operation.

[ENOTDIR]

Not a directory.

[EOPNOTSUPP]

Operation not supported.

[ETIMEDOUT]

A remote host did not respond within the timeout period. This error code is returned when connection establishment times out. No connection is established. A possible cause may be that the partner application is bound to the address specified by the destination_address parameter, but the partner application has not yet issued a listen().

[EUNKNOWN]

Unknown system state.

[EUNATCH]

The protocol required to support the specified address family is not available at this time.

[EPROTO]

An underlying protocol error has occurred.


Error Messages

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.


Usage Notes

  1. The application program can choose to be signaled when RSVP events occur or it can choose to allow the QoS server to handle the events. If the server handles the events, the application program will not be informed if the RSVP signaling failed or if the requested reservations was changed by the network.

Related Information

For a description of the RSVP protocol, see RFC 2205 on the RFC PagesLink outside information center.



API introduced: V5R2

[ Back to top | UNIX-Type APIs | APIs by category ]