Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rpc_svc_input(3nsl) [opensolaris man page]

rpc_svc_input(3NSL)				       Networking Services Library Functions				       rpc_svc_input(3NSL)

NAME
rpc_svc_input, svc_add_input, svc_remove_input - declare or remove a callback on a file descriptor SYNOPSIS
#include <rpc/rpc.h> typedef void (*svc_callback_t)(svc_input_id_t id, int fd, unsigned int events, void *cookie); svc_input_id_t svc_add_input(int fd, unsigned int revents, svc_callback_t callback, void *cookie); int svc_remove_input(svc_input_t id); DESCRIPTION
The following RPC routines are used to declare or remove a callback on a file descriptor. Routines See rpc(3NSL) for the definition of the SVCXPRT data structure. svc_add_input() This function is used to register a callback function on a file descriptor, fd. The file descriptor, fd, is the first parameter to be passed to svc_add_input(). This callback function will be automatically called if any of the events specified in the events parameter occur on this descriptor. The events parameter is used to specify when the callback is invoked. This parameter is a mask of poll events to which the user wants to listen. See poll(2) for further details of the events that can be specified. The callback to be invoked is specified using the callback parameter. The cookie parameter can be used to pass any data to the callback function. This parameter is a user-defined value which is passed as an argument to the callback function, and it is not used by the Sun RPC library itself. Several callbacks can be registered on the same file descriptor as long as each callback registration specifies a separate set of event flags. The callback function is called with the registration id, the fd file descriptor, an revents value, which is a bit- mask of all events concerning the file descriptor, and the cookie user-defined value. Upon successful completion, the function returns a unique identifier for this registration, that can be used later to remove this callback. Upon failure, -1 is returned and errno is set to indicate the error. The svc_add_input() function will fail if: EINVAL The fd or events parameters are invalid. EEXIST A callback is already registered to the file descriptor with one of the specified events. ENOMEM Memory is exhausted. svc_remove_input() This function is used to unregister a callback function on a file descriptor, fd. The id parameter specifies the reg- istration to be removed. Upon successful completion, the function returns zero. Upon failure, -1 is returned and errno is set to indicate the error. The svc_remove_input() function will fail if: EINVAL The id parameter is invalid. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |All | +-----------------------------+-----------------------------+ |Availability |SUNWcsl (32-bit) | +-----------------------------+-----------------------------+ | |SUNWcslx (64-bit) | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
poll(2), rpc(3NSL), attributes(5) SunOS 5.11 6 Jan 2003 rpc_svc_input(3NSL)

Check Out this Related Man Page

rpc_gss_set_callback(3NSL)			       Networking Services Library Functions				rpc_gss_set_callback(3NSL)

NAME
rpc_gss_set_callback - specify callback for context SYNOPSIS
#include <rpc/rpcsec_gss.h> bool_t rpc_gss_set_callback(struct rpc_gss_callback_t *cb); DESCRIPTION
A server may want to specify a callback routine so that it knows when a context gets first used. This user-defined callback may be speci- fied through the rpc_gss_set_callback() routine. The callback routine is invoked the first time a context is used for data exchanges, after the context is established for the specified program and version. The user-defined callback routine should take the following form: bool_t callback(struct svc_req *req, gss_cred_id_t deleg, gss_ctx_id_t gss_context, rpc_gss_lock_t *lock, void **cookie); PARAMETERS
rpc_gss_set_callback() takes one argument: a pointer to a rpc_gss_callback_t structure. This structure contains the RPC program and ver- sion number as well as a pointer to a user-defined callback() routine. (For a description of rpc_gss_callback_t and other RPCSEC_GSS data types, see the rpcsec_gss(3NSL) man page.) The user-defined callback() routine itself takes the following arguments: req Pointer to the received service request. svc_req is an RPC structure containing information on the context of an RPC invocation, such as program, version, and transport information. deleg Delegated credentials, if any. (See NOTES, below.) gss_context GSS context (allows server to do GSS operations on the context to test for acceptance criteria). See NOTES, below. lock This parameter is used to enforce a particular QOP and service for a session. This parameter points to a RPCSEC_GSS rpc_gss_lock_t structure. When the callback is invoked, the rpc_gss_lock_t.locked field is set to TRUE, thus locking the context. A locked context will reject all requests having different values for QOP or service than those specified by the raw_cred field of the rpc_gss_lock_t structure. cookie A four-byte quantity that an application may use in any manner it wants to -- RPC does not interpret it. (For example, the cookie could be a pointer or index to a structure that represents a context initiator.) The cookie is returned, along with the caller's credentials, with each invocation of rpc_gss_getcred(). RETURN VALUES
rpc_gss_set_callback() returns TRUE if the use of the context is accepted; false otherwise. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ |Availability |SUNWrsg (32-bit) | +-----------------------------+-----------------------------+ | |SUNWrsgx (64-bit) | +-----------------------------+-----------------------------+ SEE ALSO
rpc(3NSL), rpc_gss_getcred(3NSL), rpcsec_gss(3NSL), attributes(5) ONC+ Developer's Guide Linn, J. RFC 2078, Generic Security Service Application Program Interface, Version 2. Network Working Group. January 1997. NOTES
If a server does not specify a callback, all incoming contexts will be accepted. Because the GSS-API is not currently exposed, the deleg and gss_context arguments are mentioned for informational purposes only, and the user-defined callback function may choose to do nothing with them. SunOS 5.10 5 Feb 2002 rpc_gss_set_callback(3NSL)
Man Page