/net/netfilter/ipset/ |
D | ip_set_hash_ip.c | 46 __be32 ip; member 56 return e1->ip == e2->ip; in hash_ip4_data_equal() 62 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, e->ip)) in hash_ip4_data_list() 73 next->ip = e->ip; in hash_ip4_data_next() 89 __be32 ip; in hash_ip4_kadt() local 91 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &ip); in hash_ip4_kadt() 92 ip &= ip_set_netmask(h->netmask); in hash_ip4_kadt() 93 if (ip == 0) in hash_ip4_kadt() 96 e.ip = ip; in hash_ip4_kadt() 108 u32 ip = 0, ip_to = 0, hosts; in hash_ip4_uadt() local [all …]
|
D | ip_set_hash_netnet.c | 45 __be32 ip[2]; member 89 elem->ip[1] = orig->ip[1]; in hash_netnet4_data_reset_elem() 96 elem->ip[1] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask() 99 elem->ip[0] &= ip_set_netmask(cidr); in hash_netnet4_data_netmask() 110 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip[0]) || in hash_netnet4_data_list() 111 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, data->ip[1]) || in hash_netnet4_data_list() 156 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip[0]); in hash_netnet4_kadt() 157 ip4addrptr(skb, opt->flags & IPSET_DIM_TWO_SRC, &e.ip[1]); in hash_netnet4_kadt() 158 e.ip[0] &= ip_set_netmask(e.cidr[0]); in hash_netnet4_kadt() 159 e.ip[1] &= ip_set_netmask(e.cidr[1]); in hash_netnet4_kadt() [all …]
|
D | ip_set_hash_net.c | 46 __be32 ip; member 59 return ip1->ip == ip2->ip && in hash_net4_data_equal() 84 elem->ip &= ip_set_netmask(cidr); in hash_net4_data_netmask() 93 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_net4_data_list() 108 next->ip = d->ip; in hash_net4_data_next() 132 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_net4_kadt() 133 e.ip &= ip_set_netmask(e.cidr); in hash_net4_kadt() 146 u32 ip = 0, ip_to = 0; in hash_net4_uadt() local 156 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in hash_net4_uadt() 178 e.ip = htonl(ip & ip_set_hostmask(e.cidr)); in hash_net4_uadt() [all …]
|
D | ip_set_hash_ipport.c | 46 __be32 ip; member 59 return ip1->ip == ip2->ip && in hash_ipport4_data_equal() 68 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_ipport4_data_list() 82 next->ip = d->ip; in hash_ipport4_data_next() 96 struct hash_ipport4_elem e = { .ip = 0 }; in hash_ipport4_kadt() 103 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipport4_kadt() 113 struct hash_ipport4_elem e = { .ip = 0 }; in hash_ipport4_uadt() 115 u32 ip, ip_to = 0, p = 0, port, port_to; in hash_ipport4_uadt() local 127 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP], &e.ip); in hash_ipport4_uadt() 157 ip_to = ip = ntohl(e.ip); in hash_ipport4_uadt() [all …]
|
D | ip_set_hash_netportnet.c | 48 __be32 ip[2]; member 96 elem->ip[1] = orig->ip[1]; in hash_netportnet4_data_reset_elem() 104 elem->ip[1] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask() 107 elem->ip[0] &= ip_set_netmask(cidr); in hash_netportnet4_data_netmask() 118 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip[0]) || in hash_netportnet4_data_list() 119 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, data->ip[1]) || in hash_netportnet4_data_list() 171 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip[0]); in hash_netportnet4_kadt() 172 ip4addrptr(skb, opt->flags & IPSET_DIM_THREE_SRC, &e.ip[1]); in hash_netportnet4_kadt() 173 e.ip[0] &= ip_set_netmask(e.cidr[0]); in hash_netportnet4_kadt() 174 e.ip[1] &= ip_set_netmask(e.cidr[1]); in hash_netportnet4_kadt() [all …]
|
D | ip_set_hash_ipportip.c | 46 __be32 ip; member 58 return ip1->ip == ip2->ip && in hash_ipportip4_data_equal() 68 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_ipportip4_data_list() 83 next->ip = d->ip; in hash_ipportip4_data_next() 98 struct hash_ipportip4_elem e = { .ip = 0 }; in hash_ipportip4_kadt() 105 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipportip4_kadt() 116 struct hash_ipportip4_elem e = { .ip = 0 }; in hash_ipportip4_uadt() 118 u32 ip, ip_to = 0, p = 0, port, port_to; in hash_ipportip4_uadt() local 130 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP], &e.ip); in hash_ipportip4_uadt() 164 ip_to = ip = ntohl(e.ip); in hash_ipportip4_uadt() [all …]
|
D | ip_set_hash_ipmark.c | 44 __be32 ip; member 55 return ip1->ip == ip2->ip && in hash_ipmark4_data_equal() 63 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_ipmark4_data_list() 76 next->ip = d->ip; in hash_ipmark4_data_next() 96 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipmark4_kadt() 108 u32 ip, ip_to = 0; in hash_ipmark4_uadt() local 118 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP], &e.ip); in hash_ipmark4_uadt() 135 ip_to = ip = ntohl(e.ip); in hash_ipmark4_uadt() 140 if (ip > ip_to) in hash_ipmark4_uadt() 141 swap(ip, ip_to); in hash_ipmark4_uadt() [all …]
|
D | ip_set_hash_netiface.c | 50 __be32 ip; member 59 __be32 ip; member 74 return ip1->ip == ip2->ip && in hash_netiface4_data_equal() 102 elem->ip &= ip_set_netmask(cidr); in hash_netiface4_data_netmask() 114 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_netiface4_data_list() 130 next->ip = d->ip; in hash_netiface4_data_next() 170 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_netiface4_kadt() 171 e.ip &= ip_set_netmask(e.cidr); in hash_netiface4_kadt() 203 u32 ip = 0, ip_to = 0; in hash_netiface4_uadt() local 214 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in hash_netiface4_uadt() [all …]
|
D | ip_set_hash_netport.c | 55 __be32 ip; member 69 return ip1->ip == ip2->ip && in hash_netport4_data_equal() 96 elem->ip &= ip_set_netmask(cidr); in hash_netport4_data_netmask() 106 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_netport4_data_list() 123 next->ip = d->ip; in hash_netport4_data_next() 150 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_netport4_kadt() 151 e.ip &= ip_set_netmask(e.cidr + 1); in hash_netport4_kadt() 164 u32 port, port_to, p = 0, ip = 0, ip_to = 0; in hash_netport4_uadt() local 178 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in hash_netport4_uadt() 218 e.ip = htonl(ip & ip_set_hostmask(e.cidr + 1)); in hash_netport4_uadt() [all …]
|
D | ip_set_bitmap_ip.c | 61 ip_to_id(const struct bitmap_ip *m, u32 ip) in ip_to_id() argument 63 return ((ip & ip_set_hostmask(m->netmask)) - m->first_ip) / m->hosts; in ip_to_id() 120 u32 ip; in bitmap_ip_kadt() local 122 ip = ntohl(ip4addr(skb, opt->flags & IPSET_DIM_ONE_SRC)); in bitmap_ip_kadt() 123 if (ip < map->first_ip || ip > map->last_ip) in bitmap_ip_kadt() 126 e.id = ip_to_id(map, ip); in bitmap_ip_kadt() 137 u32 ip = 0, ip_to = 0; in bitmap_ip_uadt() local 148 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in bitmap_ip_uadt() 156 if (ip < map->first_ip || ip > map->last_ip) in bitmap_ip_uadt() 160 e.id = ip_to_id(map, ip); in bitmap_ip_uadt() [all …]
|
D | ip_set_hash_ipportnet.c | 56 __be32 ip; member 71 return ip1->ip == ip2->ip && in hash_ipportnet4_data_equal() 109 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) || in hash_ipportnet4_data_list() 127 next->ip = d->ip; in hash_ipportnet4_data_next() 155 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipportnet4_kadt() 170 u32 ip = 0, ip_to = 0, p = 0, port, port_to; in hash_ipportnet4_uadt() local 185 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in hash_ipportnet4_uadt() 230 e.ip = htonl(ip); in hash_ipportnet4_uadt() 237 ip_to = ip; in hash_ipportnet4_uadt() 242 if (ip > ip_to) in hash_ipportnet4_uadt() [all …]
|
D | ip_set_hash_ipmac.c | 47 __be32 ip; member 61 return e1->ip == e2->ip && ether_addr_equal(e1->ether, e2->ether); in hash_ipmac4_data_equal() 67 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, e->ip) || in hash_ipmac4_data_list() 80 next->ip = e->ip; in hash_ipmac4_data_next() 95 struct hash_ipmac4_elem e = { .ip = 0, { .foo[0] = 0, .foo[1] = 0 } }; in hash_ipmac4_kadt() 110 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipmac4_kadt() 120 struct hash_ipmac4_elem e = { .ip = 0, { .foo[0] = 0, .foo[1] = 0 } }; in hash_ipmac4_uadt() 138 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP], &e.ip) || in hash_ipmac4_uadt() 154 union nf_inet_addr ip; member 168 return ipv6_addr_equal(&e1->ip.in6, &e2->ip.in6) && in hash_ipmac6_data_equal() [all …]
|
D | Kconfig | 28 tristate "bitmap:ip set support" 31 This option adds the bitmap:ip set type support, by which one 37 tristate "bitmap:ip,mac set support" 40 This option adds the bitmap:ip,mac set type support, by which one 55 tristate "hash:ip set support" 58 This option adds the hash:ip set type support, by which one 65 tristate "hash:ip,mark set support" 68 This option adds the hash:ip,mark set type support, by which one 74 tristate "hash:ip,port set support" 77 This option adds the hash:ip,port set type support, by which one [all …]
|
D | ip_set_bitmap_ipmac.c | 72 ip_to_id(const struct bitmap_ipmac *m, u32 ip) in ip_to_id() argument 74 return ip - m->first_ip; in ip_to_id() 219 u32 ip; in bitmap_ipmac_kadt() local 225 ip = ntohl(ip4addr(skb, opt->flags & IPSET_DIM_ONE_SRC)); in bitmap_ipmac_kadt() 226 if (ip < map->first_ip || ip > map->last_ip) in bitmap_ipmac_kadt() 234 e.id = ip_to_id(map, ip); in bitmap_ipmac_kadt() 248 u32 ip = 0; in bitmap_ipmac_uadt() local 257 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP], &ip); in bitmap_ipmac_uadt() 265 if (ip < map->first_ip || ip > map->last_ip) in bitmap_ipmac_uadt() 268 e.id = ip_to_id(map, ip); in bitmap_ipmac_uadt()
|
/net/ipv4/netfilter/ |
D | nf_nat_h323.c | 26 unsigned int addroff, __be32 ip, __be16 port) in set_addr() argument 31 __be32 ip; in set_addr() member 37 buf.ip = ip; in set_addr() 77 return set_addr(skb, protoff, data, dataoff, taddr->ipAddress.ip, in set_h225_addr() 78 addr->ip, port); in set_h225_addr() 89 addr->ip, port); in set_h245_addr() 106 if (addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && in set_sig_addr() 114 (ntohl(addr.ip) & 0xff000000) == 0x7f000000) in set_sig_addr() 118 &addr.ip, port, in set_sig_addr() 119 &ct->tuplehash[!dir].tuple.dst.u3.ip, in set_sig_addr() [all …]
|
D | nf_nat_l3proto_ipv4.c | 42 fl4->daddr = t->dst.u3.ip; in nf_nat_ipv4_decode_session() 54 fl4->saddr = t->src.u3.ip; in nf_nat_ipv4_decode_session() 68 return ntohl(t->src.u3.ip) >= ntohl(range->min_addr.ip) && in nf_nat_ipv4_in_range() 69 ntohl(t->src.u3.ip) <= ntohl(range->max_addr.ip); in nf_nat_ipv4_in_range() 75 return secure_ipv4_port_ephemeral(t->src.u3.ip, t->dst.u3.ip, dport); in nf_nat_ipv4_secure_port() 99 csum_replace4(&iph->check, iph->saddr, target->src.u3.ip); in nf_nat_ipv4_manip_pkt() 100 iph->saddr = target->src.u3.ip; in nf_nat_ipv4_manip_pkt() 102 csum_replace4(&iph->check, iph->daddr, target->dst.u3.ip); in nf_nat_ipv4_manip_pkt() 103 iph->daddr = target->dst.u3.ip; in nf_nat_ipv4_manip_pkt() 118 newip = t->src.u3.ip; in nf_nat_ipv4_csum_update() [all …]
|
D | nf_conntrack_l3proto_ipv4.c | 51 tuple->src.u3.ip = ap[0]; in ipv4_pkt_to_tuple() 52 tuple->dst.u3.ip = ap[1]; in ipv4_pkt_to_tuple() 60 tuple->src.u3.ip = orig->dst.u3.ip; in ipv4_invert_tuple() 61 tuple->dst.u3.ip = orig->src.u3.ip; in ipv4_invert_tuple() 235 tuple.src.u3.ip = inet->inet_rcv_saddr; in getorigdst() 237 tuple.dst.u3.ip = inet->inet_daddr; in getorigdst() 265 .tuple.dst.u3.ip; in getorigdst() 277 &tuple.src.u3.ip, ntohs(tuple.src.u.tcp.port), in getorigdst() 278 &tuple.dst.u3.ip, ntohs(tuple.dst.u.tcp.port)); in getorigdst() 290 if (nla_put_in_addr(skb, CTA_IP_V4_SRC, tuple->src.u3.ip) || in ipv4_tuple_to_nlattr() [all …]
|
/net/atm/ |
D | mpoa_proc.c | 247 unsigned char ip[4]; in parse_qos() local 255 ip, ip+1, ip+2, ip+3) == 4) { in parse_qos() 256 ipaddr = *(__be32 *)ip; in parse_qos() 261 ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu) == 6) { in parse_qos() 265 ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu, &rx_pcr, &rx_sdu) != 8) in parse_qos() 268 ipaddr = *(__be32 *)ip; in parse_qos()
|
/net/openvswitch/ |
D | flow.c | 272 key->ip.proto = NEXTHDR_NONE; in parse_ipv6hdr() 273 key->ip.tos = ipv6_get_dsfield(nh); in parse_ipv6hdr() 274 key->ip.ttl = nh->hop_limit; in parse_ipv6hdr() 283 key->ip.frag = OVS_FRAG_TYPE_LATER; in parse_ipv6hdr() 285 key->ip.frag = OVS_FRAG_TYPE_FIRST; in parse_ipv6hdr() 287 key->ip.frag = OVS_FRAG_TYPE_NONE; in parse_ipv6hdr() 299 key->ip.proto = nexthdr; in parse_ipv6hdr() 574 memset(&key->ip, 0, sizeof(key->ip)); in key_extract() 587 key->ip.proto = nh->protocol; in key_extract() 588 key->ip.tos = nh->tos; in key_extract() [all …]
|
/net/netfilter/ |
D | xt_osf.c | 170 const struct iphdr *ip = ip_hdr(skb); in xt_osf_ttl() local 174 return ip->ttl == f_ttl; in xt_osf_ttl() 177 else if (ip->ttl <= f_ttl) in xt_osf_ttl() 184 if (inet_ifa_match(ip->saddr, ifa)) { in xt_osf_ttl() 185 ret = (ip->ttl == f_ttl); in xt_osf_ttl() 195 return ip->ttl == f_ttl; in xt_osf_ttl() 202 const struct iphdr *ip = ip_hdr(skb); in xt_osf_match_packet() local 225 totlen = ntohs(ip->tot_len); in xt_osf_match_packet() 226 df = ntohs(ip->frag_off) & IP_DF; in xt_osf_match_packet() 341 &ip->saddr, ntohs(tcp->source), in xt_osf_match_packet() [all …]
|
D | xt_iprange.c | 27 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); in iprange_mt4() 28 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); in iprange_mt4() 34 &info->src_min.ip, in iprange_mt4() 35 &info->src_max.ip); in iprange_mt4() 40 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); in iprange_mt4() 41 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); in iprange_mt4() 47 &info->dst_min.ip, in iprange_mt4() 48 &info->dst_max.ip); in iprange_mt4()
|
D | xt_HMARK.c | 258 struct iphdr *ip, _ip; in hmark_pkt_set_htuple_ipv4() local 261 ip = (struct iphdr *) (skb->data + nhoff); in hmark_pkt_set_htuple_ipv4() 262 if (ip->protocol == IPPROTO_ICMP) { in hmark_pkt_set_htuple_ipv4() 264 if (get_inner_hdr(skb, ip->ihl * 4, &nhoff)) { in hmark_pkt_set_htuple_ipv4() 265 ip = skb_header_pointer(skb, nhoff, sizeof(_ip), &_ip); in hmark_pkt_set_htuple_ipv4() 266 if (ip == NULL) in hmark_pkt_set_htuple_ipv4() 271 t->src = ip->saddr & info->src_mask.ip; in hmark_pkt_set_htuple_ipv4() 272 t->dst = ip->daddr & info->dst_mask.ip; in hmark_pkt_set_htuple_ipv4() 277 t->proto = ip->protocol; in hmark_pkt_set_htuple_ipv4() 284 if (ip->frag_off & htons(IP_MF | IP_OFFSET)) in hmark_pkt_set_htuple_ipv4() [all …]
|
D | xt_l2tp.c | 262 const struct ipt_ip *ip = &e->ip; in l2tp_mt_check4() local 269 if ((ip->proto != IPPROTO_UDP) && in l2tp_mt_check4() 270 (ip->proto != IPPROTO_L2TP)) { in l2tp_mt_check4() 275 if ((ip->proto == IPPROTO_L2TP) && in l2tp_mt_check4() 289 const struct ip6t_ip6 *ip = &e->ipv6; in l2tp_mt_check6() local 296 if ((ip->proto != IPPROTO_UDP) && in l2tp_mt_check6() 297 (ip->proto != IPPROTO_L2TP)) { in l2tp_mt_check6() 302 if ((ip->proto == IPPROTO_L2TP) && in l2tp_mt_check6()
|
/net/netfilter/ipvs/ |
D | ip_vs_ftp.c | 213 &from.ip, &port, in ip_vs_ftp_out() 218 &from.ip, ntohs(port), &cp->caddr.ip, 0); in ip_vs_ftp_out() 250 from.ip = n_cp->vaddr.ip; in ip_vs_ftp_out() 253 ((unsigned char *)&from.ip)[0], in ip_vs_ftp_out() 254 ((unsigned char *)&from.ip)[1], in ip_vs_ftp_out() 255 ((unsigned char *)&from.ip)[2], in ip_vs_ftp_out() 256 ((unsigned char *)&from.ip)[3], in ip_vs_ftp_out() 375 ' ', '\r', &to.ip, &port, in ip_vs_ftp_in() 379 IP_VS_DBG(7, "PORT %pI4:%d detected\n", &to.ip, ntohs(port)); in ip_vs_ftp_in() 389 &to.ip, ntohs(port), &cp->vaddr.ip, 0); in ip_vs_ftp_in()
|
/net/ipv6/ila/ |
D | ila_xlat.c | 14 struct ila_params ip; member 93 return (ila->xp.ip.locator_match.v64 != *(__be64 *)arg->key); in ila_cmpfn() 109 .key_offset = offsetof(struct ila_map, xp.ip.locator_match), 132 xp->ip.locator.v64 = (__force __be64)nla_get_u64( in parse_nl_config() 136 xp->ip.locator_match.v64 = (__force __be64)nla_get_u64( in parse_nl_config() 140 xp->ip.csum_mode = nla_get_u8(info->attrs[ILA_ATTR_CSUM_MODE]); in parse_nl_config() 173 &xp->ip.locator_match, in ila_lookup_by_params() 225 spinlock_t *lock = ila_get_lock(ilan, xp->ip.locator_match); in ila_add_mapping() 244 ila_init_saved_csum(&xp->ip); in ila_add_mapping() 253 &xp->ip.locator_match, in ila_add_mapping() [all …]
|