/openbmc/linux/net/netfilter/ipset/ |
H A D | ip_set_hash_netnet.c | 52 u8 cidr[2]; member 98 elem->cidr[1] = cidr; in hash_netnet4_data_netmask() 101 elem->cidr[0] = cidr; in hash_netnet4_data_netmask() 152 e.cidr[0] = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK); in hash_netnet4_kadt() 153 e.cidr[1] = INIT_CIDR(h->nets[0].cidr[1], HOST_MASK); in hash_netnet4_kadt() 199 if (!e.cidr[0] || e.cidr[0] > HOST_MASK) in hash_netnet4_uadt() 205 if (!e.cidr[1] || e.cidr[1] > HOST_MASK) in hash_netnet4_uadt() 334 elem->cidr[1] = cidr; in hash_netnet6_data_netmask() 337 elem->cidr[0] = cidr; in hash_netnet6_data_netmask() 443 if (!e.cidr[0] || e.cidr[0] > HOST_MASK) in hash_netnet6_uadt() [all …]
|
H A D | ip_set_hash_net.c | 46 u8 cidr; member 57 ip1->cidr == ip2->cidr; in hash_net4_data_equal() 82 elem->cidr = cidr; in hash_net4_data_netmask() 120 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_net4_kadt() 124 if (e.cidr == 0) in hash_net4_kadt() 163 if (!e.cidr || e.cidr > HOST_MASK) in hash_net4_uadt() 217 u8 cidr; member 228 ip1->cidr == ip2->cidr; in hash_net6_data_equal() 253 elem->cidr = cidr; in hash_net6_data_netmask() 294 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_net6_kadt() [all …]
|
H A D | ip_set_hash_netportnet.c | 51 u8 cidr[2]; member 103 elem->cidr[1] = cidr; in hash_netportnet4_data_netmask() 106 elem->cidr[0] = cidr; in hash_netportnet4_data_netmask() 160 e.cidr[0] = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK); in hash_netportnet4_kadt() 161 e.cidr[1] = INIT_CIDR(h->nets[0].cidr[1], HOST_MASK); in hash_netportnet4_kadt() 181 *cidr = 0; in hash_netportnet4_range_to_cidr() 342 u8 cidr[2]; member 395 elem->cidr[1] = cidr; in hash_netportnet6_data_netmask() 398 elem->cidr[0] = cidr; in hash_netportnet6_data_netmask() 455 e.cidr[0] = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK); in hash_netportnet6_kadt() [all …]
|
H A D | ip_set_hash_ipportnet.c | 70 ip1->cidr == ip2->cidr && in hash_ipportnet4_data_equal() 97 elem->cidr = cidr - 1; in hash_ipportnet4_data_netmask() 170 u8 cidr; in hash_ipportnet4_uadt() local 196 if (!cidr || cidr > HOST_MASK) in hash_ipportnet4_uadt() 198 e.cidr = cidr - 1; in hash_ipportnet4_uadt() 244 if (!cidr || cidr > HOST_MASK) in hash_ipportnet4_uadt() 285 e.cidr = cidr - 1; in hash_ipportnet4_uadt() 325 ip1->cidr == ip2->cidr && in hash_ipportnet6_data_equal() 352 elem->cidr = cidr - 1; in hash_ipportnet6_data_netmask() 460 if (!cidr || cidr > HOST_MASK) in hash_ipportnet6_uadt() [all …]
|
H A D | ip_set_hash_netport.c | 55 u8 cidr:7; member 69 ip1->cidr == ip2->cidr; in hash_netport4_data_equal() 94 elem->cidr = cidr - 1; in hash_netport4_data_netmask() 163 u8 cidr; in hash_netport4_uadt() local 185 if (!cidr || cidr > HOST_MASK) in hash_netport4_uadt() 187 e.cidr = cidr - 1; in hash_netport4_uadt() 248 e.cidr = cidr - 1; in hash_netport4_uadt() 286 ip1->cidr == ip2->cidr; in hash_netport6_data_equal() 311 elem->cidr = cidr - 1; in hash_netport6_data_netmask() 407 if (!cidr || cidr > HOST_MASK) in hash_netport6_uadt() [all …]
|
H A D | ip_set_hash_netiface.c | 50 u8 cidr; member 59 u8 cidr; member 74 ip1->cidr == ip2->cidr && in hash_netiface4_data_equal() 104 elem->cidr = cidr; in hash_netiface4_data_netmask() 164 .cidr = INIT_CIDR(h->nets[0].cidr[0], HOST_MASK), in hash_netiface4_kadt() 170 e.cidr = HOST_MASK; in hash_netiface4_kadt() 285 u8 cidr; member 293 u8 cidr; member 308 ip1->cidr == ip2->cidr && in hash_netiface6_data_equal() 338 elem->cidr = cidr; in hash_netiface6_data_netmask() [all …]
|
H A D | ip_set_hash_gen.h | 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 137 #define DCIDR_PUT(cidr) (cidr) argument 138 #define DCIDR_GET(cidr, i) __CIDR(cidr, i) argument 334 } else if (h->nets[i].cidr[n] < cidr) { in mtype_add_cidr() 336 } else if (h->nets[i].cidr[n] == cidr) { in mtype_add_cidr() 345 h->nets[i].cidr[n] = cidr; in mtype_add_cidr() [all …]
|
H A 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()
|
H A D | ip_set_hash_ip.c | 143 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip4_uadt() local 145 if (!cidr || cidr > HOST_MASK) in hash_ip4_uadt() 147 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ip4_uadt() 251 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ip6_uadt() local 253 if (cidr != HOST_MASK) in hash_ip6_uadt()
|
H A 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()
|
H A 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()
|
H A D | ip_set_hash_ipport.c | 173 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport4_uadt() local 175 if (!cidr || cidr > HOST_MASK) in hash_ipport4_uadt() 177 ip_set_mask_from_to(ip, ip_to, cidr); in hash_ipport4_uadt() 304 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); in hash_ipport6_uadt() local 306 if (cidr != HOST_MASK) in hash_ipport6_uadt()
|
H A 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()
|
H A 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()
|
/openbmc/linux/drivers/net/wireguard/ |
H A 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() 119 if (node->cidr == bits) in find_node() 157 while (node && node->cidr <= cidr && prefix_matches(node, key, bits)) { in node_placement() 159 if (parent->cidr == cidr) { in node_placement() 222 cidr = min(cidr, common_bits(down, key, bits)); in add() 225 if (newnode->cidr == cidr) { in add() 348 if (node->cidr) in wg_allowedips_read_node() [all …]
|
H A 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);
|
H A 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 …]
|
/openbmc/openbmc/meta-google/recipes-google/networking/network-sh/ |
H A D | lib.sh | 224 local cidr="${BASH_REMATCH[2]}" 238 if (( (pfx_bytes[cidr/8] & ~(~0 << (8-cidr%8))) != 0 )); then 244 for (( i=cidr/8+1; i<${#pfx_bytes[@]}; i++ )); do 263 if (( (sfx_bytes[cidr/8] & (~0 << (8-cidr%8))) != 0 )); then 269 for (( i=0; i<cidr/8; i++ )); do 280 echo "$(ip_bytes_to_str out_bytes)/$cidr"
|
H A D | test.sh | 192 cidr="$(ip_pfx_to_cidr 'fd01::/64')" || fail 193 expect_numeq "$cidr" 64 194 cidr="$(ip_pfx_to_cidr 'fd01:eeee:aaaa:cccc:a:1234:5678:90af/128')" || fail 195 expect_numeq "$cidr" 128 196 cidr="$(ip_pfx_to_cidr '10.0.0.1/24')" || fail 197 expect_numeq "$cidr" 24
|
/openbmc/linux/drivers/net/wireguard/selftest/ |
H A D | allowedips.c | 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() 189 node->mask = horrible_cidr_to_mask(cidr); in horrible_allowedips_insert_v4() 288 cidr = get_random_u32_inclusive(1, 32); in randomized_test() 296 cidr, peer) < 0) { in randomized_test() 318 cidr, peer, &mutex) < 0) { in randomized_test() 340 cidr, peer) < 0) { in randomized_test() 362 cidr, peer, &mutex) < 0) { in randomized_test() 462 cidr, mem, &mutex) [all …]
|
/openbmc/linux/drivers/soc/atmel/ |
H A D | soc.c | 251 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, soc->version_mask)); in at91_soc_init() [all …]
|
/openbmc/linux/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) \ argument 41 from &= ip_set_hostmask(cidr); \ 42 to = from | ~ip_set_hostmask(cidr); \
|
/openbmc/openbmc/meta-google/recipes-google/networking/gbmc-bridge/ |
H A D | gbmc-br-from-ra.sh | 31 local cidr 32 if ! cidr="$(ip_pfx_to_cidr "$pfx")"; then 36 if (( cidr == 80 )); then
|
/openbmc/u-boot/arch/arm/mach-at91/include/mach/ |
H A D | at91_dbu.h | 26 u32 cidr; /* Chip ID Register RO */ member
|
/openbmc/openbmc/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ |
H A D | 14_cidr_support.patch | 38 +/* cidr_mask_addr - convert cidr netmask length to internal form */
|