/Linux-v5.10/net/netfilter/ipset/ |
D | ip_set_hash_netnet.c | 48 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[1]) || in hash_netnet4_data_list() 134 e->cidr[0] = HOST_MASK; in hash_netnet4_init() 135 e->cidr[1] = HOST_MASK; in hash_netnet4_init() [all …]
|
D | ip_set_hash_net.c | 45 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[0], HOST_MASK), in hash_net4_kadt() 123 if (e.cidr == 0) in hash_net4_kadt() 126 e.cidr = HOST_MASK; in hash_net4_kadt() 129 e.ip &= ip_set_netmask(e.cidr); in hash_net4_kadt() [all …]
|
D | ip_set_hash_ipportnet.c | 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 - 1; in hash_ipportnet4_data_netmask() 108 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) || in hash_ipportnet4_data_list() 140 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_ipportnet4_kadt() 145 e.cidr = HOST_MASK - 1; in hash_ipportnet4_kadt() 153 e.ip2 &= ip_set_netmask(e.cidr + 1); in hash_ipportnet4_kadt() 164 struct hash_ipportnet4_elem e = { .cidr = HOST_MASK - 1 }; in hash_ipportnet4_uadt() [all …]
|
D | ip_set_hash_netport.c | 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 - 1; in hash_netport4_data_netmask() 104 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) || in hash_netport4_data_list() 135 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_netport4_kadt() 140 e.cidr = HOST_MASK - 1; in hash_netport4_kadt() 147 e.ip &= ip_set_netmask(e.cidr + 1); in hash_netport4_kadt() 158 struct hash_netport4_elem e = { .cidr = HOST_MASK - 1 }; in hash_netport4_uadt() [all …]
|
D | ip_set_hash_netportnet.c | 49 u8 cidr[2]; member 97 u8 cidr, bool inner) in hash_netportnet4_data_netmask() argument 100 elem->ip[1] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask() 101 elem->cidr[1] = cidr; in hash_netportnet4_data_netmask() 103 elem->ip[0] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask() 104 elem->cidr[0] = cidr; in hash_netportnet4_data_netmask() 117 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netportnet4_data_list() 118 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[1]) || in hash_netportnet4_data_list() 144 e->cidr[0] = HOST_MASK; in hash_netportnet4_init() 145 e->cidr[1] = HOST_MASK; in hash_netportnet4_init() [all …]
|
D | ip_set_hash_netiface.c | 49 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 = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_netiface4_kadt() 169 e.cidr = HOST_MASK; in hash_netiface4_kadt() 172 e.ip &= ip_set_netmask(e.cidr); in hash_netiface4_kadt() [all …]
|
D | ip_set_hash_gen.h | 126 u8 cidr[IPSET_NET_COUNT]; /* the cidr value */ member 162 #define __CIDR(cidr, i) (cidr[i]) argument 164 #define __CIDR(cidr, i) (cidr) argument 168 #define NCIDR_PUT(cidr) ((cidr) + 1) argument 169 #define NCIDR_GET(cidr) ((cidr) - 1) argument 173 #define DCIDR_PUT(cidr) ((cidr) - 1) argument 174 #define DCIDR_GET(cidr, i) (__CIDR(cidr, i) + 1) argument 176 #define DCIDR_PUT(cidr) (cidr) argument 177 #define DCIDR_GET(cidr, i) __CIDR(cidr, i) argument 180 #define INIT_CIDR(cidr, host_mask) \ argument [all …]
|
D | ip_set_hash_ip.c | 137 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip4_uadt() local 139 if (!cidr || cidr > HOST_MASK) in hash_ip4_uadt() 141 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ip4_uadt() 249 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip6_uadt() local 251 if (cidr != HOST_MASK) in hash_ip6_uadt()
|
D | ip_set_hash_ipmark.c | 138 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipmark4_uadt() local 140 if (!cidr || cidr > HOST_MASK) in hash_ipmark4_uadt() 142 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipmark4_uadt() 240 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipmark6_uadt() local 242 if (cidr != HOST_MASK) in hash_ipmark6_uadt()
|
D | ip_set_bitmap_ip.c | 172 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in bitmap_ip_uadt() local 174 if (!cidr || cidr > HOST_MASK) in bitmap_ip_uadt() 176 ip_set_mask_from_to(ip, ip_to, cidr); in bitmap_ip_uadt() 278 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in bitmap_ip_create() local 280 if (cidr >= HOST_MASK) in bitmap_ip_create() 282 ip_set_mask_from_to(first_ip, last_ip, cidr); in bitmap_ip_create()
|
D | pfxlen.c | 172 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr) in ip_set_range_to_cidr() argument 182 *cidr = i; in ip_set_range_to_cidr() 186 *cidr = 32; in ip_set_range_to_cidr()
|
D | ip_set_hash_ipport.c | 161 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport4_uadt() local 163 if (!cidr || cidr > HOST_MASK) in hash_ipport4_uadt() 165 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipport4_uadt() 283 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport6_uadt() local 285 if (cidr != HOST_MASK) in hash_ipport6_uadt()
|
D | ip_set_hash_ipportip.c | 168 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipportip4_uadt() local 170 if (!cidr || cidr > HOST_MASK) in hash_ipportip4_uadt() 172 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipportip4_uadt() 294 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipportip6_uadt() local 296 if (cidr != HOST_MASK) in hash_ipportip6_uadt()
|
D | ip_set_bitmap_ipmac.c | 342 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in bitmap_ipmac_create() local 344 if (cidr >= HOST_MASK) in bitmap_ipmac_create() 346 ip_set_mask_from_to(first_ip, last_ip, cidr); in bitmap_ipmac_create()
|
/Linux-v5.10/drivers/net/wireguard/ |
D | allowedips.c | 20 u8 cidr, u8 bits) in copy_and_assign_cidr() argument 22 node->cidr = cidr; in copy_and_assign_cidr() 23 node->bit_at_a = cidr / 8U; in copy_and_assign_cidr() 27 node->bit_at_b = 7U - (cidr % 8U); in copy_and_assign_cidr() 149 return common_bits(node, key, bits) >= node->cidr; in prefix_matches() 160 if (node->cidr == bits) in find_node() 191 u8 cidr, u8 bits, struct allowedips_node **rnode, in node_placement() argument 199 while (node && node->cidr <= cidr && prefix_matches(node, key, bits)) { in node_placement() 201 if (parent->cidr == cidr) { in node_placement() 213 u8 cidr, struct wg_peer *peer, struct mutex *lock) in add() argument [all …]
|
D | allowedips.h | 23 u8 cidr, bit_at_a, bit_at_b, bitlen; member 41 u8 cidr, struct wg_peer *peer, struct mutex *lock); 43 u8 cidr, struct wg_peer *peer, struct mutex *lock); 47 int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr);
|
D | netlink.c | 75 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 <= 128 && in set_allowedip() [all …]
|
/Linux-v5.10/drivers/net/wireguard/selftest/ |
D | allowedips.c | 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() [all …]
|
/Linux-v5.10/drivers/soc/atmel/ |
D | soc.c | 156 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 …]
|
/Linux-v5.10/include/linux/netfilter/ipset/ |
D | pfxlen.h | 37 extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr); 39 #define ip_set_mask_from_to(from, to, cidr) \ argument 41 from &= ip_set_hostmask(cidr); \ 42 to = from | ~ip_set_hostmask(cidr); \
|