Lines Matching refs:bits
51 static char * inet_net_ntop_ipv4(const u_char *src, int bits,
53 static char * inet_net_ntop_ipv6(const u_char *src, int bits,
67 inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size) in inet_net_ntop() argument
71 return (inet_net_ntop_ipv4(src, bits, dst, size)); in inet_net_ntop()
73 return (inet_net_ntop_ipv6(src, bits, dst, size)); in inet_net_ntop()
94 inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) in inet_net_ntop_ipv4() argument
101 if (bits < 0 || bits > 32) { in inet_net_ntop_ipv4()
106 if (bits == 0) { in inet_net_ntop_ipv4()
115 for (b = bits / 8; b > 0; b--) { in inet_net_ntop_ipv4()
128 b = bits % 8; in inet_net_ntop_ipv4()
143 dst += SPRINTF((dst, "/%u", bits)); in inet_net_ntop_ipv4()
169 inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) in inet_net_ntop_ipv6() argument
183 if (bits < 0 || bits > 128) { in inet_net_ntop_ipv6()
190 if (bits == 0) { in inet_net_ntop_ipv6()
196 p = (bits + 7) / 8; in inet_net_ntop_ipv6()
199 b = bits % 8; in inet_net_ntop_ipv6()
208 words = (bits + 15) / 16; in inet_net_ntop_ipv6()
255 if (p != 7 || bits > 120) { in inet_net_ntop_ipv6()
268 (void)SPRINTF((cp, "/%u", bits)); in inet_net_ntop_ipv6()