]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/include/nfsrpc.h
libnfs.a: Provide shared helpers for managing netids
[nfs-utils.git] / support / include / nfsrpc.h
index b3cdb8c44f3357e3753a9019e6938bab924fd405..d6d4a1cf881571935c015b66e97394bd631e9d13 100644 (file)
@@ -58,6 +58,16 @@ 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
  */
@@ -79,6 +89,18 @@ 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
  */