Searched refs:iph (Results 1 – 9 of 9) sorted by relevance
| /samples/bpf/ |
| A D | parse_varlen.c | 53 struct iphdr *iph; in parse_ipv4() local 56 iph = data + nh_off; in parse_ipv4() 57 if (iph + 1 > data_end) in parse_ipv4() 60 if (ip_is_fragment(iph)) in parse_ipv4() 62 ihl_len = iph->ihl * 4; in parse_ipv4() 66 if (iph + 1 > data_end) in parse_ipv4() 68 ihl_len += iph->ihl * 4; in parse_ipv4() 81 struct iphdr *iph; in parse_ipv6() local 93 if (iph + 1 > data_end) in parse_ipv6() 95 ihl_len += iph->ihl * 4; in parse_ipv6() [all …]
|
| A D | xdp_tx_iptunnel_kern.c | 92 if (iph + 1 > data_end) in handle_ipv4() 95 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 101 vip.daddr.v4 = iph->daddr; in handle_ipv4() 124 iph + 1 > data_end) in handle_ipv4() 129 iph->version = 4; in handle_ipv4() 130 iph->ihl = sizeof(*iph) >> 2; in handle_ipv4() 131 iph->frag_off = 0; in handle_ipv4() 133 iph->check = 0; in handle_ipv4() 134 iph->tos = 0; in handle_ipv4() 135 iph->tot_len = htons(payload_len + sizeof(*iph)); in handle_ipv4() [all …]
|
| A D | parse_simple.c | 31 struct iphdr *iph = data + sizeof(*eth); in handle_ingress() local 32 struct udphdr *udp = data + sizeof(*eth) + sizeof(*iph); in handle_ingress() 36 if (data + sizeof(*eth) + sizeof(*iph) + sizeof(*udp) > data_end) in handle_ingress() 41 if (iph->protocol != IPPROTO_UDP || iph->ihl != 5) in handle_ingress() 43 if (ip_is_fragment(iph)) in handle_ingress()
|
| A D | xdp_fwd_kern.c | 36 u32 check = (__force u32)iph->check; in ip_decrease_ttl() 40 return --iph->ttl; in ip_decrease_ttl() 50 struct iphdr *iph; in xdp_fwd_flags() local 63 iph = data + nh_off; in xdp_fwd_flags() 65 if (iph + 1 > data_end) in xdp_fwd_flags() 68 if (iph->ttl <= 1) in xdp_fwd_flags() 72 fib_params.tos = iph->tos; in xdp_fwd_flags() 73 fib_params.l4_protocol = iph->protocol; in xdp_fwd_flags() 77 fib_params.ipv4_src = iph->saddr; in xdp_fwd_flags() 78 fib_params.ipv4_dst = iph->daddr; in xdp_fwd_flags() [all …]
|
| A D | xdp_adjust_tail_kern.c | 83 struct iphdr *iph, *orig_iph; in send_icmp4_too_big() local 92 iph = data + off; in send_icmp4_too_big() 103 iph->ttl = DEFAULT_TTL; in send_icmp4_too_big() 104 iph->daddr = orig_iph->saddr; in send_icmp4_too_big() 105 iph->saddr = orig_iph->daddr; in send_icmp4_too_big() 106 iph->version = 4; in send_icmp4_too_big() 107 iph->ihl = 5; in send_icmp4_too_big() 109 iph->tos = 0; in send_icmp4_too_big() 110 iph->tot_len = htons( in send_icmp4_too_big() 112 iph->check = 0; in send_icmp4_too_big() [all …]
|
| A D | tc_l2_redirect_kern.c | 75 struct iphdr *iph = data + sizeof(*eth); in _l2_to_iptun_ingress_forward() local 77 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_iptun_ingress_forward() 80 if (iph->protocol != IPPROTO_IPIP) in _l2_to_iptun_ingress_forward() 84 _htonl(iph->daddr)); in _l2_to_iptun_ingress_forward() 124 struct iphdr *iph = data + sizeof(*eth); in _l2_to_iptun_ingress_redirect() local 125 __be32 daddr = iph->daddr; in _l2_to_iptun_ingress_redirect() 127 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_iptun_ingress_redirect() 163 struct iphdr *iph = data + sizeof(*eth); in _l2_to_ip6tun_ingress_redirect() local 168 if (!is_vip_addr(eth->h_proto, iph->daddr)) in _l2_to_ip6tun_ingress_redirect() 211 struct iphdr *iph = data + sizeof(*eth); in _drop_non_tun_vip() local [all …]
|
| A D | xdp_router_ipv4.bpf.c | 110 struct iphdr *iph = data + nh_off; in xdp_router_ipv4_prog() local 115 if (iph + 1 > data_end) in xdp_router_ipv4_prog() 118 direct_entry = bpf_map_lookup_elem(&exact_match, &iph->daddr); in xdp_router_ipv4_prog() 132 key4.b8[4] = iph->daddr & 0xff; in xdp_router_ipv4_prog() 133 key4.b8[5] = (iph->daddr >> 8) & 0xff; in xdp_router_ipv4_prog() 134 key4.b8[6] = (iph->daddr >> 16) & 0xff; in xdp_router_ipv4_prog() 135 key4.b8[7] = (iph->daddr >> 24) & 0xff; in xdp_router_ipv4_prog() 146 dest_mac = bpf_map_lookup_elem(&arp_table, &iph->daddr); in xdp_router_ipv4_prog()
|
| A D | hbm_kern.h | 111 struct iphdr iph; in hbm_get_pkt_info() local 116 bpf_skb_load_bytes(skb, 0, &iph, 12); in hbm_get_pkt_info() 117 if (iph.version == 6) { in hbm_get_pkt_info() 118 ip6h = (struct ipv6hdr *)&iph; in hbm_get_pkt_info() 122 } else if (iph.version == 4) { in hbm_get_pkt_info() 124 pkti->is_tcp = (iph.protocol == 6); in hbm_get_pkt_info() 125 pkti->ecn = iph.tos & INET_ECN_MASK; in hbm_get_pkt_info()
|
| A D | test_lwt_bpf.c | 64 struct iphdr *iph = data; in do_test_data() local 66 if (data + sizeof(*iph) > data_end) { in do_test_data() 71 printk("src: %x dst: %x", iph->saddr, iph->daddr); in do_test_data()
|
Completed in 17 milliseconds