The user_rapi_callback() call provides the RSVP callback function.
Syntax
#include <rsvprapi.h> int _System user_rapi_callback( rapi_sid_t sid, rapi_eventinfo_t eventType, rapi_styleid_t styleID, int errorCode, int errorValue, struct sockaddr *pErrorNodeAddr, u_char errorFlags, int nFilterSpecs, rapi_filter_t *pFilterSpec, int nFlowSpecs, rapi_flowspec_t *pFlowSpec, int nAdSpecs, rapi_adspec_t *pAdSpec, void *pClientArg);
Parameters
sid
RAPI_PATH_EVENT
Error flag for a RAPI_PATH_ERROR event. Set to one of these values:
RAPI_ERRF_InPlace
Description
The user_rapi_callback() call processes asynchronous events from the RSVP API. A pointer to the function is passed to rapi_session(). The callback function must be declared as shown above. The name of the function is chosen by the user, but is shown above as user_rapi_callback().
The rapi_getfd() call returns a socket for the session. The socket may be used with the select() call as a read socket. When a select() call indicates that there is some data to read, a rapi_dispatch() call should be issued to read and process the data from the socket. Typically the rapi_dispatch() call will invoke the user callback function to provide the program with information, if the user supplied such a function in the rapi_session() call.
The user callback function should copy any information that it wants to save, because the storage that is pointed to by the pErrorNodeAddr, pFilterSpec, pFlowSpec, and pAdSpec will be freed as soon as the callback function returns.
Return Values
The function is declared to have an integer return value, but nothing is done with the value currently. It is recommended that the user always return 0.
Related Calls