X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Finclude%2Fnfsrpc.h;h=d6d4a1cf881571935c015b66e97394bd631e9d13;hb=3b777b084a438f55482c8bf7508903ff4c30e1db;hp=543c35bc9fdc8901395c6ae378b46ec182ab8bc9;hpb=8c94296bc84f3a204f2061c0391a1d2350e4f37e;p=nfs-utils.git diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h index 543c35b..d6d4a1c 100644 --- a/support/include/nfsrpc.h +++ b/support/include/nfsrpc.h @@ -49,6 +49,25 @@ #define NSMPROG ((rpcprog_t)100024) #endif +/** + * nfs_clear_rpc_createerr - zap all error reporting fields + * + */ +static inline void nfs_clear_rpc_createerr(void) +{ + memset(&rpc_createerr, 0, sizeof(rpc_createerr)); +} + +/* + * Extract port value from a socket address + */ +extern uint16_t nfs_get_port(const struct sockaddr *); + +/* + * Set port value in a socket address + */ +extern void nfs_set_port(struct sockaddr *, const uint16_t); + /* * Look up an RPC program name in /etc/rpc */ @@ -70,11 +89,22 @@ extern CLIENT *nfs_get_priv_rpcclient( const struct sockaddr *, const rpcprog_t, const rpcvers_t, struct timeval *); +/* + * Convert a netid to a protocol number and protocol family + */ +extern int nfs_get_proto(const char *netid, sa_family_t *family, + unsigned long *protocol); + +/* + * Convert a protocol family and protocol name to a netid + */ +extern char *nfs_get_netid(const sa_family_t family, + const unsigned long protocol); + /* * Convert a socket address to a universal address */ -extern char *nfs_sockaddr2universal(const struct sockaddr *, - const socklen_t); +extern char *nfs_sockaddr2universal(const struct sockaddr *); /* * Extract port number from a universal address @@ -114,7 +144,6 @@ extern unsigned short nfs_rpcb_getaddr(const struct sockaddr *, const socklen_t, const unsigned short, const struct sockaddr *, - const socklen_t, const rpcprog_t, const rpcvers_t, const unsigned short,