rapi_session()--Create a RAPI session


  Syntax
 #include <rapi.h>
 rapi_sid_t  rapi_session(
                         rapi_addr_t       *Dest, 
                         int               Protid, 
                         int               flags, 
                         rapi_event_rtn_t  Event_rtn, 
                         void              *Event_arg,    
			 int               *errnop ) 


  Service program name: QSYS/QTOQRAPI

  Default public authority: *EXCLUDE

  Threadsafe: Yes

The rapi_session() API returns an API session ID that is unique to this request. This ID is used in calling the other RAPI APIs to identify which RSVP session is being requested.


Parameters

Dest
(Input) Required
A pointer to a rapi_addr_t structure defining the destination IP address and a port number that is the target of the data. The dest and protid parameters are used to identify an RSVP session. If the protid specifies UDP or TCP transport, the port value identifies the appropriate transport port number. The format of the rapi_addr_t structure is implementation-dependent.

Protid
(Input) Required
The IP protocol ID for the session. This value can be either 17(UDP) or 6(TCP). If is is zero, then 17(UDP) is assumed.

flags
(Input) Required
The flags value is set as follows:

1 RAPI_USE_INTSERV Currently, the only flag supported. If this flag is set, IntServ formats are used in the RAPI message-handling routines. I f this flag is not set, the simplified format is used.

Event_rtn
(Input) Required
A pointer to a RAPI message-handling routine that is called to communicate RSVP errors and state change events to the calling application. The RAPI message-handling routine is called when the rapi_dispatch() API is called as the result of events. This pointer is used with select() or poll(). This routine must be supplied by the application calling the API.

Event_arg
(Input/Output) Optional
An argument data that is passed to the RAPI message-handling routine function when it is called. It is set to NULL if not used.

errnop
(Input/Output) Required
A pointer to an integer in which a RAPI error code will be returned.

Authorities

None


Return Value

Successful completion of this function returns a nonzero session handle that can be used in further RAPI calls for this session. If the call fails, it returns zero (RAPI_NULL_SID) and stores a RAPI error code in the integer errnop parameter.


Error Conditions

[RAPI_ERR_NORSVP]

The RSVP server did not respond to the API request. Make sure the RSVP server is running.

[RAPI_ERR_UNSUPPORTED]

The flags parameter was set to an unsupported value.

[RAPI_ERR_SYSCALL]

There was a problem calling a system function. Check the system errno for further information.

[RAPI_ERR_INVAL]

A parameter that is not valid was used in the API call.

[RAPI_ERR_MAXSESS]

The maximum number of available RAPI sessions has been exceeded.


Usage Notes

  1. The rapi_session() API must be called to establish a session ID to be used with the other RAPI APIs.

  2. The RSVP server must be running before any of the RAPI APIs are called.

Related Information

For a description of the RSVP protocol, see RFC 2205 on the RFC Pages for The Internet Engineering Task Force.Link outside Information Center

Complete documentation of the RAPI APIs can be found at The Open Group.Link outside Information Center



API introduced: V5R1
Top | UNIX-Type APIs | APIs by category