1RPC_SVC_REG(3) BSD Library Functions Manual RPC_SVC_REG(3)
2
4 rpc_svc_reg, rpc_reg, svc_reg, svc_unreg, svc_auth_reg, xprt_register,
5 xprt_unregister — library routines for registering servers
6
8 #include <rpc/rpc.h>
9
10 int
11 rpc_reg(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
12 char *(*procname)(), xdrproc_t inproc, xdrproc_t outproc,
13 char *nettype);
14
15 bool_t
16 svc_reg(SVCXPRT *xprt, const rpcprog_t prognum, const rpcvers_t versnum,
17 void (*dispatch)(struct svc_req *, SVCXPRT *),
18 const struct netconfig *netconf);
19
20 void
21 svc_unreg(const rpcprog_t prognum, const rpcvers_t versnum);
22
23 int
24 svc_auth_reg(int cred_flavor,
25 enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *));
26
27 void
28 xprt_register(SVCXPRT *xprt);
29
30 void
31 xprt_unregister(SVCXPRT *xprt);
32
34 These routines are a part of the RPC library which allows the RPC servers
35 to register themselves with rpcbind (see rpcbind(8)), and associate the
36 given program and version number with the dispatch function. When the
37 RPC server receives a RPC request, the library invokes the dispatch rou‐
38 tine with the appropriate arguments.
39
41 See rpc(3) for the definition of the SVCXPRT data structure.
42
43 rpc_reg()
44 Register program prognum, procedure procname, and version versnum
45 with the RPC service package. If a request arrives for program
46 prognum, version versnum, and procedure procnum, procname is
47 called with a pointer to its argument(s); procname should return a
48 pointer to its static result(s); inproc is the XDR function used
49 to decode the arguments while outproc is the XDR function used to
50 encode the results. Procedures are registered on all available
51 transports of the class nettype. See rpc(3). This routine
52 returns 0 if the registration succeeded, -1 otherwise.
53
54 svc_reg()
55 Associates prognum and versnum with the service dispatch proce‐
56 dure, dispatch. If netconf is NULL, the service is not registered
57 with the rpcbind(8) service. If netconf is non-zero, then a map‐
58 ping of the triple [prognum, versnum, netconf->nc_netid] to
59 xprt->xp_ltaddr is established with the local rpcbind service.
60
61 The svc_reg() routine returns 1 if it succeeds, and 0 otherwise.
62
63 svc_unreg()
64 Remove from the rpcbind service, all mappings of the triple
65 [prognum, versnum, all-transports] to network address and all map‐
66 pings within the RPC service package of the double [prognum,
67 versnum] to dispatch routines.
68
69 svc_auth_reg()
70 Registers the service authentication routine handler with the dis‐
71 patch mechanism so that it can be invoked to authenticate RPC
72 requests received with authentication type cred_flavor. This
73 interface allows developers to add new authentication types to
74 their RPC applications without needing to modify the libraries.
75 Service implementors usually do not need this routine.
76
7