Lines Matching defs:ip

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