Lines Matching refs:cidr
106 static __init inline union nf_inet_addr horrible_cidr_to_mask(u8 cidr) in horrible_cidr_to_mask() argument
111 memset(&mask.all, 0xff, cidr / 8); in horrible_cidr_to_mask()
112 if (cidr % 32) in horrible_cidr_to_mask()
113 mask.all[cidr / 32] = (__force u32)htonl( in horrible_cidr_to_mask()
114 (0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL); in horrible_cidr_to_mask()
182 struct in_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v4() argument
189 node->mask = horrible_cidr_to_mask(cidr); in horrible_allowedips_insert_v4()
199 struct in6_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v6() argument
206 node->mask = horrible_cidr_to_mask(cidr); in horrible_allowedips_insert_v6()
256 unsigned int i, j, k, mutate_amount, cidr; in randomized_test() local
288 cidr = get_random_u32_inclusive(1, 32); in randomized_test()
290 if (wg_allowedips_insert_v4(&t, (struct in_addr *)ip, cidr, in randomized_test()
296 cidr, peer) < 0) { in randomized_test()
314 cidr = get_random_u32_inclusive(1, 32); in randomized_test()
318 cidr, peer, &mutex) < 0) { in randomized_test()
323 (struct in_addr *)mutated, cidr, peer)) { in randomized_test()
332 cidr = get_random_u32_inclusive(1, 128); in randomized_test()
334 if (wg_allowedips_insert_v6(&t, (struct in6_addr *)ip, cidr, in randomized_test()
340 cidr, peer) < 0) { in randomized_test()
358 cidr = get_random_u32_inclusive(1, 128); in randomized_test()
362 cidr, peer, &mutex) < 0) { in randomized_test()
367 &h, (struct in6_addr *)mutated, cidr, in randomized_test()
460 #define insert(version, mem, ipa, ipb, ipc, ipd, cidr) \ argument
462 cidr, mem, &mutex)
619 u8 cidr, ip[16] __aligned(__alignof(u64)); in wg_allowedips_selftest() local
620 int family = wg_allowedips_read_node(iter_node, ip, &cidr); in wg_allowedips_selftest()
624 if (cidr == 27 && family == AF_INET && in wg_allowedips_selftest()
627 else if (cidr == 128 && family == AF_INET6 && in wg_allowedips_selftest()
631 else if (cidr == 29 && family == AF_INET && in wg_allowedips_selftest()
634 else if (cidr == 83 && family == AF_INET6 && in wg_allowedips_selftest()
638 else if (cidr == 21 && family == AF_INET6 && in wg_allowedips_selftest()