-/**
- * nfs_get_port - extract port value from a socket address
- * @sap: pointer to socket address
- *
- * Returns port value in host byte order.
- */
-uint16_t
-nfs_get_port(const struct sockaddr *sap)
-{
- const struct sockaddr_in *sin = (const struct sockaddr_in *)sap;
- const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sap;
-
- switch (sap->sa_family) {
- case AF_INET:
- return ntohs(sin->sin_port);
- case AF_INET6:
- return ntohs(sin6->sin6_port);
- }
- return 0;
-}
-
-/**
- * nfs_set_port - set port value in a socket address
- * @sap: pointer to socket address
- * @port: port value to set
- *
- */
-void
-nfs_set_port(struct sockaddr *sap, const uint16_t port)
-{
- struct sockaddr_in *sin = (struct sockaddr_in *)sap;
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
-
- switch (sap->sa_family) {
- case AF_INET:
- sin->sin_port = htons(port);
- break;
- case AF_INET6:
- sin6->sin6_port = htons(port);
- break;
- }
-}
-