/linux-master/net/xfrm/ |
H A D | xfrm_inout.h | 11 const struct iphdr *iph = ip_hdr(skb); local 13 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); 14 XFRM_MODE_SKB_CB(skb)->id = iph->id; 15 XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off; 16 XFRM_MODE_SKB_CB(skb)->tos = iph->tos; 17 XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl; 18 XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph); 26 struct ipv6hdr *iph = ipv6_hdr(skb); local 28 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); 43 struct ipv6hdr *iph = ipv6_hdr(skb); local 57 struct iphdr *iph = ip_hdr(skb); local [all...] |
/linux-master/include/net/netfilter/ |
H A D | nf_tables_ipv4.h | 21 struct iphdr *iph, _iph; local 24 iph = skb_header_pointer(pkt->skb, skb_network_offset(pkt->skb), 25 sizeof(*iph), &_iph); 26 if (!iph) 29 if (iph->ihl < 5 || iph->version != 4) 32 len = iph_totlen(pkt->skb, iph); 33 thoff = skb_network_offset(pkt->skb) + (iph->ihl * 4); 38 else if (thoff < sizeof(*iph)) 42 pkt->tprot = iph 57 struct iphdr *iph; local [all...] |
H A D | nf_queue.h | 48 static inline u32 hash_v4(const struct iphdr *iph, u32 initval) argument 51 if ((__force u32)iph->saddr < (__force u32)iph->daddr) 52 return jhash_3words((__force u32)iph->saddr, 53 (__force u32)iph->daddr, iph->protocol, initval); 55 return jhash_3words((__force u32)iph->daddr, 56 (__force u32)iph->saddr, iph->protocol, initval); 84 struct iphdr *iph, _ip local [all...] |
/linux-master/net/netfilter/ipvs/ |
H A D | ip_vs_proto_ah_esp.c | 41 const struct ip_vs_iphdr *iph, 44 if (likely(!ip_vs_iph_inverse(iph))) 46 &iph->saddr, htons(PORT_ISAKMP), 47 &iph->daddr, htons(PORT_ISAKMP), p); 50 &iph->daddr, htons(PORT_ISAKMP), 51 &iph->saddr, htons(PORT_ISAKMP), p); 56 const struct ip_vs_iphdr *iph) 61 ah_esp_conn_fill_param_proto(ipvs, af, iph, &p); 70 ip_vs_iph_icmp(iph) ? "ICMP+" : "", 71 ip_vs_proto_get(iph 40 ah_esp_conn_fill_param_proto(struct netns_ipvs *ipvs, int af, const struct ip_vs_iphdr *iph, struct ip_vs_conn_param *p) argument 55 ah_esp_conn_in_get(struct netns_ipvs *ipvs, int af, const struct sk_buff *skb, const struct ip_vs_iphdr *iph) argument 81 ah_esp_conn_out_get(struct netns_ipvs *ipvs, int af, const struct sk_buff *skb, const struct ip_vs_iphdr *iph) argument 103 ah_esp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb, struct ip_vs_proto_data *pd, int *verdict, struct ip_vs_conn **cpp, struct ip_vs_iphdr *iph) argument [all...] |
/linux-master/samples/bpf/ |
H A D | parse_simple.c | 31 struct iphdr *iph = data + sizeof(*eth); local 32 struct udphdr *udp = data + sizeof(*eth) + sizeof(*iph); 36 if (data + sizeof(*eth) + sizeof(*iph) + sizeof(*udp) > data_end) 41 if (iph->protocol != IPPROTO_UDP || iph->ihl != 5) 43 if (ip_is_fragment(iph))
|
H A D | parse_varlen.c | 53 struct iphdr *iph; local 56 iph = data + nh_off; 57 if (iph + 1 > data_end) 60 if (ip_is_fragment(iph)) 62 ihl_len = iph->ihl * 4; 64 if (iph->protocol == IPPROTO_IPIP) { 65 iph = data + nh_off + ihl_len; 66 if (iph + 1 > data_end) 68 ihl_len += iph->ihl * 4; 71 if (iph 81 struct iphdr *iph; local [all...] |
H A D | xdp_tx_iptunnel_kern.c | 84 struct iphdr *iph = data + sizeof(struct ethhdr); local 92 if (iph + 1 > data_end) 95 dport = get_dport(iph + 1, data_end, iph->protocol); 99 vip.protocol = iph->protocol; 101 vip.daddr.v4 = iph->daddr; 103 payload_len = ntohs(iph->tot_len); 119 iph = data + sizeof(*new_eth); 120 old_eth = data + sizeof(*iph); 124 iph [all...] |
H A D | xdp_fwd_kern.c | 34 static __always_inline int ip_decrease_ttl(struct iphdr *iph) argument 36 u32 check = (__force u32)iph->check; 39 iph->check = (__force __sum16)(check + (check >= 0xFFFF)); 40 return --iph->ttl; 50 struct iphdr *iph; local 63 iph = data + nh_off; 65 if (iph + 1 > data_end) 68 if (iph->ttl <= 1) 72 fib_params.tos = iph->tos; 73 fib_params.l4_protocol = iph [all...] |
H A D | xdp_adjust_tail_kern.c | 82 struct iphdr *iph, *orig_iph; local 91 iph = data + off; 102 iph->ttl = DEFAULT_TTL; 103 iph->daddr = orig_iph->saddr; 104 iph->saddr = orig_iph->daddr; 105 iph->version = 4; 106 iph->ihl = 5; 107 iph->protocol = IPPROTO_ICMP; 108 iph->tos = 0; 109 iph [all...] |
/linux-master/tools/testing/selftests/bpf/progs/ |
H A D | test_lwt_reroute.c | 15 struct iphdr *iph = NULL; local 23 if (start + sizeof(*iph) > end) 26 iph = (struct iphdr *)start; 27 skb->mark = bpf_ntohl(iph->daddr) & 0xff;
|
H A D | xdping_kern.c | 66 struct iphdr *iph; local 68 if (data + sizeof(*eth) + sizeof(*iph) + ICMP_ECHO_LEN > data_end) 74 iph = data + sizeof(*eth); 76 if (iph->protocol != IPPROTO_ICMP) 79 if (bpf_ntohs(iph->tot_len) - sizeof(*iph) != ICMP_ECHO_LEN) 82 icmph = data + sizeof(*eth) + sizeof(*iph); 97 struct iphdr *iph; local 109 iph = data + sizeof(*eth); 110 icmph = data + sizeof(*eth) + sizeof(*iph); 159 struct iphdr *iph; local [all...] |
H A D | test_tc_bpf.c | 20 struct iphdr *iph = (void *)(long)skb->data + sizeof(struct ethhdr); local 22 if ((long)(iph + 1) > (long)skb->data_end)
|
H A D | load_bytes_relative.c | 24 struct iphdr iph; local 34 if (bpf_skb_load_bytes_relative(skb, 0, &iph, sizeof(iph), 38 if (bpf_skb_load_bytes_relative(skb, 0xffff, &iph, sizeof(iph),
|
H A D | test_xdp.c | 86 struct iphdr *iph = data + sizeof(struct ethhdr); local 94 if (iph + 1 > data_end) 97 dport = get_dport(iph + 1, data_end, iph->protocol); 101 vip.protocol = iph->protocol; 103 vip.daddr.v4 = iph->daddr; 105 payload_len = bpf_ntohs(iph->tot_len); 119 iph = data + sizeof(*new_eth); 120 old_eth = data + sizeof(*iph); 124 iph [all...] |
H A D | test_xdp_loop.c | 82 struct iphdr *iph = data + sizeof(struct ethhdr); local 90 if (iph + 1 > data_end) 93 dport = get_dport(iph + 1, data_end, iph->protocol); 97 vip.protocol = iph->protocol; 99 vip.daddr.v4 = iph->daddr; 101 payload_len = bpf_ntohs(iph->tot_len); 115 iph = data + sizeof(*new_eth); 116 old_eth = data + sizeof(*iph); 120 iph [all...] |
H A D | test_lwt_ip_encap.c | 19 struct iphdr iph; member in struct:encap_hdr 26 hdr.iph.ihl = 5; 27 hdr.iph.version = 4; 28 hdr.iph.ttl = 0x40; 29 hdr.iph.protocol = 47; /* IPPROTO_GRE */ 31 hdr.iph.saddr = 0x640110ac; /* 172.16.1.100 */ 32 hdr.iph.daddr = 0x641010ac; /* 172.16.16.100 */ 34 hdr.iph.saddr = 0xac100164; /* 172.16.1.100 */ 35 hdr.iph.daddr = 0xac101064; /* 172.16.16.100 */ 39 hdr.iph [all...] |
/linux-master/include/net/ |
H A D | dsfield.h | 16 static inline __u8 ipv4_get_dsfield(const struct iphdr *iph) argument 18 return iph->tos; 28 static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, argument 31 __u32 check = ntohs((__force __be16)iph->check); 34 dsfield = (iph->tos & mask) | value; 35 check += iph->tos; 39 iph->check = (__force __sum16)htons(check); 40 iph->tos = dsfield;
|
/linux-master/drivers/net/ethernet/netronome/nfp/nfdk/ |
H A D | ipsec.c | 12 struct iphdr *iph = ip_hdr(skb); local 15 if (iph->version == 4)
|
/linux-master/arch/arm64/include/asm/ |
H A D | checksum.h | 23 static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) argument 29 tmp = *(const __uint128_t *)iph; 30 iph += 16; 35 sum += *(const u32 *)iph; 36 iph += 4;
|
/linux-master/arch/loongarch/include/asm/ |
H A D | checksum.h | 40 static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) argument 46 tmp = *(const __uint128_t *)iph; 47 iph += 16; 52 sum += *(const u32 *)iph; 53 iph += 4;
|
/linux-master/include/linux/ |
H A D | ip.h | 39 static inline unsigned int iph_totlen(const struct sk_buff *skb, const struct iphdr *iph) argument 41 u32 len = ntohs(iph->tot_len); 55 static inline void iph_set_totlen(struct iphdr *iph, unsigned int len) argument 57 iph->tot_len = len <= IP_MAX_MTU ? htons(len) : 0;
|
/linux-master/net/netfilter/ |
H A D | xt_HL.c | 28 struct iphdr *iph; local 32 if (skb_ensure_writable(skb, sizeof(*iph))) 35 iph = ip_hdr(skb); 42 new_ttl = iph->ttl + info->ttl; 47 new_ttl = iph->ttl - info->ttl; 52 new_ttl = iph->ttl; 56 if (new_ttl != iph->ttl) { 57 csum_replace2(&iph->check, htons(iph->ttl << 8), 59 iph [all...] |
H A D | xt_iprange.c | 20 const struct iphdr *iph = ip_hdr(skb); local 24 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); 25 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); 29 &iph->saddr, 37 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); 38 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); 42 &iph->daddr, 69 const struct ipv6hdr *iph = ipv6_hdr(skb); local 73 m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); 74 m |= iprange_ipv6_lt(&info->src_max.in6, &iph [all...] |
/linux-master/net/ipv4/ |
H A D | xfrm4_input.c | 33 const struct iphdr *iph = ip_hdr(skb); local 35 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, 36 iph->tos, skb->dev)) 52 struct iphdr *iph = ip_hdr(skb); local 54 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; 58 return -iph->protocol; 62 iph->tot_len = htons(skb->len); 63 ip_send_check(iph); 81 struct iphdr *iph; local [all...] |
/linux-master/net/ipv4/netfilter/ |
H A D | iptable_mangle.c | 40 const struct iphdr *iph; local 48 iph = ip_hdr(skb); 49 saddr = iph->saddr; 50 daddr = iph->daddr; 51 tos = iph->tos; 57 iph = ip_hdr(skb); 59 if (iph->saddr != saddr || 60 iph->daddr != daddr || 62 iph->tos != tos) {
|