Lines Matching refs:buflen
29 char *buf, const int buflen) in rpc_ntop6_noscopeid() argument
40 return snprintf(buf, buflen, "::"); in rpc_ntop6_noscopeid()
48 return snprintf(buf, buflen, "::1"); in rpc_ntop6_noscopeid()
57 return snprintf(buf, buflen, "::ffff:%pI4", in rpc_ntop6_noscopeid()
63 return snprintf(buf, buflen, "%pI6c", addr); in rpc_ntop6_noscopeid()
67 char *buf, const size_t buflen) in rpc_ntop6() argument
74 len = rpc_ntop6_noscopeid(sap, buf, buflen); in rpc_ntop6()
89 if (unlikely(len >= buflen)) in rpc_ntop6()
99 char *buf, const int buflen) in rpc_ntop6_noscopeid() argument
105 char *buf, const size_t buflen) in rpc_ntop6() argument
113 char *buf, const size_t buflen) in rpc_ntop4() argument
117 return snprintf(buf, buflen, "%pI4", &sin->sin_addr); in rpc_ntop4()
129 size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen) in rpc_ntop() argument
133 return rpc_ntop4(sap, buf, buflen); in rpc_ntop()
135 return rpc_ntop6(sap, buf, buflen); in rpc_ntop()
142 static size_t rpc_pton4(const char *buf, const size_t buflen, in rpc_pton4() argument
148 if (buflen > INET_ADDRSTRLEN || salen < sizeof(struct sockaddr_in)) in rpc_pton4()
153 if (in4_pton(buf, buflen, addr, '\0', NULL) == 0) in rpc_pton4()
162 const size_t buflen, const char *delim, in rpc_parse_scope_id() argument
168 if ((buf + buflen) == delim) in rpc_parse_scope_id()
177 len = (buf + buflen) - delim - 1; in rpc_parse_scope_id()
203 static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen, in rpc_pton6() argument
210 if (buflen > (INET6_ADDRSTRLEN + IPV6_SCOPE_ID_LEN) || in rpc_pton6()
216 if (in6_pton(buf, buflen, addr, IPV6_SCOPE_DELIMITER, &delim) == 0) in rpc_pton6()
219 if (!rpc_parse_scope_id(net, buf, buflen, delim, sin6)) in rpc_pton6()
226 static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen, in rpc_pton6() argument
248 size_t rpc_pton(struct net *net, const char *buf, const size_t buflen, in rpc_pton() argument
253 for (i = 0; i < buflen; i++) in rpc_pton()
255 return rpc_pton6(net, buf, buflen, sap, salen); in rpc_pton()
256 return rpc_pton4(buf, buflen, sap, salen); in rpc_pton()