• Home
  • Raw
  • Download

Lines Matching refs:ip

84 	union nf_inet_addr ip;  member
128 node->ip.ip &= node->mask.ip; in horrible_mask_self()
130 node->ip.ip6[0] &= node->mask.ip6[0]; in horrible_mask_self()
131 node->ip.ip6[1] &= node->mask.ip6[1]; in horrible_mask_self()
132 node->ip.ip6[2] &= node->mask.ip6[2]; in horrible_mask_self()
133 node->ip.ip6[3] &= node->mask.ip6[3]; in horrible_mask_self()
138 horrible_match_v4(const struct horrible_allowedips_node *node, struct in_addr *ip) in horrible_match_v4() argument
140 return (ip->s_addr & node->mask.ip) == node->ip.ip; in horrible_match_v4()
144 horrible_match_v6(const struct horrible_allowedips_node *node, struct in6_addr *ip) in horrible_match_v6() argument
146 return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) == node->ip.ip6[0] && in horrible_match_v6()
147 (ip->in6_u.u6_addr32[1] & node->mask.ip6[1]) == node->ip.ip6[1] && in horrible_match_v6()
148 (ip->in6_u.u6_addr32[2] & node->mask.ip6[2]) == node->ip.ip6[2] && in horrible_match_v6()
149 (ip->in6_u.u6_addr32[3] & node->mask.ip6[3]) == node->ip.ip6[3]; in horrible_match_v6()
161 !memcmp(&other->ip, &node->ip, sizeof(union nf_inet_addr))) { in horrible_insert_ordered()
182 struct in_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v4() argument
188 node->ip.in = *ip; in horrible_allowedips_insert_v4()
199 struct in6_addr *ip, u8 cidr, void *value) in horrible_allowedips_insert_v6() argument
205 node->ip.in6 = *ip; in horrible_allowedips_insert_v6()
215 horrible_allowedips_lookup_v4(struct horrible_allowedips *table, struct in_addr *ip) in horrible_allowedips_lookup_v4() argument
220 if (node->ip_version == 4 && horrible_match_v4(node, ip)) in horrible_allowedips_lookup_v4()
227 horrible_allowedips_lookup_v6(struct horrible_allowedips *table, struct in6_addr *ip) in horrible_allowedips_lookup_v6() argument
232 if (node->ip_version == 6 && horrible_match_v6(node, ip)) in horrible_allowedips_lookup_v6()
257 u8 ip[16], mutate_mask[16], mutated[16]; in randomized_test() local
287 prandom_bytes(ip, 4); in randomized_test()
290 if (wg_allowedips_insert_v4(&t, (struct in_addr *)ip, cidr, in randomized_test()
295 if (horrible_allowedips_insert_v4(&h, (struct in_addr *)ip, in randomized_test()
301 memcpy(mutated, ip, 4); in randomized_test()
331 prandom_bytes(ip, 16); in randomized_test()
334 if (wg_allowedips_insert_v6(&t, (struct in6_addr *)ip, cidr, in randomized_test()
339 if (horrible_allowedips_insert_v6(&h, (struct in6_addr *)ip, in randomized_test()
345 memcpy(mutated, ip, 16); in randomized_test()
384 prandom_bytes(ip, 4); in randomized_test()
385 if (lookup(t.root4, 32, ip) != horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip)) { in randomized_test()
386 horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip); in randomized_test()
390 prandom_bytes(ip, 16); in randomized_test()
391 if (lookup(t.root6, 128, ip) != horrible_allowedips_lookup_v6(&h, (struct in6_addr *)ip)) { in randomized_test()
427 static struct in_addr ip; in ip4() local
428 u8 *split = (u8 *)&ip; in ip4()
434 return &ip; in ip4()
439 static struct in6_addr ip; in ip6() local
440 __be32 *split = (__be32 *)&ip; in ip6()
446 return &ip; in ip6()
461 wg_allowedips_insert_v##version(&t, ip##version(ipa, ipb, ipc, ipd), \
474 ip##version(ipa, ipb, ipc, ipd)) == (mem); \
480 ip##version(ipa, ipb, ipc, ipd)) != (mem); \
500 struct in6_addr ip; in wg_allowedips_selftest() local
601 memset(&ip, 0xff, 8); in wg_allowedips_selftest()
602 memcpy((u8 *)&ip + 8, &part, 8); in wg_allowedips_selftest()
603 wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); in wg_allowedips_selftest()
604 memcpy(&ip, &part, 8); in wg_allowedips_selftest()
605 memset((u8 *)&ip + 8, 0, 8); in wg_allowedips_selftest()
606 wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); in wg_allowedips_selftest()
608 memset(&ip, 0, 16); in wg_allowedips_selftest()
609 wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); in wg_allowedips_selftest()
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()
625 !memcmp(ip, ip4(192, 95, 5, 64), sizeof(struct in_addr))) in wg_allowedips_selftest()
628 !memcmp(ip, ip6(0x26075300, 0x60006b00, 0, 0xc05f0543), in wg_allowedips_selftest()
632 !memcmp(ip, ip4(10, 1, 0, 16), sizeof(struct in_addr))) in wg_allowedips_selftest()
635 !memcmp(ip, ip6(0x26075300, 0x6d8a6bf8, 0xdab1e000, 0), in wg_allowedips_selftest()
639 !memcmp(ip, ip6(0x26075000, 0, 0, 0), in wg_allowedips_selftest()