/linux-6.1.9/net/netfilter/ipset/ |
D | ip_set_hash_netnet.c | 49 u8 cidr[2]; member 91 hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner) in hash_netnet4_data_netmask() argument 94 elem->ip[1] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask() 95 elem->cidr[1] = cidr; in hash_netnet4_data_netmask() 97 elem->ip[0] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask() 98 elem->cidr[0] = cidr; in hash_netnet4_data_netmask() 110 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || in hash_netnet4_data_list() 111 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[1]) || in hash_netnet4_data_list() 135 e->cidr[0] = HOST_MASK; in hash_netnet4_init() 136 e->cidr[1] = HOST_MASK; in hash_netnet4_init() [all …]
|
D | ip_set_hash_net.c | 46 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[0], HOST_MASK), in hash_net4_kadt() 124 if (e.cidr == 0) in hash_net4_kadt() 127 e.cidr = HOST_MASK; in hash_net4_kadt() 130 e.ip &= ip_set_netmask(e.cidr); in hash_net4_kadt() [all …]
|
D | ip_set_hash_netportnet.c | 50 u8 cidr[2]; member 98 u8 cidr, bool inner) in hash_netportnet4_data_netmask() argument 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[1]) || in hash_netportnet4_data_list() 145 e->cidr[0] = HOST_MASK; in hash_netportnet4_init() 146 e->cidr[1] = HOST_MASK; in hash_netportnet4_init() [all …]
|
D | ip_set_hash_ipportnet.c | 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 - 1; in hash_ipportnet4_data_netmask() 109 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) || in hash_ipportnet4_data_list() 141 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_ipportnet4_kadt() 146 e.cidr = HOST_MASK - 1; in hash_ipportnet4_kadt() 154 e.ip2 &= ip_set_netmask(e.cidr + 1); in hash_ipportnet4_kadt() 165 struct hash_ipportnet4_elem e = { .cidr = HOST_MASK - 1 }; in hash_ipportnet4_uadt() [all …]
|
D | ip_set_hash_netport.c | 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 - 1; in hash_netport4_data_netmask() 105 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) || in hash_netport4_data_list() 136 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_netport4_kadt() 141 e.cidr = HOST_MASK - 1; in hash_netport4_kadt() 148 e.ip &= ip_set_netmask(e.cidr + 1); in hash_netport4_kadt() 159 struct hash_netport4_elem e = { .cidr = HOST_MASK - 1 }; in hash_netport4_uadt() [all …]
|
D | ip_set_hash_netiface.c | 50 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 = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_netiface4_kadt() 170 e.cidr = HOST_MASK; in hash_netiface4_kadt() 173 e.ip &= ip_set_netmask(e.cidr); in hash_netiface4_kadt() [all …]
|
D | ip_set_hash_gen.h | 101 u8 cidr[IPSET_NET_COUNT]; /* the cidr value */ member 123 #define __CIDR(cidr, i) (cidr[i]) argument 125 #define __CIDR(cidr, i) (cidr) argument 129 #define NCIDR_PUT(cidr) ((cidr) + 1) argument 130 #define NCIDR_GET(cidr) ((cidr) - 1) argument 134 #define DCIDR_PUT(cidr) ((cidr) - 1) argument 135 #define DCIDR_GET(cidr, i) (__CIDR(cidr, i) + 1) argument 137 #define DCIDR_PUT(cidr) (cidr) argument 138 #define DCIDR_GET(cidr, i) __CIDR(cidr, i) argument 141 #define INIT_CIDR(cidr, host_mask) \ argument [all …]
|
D | ip_set_hash_ipmark.c | 144 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipmark4_uadt() local 146 if (!cidr || cidr > HOST_MASK) in hash_ipmark4_uadt() 148 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipmark4_uadt() 250 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipmark6_uadt() local 252 if (cidr != HOST_MASK) in hash_ipmark6_uadt()
|
D | ip_set_hash_ip.c | 141 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip4_uadt() local 143 if (!cidr || cidr > HOST_MASK) in hash_ip4_uadt() 145 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ip4_uadt() 255 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip6_uadt() local 257 if (cidr != HOST_MASK) in hash_ip6_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 | 162 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport4_uadt() local 164 if (!cidr || cidr > HOST_MASK) in hash_ipport4_uadt() 166 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipport4_uadt() 288 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport6_uadt() local 290 if (cidr != HOST_MASK) in hash_ipport6_uadt()
|
D | ip_set_hash_ipportip.c | 169 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipportip4_uadt() local 171 if (!cidr || cidr > HOST_MASK) in hash_ipportip4_uadt() 173 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipportip4_uadt() 299 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipportip6_uadt() local 301 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-6.1.9/drivers/net/wireguard/ |
D | allowedips.c | 24 u8 cidr, u8 bits) in copy_and_assign_cidr() argument 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() 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() argument 157 while (node && node->cidr <= cidr && prefix_matches(node, key, bits)) { in node_placement() 159 if (parent->cidr == cidr) { in node_placement() 182 u8 cidr, struct wg_peer *peer, struct mutex *lock) in add() argument [all …]
|
D | allowedips.h | 18 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);
|
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-6.1.9/drivers/net/wireguard/selftest/ |
D | allowedips.c | 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 [all …]
|
/linux-6.1.9/drivers/soc/atmel/ |
D | soc.c | 242 static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_dbgu() argument 262 *cidr = readl(regs + AT91_DBGU_CIDR); in at91_get_cidr_exid_from_dbgu() 270 static int __init at91_get_cidr_exid_from_chipid(u32 *cidr, u32 *exid) in at91_get_cidr_exid_from_chipid() argument 292 *cidr = readl(regs + AT91_CHIPID_CIDR); in at91_get_cidr_exid_from_chipid() 305 u32 cidr, exid; in at91_soc_init() local 313 ret = at91_get_cidr_exid_from_dbgu(&cidr, &exid); in at91_soc_init() 315 ret = at91_get_cidr_exid_from_chipid(&cidr, &exid); in at91_soc_init() 323 if (soc->cidr_match != (cidr & soc->cidr_mask)) in at91_soc_init() 326 if (!(cidr & AT91_CIDR_EXT) || soc->exid_match == exid) in at91_soc_init() 342 AT91_CIDR_VERSION(cidr, soc->version_mask)); in at91_soc_init() [all …]
|
/linux-6.1.9/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); \
|