Lines Matching refs:bits
44 inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size);
46 inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size);
63 inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size) { in inet_cidr_ntop() argument
66 return (inet_cidr_ntop_ipv4(src, bits, dst, size)); in inet_cidr_ntop()
68 return (inet_cidr_ntop_ipv6(src, bits, dst, size)); in inet_cidr_ntop()
109 inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) { in inet_cidr_ntop_ipv4() argument
115 if ((bits < -1) || (bits > 32)) { in inet_cidr_ntop_ipv4()
121 if (bits == -1) in inet_cidr_ntop_ipv4()
129 bytes = (((bits <= 0) ? 1 : bits) + 7) / 8; in inet_cidr_ntop_ipv4()
138 if (bits != -1) { in inet_cidr_ntop_ipv4()
142 dst += SPRINTF((dst, "/%u", bits)); in inet_cidr_ntop_ipv4()
153 inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) { in inet_cidr_ntop_ipv6() argument
167 if ((bits < -1) || (bits > 128)) { in inet_cidr_ntop_ipv6()
226 if (src[15] || bits == -1 || bits > 120) in inet_cidr_ntop_ipv6()
228 else if (src[14] || bits > 112) in inet_cidr_ntop_ipv6()
249 if (bits != -1) in inet_cidr_ntop_ipv6()
250 tp += SPRINTF((tp, "/%u", bits)); in inet_cidr_ntop_ipv6()