2 * In-kernel rpcbind client supporting versions 2, 3, and 4 of the rpcbind
5 * Based on RFC 1833: "Binding Protocols for ONC RPC Version 2" and
6 * RFC 3530: "Network File System (NFS) version 4 Protocol"
8 * Original: Gilles Quillard, Bull Open Source, 2005 <gilles.quillard@bull.net>
9 * Updated: Chuck Lever, Oracle Corporation, 2007 <chuck.lever@oracle.com>
11 * Descended from net/sunrpc/pmap_clnt.c,
12 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
15 #include <linux/module.h>
17 #include <linux/types.h>
18 #include <linux/socket.h>
20 #include <linux/in6.h>
21 #include <linux/kernel.h>
22 #include <linux/errno.h>
25 #include <linux/sunrpc/clnt.h>
26 #include <linux/sunrpc/sched.h>
27 #include <linux/sunrpc/xprtsock.h>
30 # define RPCDBG_FACILITY RPCDBG_BIND
33 #define RPCBIND_PROGRAM (100000u)
34 #define RPCBIND_PORT (111u)
36 #define RPCBVERS_2 (2u)
37 #define RPCBVERS_3 (3u)
38 #define RPCBVERS_4 (4u)
45 RPCBPROC_GETADDR = 3, /* alias for GETPORT */
48 RPCBPROC_BCAST = 5, /* alias for CALLIT */
58 #define RPCB_HIGHPROC_2 RPCBPROC_CALLIT
59 #define RPCB_HIGHPROC_3 RPCBPROC_TADDR2UADDR
60 #define RPCB_HIGHPROC_4 RPCBPROC_GETSTAT
65 * The "owner" is allowed to unset a service in the rpcbind database.
66 * We always use the following (arbitrary) fixed string.
68 #define RPCB_OWNER_STRING "rpcb"
69 #define RPCB_MAXOWNERLEN sizeof(RPCB_OWNER_STRING)
71 static void rpcb_getport_done(struct rpc_task *, void *);
72 static void rpcb_map_release(void *data);
73 static struct rpc_program rpcb_program;
76 struct rpc_xprt * r_xprt;
81 unsigned short r_port;
89 static struct rpc_procinfo rpcb_procedures2[];
90 static struct rpc_procinfo rpcb_procedures3[];
91 static struct rpc_procinfo rpcb_procedures4[];
95 struct rpc_procinfo * rpc_proc;
98 static struct rpcb_info rpcb_next_version[];
99 static struct rpcb_info rpcb_next_version6[];
101 static const struct rpc_call_ops rpcb_getport_ops = {
102 .rpc_call_done = rpcb_getport_done,
103 .rpc_release = rpcb_map_release,
106 static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
108 xprt_clear_binding(xprt);
109 rpc_wake_up_status(&xprt->binding, status);
112 static void rpcb_map_release(void *data)
114 struct rpcbind_args *map = data;
116 rpcb_wake_rpcbind_waiters(map->r_xprt, map->r_status);
117 xprt_put(map->r_xprt);
121 static const struct sockaddr_in rpcb_inaddr_loopback = {
122 .sin_family = AF_INET,
123 .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
124 .sin_port = htons(RPCBIND_PORT),
127 static struct rpc_clnt *rpcb_create_local(struct sockaddr *addr,
128 size_t addrlen, u32 version)
130 struct rpc_create_args args = {
131 .protocol = XPRT_TRANSPORT_UDP,
134 .servername = "localhost",
135 .program = &rpcb_program,
137 .authflavor = RPC_AUTH_UNIX,
138 .flags = RPC_CLNT_CREATE_NOPING,
141 return rpc_create(&args);
144 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
145 size_t salen, int proto, u32 version)
147 struct rpc_create_args args = {
151 .servername = hostname,
152 .program = &rpcb_program,
154 .authflavor = RPC_AUTH_UNIX,
155 .flags = (RPC_CLNT_CREATE_NOPING |
156 RPC_CLNT_CREATE_NONPRIVPORT),
159 switch (srvaddr->sa_family) {
161 ((struct sockaddr_in *)srvaddr)->sin_port = htons(RPCBIND_PORT);
164 ((struct sockaddr_in6 *)srvaddr)->sin6_port = htons(RPCBIND_PORT);
170 return rpc_create(&args);
173 static int rpcb_register_call(const u32 version, struct rpc_message *msg)
175 struct sockaddr *addr = (struct sockaddr *)&rpcb_inaddr_loopback;
176 size_t addrlen = sizeof(rpcb_inaddr_loopback);
177 struct rpc_clnt *rpcb_clnt;
178 int result, error = 0;
180 msg->rpc_resp = &result;
182 rpcb_clnt = rpcb_create_local(addr, addrlen, version);
183 if (!IS_ERR(rpcb_clnt)) {
184 error = rpc_call_sync(rpcb_clnt, msg, 0);
185 rpc_shutdown_client(rpcb_clnt);
187 error = PTR_ERR(rpcb_clnt);
190 printk(KERN_WARNING "RPC: failed to contact local rpcbind "
191 "server (errno %d).\n", -error);
201 * rpcb_register - set or unset a port registration with the local rpcbind svc
202 * @prog: RPC program number to bind
203 * @vers: RPC version number to bind
204 * @prot: transport protocol to register
205 * @port: port value to register
207 * Returns zero if the registration request was dispatched successfully
208 * and the rpcbind daemon returned success. Otherwise, returns an errno
209 * value that reflects the nature of the error (request could not be
210 * dispatched, timed out, or rpcbind returned an error).
212 * RPC services invoke this function to advertise their contact
213 * information via the system's rpcbind daemon. RPC services
214 * invoke this function once for each [program, version, transport]
215 * tuple they wish to advertise.
217 * Callers may also unregister RPC services that are no longer
218 * available by setting the passed-in port to zero. This removes
219 * all registered transports for [program, version] from the local
222 * This function uses rpcbind protocol version 2 to contact the
223 * local rpcbind daemon.
225 * Registration works over both AF_INET and AF_INET6, and services
226 * registered via this function are advertised as available for any
227 * address. If the local rpcbind daemon is listening on AF_INET6,
228 * services registered via this function will be advertised on
229 * IN6ADDR_ANY (ie available for all AF_INET and AF_INET6
232 int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
234 struct rpcbind_args map = {
240 struct rpc_message msg = {
244 dprintk("RPC: %sregistering (%u, %u, %d, %u) with local "
245 "rpcbind\n", (port ? "" : "un"),
246 prog, vers, prot, port);
248 msg.rpc_proc = &rpcb_procedures2[RPCBPROC_UNSET];
250 msg.rpc_proc = &rpcb_procedures2[RPCBPROC_SET];
252 return rpcb_register_call(RPCBVERS_2, &msg);
256 * Fill in AF_INET family-specific arguments to register
258 static int rpcb_register_netid4(const struct sockaddr *sap,
259 struct rpc_message *msg)
261 const struct sockaddr_in *sin = (const struct sockaddr_in *)sap;
262 struct rpcbind_args *map = msg->rpc_argp;
263 unsigned short port = ntohs(sin->sin_port);
266 /* Construct AF_INET universal address */
267 snprintf(buf, sizeof(buf), "%pI4.%u.%u",
268 &sin->sin_addr.s_addr, port >> 8, port & 0xff);
271 dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with "
272 "local rpcbind\n", (port ? "" : "un"),
273 map->r_prog, map->r_vers,
274 map->r_addr, map->r_netid);
276 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET];
278 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET];
280 return rpcb_register_call(RPCBVERS_4, msg);
284 * Fill in AF_INET6 family-specific arguments to register
286 static int rpcb_register_netid6(const struct sockaddr *sap,
287 struct rpc_message *msg)
289 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sap;
290 struct rpcbind_args *map = msg->rpc_argp;
291 unsigned short port = ntohs(sin6->sin6_port);
294 /* Construct AF_INET6 universal address */
295 if (ipv6_addr_any(&sin6->sin6_addr))
296 snprintf(buf, sizeof(buf), "::.%u.%u",
297 port >> 8, port & 0xff);
299 snprintf(buf, sizeof(buf), "%pI6.%u.%u",
300 &sin6->sin6_addr, port >> 8, port & 0xff);
303 dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with "
304 "local rpcbind\n", (port ? "" : "un"),
305 map->r_prog, map->r_vers,
306 map->r_addr, map->r_netid);
308 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET];
310 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET];
312 return rpcb_register_call(RPCBVERS_4, msg);
316 * rpcb_v4_register - set or unset a port registration with the local rpcbind
317 * @program: RPC program number of service to (un)register
318 * @version: RPC version number of service to (un)register
319 * @address: address family, IP address, and port to (un)register
320 * @netid: netid of transport protocol to (un)register
322 * Returns zero if the registration request was dispatched successfully
323 * and the rpcbind daemon returned success. Otherwise, returns an errno
324 * value that reflects the nature of the error (request could not be
325 * dispatched, timed out, or rpcbind returned an error).
327 * RPC services invoke this function to advertise their contact
328 * information via the system's rpcbind daemon. RPC services
329 * invoke this function once for each [program, version, address,
330 * netid] tuple they wish to advertise.
332 * Callers may also unregister RPC services that are no longer
333 * available by setting the port number in the passed-in address
334 * to zero. Callers pass a netid of "" to unregister all
335 * transport netids associated with [program, version, address].
337 * This function uses rpcbind protocol version 4 to contact the
338 * local rpcbind daemon. The local rpcbind daemon must support
339 * version 4 of the rpcbind protocol in order for these functions
340 * to register a service successfully.
342 * Supported netids include "udp" and "tcp" for UDP and TCP over
343 * IPv4, and "udp6" and "tcp6" for UDP and TCP over IPv6,
346 * The contents of @address determine the address family and the
347 * port to be registered. The usual practice is to pass INADDR_ANY
348 * as the raw address, but specifying a non-zero address is also
349 * supported by this API if the caller wishes to advertise an RPC
350 * service on a specific network interface.
352 * Note that passing in INADDR_ANY does not create the same service
353 * registration as IN6ADDR_ANY. The former advertises an RPC
354 * service on any IPv4 address, but not on IPv6. The latter
355 * advertises the service on all IPv4 and IPv6 addresses.
357 int rpcb_v4_register(const u32 program, const u32 version,
358 const struct sockaddr *address, const char *netid)
360 struct rpcbind_args map = {
364 .r_owner = RPCB_OWNER_STRING,
366 struct rpc_message msg = {
370 switch (address->sa_family) {
372 return rpcb_register_netid4(address, &msg);
374 return rpcb_register_netid6(address, &msg);
377 return -EAFNOSUPPORT;
381 * rpcb_getport_sync - obtain the port for an RPC service on a given host
382 * @sin: address of remote peer
383 * @prog: RPC program number to bind
384 * @vers: RPC version number to bind
385 * @prot: transport protocol to use to make this request
387 * Return value is the requested advertised port number,
388 * or a negative errno value.
390 * Called from outside the RPC client in a synchronous task context.
391 * Uses default timeout parameters specified by underlying transport.
393 * XXX: Needs to support IPv6
395 int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot)
397 struct rpcbind_args map = {
403 struct rpc_message msg = {
404 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT],
406 .rpc_resp = &map.r_port,
408 struct rpc_clnt *rpcb_clnt;
411 dprintk("RPC: %s(%pI4, %u, %u, %d)\n",
412 __func__, &sin->sin_addr.s_addr, prog, vers, prot);
414 rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin,
415 sizeof(*sin), prot, RPCBVERS_2);
416 if (IS_ERR(rpcb_clnt))
417 return PTR_ERR(rpcb_clnt);
419 status = rpc_call_sync(rpcb_clnt, &msg, 0);
420 rpc_shutdown_client(rpcb_clnt);
429 EXPORT_SYMBOL_GPL(rpcb_getport_sync);
431 static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbind_args *map, struct rpc_procinfo *proc)
433 struct rpc_message msg = {
436 .rpc_resp = &map->r_port,
438 struct rpc_task_setup task_setup_data = {
439 .rpc_client = rpcb_clnt,
441 .callback_ops = &rpcb_getport_ops,
442 .callback_data = map,
443 .flags = RPC_TASK_ASYNC,
446 return rpc_run_task(&task_setup_data);
450 * In the case where rpc clients have been cloned, we want to make
451 * sure that we use the program number/version etc of the actual
452 * owner of the xprt. To do so, we walk back up the tree of parents
453 * to find whoever created the transport and/or whoever has the
456 static struct rpc_clnt *rpcb_find_transport_owner(struct rpc_clnt *clnt)
458 struct rpc_clnt *parent = clnt->cl_parent;
460 while (parent != clnt) {
461 if (parent->cl_xprt != clnt->cl_xprt)
463 if (clnt->cl_autobind)
466 parent = parent->cl_parent;
472 * rpcb_getport_async - obtain the port for a given RPC service on a given host
473 * @task: task that is waiting for portmapper request
475 * This one can be called for an ongoing RPC request, and can be used in
476 * an async (rpciod) context.
478 void rpcb_getport_async(struct rpc_task *task)
480 struct rpc_clnt *clnt;
481 struct rpc_procinfo *proc;
483 struct rpc_xprt *xprt;
484 struct rpc_clnt *rpcb_clnt;
485 static struct rpcbind_args *map;
486 struct rpc_task *child;
487 struct sockaddr_storage addr;
488 struct sockaddr *sap = (struct sockaddr *)&addr;
492 clnt = rpcb_find_transport_owner(task->tk_client);
493 xprt = clnt->cl_xprt;
495 dprintk("RPC: %5u %s(%s, %u, %u, %d)\n",
496 task->tk_pid, __func__,
497 clnt->cl_server, clnt->cl_prog, clnt->cl_vers, xprt->prot);
499 /* Put self on the wait queue to ensure we get notified if
500 * some other task is already attempting to bind the port */
501 rpc_sleep_on(&xprt->binding, task, NULL);
503 if (xprt_test_and_set_binding(xprt)) {
504 dprintk("RPC: %5u %s: waiting for another binder\n",
505 task->tk_pid, __func__);
509 /* Someone else may have bound if we slept */
510 if (xprt_bound(xprt)) {
512 dprintk("RPC: %5u %s: already bound\n",
513 task->tk_pid, __func__);
517 salen = rpc_peeraddr(clnt, sap, sizeof(addr));
519 /* Don't ever use rpcbind v2 for AF_INET6 requests */
520 switch (sap->sa_family) {
522 proc = rpcb_next_version[xprt->bind_index].rpc_proc;
523 bind_version = rpcb_next_version[xprt->bind_index].rpc_vers;
526 proc = rpcb_next_version6[xprt->bind_index].rpc_proc;
527 bind_version = rpcb_next_version6[xprt->bind_index].rpc_vers;
530 status = -EAFNOSUPPORT;
531 dprintk("RPC: %5u %s: bad address family\n",
532 task->tk_pid, __func__);
536 xprt->bind_index = 0;
537 status = -EPFNOSUPPORT;
538 dprintk("RPC: %5u %s: no more getport versions available\n",
539 task->tk_pid, __func__);
543 dprintk("RPC: %5u %s: trying rpcbind version %u\n",
544 task->tk_pid, __func__, bind_version);
546 rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
548 if (IS_ERR(rpcb_clnt)) {
549 status = PTR_ERR(rpcb_clnt);
550 dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
551 task->tk_pid, __func__, PTR_ERR(rpcb_clnt));
555 map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC);
558 dprintk("RPC: %5u %s: no memory available\n",
559 task->tk_pid, __func__);
560 goto bailout_release_client;
562 map->r_prog = clnt->cl_prog;
563 map->r_vers = clnt->cl_vers;
564 map->r_prot = xprt->prot;
566 map->r_xprt = xprt_get(xprt);
567 map->r_netid = rpc_peeraddr2str(clnt, RPC_DISPLAY_NETID);
568 map->r_addr = rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR);
569 map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */
570 map->r_status = -EIO;
572 child = rpcb_call_async(rpcb_clnt, map, proc);
573 rpc_release_client(rpcb_clnt);
575 /* rpcb_map_release() has freed the arguments */
576 dprintk("RPC: %5u %s: rpc_run_task failed\n",
577 task->tk_pid, __func__);
581 xprt->stat.bind_count++;
585 bailout_release_client:
586 rpc_release_client(rpcb_clnt);
588 rpcb_wake_rpcbind_waiters(xprt, status);
589 task->tk_status = status;
591 EXPORT_SYMBOL_GPL(rpcb_getport_async);
594 * Rpcbind child task calls this callback via tk_exit.
596 static void rpcb_getport_done(struct rpc_task *child, void *data)
598 struct rpcbind_args *map = data;
599 struct rpc_xprt *xprt = map->r_xprt;
600 int status = child->tk_status;
602 /* Garbage reply: retry with a lesser rpcbind version */
604 status = -EPROTONOSUPPORT;
606 /* rpcbind server doesn't support this rpcbind protocol version */
607 if (status == -EPROTONOSUPPORT)
611 /* rpcbind server not available on remote host? */
612 xprt->ops->set_port(xprt, 0);
613 } else if (map->r_port == 0) {
614 /* Requested RPC service wasn't registered on remote host */
615 xprt->ops->set_port(xprt, 0);
619 xprt->ops->set_port(xprt, map->r_port);
620 xprt_set_bound(xprt);
624 dprintk("RPC: %5u rpcb_getport_done(status %d, port %u)\n",
625 child->tk_pid, status, map->r_port);
627 map->r_status = status;
631 * XDR functions for rpcbind
634 static int rpcb_encode_mapping(struct rpc_rqst *req, __be32 *p,
635 struct rpcbind_args *rpcb)
637 dprintk("RPC: encoding rpcb request (%u, %u, %d, %u)\n",
638 rpcb->r_prog, rpcb->r_vers, rpcb->r_prot, rpcb->r_port);
639 *p++ = htonl(rpcb->r_prog);
640 *p++ = htonl(rpcb->r_vers);
641 *p++ = htonl(rpcb->r_prot);
642 *p++ = htonl(rpcb->r_port);
644 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
648 static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p,
649 unsigned short *portp)
651 *portp = (unsigned short) ntohl(*p++);
652 dprintk("RPC: rpcb getport result: %u\n",
657 static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p,
660 *boolp = (unsigned int) ntohl(*p++);
661 dprintk("RPC: rpcb set/unset call %s\n",
662 (*boolp ? "succeeded" : "failed"));
666 static int rpcb_encode_getaddr(struct rpc_rqst *req, __be32 *p,
667 struct rpcbind_args *rpcb)
669 dprintk("RPC: encoding rpcb request (%u, %u, %s)\n",
670 rpcb->r_prog, rpcb->r_vers, rpcb->r_addr);
671 *p++ = htonl(rpcb->r_prog);
672 *p++ = htonl(rpcb->r_vers);
674 p = xdr_encode_string(p, rpcb->r_netid);
675 p = xdr_encode_string(p, rpcb->r_addr);
676 p = xdr_encode_string(p, rpcb->r_owner);
678 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
683 static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p,
684 unsigned short *portp)
688 int c, i, f, first, val;
691 addr_len = ntohl(*p++);
694 dprintk("RPC: rpcb_decode_getaddr: "
695 "service is not registered\n");
700 * Simple sanity check.
702 if (addr_len > RPCBIND_MAXUADDRLEN)
706 * Start at the end and walk backwards until the first dot
707 * is encountered. When the second dot is found, we have
708 * both parts of the port number.
714 for (i = addr_len - 1; i > 0; i--) {
716 if (c >= '0' && c <= '9') {
717 val += (c - '0') * f;
719 } else if (c == '.') {
725 *portp |= (val << 8);
732 * Simple sanity check. If we never saw a dot in the reply,
733 * then this was probably just garbage.
738 dprintk("RPC: rpcb_decode_getaddr port=%u\n", *portp);
742 dprintk("RPC: rpcbind server returned malformed reply\n");
746 #define RPCB_program_sz (1u)
747 #define RPCB_version_sz (1u)
748 #define RPCB_protocol_sz (1u)
749 #define RPCB_port_sz (1u)
750 #define RPCB_boolean_sz (1u)
752 #define RPCB_netid_sz (1+XDR_QUADLEN(RPCBIND_MAXNETIDLEN))
753 #define RPCB_addr_sz (1+XDR_QUADLEN(RPCBIND_MAXUADDRLEN))
754 #define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN))
756 #define RPCB_mappingargs_sz RPCB_program_sz+RPCB_version_sz+ \
757 RPCB_protocol_sz+RPCB_port_sz
758 #define RPCB_getaddrargs_sz RPCB_program_sz+RPCB_version_sz+ \
759 RPCB_netid_sz+RPCB_addr_sz+ \
762 #define RPCB_setres_sz RPCB_boolean_sz
763 #define RPCB_getportres_sz RPCB_port_sz
766 * Note that RFC 1833 does not put any size restrictions on the
767 * address string returned by the remote rpcbind database.
769 #define RPCB_getaddrres_sz RPCB_addr_sz
771 #define PROC(proc, argtype, restype) \
772 [RPCBPROC_##proc] = { \
773 .p_proc = RPCBPROC_##proc, \
774 .p_encode = (kxdrproc_t) rpcb_encode_##argtype, \
775 .p_decode = (kxdrproc_t) rpcb_decode_##restype, \
776 .p_arglen = RPCB_##argtype##args_sz, \
777 .p_replen = RPCB_##restype##res_sz, \
778 .p_statidx = RPCBPROC_##proc, \
784 * Not all rpcbind procedures described in RFC 1833 are implemented
785 * since the Linux kernel RPC code requires only these.
787 static struct rpc_procinfo rpcb_procedures2[] = {
788 PROC(SET, mapping, set),
789 PROC(UNSET, mapping, set),
790 PROC(GETPORT, mapping, getport),
793 static struct rpc_procinfo rpcb_procedures3[] = {
794 PROC(SET, getaddr, set),
795 PROC(UNSET, getaddr, set),
796 PROC(GETADDR, getaddr, getaddr),
799 static struct rpc_procinfo rpcb_procedures4[] = {
800 PROC(SET, getaddr, set),
801 PROC(UNSET, getaddr, set),
802 PROC(GETADDR, getaddr, getaddr),
803 PROC(GETVERSADDR, getaddr, getaddr),
806 static struct rpcb_info rpcb_next_version[] = {
808 .rpc_vers = RPCBVERS_2,
809 .rpc_proc = &rpcb_procedures2[RPCBPROC_GETPORT],
816 static struct rpcb_info rpcb_next_version6[] = {
818 .rpc_vers = RPCBVERS_4,
819 .rpc_proc = &rpcb_procedures4[RPCBPROC_GETADDR],
822 .rpc_vers = RPCBVERS_3,
823 .rpc_proc = &rpcb_procedures3[RPCBPROC_GETADDR],
830 static struct rpc_version rpcb_version2 = {
831 .number = RPCBVERS_2,
832 .nrprocs = RPCB_HIGHPROC_2,
833 .procs = rpcb_procedures2
836 static struct rpc_version rpcb_version3 = {
837 .number = RPCBVERS_3,
838 .nrprocs = RPCB_HIGHPROC_3,
839 .procs = rpcb_procedures3
842 static struct rpc_version rpcb_version4 = {
843 .number = RPCBVERS_4,
844 .nrprocs = RPCB_HIGHPROC_4,
845 .procs = rpcb_procedures4
848 static struct rpc_version *rpcb_version[] = {
856 static struct rpc_stat rpcb_stats;
858 static struct rpc_program rpcb_program = {
860 .number = RPCBIND_PROGRAM,
861 .nrvers = ARRAY_SIZE(rpcb_version),
862 .version = rpcb_version,
863 .stats = &rpcb_stats,