aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/rpcb_clnt.c
diff options
context:
space:
mode:
author\"Talpey, Thomas\ <Thomas.Talpey@netapp.com>2007-09-10 13:42:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:17:18 -0400
commit4f40ee4a02a2d017b714d5b2faaf5c25bf9eae47 (patch)
treeb5de8ba7983428f3764e24664a4ae790efb2b596 /net/sunrpc/rpcb_clnt.c
parent817cb9d43d4c330f9fc023d96e5beaa1abe8c4b7 (diff)
SUNRPC: move per-transport rpcbind netid's
Move the TCP/UDP rpcbind netid's from the rpcbind client to a global header. Signed-off-by: Tom Talpey <tmt@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r--net/sunrpc/rpcb_clnt.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index d7b9f02489e6..b028a0ecd593 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -93,26 +93,6 @@ enum {
93#define RPCB_MAXADDRLEN (128u) 93#define RPCB_MAXADDRLEN (128u)
94 94
95/* 95/*
96 * r_netid
97 *
98 * Quoting RFC 3530, section 2.2:
99 *
100 * For TCP over IPv4 the value of r_netid is the string "tcp". For UDP
101 * over IPv4 the value of r_netid is the string "udp".
102 *
103 * ...
104 *
105 * For TCP over IPv6 the value of r_netid is the string "tcp6". For UDP
106 * over IPv6 the value of r_netid is the string "udp6".
107 */
108#define RPCB_NETID_UDP "\165\144\160" /* "udp" */
109#define RPCB_NETID_TCP "\164\143\160" /* "tcp" */
110#define RPCB_NETID_UDP6 "\165\144\160\066" /* "udp6" */
111#define RPCB_NETID_TCP6 "\164\143\160\066" /* "tcp6" */
112
113#define RPCB_MAXNETIDLEN (4u)
114
115/*
116 * r_owner 96 * r_owner
117 * 97 *
118 * The "owner" is allowed to unset a service in the rpcbind database. 98 * The "owner" is allowed to unset a service in the rpcbind database.
@@ -408,8 +388,8 @@ void rpcb_getport_async(struct rpc_task *task)
408 map->r_prot = xprt->prot; 388 map->r_prot = xprt->prot;
409 map->r_port = 0; 389 map->r_port = 0;
410 map->r_xprt = xprt_get(xprt); 390 map->r_xprt = xprt_get(xprt);
411 map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCB_NETID_TCP : 391 map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCBIND_NETID_TCP :
412 RPCB_NETID_UDP; 392 RPCBIND_NETID_UDP;
413 memcpy(map->r_addr, 393 memcpy(map->r_addr,
414 rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR), 394 rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR),
415 sizeof(map->r_addr)); 395 sizeof(map->r_addr));
@@ -587,7 +567,7 @@ out_err:
587#define RPCB_port_sz (1u) 567#define RPCB_port_sz (1u)
588#define RPCB_boolean_sz (1u) 568#define RPCB_boolean_sz (1u)
589 569
590#define RPCB_netid_sz (1+XDR_QUADLEN(RPCB_MAXNETIDLEN)) 570#define RPCB_netid_sz (1+XDR_QUADLEN(RPCBIND_MAXNETIDLEN))
591#define RPCB_addr_sz (1+XDR_QUADLEN(RPCB_MAXADDRLEN)) 571#define RPCB_addr_sz (1+XDR_QUADLEN(RPCB_MAXADDRLEN))
592#define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN)) 572#define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN))
593 573