Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
addr.c File Reference
#include <net/ipv6.h>
#include <linux/sunrpc/clnt.h>
#include <linux/slab.h>
#include <linux/export.h>

Go to the source code of this file.

Functions

size_t rpc_ntop (const struct sockaddr *sap, char *buf, const size_t buflen)
 
 EXPORT_SYMBOL_GPL (rpc_ntop)
 
size_t rpc_pton (struct net *net, const char *buf, const size_t buflen, struct sockaddr *sap, const size_t salen)
 
 EXPORT_SYMBOL_GPL (rpc_pton)
 
charrpc_sockaddr2uaddr (const struct sockaddr *sap, gfp_t gfp_flags)
 
size_t rpc_uaddr2sockaddr (struct net *net, const char *uaddr, const size_t uaddr_len, struct sockaddr *sap, const size_t salen)
 
 EXPORT_SYMBOL_GPL (rpc_uaddr2sockaddr)
 

Function Documentation

EXPORT_SYMBOL_GPL ( rpc_ntop  )
EXPORT_SYMBOL_GPL ( rpc_pton  )
EXPORT_SYMBOL_GPL ( rpc_uaddr2sockaddr  )
size_t rpc_ntop ( const struct sockaddr sap,
char buf,
const size_t  buflen 
)

rpc_ntop - construct a presentation address in : socket address : construction area : size of , in bytes

Plants a NUL-terminated string in and returns the length of the string, excluding the NUL. Otherwise zero is returned.

Definition at line 127 of file addr.c.

size_t rpc_pton ( struct net net,
const char buf,
const size_t  buflen,
struct sockaddr sap,
const size_t  salen 
)

rpc_pton - Construct a sockaddr in : applicable network namespace : C string containing presentation format IP address : length of presentation address in bytes : buffer into which to plant socket address : size of buffer in bytes

Returns the size of the socket address if successful; otherwise zero is returned.

Plants a socket address in and returns the size of the socket address, if successful. Returns zero if an error occurred.

Definition at line 246 of file addr.c.

char* rpc_sockaddr2uaddr ( const struct sockaddr sap,
gfp_t  gfp_flags 
)

rpc_sockaddr2uaddr - Construct a universal address string from . : socket address : allocation mode

Returns a NUL-terminated string in dynamically allocated memory; otherwise NULL is returned if an error occurred. Caller must free the returned string.

Definition at line 267 of file addr.c.

size_t rpc_uaddr2sockaddr ( struct net net,
const char uaddr,
const size_t  uaddr_len,
struct sockaddr sap,
const size_t  salen 
)

rpc_uaddr2sockaddr - convert a universal address to a socket address. : applicable network namespace : C string containing universal address to convert : length of universal address string : buffer into which to plant socket address : size of buffer

does not have to be '\0'-terminated, but strict_strtoul() and rpc_pton() require proper string termination to be successful.

Returns the size of the socket address if successful; otherwise zero is returned.

Definition at line 312 of file addr.c.