Specifications
Page 22 Remote Procedure Call Programming Guide
/*
* An RPC Service request
*/
struct svc_req {
u_long rq_prog; /* service program number */
u_long rq_vers; /* service protocol vers num */
u_long rq_proc; /* desired procedure number */
struct opaque_auth rq_cred; /* raw credentials from wire */
caddr_t rq_clntcred; /* credentials (read only) */
};
The rq_cred is mostly opaque, except for one field of interest: the style or flavor of authentication creden-
tials:
/*
* Authentication info. Mostly opaque to the programmer.
*/
struct opaque_auth {
enum_t oa_flavor; /* style of credentials */
caddr_t oa_base; /* address of more auth stuff */
u_int oa_length; /* not to exceed MAX_AUTH_BYTES */
};
The RPC package guarantees the following to the service dispatch routine:
1. That the request’s rq_cred is well formed. Thus the service implementor may inspect the request’s
rq_cred.oa_flavor to determine which style of authentication the caller used. The service implemen-
tor may also wish to inspect the other fields of rq_cred if the style is not one of the styles supported
by the RPC package.
2. That the request’s rq_clntcred field is either NULL or points to a well formed structure that corre-
sponds to a supported style of authentication credentials. Remember that only unix style is currently
supported, so (currently) rq_clntcred could be cast to a pointer to an authunix_parms structure. If
rq_clntcred is NULL, the service implementor may wish to inspect the other (opaque) fields of
rq_cred in case the service knows about a new type of authentication that the RPC package does not
know about.
Our remote users service example can be extended so that it computes results for all users except UID 16: