summaryrefslogtreecommitdiffstats
path: root/support/include
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-07-14 16:47:09 -0400
committerSteve Dickson <steved@redhat.com>2009-07-14 16:47:09 -0400
commit5600327322a78a3a803368c0fe4f923cf14a4cf7 (patch)
tree67e3774f33391e09e703073b68ed46f57ccca599 /support/include
parent23c1a452afce5726cfe661a4d7ac14a1883ecb55 (diff)
downloadnfs-utils-5600327322a78a3a803368c0fe4f923cf14a4cf7.tar.gz
nfs-utils-5600327322a78a3a803368c0fe4f923cf14a4cf7.tar.xz
nfs-utils-5600327322a78a3a803368c0fe4f923cf14a4cf7.zip
support: Introduce sockaddr helpers to get and set IP port numbers
Introduce address family-agnostic functions that get and set IP port numbers in socket addresses. We can already replace a few similar functions in the mount command, and a few more will come up with statd and sm-notify. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include')
-rw-r--r--support/include/nfsrpc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h
index b3cdb8c..dff6af7 100644
--- a/support/include/nfsrpc.h
+++ b/support/include/nfsrpc.h
@@ -59,6 +59,16 @@ static inline void nfs_clear_rpc_createerr(void)
}
/*
+ * 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
*/
extern rpcprog_t nfs_getrpcbyname(const rpcprog_t, const char *table[]);