/openbmc/linux/samples/bpf/ |
H A D | parse_varlen.c | 118 uint64_t h_proto, nh_off; in handle_ingress() local 124 h_proto = eth->h_proto; in handle_ingress() 126 if (h_proto == ETH_P_8021Q || h_proto == ETH_P_8021AD) { in handle_ingress() 133 h_proto = vhdr->h_vlan_encapsulated_proto; in handle_ingress() 135 if (h_proto == ETH_P_8021Q || h_proto == ETH_P_8021AD) { in handle_ingress() 142 h_proto = vhdr->h_vlan_encapsulated_proto; in handle_ingress() 144 if (h_proto == htons(ETH_P_IP)) in handle_ingress() 146 else if (h_proto == htons(ETH_P_IPV6)) in handle_ingress()
|
H A D | tc_l2_redirect_kern.c | 37 unsigned short h_proto; member 76 if (eth->h_proto == htons(ETH_P_IP)) { in _l2_to_iptun_ingress_forward() 89 } else if (eth->h_proto == htons(ETH_P_IPV6)) { in _l2_to_iptun_ingress_forward() 127 if (eth->h_proto == htons(ETH_P_IP)) { in _l2_to_iptun_ingress_redirect() 135 if (!is_vip_addr(eth->h_proto, daddr)) in _l2_to_iptun_ingress_redirect() 166 if (eth->h_proto == htons(ETH_P_IP)) { in _l2_to_ip6tun_ingress_redirect() 173 if (!is_vip_addr(eth->h_proto, iph->daddr)) in _l2_to_ip6tun_ingress_redirect() 178 } else if (eth->h_proto == htons(ETH_P_IPV6)) { in _l2_to_ip6tun_ingress_redirect() 216 if (eth->h_proto == htons(ETH_P_IP)) { in _drop_non_tun_vip() 222 if (is_vip_addr(eth->h_proto, iph->daddr)) in _drop_non_tun_vip() [all …]
|
H A D | xdp_fwd_kern.c | 51 u16 h_proto; in xdp_fwd_flags() local 61 h_proto = eth->h_proto; in xdp_fwd_flags() 62 if (h_proto == htons(ETH_P_IP)) { in xdp_fwd_flags() 79 } else if (h_proto == htons(ETH_P_IPV6)) { in xdp_fwd_flags() 133 if (h_proto == htons(ETH_P_IP)) in xdp_fwd_flags() 135 else if (h_proto == htons(ETH_P_IPV6)) in xdp_fwd_flags()
|
H A D | xdp_router_ipv4.bpf.c | 81 __be16 h_proto; in xdp_router_ipv4_prog() local 91 h_proto = eth->h_proto; in xdp_router_ipv4_prog() 92 if (h_proto == bpf_htons(ETH_P_8021Q) || in xdp_router_ipv4_prog() 93 h_proto == bpf_htons(ETH_P_8021AD)) { in xdp_router_ipv4_prog() 101 h_proto = vhdr->h_vlan_encapsulated_proto; in xdp_router_ipv4_prog() 104 switch (bpf_ntohs(h_proto)) { in xdp_router_ipv4_prog()
|
H A D | xdp_adjust_tail_kern.c | 55 eth->h_proto = orig_eth->h_proto; in swap_mac() 142 __u16 h_proto; in _xdp_icmp() local 147 h_proto = eth->h_proto; in _xdp_icmp() 149 if (h_proto == htons(ETH_P_IP)) in _xdp_icmp()
|
H A D | xdp_tx_iptunnel_kern.c | 70 __be16 h_proto) in set_ethhdr() argument 74 new_eth->h_proto = h_proto; in set_ethhdr() 221 __u16 h_proto; in _xdp_tx_iptunnel() local 226 h_proto = eth->h_proto; in _xdp_tx_iptunnel() 228 if (h_proto == htons(ETH_P_IP)) in _xdp_tx_iptunnel() 230 else if (h_proto == htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
|
H A D | test_cgrp2_tc.bpf.c | 16 unsigned short h_proto; member 42 if (eth->h_proto != bpf_htons(ETH_P_IPV6) || in handle_egress() 45 eth->h_proto, ip6h->nexthdr); in handle_egress()
|
H A D | parse_simple.c | 23 unsigned short h_proto; member 39 if (eth->h_proto != htons(ETH_P_IP)) in handle_ingress()
|
/openbmc/linux/tools/testing/selftests/bpf/progs/ |
H A D | xdp_redirect_multi_kern.c | 44 __u16 h_proto; in xdp_redirect_map_multi_prog() local 51 h_proto = eth->h_proto; in xdp_redirect_map_multi_prog() 54 if (h_proto == bpf_htons(ETH_P_IP)) in xdp_redirect_map_multi_prog() 58 else if (h_proto == bpf_htons(ETH_P_IPV6)) in xdp_redirect_map_multi_prog()
|
H A D | test_xdp_loop.c | 67 __be16 h_proto) in set_ethhdr() argument 71 new_eth->h_proto = h_proto; in set_ethhdr() 213 __u16 h_proto; in _xdp_tx_iptunnel() local 218 h_proto = eth->h_proto; in _xdp_tx_iptunnel() 220 if (h_proto == bpf_htons(ETH_P_IP)) in _xdp_tx_iptunnel() 222 else if (h_proto == bpf_htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
|
H A D | test_xdp.c | 71 __be16 h_proto) in set_ethhdr() argument 75 new_eth->h_proto = h_proto; in set_ethhdr() 217 __u16 h_proto; in _xdp_tx_iptunnel() local 222 h_proto = eth->h_proto; in _xdp_tx_iptunnel() 224 if (h_proto == bpf_htons(ETH_P_IP)) in _xdp_tx_iptunnel() 226 else if (h_proto == bpf_htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
|
H A D | test_xdp_dynptr.c | 70 __be16 h_proto) in set_ethhdr() argument 74 new_eth->h_proto = h_proto; in set_ethhdr() 236 __u16 h_proto; in _xdp_tx_iptunnel() local 245 h_proto = eth->h_proto; in _xdp_tx_iptunnel() 247 if (h_proto == bpf_htons(ETH_P_IP)) in _xdp_tx_iptunnel() 249 else if (h_proto == bpf_htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
|
H A D | dynptr_fail.c | 1086 hdr->h_proto = 1; in skb_invalid_slice_write() 1106 val = hdr->h_proto; in skb_invalid_data_slice1() 1112 val = hdr->h_proto; in skb_invalid_data_slice1() 1132 hdr->h_proto = 123; in skb_invalid_data_slice2() 1138 hdr->h_proto = 1; in skb_invalid_data_slice2() 1159 val = hdr->h_proto; in skb_invalid_data_slice3() 1164 val = hdr->h_proto; in skb_invalid_data_slice3() 1184 hdr->h_proto = 123; in skb_invalid_data_slice4() 1189 hdr->h_proto = 1; in skb_invalid_data_slice4() 1233 hdr->h_proto = 9; in xdp_invalid_data_slice2() [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | flow_dissector.c | 115 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 137 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 158 .eth.h_proto = __bpf_constant_htons(ETH_P_8021Q), 205 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 232 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 255 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 282 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 305 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 375 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 404 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), [all …]
|
/openbmc/linux/net/ethernet/ |
H A D | eth.c | 86 eth->h_proto = htons(type); in eth_header() 88 eth->h_proto = htons(len); in eth_header() 137 eth->h_proto, sizeof(*eth), in eth_get_headlen() 178 if (likely(eth_proto_is_802_3(eth->h_proto))) in eth_type_trans() 179 return eth->h_proto; in eth_type_trans() 230 eth->h_proto = type; in eth_header_cache() 268 return eth->h_proto; in eth_header_parse_protocol() 424 type = eh->h_proto; in eth_gro_receive() 449 __be16 type = eh->h_proto; in eth_gro_complete()
|
/openbmc/qemu/net/ |
H A D | eth.c | 31 vhdr->h_proto = ehdr->h_proto; in eth_setup_vlan_headers() 32 ehdr->h_proto = cpu_to_be16(vlan_ethtype); in eth_setup_vlan_headers() 236 switch (be16_to_cpu(new_ehdr->h_proto)) { in eth_strip_vlan() 246 new_ehdr->h_proto = vlan_hdr.h_proto; in eth_strip_vlan() 251 if (be16_to_cpu(new_ehdr->h_proto) == ETH_P_VLAN) { in eth_strip_vlan() 283 new_ehdr_proto = &PKT_GET_ETH_HDR(new_ehdr_buf)->h_proto; in eth_strip_vlan_ex() 289 new_ehdr_proto = &PKT_GET_VLAN_HDR(new_ehdr_buf)->h_proto; in eth_strip_vlan_ex() 292 if (be16_to_cpu(PKT_GET_ETH_HDR(new_ehdr_buf)->h_proto) != vet_ext) { in eth_strip_vlan_ex() 311 *new_ehdr_proto = vlan_hdr.h_proto; in eth_strip_vlan_ex()
|
/openbmc/linux/net/bridge/netfilter/ |
H A D | ebt_log.c | 90 ntohs(eth_hdr(skb)->h_proto)); in ebt_log_packet() 97 if ((bitmask & EBT_LOG_IP) && eth_hdr(skb)->h_proto == in ebt_log_packet() 114 if ((bitmask & EBT_LOG_IP6) && eth_hdr(skb)->h_proto == in ebt_log_packet() 139 ((eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) || in ebt_log_packet() 140 (eth_hdr(skb)->h_proto == htons(ETH_P_RARP)))) { in ebt_log_packet()
|
H A D | ebt_among.c | 73 if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { in get_ip_dst() 81 } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { in get_ip_dst() 104 if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { in get_ip_src() 112 } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { in get_ip_src()
|
/openbmc/linux/net/hsr/ |
H A D | hsr_forward.c | 52 if (!(eth_hdr->h_proto == htons(ETH_P_PRP) || in is_supervision_frame() 53 eth_hdr->h_proto == htons(ETH_P_HSR))) in is_supervision_frame() 57 if (eth_hdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ in is_supervision_frame() 145 skb->protocol = eth_hdr(skb)->h_proto; in create_stripped_skb_hsr() 231 skb->protocol = eth_hdr(skb)->h_proto; in prp_fill_rct() 269 hsr_ethhdr->hsr_tag.encap_proto = hsr_ethhdr->ethhdr.h_proto; in hsr_fill_tag() 270 hsr_ethhdr->ethhdr.h_proto = htons(proto_version ? in hsr_fill_tag() 272 skb->protocol = hsr_ethhdr->ethhdr.h_proto; in hsr_fill_tag() 585 proto = ethhdr->h_proto; in fill_frame_info()
|
/openbmc/linux/tools/testing/selftests/net/ |
H A D | nat6to4.c | 70 if (eth->h_proto != bpf_htons(ETH_P_IPV6)) in sched_cls_ingress6_nat_6_prog() 92 eth2.h_proto = bpf_htons(ETH_P_IP); // But replace the ethertype in sched_cls_ingress6_nat_6_prog() 167 if (eth->h_proto != bpf_htons(ETH_P_IP)) in sched_cls_egress4_snat4_prog() 227 eth2.h_proto = bpf_htons(ETH_P_IPV6); // But replace the ethertype in sched_cls_egress4_snat4_prog()
|
/openbmc/linux/drivers/net/wireless/intel/ipw2x00/ |
H A D | libipw_tx.c | 115 static int libipw_copy_snap(u8 * data, __be16 h_proto) in libipw_copy_snap() argument 125 if (h_proto == htons(ETH_P_AARP) || h_proto == htons(ETH_P_IPX)) in libipw_copy_snap() 133 memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16)); in libipw_copy_snap() 215 if (eth->h_proto != htons(ETH_P_IP)) in libipw_classify() 281 ether_type = ((struct ethhdr *)skb->data)->h_proto; in libipw_xmit()
|
/openbmc/qemu/include/net/ |
H A D | eth.h | 41 uint16_t h_proto; /* packet type ID field */ member 46 uint16_t h_proto; /* encapsulated protocol */ member 301 uint16_t proto = be16_to_cpu(PKT_GET_ETH_HDR(p)->h_proto); in eth_get_l2_hdr_length() 307 if (be16_to_cpu(hvlan->h_proto) == ETH_P_VLAN) { in eth_get_l2_hdr_length() 333 uint16_t proto = be16_to_cpu(PKT_GET_ETH_HDR(p)->h_proto); in eth_get_pkt_tci()
|
/openbmc/linux/drivers/staging/gdm724x/ |
H A D | gdm_lte.c | 118 if (ntohs(((struct ethhdr *)skb_in->data)->h_proto) == ETH_P_8021Q) { in gdm_lte_emulate_arp() 164 skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto; in gdm_lte_emulate_arp() 238 if (ntohs(((struct ethhdr *)skb_in->data)->h_proto) == ETH_P_8021Q) { in gdm_lte_emulate_ndp() 246 if (ntohs(eth.h_proto) != ETH_P_IPV6) in gdm_lte_emulate_ndp() 325 skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto; in gdm_lte_emulate_ndp() 351 if (ntohs(eth->h_proto) == ETH_P_8021Q) { in gdm_lte_tx_nic_type() 357 mac_proto = ntohs(eth->h_proto); in gdm_lte_tx_nic_type() 642 eth.h_proto = htons(ETH_P_ARP); in gdm_lte_netif_rx() 647 eth.h_proto = htons(ETH_P_IP); in gdm_lte_netif_rx() 650 eth.h_proto = htons(ETH_P_IPV6); in gdm_lte_netif_rx() [all …]
|
/openbmc/linux/drivers/net/usb/ |
H A D | lg-vl600.c | 49 __be16 h_proto; member 176 if (be16_to_cpup(ðhdr->h_proto) == ETH_P_ARP && in vl600_rx_fixup() 195 ethhdr->h_proto = htons(ETH_P_IPV6); in vl600_rx_fixup() 285 packet->h_proto = htons(ETH_P_IP); in vl600_tx_fixup()
|
/openbmc/linux/drivers/net/ethernet/engleder/ |
H A D | tsnep_rxnfc.c | 115 fsp->h_u.ether_spec.h_proto = htons(rule->filter.ether_type); in tsnep_rxnfc_get_rule() 116 fsp->m_u.ether_spec.h_proto = ETHER_TYPE_FULL_MASK; in tsnep_rxnfc_get_rule() 180 rule->filter.ether_type = ntohs(fsp->h_u.ether_spec.h_proto); in tsnep_rxnfc_init_rule() 214 fsp->m_u.ether_spec.h_proto != ETHER_TYPE_FULL_MASK) { in tsnep_rxnfc_add_rule()
|