Lines Matching refs:bits
43 static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
45 static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
59 inet_net_ntop(af, src, bits, dst, size) in inet_net_ntop() argument
62 int bits;
68 return (inet_net_ntop_ipv4(src, bits, dst, size));
70 return (inet_net_ntop_ipv6(src, bits, dst, size));
91 inet_net_ntop_ipv4(src, bits, dst, size) in inet_net_ntop_ipv4() argument
93 int bits;
102 if (bits < 0 || bits > 32) {
107 if (bits == 0) {
116 for (b = bits / 8; b > 0; b--) {
129 b = bits % 8;
144 dst += SPRINTF((dst, "/%u", bits));
170 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 sprintf(cp, "/%u", bits); in inet_net_ntop_ipv6()