Lines Matching defs:bits
65 This won't work for subnets with more than 32 bits of host address, but
159 /* Mask out the network bits... */
164 /* Copy out up to 32 bits... */
295 * This is not the case if any bits longer than the bitmask are 1.
308 is_cidr_mask_valid(const struct iaddr *addr, int bits) {
318 if (bits < 0) {
321 if (bits > (addr->len * 8)) {
326 * Figure out how many low-order bits need to be zero.
328 zero_bits = (addr->len * 8) - bits;
341 * Look to see if any bits not in right-hand bytes are
342 * non-zero, by making a byte that has these bits set to zero
344 * equal, then the right-hand bits are zero, and we are
463 net->cidrnet.bits = (addr.len * 8) - bit;
568 /* Determine netmask width in bits. */
588 piaddrcidr(const struct iaddr *addr, unsigned int bits) {
595 /* INSIST(bits <= (addr->len * 8)); */
597 if (bits > (addr->len * 8))
600 sprintf(ret, "%s/%d", piaddr(*addr), bits);