/linux-master/drivers/net/wireguard/ |
H A D | netlink.c | 75 static int get_allowedips(struct sk_buff *skb, const u8 *ip, u8 cidr, argument 84 if (nla_put_u8(skb, WGALLOWEDIP_A_CIDR_MASK, cidr) || 177 u8 cidr, ip[16] __aligned(__alignof(u64)); local 180 family = wg_allowedips_read_node(allowedips_node, ip, &cidr); 181 if (get_allowedips(skb, ip, cidr, family)) { 333 u8 cidr; local 339 cidr = nla_get_u8(attrs[WGALLOWEDIP_A_CIDR_MASK]); 341 if (family == AF_INET && cidr <= 32 && 345 nla_data(attrs[WGALLOWEDIP_A_IPADDR]), cidr, peer, 347 else if (family == AF_INET6 && cidr < [all...] |
H A D | allowedips.c | 24 u8 cidr, u8 bits) 26 node->cidr = cidr; 27 node->bit_at_a = cidr / 8U; 31 node->bit_at_b = 7U - (cidr % 8U); 103 * bits properly, by precomputing a mask bswap(~0 << (32 - cidr)), and 108 return common_bits(node, key, bits) >= node->cidr; 119 if (node->cidr == bits) 150 u8 cidr, u8 bits, struct allowedips_node **rnode, 157 while (node && node->cidr < 23 copy_and_assign_cidr(struct allowedips_node *node, const u8 *src, u8 cidr, u8 bits) argument 149 node_placement(struct allowedips_node __rcu *trie, const u8 *key, u8 cidr, u8 bits, struct allowedips_node **rnode, struct mutex *lock) argument 181 add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key, u8 cidr, struct wg_peer *peer, struct mutex *lock) argument 281 wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) argument 292 wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip, u8 cidr, struct wg_peer *peer, struct mutex *lock) argument 343 wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr) argument [all...] |
H A D | allowedips.h | 18 u8 cidr, bit_at_a, bit_at_b, bitlen; member in struct:allowedips_node 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);
|
/linux-master/net/netfilter/ipset/ |
H A D | ip_set_hash_gen.h | 101 u32 nets[IPSET_NET_COUNT]; /* number of elements for this cidr */ 102 u8 cidr[IPSET_NET_COUNT]; /* the cidr value */ member in struct:net_prefixes 124 #define __CIDR(cidr, i) (cidr[i]) 126 #define __CIDR(cidr, i) (cidr) 129 /* cidr + 1 is stored in net_prefixes to support /0 */ 130 #define NCIDR_PUT(cidr) ((cidr) 326 mtype_add_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) argument 353 mtype_del_cidr(struct ip_set *set, struct htype *h, u8 cidr, u8 n) argument [all...] |
H A D | ip_set_hash_netiface.c | 50 u8 cidr; member in struct:hash_netiface4_elem_hashed 59 u8 cidr; member in struct:hash_netiface4_elem 74 ip1->cidr == ip2->cidr && 101 hash_netiface4_data_netmask(struct hash_netiface4_elem *elem, u8 cidr) argument 103 elem->ip &= ip_set_netmask(cidr); 104 elem->cidr = cidr; 117 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || 164 .cidr 285 u8 cidr; member in struct:hash_netiface6_elem_hashed 293 u8 cidr; member in struct:hash_netiface6_elem 335 hash_netiface6_data_netmask(struct hash_netiface6_elem *elem, u8 cidr) argument [all...] |
H A D | ip_set_hash_netportnet.c | 51 u8 cidr[2]; member in union:hash_netportnet4_elem::__anon378 99 u8 cidr, bool inner) 102 elem->ip[1] &= ip_set_netmask(cidr); 103 elem->cidr[1] = cidr; 105 elem->ip[0] &= ip_set_netmask(cidr); 106 elem->cidr[0] = cidr; 119 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || 120 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ 98 hash_netportnet4_data_netmask(struct hash_netportnet4_elem *elem, u8 cidr, bool inner) argument 178 hash_netportnet4_range_to_cidr(u32 from, u32 to, u8 *cidr) argument 342 u8 cidr[2]; member in union:hash_netportnet6_elem::__anon379 390 hash_netportnet6_data_netmask(struct hash_netportnet6_elem *elem, u8 cidr, bool inner) argument [all...] |
H A D | ip_set_bitmap_ip.c | 172 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 174 if (!cidr || cidr > HOST_MASK) 176 ip_set_mask_from_to(ip, ip_to, cidr); 278 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 280 if (cidr >= HOST_MASK) 282 ip_set_mask_from_to(first_ip, last_ip, cidr);
|
H A D | ip_set_hash_netport.c | 42 /* 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 in struct:hash_netport4_elem 69 ip1->cidr == ip2->cidr; 91 hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr) argument 93 elem->ip &= ip_set_netmask(cidr); 94 elem->cidr = cidr 163 u8 cidr; local 272 u8 cidr:7; member in struct:hash_netport6_elem 308 hash_netport6_data_netmask(struct hash_netport6_elem *elem, u8 cidr) argument 383 u8 cidr; local [all...] |
H A D | ip_set_hash_netnet.c | 52 u8 cidr[2]; member in union:hash_netnet4_elem::__anon381 94 hash_netnet4_data_netmask(struct hash_netnet4_elem *elem, u8 cidr, bool inner) argument 97 elem->ip[1] &= ip_set_netmask(cidr); 98 elem->cidr[1] = cidr; 100 elem->ip[0] &= ip_set_netmask(cidr); 101 elem->cidr[0] = cidr; 113 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr[0]) || 114 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr[ 287 u8 cidr[2]; member in union:hash_netnet6_elem::__anon382 330 hash_netnet6_data_netmask(struct hash_netnet6_elem *elem, u8 cidr, bool inner) argument [all...] |
H A D | ip_set_hash_net.c | 46 u8 cidr; member in struct:hash_net4_elem 57 ip1->cidr == ip2->cidr; 79 hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr) argument 81 elem->ip &= ip_set_netmask(cidr); 82 elem->cidr = cidr; 91 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) || 120 .cidr = INIT_CIDR(h->nets[0].cidr[ 217 u8 cidr; member in struct:hash_net6_elem 250 hash_net6_data_netmask(struct hash_net6_elem *elem, u8 cidr) argument [all...] |
H A D | ip_set_hash_ipportnet.c | 41 /* 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 in struct:hash_ipportnet4_elem 70 ip1->cidr == ip2->cidr && 94 hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr) argument 96 elem->ip2 &= ip_set_netmask(cidr); 97 elem->cidr = cidr 170 u8 cidr; local 311 u8 cidr:7; member in struct:hash_ipportnet6_elem 349 hash_ipportnet6_data_netmask(struct hash_ipportnet6_elem *elem, u8 cidr) argument 426 u8 cidr; local [all...] |
H A D | ip_set_hash_ipport.c | 173 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 175 if (!cidr || cidr > HOST_MASK) 177 ip_set_mask_from_to(ip, ip_to, cidr); 304 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 306 if (cidr != HOST_MASK)
|
H A D | ip_set_hash_ipportip.c | 169 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 171 if (!cidr || cidr > HOST_MASK) 173 ip_set_mask_from_to(ip, ip_to, cidr); 299 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 301 if (cidr != HOST_MASK)
|
H A D | ip_set_hash_ip.c | 143 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 145 if (!cidr || cidr > HOST_MASK) 147 ip_set_mask_from_to(ip, ip_to, cidr); 251 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 253 if (cidr != HOST_MASK)
|
H A D | ip_set_hash_ipmark.c | 144 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 146 if (!cidr || cidr > HOST_MASK) 148 ip_set_mask_from_to(ip, ip_to, cidr); 250 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 252 if (cidr != HOST_MASK)
|
H A D | ip_set_bitmap_ipmac.c | 342 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); local 344 if (cidr >= HOST_MASK) 346 ip_set_mask_from_to(first_ip, last_ip, cidr);
|
H A D | pfxlen.c | 172 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr) argument 182 *cidr = i; 186 *cidr = 32;
|
/linux-master/drivers/net/wireguard/selftest/ |
H A D | allowedips.c | 106 static __init inline union nf_inet_addr horrible_cidr_to_mask(u8 cidr) argument 111 memset(&mask.all, 0xff, cidr / 8); 112 if (cidr % 32) 113 mask.all[cidr / 32] = (__force u32)htonl( 114 (0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL); 182 struct in_addr *ip, u8 cidr, void *value) 189 node->mask = horrible_cidr_to_mask(cidr); 199 struct in6_addr *ip, u8 cidr, void *value) 206 node->mask = horrible_cidr_to_mask(cidr); 256 unsigned int i, j, k, mutate_amount, cidr; local 181 horrible_allowedips_insert_v4(struct horrible_allowedips *table, struct in_addr *ip, u8 cidr, void *value) argument 198 horrible_allowedips_insert_v6(struct horrible_allowedips *table, struct in6_addr *ip, u8 cidr, void *value) argument 619 u8 cidr, ip[16] __aligned(__alignof(u64)); local [all...] |
/linux-master/drivers/soc/atmel/ |
H A D | soc.c | 251 static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) argument 271 *cidr = readl(regs + AT91_DBGU_CIDR); 279 static int __init at91_get_cidr_exid_from_chipid(u32 *cidr, u32 *exid) argument 301 *cidr = readl(regs + AT91_CHIPID_CIDR); 314 u32 cidr, exid; local 322 ret = at91_get_cidr_exid_from_dbgu(&cidr, &exid); 324 ret = at91_get_cidr_exid_from_chipid(&cidr, &exid); 332 if (soc->cidr_match != (cidr & soc->cidr_mask)) 335 if (!(cidr & AT91_CIDR_EXT) || soc->exid_match == exid) 351 AT91_CIDR_VERSION(cidr, so [all...] |
/linux-master/include/linux/netfilter/ipset/ |
H A 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) \ 41 from &= ip_set_hostmask(cidr); \ 42 to = from | ~ip_set_hostmask(cidr); \
|