Lines Matching refs:cidr
23 u8 cidr) in swap_endian_and_apply_cidr() argument
26 memset(dst + (cidr + 7) / 8, 0, bits / 8 - (cidr + 7) / 8); in swap_endian_and_apply_cidr()
27 if (cidr) in swap_endian_and_apply_cidr()
28 dst[(cidr + 7) / 8 - 1] &= ~0U << ((8 - (cidr % 8)) % 8); in swap_endian_and_apply_cidr()
58 swap_endian_and_apply_cidr(ip1, node->bits, bits, node->cidr); in print_node()
59 printk(fmt_declaration, ip1, node->cidr, style, color); in print_node()
63 node->cidr); in print_node()
64 printk(fmt_connection, ip1, node->cidr, ip2, in print_node()
65 rcu_dereference_raw(node->bit[0])->cidr); in print_node()
71 bits, node->cidr); in print_node()
72 printk(fmt_connection, ip1, node->cidr, ip2, in print_node()
73 rcu_dereference_raw(node->bit[1])->cidr); in print_node()
120 static __init inline union nf_inet_addr horrible_cidr_to_mask(u8 cidr) in horrible_cidr_to_mask() argument
125 memset(&mask, 0xff, cidr / 8); in horrible_cidr_to_mask()
126 if (cidr % 32) in horrible_cidr_to_mask()
127 mask.all[cidr / 32] = (__force u32)htonl( in horrible_cidr_to_mask()
128 (0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL); in horrible_cidr_to_mask()
202 struct in_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v4() argument
210 node->mask = horrible_cidr_to_mask(cidr); in horrible_allowedips_insert_v4()
220 struct in6_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v6() argument
228 node->mask = horrible_cidr_to_mask(cidr); in horrible_allowedips_insert_v6()
274 unsigned int i, j, k, mutate_amount, cidr; in randomized_test() local
305 cidr = prandom_u32_max(32) + 1; in randomized_test()
307 if (wg_allowedips_insert_v4(&t, (struct in_addr *)ip, cidr, in randomized_test()
313 cidr, peer) < 0) { in randomized_test()
331 cidr = prandom_u32_max(32) + 1; in randomized_test()
335 cidr, peer, &mutex) < 0) { in randomized_test()
340 (struct in_addr *)mutated, cidr, peer)) { in randomized_test()
349 cidr = prandom_u32_max(128) + 1; in randomized_test()
351 if (wg_allowedips_insert_v6(&t, (struct in6_addr *)ip, cidr, in randomized_test()
357 cidr, peer) < 0) { in randomized_test()
375 cidr = prandom_u32_max(128) + 1; in randomized_test()
379 cidr, peer, &mutex) < 0) { in randomized_test()
384 &h, (struct in6_addr *)mutated, cidr, in randomized_test()
467 #define insert(version, mem, ipa, ipb, ipc, ipd, cidr) \ argument
469 cidr, mem, &mutex)
622 u8 cidr, ip[16] __aligned(__alignof(u64)); in wg_allowedips_selftest() local
623 int family = wg_allowedips_read_node(iter_node, ip, &cidr); in wg_allowedips_selftest()
627 if (cidr == 27 && family == AF_INET && in wg_allowedips_selftest()
630 else if (cidr == 128 && family == AF_INET6 && in wg_allowedips_selftest()
634 else if (cidr == 29 && family == AF_INET && in wg_allowedips_selftest()
637 else if (cidr == 83 && family == AF_INET6 && in wg_allowedips_selftest()
641 else if (cidr == 21 && family == AF_INET6 && in wg_allowedips_selftest()