Home
last modified time | relevance | path

Searched refs:cidr (Results 1 - 25 of 40) sorted by relevance

12

/kernel/linux/linux-5.10/net/netfilter/ipset/
H A Dip_set_hash_netnet.c48 u8 cidr[2]; member
90 hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner) in hash_netnet4_data_netmask() argument
93 elem->ip[1] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask()
94 elem->cidr[1] = cidr; in hash_netnet4_data_netmask()
96 elem->ip[0] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask()
97 elem->cidr[0] = cidr; in hash_netnet4_data_netmask()
109 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netnet4_data_list()
110 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ in hash_netnet4_data_list()
283 u8 cidr[2]; global() member
326 hash_netnet6_data_netmask(struct hash_netnet6_elem *elem, u8 cidr, bool inner) hash_netnet6_data_netmask() argument
[all...]
H A Dip_set_hash_netportnet.c50 u8 cidr[2]; member
98 u8 cidr, bool inner) in hash_netportnet4_data_netmask()
101 elem->ip[1] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask()
102 elem->cidr[1] = cidr; in hash_netportnet4_data_netmask()
104 elem->ip[0] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask()
105 elem->cidr[0] = cidr; in hash_netportnet4_data_netmask()
118 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netportnet4_data_list()
119 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ in hash_netportnet4_data_list()
97 hash_netportnet4_data_netmask(struct hash_netportnet4_elem *elem, u8 cidr, bool inner) hash_netportnet4_data_netmask() argument
177 hash_netportnet4_range_to_cidr(u32 from, u32 to, u8 *cidr) hash_netportnet4_range_to_cidr() argument
341 u8 cidr[2]; global() member
389 hash_netportnet6_data_netmask(struct hash_netportnet6_elem *elem, u8 cidr, bool inner) hash_netportnet6_data_netmask() argument
[all...]
H A Dip_set_hash_netport.c41 /* We squeeze the "nomatch" flag into cidr: we don't support cidr == 0
42 * However this way we have to store internally cidr - 1,
54 u8 cidr:7; member
68 ip1->cidr == ip2->cidr; in hash_netport4_data_equal()
90 hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr) in hash_netport4_data_netmask() argument
92 elem->ip &= ip_set_netmask(cidr); in hash_netport4_data_netmask()
93 elem->cidr = cidr in hash_netport4_data_netmask()
162 u8 cidr; hash_netport4_uadt() local
271 u8 cidr:7; global() member
307 hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr) hash_netport6_data_netmask() argument
382 u8 cidr; hash_netport6_uadt() local
[all...]
H A Dip_set_hash_ipportnet.c40 /* We squeeze the "nomatch" flag into cidr: we don't support cidr == 0
41 * However this way we have to store internally cidr - 1,
55 u8 cidr:7; member
69 ip1->cidr == ip2->cidr && in hash_ipportnet4_data_equal()
93 hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr) in hash_ipportnet4_data_netmask() argument
95 elem->ip2 &= ip_set_netmask(cidr); in hash_ipportnet4_data_netmask()
96 elem->cidr = cidr in hash_ipportnet4_data_netmask()
169 u8 cidr; hash_ipportnet4_uadt() local
310 u8 cidr:7; global() member
348 hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr) hash_ipportnet6_data_netmask() argument
425 u8 cidr; hash_ipportnet6_uadt() local
[all...]
H A Dip_set_hash_net.c45 u8 cidr; member
56 ip1->cidr == ip2->cidr; in hash_net4_data_equal()
78 hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr) in hash_net4_data_netmask() argument
80 elem->ip &= ip_set_netmask(cidr); in hash_net4_data_netmask()
81 elem->cidr = cidr; in hash_net4_data_netmask()
90 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || in hash_net4_data_list()
119 .cidr = INIT_CIDR(h->nets[0].cidr[ in hash_net4_kadt()
216 u8 cidr; global() member
249 hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr) hash_net6_data_netmask() argument
[all...]
H A Dip_set_hash_netiface.c49 u8 cidr; member
58 u8 cidr; member
73 ip1->cidr == ip2->cidr && in hash_netiface4_data_equal()
100 hash_netiface4_data_netmask(struct hash_netiface4_elem *elem, u8 cidr) in hash_netiface4_data_netmask() argument
102 elem->ip &= ip_set_netmask(cidr); in hash_netiface4_data_netmask()
103 elem->cidr = cidr; in hash_netiface4_data_netmask()
116 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || in hash_netiface4_data_list()
163 .cidr in hash_netiface4_kadt()
284 u8 cidr; global() member
292 u8 cidr; global() member
334 hash_netiface6_data_netmask(struct hash_netiface6_elem *elem, u8 cidr) hash_netiface6_data_netmask() argument
[all...]
H A Dip_set_hash_gen.h125 u32 nets[IPSET_NET_COUNT]; /* number of elements for this cidr */
126 u8 cidr[IPSET_NET_COUNT]; /* the cidr value */ member
148 #define __CIDR(cidr, i) (cidr[i])
150 #define __CIDR(cidr, i) (cidr)
153 /* cidr + 1 is stored in net_prefixes to support /0 */
154 #define NCIDR_PUT(cidr) ((cidr)
340 mtype_add_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) mtype_add_cidr() argument
367 mtype_del_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) mtype_del_cidr() argument
[all...]
/kernel/linux/linux-6.6/net/netfilter/ipset/
H A Dip_set_hash_netnet.c52 u8 cidr[2]; member
94 hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner) in hash_netnet4_data_netmask() argument
97 elem->ip[1] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask()
98 elem->cidr[1] = cidr; in hash_netnet4_data_netmask()
100 elem->ip[0] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask()
101 elem->cidr[0] = cidr; in hash_netnet4_data_netmask()
113 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netnet4_data_list()
114 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ in hash_netnet4_data_list()
287 u8 cidr[2]; global() member
330 hash_netnet6_data_netmask(struct hash_netnet6_elem *elem, u8 cidr, bool inner) hash_netnet6_data_netmask() argument
[all...]
H A Dip_set_hash_netportnet.c51 u8 cidr[2]; member
99 u8 cidr, bool inner) in hash_netportnet4_data_netmask()
102 elem->ip[1] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask()
103 elem->cidr[1] = cidr; in hash_netportnet4_data_netmask()
105 elem->ip[0] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask()
106 elem->cidr[0] = cidr; in hash_netportnet4_data_netmask()
119 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netportnet4_data_list()
120 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ in hash_netportnet4_data_list()
98 hash_netportnet4_data_netmask(struct hash_netportnet4_elem *elem, u8 cidr, bool inner) hash_netportnet4_data_netmask() argument
178 hash_netportnet4_range_to_cidr(u32 from, u32 to, u8 *cidr) hash_netportnet4_range_to_cidr() argument
342 u8 cidr[2]; global() member
390 hash_netportnet6_data_netmask(struct hash_netportnet6_elem *elem, u8 cidr, bool inner) hash_netportnet6_data_netmask() argument
[all...]
H A Dip_set_hash_netport.c42 /* We squeeze the "nomatch" flag into cidr: we don't support cidr == 0
43 * However this way we have to store internally cidr - 1,
55 u8 cidr:7; member
69 ip1->cidr == ip2->cidr; in hash_netport4_data_equal()
91 hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr) in hash_netport4_data_netmask() argument
93 elem->ip &= ip_set_netmask(cidr); in hash_netport4_data_netmask()
94 elem->cidr = cidr in hash_netport4_data_netmask()
163 u8 cidr; hash_netport4_uadt() local
272 u8 cidr:7; global() member
308 hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr) hash_netport6_data_netmask() argument
383 u8 cidr; hash_netport6_uadt() local
[all...]
H A Dip_set_hash_ipportnet.c41 /* We squeeze the "nomatch" flag into cidr: we don't support cidr == 0
42 * However this way we have to store internally cidr - 1,
56 u8 cidr:7; member
70 ip1->cidr == ip2->cidr && in hash_ipportnet4_data_equal()
94 hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr) in hash_ipportnet4_data_netmask() argument
96 elem->ip2 &= ip_set_netmask(cidr); in hash_ipportnet4_data_netmask()
97 elem->cidr = cidr in hash_ipportnet4_data_netmask()
170 u8 cidr; hash_ipportnet4_uadt() local
311 u8 cidr:7; global() member
349 hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr) hash_ipportnet6_data_netmask() argument
426 u8 cidr; hash_ipportnet6_uadt() local
[all...]
H A Dip_set_hash_net.c46 u8 cidr; member
57 ip1->cidr == ip2->cidr; in hash_net4_data_equal()
79 hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr) in hash_net4_data_netmask() argument
81 elem->ip &= ip_set_netmask(cidr); in hash_net4_data_netmask()
82 elem->cidr = cidr; in hash_net4_data_netmask()
91 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || in hash_net4_data_list()
120 .cidr = INIT_CIDR(h->nets[0].cidr[ in hash_net4_kadt()
217 u8 cidr; global() member
250 hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr) hash_net6_data_netmask() argument
[all...]
H A Dip_set_hash_netiface.c50 u8 cidr; member
59 u8 cidr; member
74 ip1->cidr == ip2->cidr && in hash_netiface4_data_equal()
101 hash_netiface4_data_netmask(struct hash_netiface4_elem *elem, u8 cidr) in hash_netiface4_data_netmask() argument
103 elem->ip &= ip_set_netmask(cidr); in hash_netiface4_data_netmask()
104 elem->cidr = cidr; in hash_netiface4_data_netmask()
117 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || in hash_netiface4_data_list()
164 .cidr in hash_netiface4_kadt()
285 u8 cidr; global() member
293 u8 cidr; global() member
335 hash_netiface6_data_netmask(struct hash_netiface6_elem *elem, u8 cidr) hash_netiface6_data_netmask() argument
[all...]
H A Dip_set_hash_gen.h100 u32 nets[IPSET_NET_COUNT]; /* number of elements for this cidr */
101 u8 cidr[IPSET_NET_COUNT]; /* the cidr value */ member
123 #define __CIDR(cidr, i) (cidr[i])
125 #define __CIDR(cidr, i) (cidr)
128 /* cidr + 1 is stored in net_prefixes to support /0 */
129 #define NCIDR_PUT(cidr) ((cidr)
325 mtype_add_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) mtype_add_cidr() argument
352 mtype_del_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) mtype_del_cidr() argument
[all...]
/kernel/linux/linux-5.10/drivers/net/wireguard/
H A Dallowedips.c24 u8 cidr, u8 bits) in copy_and_assign_cidr()
26 node->cidr = cidr; in copy_and_assign_cidr()
27 node->bit_at_a = cidr / 8U; in copy_and_assign_cidr()
31 node->bit_at_b = 7U - (cidr % 8U); in copy_and_assign_cidr()
103 * bits properly, by precomputing a mask bswap(~0 << (32 - cidr)), and in prefix_matches()
108 return common_bits(node, key, bits) >= node->cidr; in prefix_matches()
119 if (node->cidr == bits) in find_node()
150 u8 cidr, u8 bits, struct allowedips_node **rnode, in node_placement()
157 while (node && node->cidr < in node_placement()
23 copy_and_assign_cidr(struct allowedips_node *node, const u8 *src, u8 cidr, u8 bits) copy_and_assign_cidr() argument
149 node_placement(struct allowedips_node __rcu *trie, const u8 *key, u8 cidr, u8 bits, struct allowedips_node **rnode, struct mutex *lock) node_placement() argument
181 add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key, u8 cidr, struct wg_peer *peer, struct mutex *lock) add() argument
281 wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) wg_allowedips_insert_v4() argument
292 wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) wg_allowedips_insert_v6() argument
343 wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr) wg_allowedips_read_node() argument
[all...]
H A Dallowedips.h18 u8 cidr, bit_at_a, bit_at_b, bitlen; member
38 u8 cidr, struct wg_peer *peer, struct mutex *lock);
40 u8 cidr, struct wg_peer *peer, struct mutex *lock);
44 int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr);
H A Dnetlink.c75 static int get_allowedips(struct sk_buff *skb, const u8 *ip, u8 cidr, in get_allowedips() argument
84 if (nla_put_u8(skb, WGALLOWEDIP_A_CIDR_MASK, cidr) || in get_allowedips()
177 u8 cidr, ip[16] __aligned(__alignof(u64)); in get_peer() local
180 family = wg_allowedips_read_node(allowedips_node, ip, &cidr); in get_peer()
181 if (get_allowedips(skb, ip, cidr, family)) { in get_peer()
333 u8 cidr; in set_allowedip() local
339 cidr = nla_get_u8(attrs[WGALLOWEDIP_A_CIDR_MASK]); in set_allowedip()
341 if (family == AF_INET && cidr <= 32 && in set_allowedip()
345 nla_data(attrs[WGALLOWEDIP_A_IPADDR]), cidr, peer, in set_allowedip()
347 else if (family == AF_INET6 && cidr < in set_allowedip()
[all...]
/kernel/linux/linux-6.6/drivers/net/wireguard/
H A Dallowedips.c24 u8 cidr, u8 bits) in copy_and_assign_cidr()
26 node->cidr = cidr; in copy_and_assign_cidr()
27 node->bit_at_a = cidr / 8U; in copy_and_assign_cidr()
31 node->bit_at_b = 7U - (cidr % 8U); in copy_and_assign_cidr()
103 * bits properly, by precomputing a mask bswap(~0 << (32 - cidr)), and in prefix_matches()
108 return common_bits(node, key, bits) >= node->cidr; in prefix_matches()
119 if (node->cidr == bits) in find_node()
150 u8 cidr, u8 bits, struct allowedips_node **rnode, in node_placement()
157 while (node && node->cidr < in node_placement()
23 copy_and_assign_cidr(struct allowedips_node *node, const u8 *src, u8 cidr, u8 bits) copy_and_assign_cidr() argument
149 node_placement(struct allowedips_node __rcu *trie, const u8 *key, u8 cidr, u8 bits, struct allowedips_node **rnode, struct mutex *lock) node_placement() argument
181 add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key, u8 cidr, struct wg_peer *peer, struct mutex *lock) add() argument
281 wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) wg_allowedips_insert_v4() argument
292 wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) wg_allowedips_insert_v6() argument
343 wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr) wg_allowedips_read_node() argument
[all...]
H A Dallowedips.h18 u8 cidr, bit_at_a, bit_at_b, bitlen; member
38 u8 cidr, struct wg_peer *peer, struct mutex *lock);
40 u8 cidr, struct wg_peer *peer, struct mutex *lock);
44 int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr);
/kernel/linux/linux-5.10/drivers/soc/atmel/
H A Dsoc.c156 static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_dbgu() argument
176 *cidr = readl(regs + AT91_DBGU_CIDR); in at91_get_cidr_exid_from_dbgu()
184 static int __init at91_get_cidr_exid_from_chipid(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_chipid() argument
201 *cidr = readl(regs + AT91_CHIPID_CIDR); in at91_get_cidr_exid_from_chipid()
214 u32 cidr, exid; in at91_soc_init() local
222 ret = at91_get_cidr_exid_from_dbgu(&cidr, &exid); in at91_soc_init()
224 ret = at91_get_cidr_exid_from_chipid(&cidr, &exid); in at91_soc_init()
232 if (soc->cidr_match != (cidr & AT91_CIDR_MATCH_MASK)) in at91_soc_init()
235 if (!(cidr & AT91_CIDR_EXT) || soc->exid_match == exid) in at91_soc_init()
251 AT91_CIDR_VERSION(cidr)); in at91_soc_init()
[all...]
/kernel/linux/linux-5.10/drivers/net/wireguard/selftest/
H A Dallowedips.c106 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()
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()
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
181 horrible_allowedips_insert_v4(struct horrible_allowedips *table, struct in_addr *ip, u8 cidr, void *value) horrible_allowedips_insert_v4() argument
198 horrible_allowedips_insert_v6(struct horrible_allowedips *table, struct in6_addr *ip, u8 cidr, void *value) horrible_allowedips_insert_v6() argument
619 u8 cidr, ip[16] __aligned(__alignof(u64)); wg_allowedips_selftest() local
[all...]
/kernel/linux/linux-6.6/drivers/net/wireguard/selftest/
H A Dallowedips.c106 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()
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()
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
181 horrible_allowedips_insert_v4(struct horrible_allowedips *table, struct in_addr *ip, u8 cidr, void *value) horrible_allowedips_insert_v4() argument
198 horrible_allowedips_insert_v6(struct horrible_allowedips *table, struct in6_addr *ip, u8 cidr, void *value) horrible_allowedips_insert_v6() argument
619 u8 cidr, ip[16] __aligned(__alignof(u64)); wg_allowedips_selftest() local
[all...]
/kernel/linux/linux-6.6/drivers/soc/atmel/
H A Dsoc.c251 static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_dbgu() argument
271 *cidr = readl(regs + AT91_DBGU_CIDR); in at91_get_cidr_exid_from_dbgu()
279 static int __init at91_get_cidr_exid_from_chipid(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_chipid() argument
301 *cidr = readl(regs + AT91_CHIPID_CIDR); in at91_get_cidr_exid_from_chipid()
314 u32 cidr, exid; in at91_soc_init() local
322 ret = at91_get_cidr_exid_from_dbgu(&cidr, &exid); in at91_soc_init()
324 ret = at91_get_cidr_exid_from_chipid(&cidr, &exid); in at91_soc_init()
332 if (soc->cidr_match != (cidr & soc->cidr_mask)) in at91_soc_init()
335 if (!(cidr & AT91_CIDR_EXT) || soc->exid_match == exid) in at91_soc_init()
351 AT91_CIDR_VERSION(cidr, so in at91_soc_init()
[all...]
/kernel/linux/linux-5.10/include/linux/netfilter/ipset/
H A Dpfxlen.h37 extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
39 #define ip_set_mask_from_to(from, to, cidr) \
41 from &= ip_set_hostmask(cidr); \
42 to = from | ~ip_set_hostmask(cidr); \
/kernel/linux/linux-6.6/include/linux/netfilter/ipset/
H A Dpfxlen.h37 extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
39 #define ip_set_mask_from_to(from, to, cidr) \
41 from &= ip_set_hostmask(cidr); \
42 to = from | ~ip_set_hostmask(cidr); \

Completed in 15 milliseconds

12