Lines Matching refs:sap
28 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, in rpc_ntop6_noscopeid() argument
31 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in rpc_ntop6_noscopeid()
66 static size_t rpc_ntop6(const struct sockaddr *sap, in rpc_ntop6() argument
69 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in rpc_ntop6()
74 len = rpc_ntop6_noscopeid(sap, buf, buflen); in rpc_ntop6()
98 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, in rpc_ntop6_noscopeid() argument
104 static size_t rpc_ntop6(const struct sockaddr *sap, in rpc_ntop6() argument
112 static int rpc_ntop4(const struct sockaddr *sap, in rpc_ntop4() argument
115 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; in rpc_ntop4()
129 size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen) in rpc_ntop() argument
131 switch (sap->sa_family) { in rpc_ntop()
133 return rpc_ntop4(sap, buf, buflen); in rpc_ntop()
135 return rpc_ntop6(sap, buf, buflen); in rpc_ntop()
143 struct sockaddr *sap, const size_t salen) in rpc_pton4() argument
145 struct sockaddr_in *sin = (struct sockaddr_in *)sap; in rpc_pton4()
151 memset(sap, 0, sizeof(struct sockaddr_in)); in rpc_pton4()
200 struct sockaddr *sap, const size_t salen) in rpc_pton6() argument
202 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in rpc_pton6()
210 memset(sap, 0, sizeof(struct sockaddr_in6)); in rpc_pton6()
223 struct sockaddr *sap, const size_t salen) in rpc_pton6() argument
245 struct sockaddr *sap, const size_t salen) in rpc_pton() argument
251 return rpc_pton6(net, buf, buflen, sap, salen); in rpc_pton()
252 return rpc_pton4(buf, buflen, sap, salen); in rpc_pton()
265 char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) in rpc_sockaddr2uaddr() argument
271 switch (sap->sa_family) { in rpc_sockaddr2uaddr()
273 if (rpc_ntop4(sap, addrbuf, sizeof(addrbuf)) == 0) in rpc_sockaddr2uaddr()
275 port = ntohs(((struct sockaddr_in *)sap)->sin_port); in rpc_sockaddr2uaddr()
278 if (rpc_ntop6_noscopeid(sap, addrbuf, sizeof(addrbuf)) == 0) in rpc_sockaddr2uaddr()
280 port = ntohs(((struct sockaddr_in6 *)sap)->sin6_port); in rpc_sockaddr2uaddr()
311 const size_t uaddr_len, struct sockaddr *sap, in rpc_uaddr2sockaddr() argument
340 if (rpc_pton(net, buf, strlen(buf), sap, salen) == 0) in rpc_uaddr2sockaddr()
343 switch (sap->sa_family) { in rpc_uaddr2sockaddr()
345 ((struct sockaddr_in *)sap)->sin_port = htons(port); in rpc_uaddr2sockaddr()
348 ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); in rpc_uaddr2sockaddr()