SUNRPC: Add support for formatted universal addresses
Subsystems (3)
PATCH 2/3 SUNRPC: Add support for formatted universal addresses
"Universal addresses" are a string representation of an IP address and port. They are described fully in RFC 3530, section 2.2. Add support for generating them in the RPC client's socket transport module.
---
include/linux/sunrpc/xprt.h | 1 + net/sunrpc/xprtsock.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-)
include/linux/sunrpc/xprt.h +1 -0
@@ -55,6 +55,7 @@ enum rpc_display_format_t {RPC_DISPLAY_ALL ,RPC_DISPLAY_HEX_ADDR ,RPC_DISPLAY_HEX_PORT , +RPC_DISPLAY_UNIVERSAL_ADDR , RPC_DISPLAY_MAX, };
net/sunrpc/xprtsock.c +18 -0
@@ -328,6 +328,15 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt) ntohs(addr->sin_port)); } xprt->address_strings[RPC_DISPLAY_HEX_PORT ] = buf; + + buf =kzalloc (30 ,GFP_KERNEL ); +if (buf) { +snprintf (buf,30 ,NIPQUAD_FMT ".%u.%u" , +NIPQUAD (addr->sin_addr.s_addr), +ntohs (addr->sin_port) >>8 , +ntohs (addr->sin_port) &0xff ); + } + xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR ] = buf; }static void xs_format_ipv6_peer_addresses (struct rpc_xprt *xprt)
@@ -380,6 +389,15 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt) ntohs(addr->sin6_port)); } xprt->address_strings[RPC_DISPLAY_HEX_PORT ] = buf; + + buf =kzalloc (50 ,GFP_KERNEL ); +if (buf) { +snprintf (buf,50 ,NIP6_FMT ".%u.%u" , +NIP6 (addr->sin6_addr), +ntohs (addr->sin6_port) >>8 , +ntohs (addr->sin6_port) &0xff ); + } + xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR ] = buf; }static void xs_free_peer_addresses (struct rpc_xprt *xprt)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 6 lines · Chuck Lever
"Universal addresses" are a string representation of an IP address and port. They are described fully in RFC 3530, section 2.2. Add support for generating them in the RPC client's socket transport module.
Signed-off-by Chuck Lever <[email protected]>---
This applies fine to the git tree, but not to 2.6.23-rc3. Given that rpcbind v3/v4 is still marked as EXPERIMENTAL, I'm inclined to rather let this and the next patch wait until the 2.6.24 merge window opens.
Trond
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs