1 .\" @(#)rpc_svc_reg.3n 1.32 93/08/31 SMI; from SVr4
2 .\" Copyright 1989 AT&T
3 .\" @(#)rpc_svc_call 1.6 89/07/20 SMI;
4 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5 .\" $NetBSD: rpc_svc_reg.3,v 1.1 2000/06/02 23:11:14 fvdl Exp $
6 .\" $FreeBSD: src/lib/libc/rpc/rpc_svc_reg.3,v 1.6 2005/02/09 18:03:14 ru Exp $
19 .Nd library routines for registering servers
25 .Fn rpc_reg "rpcprog_t prognum" "rpcvers_t versnum" "rpcproc_t procnum" "char *(*procname)()" "xdrproc_t inproc" "xdrproc_t outproc" "char *nettype"
27 .Fn svc_reg "SVCXPRT *xprt" "const rpcprog_t prognum" "const rpcvers_t versnum" "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const struct netconfig *netconf"
29 .Fn svc_unreg "const rpcprog_t prognum" "const rpcvers_t versnum"
31 .Fn svc_auth_reg "int cred_flavor" "enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *)"
33 .Fn xprt_register "SVCXPRT *xprt"
35 .Fn xprt_unregister "SVCXPRT *xprt"
37 These routines are a part of the RPC
38 library which allows the RPC
39 servers to register themselves with rpcbind
42 and associate the given program and version
43 number with the dispatch function.
44 When the RPC server receives a RPC request, the library invokes the
45 dispatch routine with the appropriate arguments.
49 for the definition of the
62 If a request arrives for program
69 is called with a pointer to its argument(s);
71 should return a pointer to its static result(s);
73 is the XDR function used to decode the arguments while
75 is the XDR function used to encode the results.
76 Procedures are registered on all available transports of the class
80 This routine returns 0 if the registration succeeded,
87 with the service dispatch procedure,
93 the service is not registered with the
99 then a mapping of the triple
100 .Bq Fa prognum , versnum , netconf->nc_netid
103 is established with the local rpcbind
108 routine returns 1 if it succeeds,
111 Remove from the rpcbind
112 service, all mappings of the triple
113 .Bq Fa prognum , versnum , No all-transports
115 and all mappings within the RPC service package
117 .Bq Fa prognum , versnum
118 to dispatch routines.
120 Registers the service authentication routine
122 with the dispatch mechanism so that it can be
123 invoked to authenticate RPC requests received
124 with authentication type
126 This interface allows developers to add new authentication
127 types to their RPC applications without needing to modify
129 Service implementors usually do not need this routine.
131 Typical service application would call
133 after registering the service and prior to calling
135 When needed to process an RPC credential of type
139 procedure will be called with two arguments,
140 .Fa "struct svc_req *rqst"
142 .Fa "struct rpc_msg *msg" ,
143 and is expected to return a valid
146 There is no provision to change or delete an authentication handler
151 routine returns 0 if the registration is successful,
154 already has an authentication handler registered for it,
157 After RPC service transport handle
159 is created, it is registered with the RPC
161 This routine modifies the global variable
164 .Xr rpc_svc_calls 3 ) .
165 Service implementors usually do not need this routine.
166 .It Fn xprt_unregister
167 Before an RPC service transport handle
169 is destroyed, it unregisters itself with the
171 This routine modifies the global variable
174 .Xr rpc_svc_calls 3 ) .
175 Service implementors usually do not need this routine.
181 .Xr rpc_svc_calls 3 ,
182 .Xr rpc_svc_create 3 ,