/kernel/linux/linux-5.10/include/net/ |
H A D | tun_proto.h | 19 return htons(ETH_P_IP); in tun_p_to_eth_p() 21 return htons(ETH_P_IPV6); in tun_p_to_eth_p() 23 return htons(ETH_P_TEB); in tun_p_to_eth_p() 25 return htons(ETH_P_NSH); in tun_p_to_eth_p() 27 return htons(ETH_P_MPLS_UC); in tun_p_to_eth_p() 35 case htons(ETH_P_IP): in tun_p_from_eth_p() 37 case htons(ETH_P_IPV6): in tun_p_from_eth_p() 39 case htons(ETH_P_TEB): in tun_p_from_eth_p() 41 case htons(ETH_P_NSH): in tun_p_from_eth_p() 43 case htons(ETH_P_MPLS_U in tun_p_from_eth_p() [all...] |
/kernel/linux/linux-6.6/include/net/ |
H A D | tun_proto.h | 20 return htons(ETH_P_IP); in tun_p_to_eth_p() 22 return htons(ETH_P_IPV6); in tun_p_to_eth_p() 24 return htons(ETH_P_TEB); in tun_p_to_eth_p() 26 return htons(ETH_P_NSH); in tun_p_to_eth_p() 28 return htons(ETH_P_MPLS_UC); in tun_p_to_eth_p() 36 case htons(ETH_P_IP): in tun_p_from_eth_p() 38 case htons(ETH_P_IPV6): in tun_p_from_eth_p() 40 case htons(ETH_P_TEB): in tun_p_from_eth_p() 42 case htons(ETH_P_NSH): in tun_p_from_eth_p() 44 case htons(ETH_P_MPLS_U in tun_p_from_eth_p() [all...] |
/kernel/linux/linux-5.10/samples/bpf/ |
H A D | xdp1_kern.c | 60 if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) { in xdp_prog1() 69 if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) { in xdp_prog1() 79 if (h_proto == htons(ETH_P_IP)) in xdp_prog1() 81 else if (h_proto == htons(ETH_P_IPV6)) in xdp_prog1()
|
H A D | tc_l2_redirect_kern.c | 50 if (eth_proto == htons(ETH_P_IP)) in is_vip_addr() 52 else if (eth_proto == htons(ETH_P_IPV6)) in is_vip_addr() 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() 166 if (eth->h_proto == htons(ETH_P_IP)) { 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() 224 } else if (eth->h_proto == htons(ETH_P_IPV6)) { in _drop_non_tun_vip()
|
H A D | xdp2_kern.c | 76 if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) { in xdp_prog1() 85 if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) { in xdp_prog1() 95 if (h_proto == htons(ETH_P_IP)) in xdp_prog1() 97 else if (h_proto == htons(ETH_P_IPV6)) in xdp_prog1()
|
H A D | parse_varlen.c | 28 if (tcp->dest == htons(80) || tcp->source == htons(80)) in tcp() 39 if (udp->dest == htons(DEFAULT_PKTGEN_UDP_PORT) || in udp() 40 udp->source == htons(DEFAULT_PKTGEN_UDP_PORT)) { in udp() 144 if (h_proto == htons(ETH_P_IP)) in handle_ingress() 146 else if (h_proto == htons(ETH_P_IPV6)) in handle_ingress()
|
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
H A D | ip_defrag.c | 112 return htons(res); in udp_checksum() 129 return htons(res); in udp6_checksum() 145 udphdr.source = htons(cfg_port + 1); in send_fragment() 146 udphdr.dest = htons(cfg_port); in send_fragment() 147 udphdr.len = htons(UDP_HLEN + payload_len); in send_fragment() 162 fraghdr->ip6f_offlg = htons(offset); in send_fragment() 165 fraghdr->ip6f_offlg = htons(offset | IP6_MF); in send_fragment() 167 ip6hdr->ip6_plen = htons(frag_len); in send_fragment() 180 iphdr->ip_off = htons(offset / 8); in send_fragment() 183 iphdr->ip_off = htons(offse in send_fragment() [all...] |
H A D | psock_snd.c | 108 eth->h_proto = htons(ETH_P_8021Q); in build_eth_header() 109 tag[1] = htons(ETH_P_IP); in build_eth_header() 113 eth->h_proto = htons(ETH_P_IP); in build_eth_header() 124 iph->tot_len = htons(sizeof(*iph) + sizeof(struct udphdr) + payload_len); in build_ipv4_header() 125 iph->id = htons(1337); in build_ipv4_header() 140 udph->source = htons(9); in build_udp_header() 141 udph->dest = htons(cfg_port); in build_udp_header() 142 udph->len = htons(len); in build_udp_header() 146 htons(IPPROTO_UDP) + udph->len); in build_udp_header() 175 laddr.sll_protocol = htons(ETH_P_I in do_bind() [all...] |
H A D | txring_overwrite.c | 51 eth->h_proto = htons(ETH_P_IP); in build_packet() 61 iph->tot_len = htons(blen - off); in build_packet() 66 udph->dest = htons(8000); in build_packet() 67 udph->source = htons(8001); in build_packet() 68 udph->len = htons(blen - off); in build_packet() 79 fdr = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)); in setup_rx() 97 laddr.sll_protocol = htons(0); in setup_tx()
|
/kernel/linux/linux-6.6/tools/testing/selftests/net/ |
H A D | ip_defrag.c | 112 return htons(res); in udp_checksum() 129 return htons(res); in udp6_checksum() 145 udphdr.source = htons(cfg_port + 1); in send_fragment() 146 udphdr.dest = htons(cfg_port); in send_fragment() 147 udphdr.len = htons(UDP_HLEN + payload_len); in send_fragment() 162 fraghdr->ip6f_offlg = htons(offset); in send_fragment() 165 fraghdr->ip6f_offlg = htons(offset | IP6_MF); in send_fragment() 167 ip6hdr->ip6_plen = htons(frag_len); in send_fragment() 180 iphdr->ip_off = htons(offset / 8); in send_fragment() 183 iphdr->ip_off = htons(offse in send_fragment() [all...] |
H A D | psock_snd.c | 108 eth->h_proto = htons(ETH_P_8021Q); in build_eth_header() 109 tag[1] = htons(ETH_P_IP); in build_eth_header() 113 eth->h_proto = htons(ETH_P_IP); in build_eth_header() 124 iph->tot_len = htons(sizeof(*iph) + sizeof(struct udphdr) + payload_len); in build_ipv4_header() 125 iph->id = htons(1337); in build_ipv4_header() 140 udph->source = htons(9); in build_udp_header() 141 udph->dest = htons(cfg_port); in build_udp_header() 142 udph->len = htons(len); in build_udp_header() 146 htons(IPPROTO_UDP) + udph->len); in build_udp_header() 175 laddr.sll_protocol = htons(ETH_P_I in do_bind() [all...] |
H A D | csum.c | 177 sum += htons(proto); in checksum() 178 sum += htons(len); in checksum() 199 iph->tot_len = htons(sizeof(*iph) + len); in build_packet_ipv4() 214 ip6h->payload_len = htons(len); in build_packet_ipv6() 229 uh->source = htons(cfg_port_src); in build_packet_udp() 230 uh->dest = htons(cfg_port_dst); in build_packet_udp() 231 uh->len = htons(sizeof(*uh) + cfg_payload_len); in build_packet_udp() 260 th->source = htons(cfg_port_src); in build_packet_tcp() 261 th->dest = htons(cfg_port_dst); in build_packet_tcp() 282 uh->dest = htons(cfg_port_ds in build_packet_udp_encap() [all...] |
H A D | txring_overwrite.c | 51 eth->h_proto = htons(ETH_P_IP); in build_packet() 61 iph->tot_len = htons(blen - off); in build_packet() 66 udph->dest = htons(8000); in build_packet() 67 udph->source = htons(8001); in build_packet() 68 udph->len = htons(blen - off); in build_packet() 79 fdr = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)); in setup_rx() 97 laddr.sll_protocol = htons(0); in setup_tx()
|
/kernel/linux/linux-5.10/net/8021q/ |
H A D | vlan_mvrp.c | 28 .pkttype.type = htons(ETH_P_MVRP), 36 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_join() 38 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_join() 47 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_leave() 49 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_leave()
|
H A D | vlan_gvrp.c | 30 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_join() 32 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_join() 41 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_leave() 43 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_leave()
|
/kernel/linux/linux-6.6/net/8021q/ |
H A D | vlan_mvrp.c | 28 .pkttype.type = htons(ETH_P_MVRP), 36 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_join() 38 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_join() 47 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_leave() 49 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_leave()
|
H A D | vlan_gvrp.c | 30 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_join() 32 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_join() 41 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_leave() 43 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_leave()
|
/kernel/linux/linux-6.6/samples/bpf/ |
H A D | tc_l2_redirect_kern.c | 50 if (eth_proto == htons(ETH_P_IP)) in is_vip_addr() 52 else if (eth_proto == htons(ETH_P_IPV6)) in is_vip_addr() 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() 166 if (eth->h_proto == htons(ETH_P_IP)) { 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() 224 } else if (eth->h_proto == htons(ETH_P_IPV6)) { in _drop_non_tun_vip()
|
H A D | parse_varlen.c | 28 if (tcp->dest == htons(80) || tcp->source == htons(80)) in tcp() 39 if (udp->dest == htons(DEFAULT_PKTGEN_UDP_PORT) || in udp() 40 udp->source == htons(DEFAULT_PKTGEN_UDP_PORT)) { in udp() 144 if (h_proto == htons(ETH_P_IP)) in handle_ingress() 146 else if (h_proto == htons(ETH_P_IPV6)) in handle_ingress()
|
/kernel/linux/linux-5.10/net/openvswitch/ |
H A D | flow.c | 57 #define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF)) 317 key_vh->tci = vh->tci | htons(VLAN_CFI_MASK); in parse_vlan_tag() 350 key->eth.vlan.tci = htons(skb->vlan_tci) | htons(VLAN_CFI_MASK); in parse_vlan() 386 return htons(ETH_P_802_2); in parse_ethertype() 389 return htons(0); in parse_ethertype() 395 return htons(ETH_P_802_2); in parse_ethertype() 402 return htons(ETH_P_802_2); in parse_ethertype() 413 key->tp.src = htons(icmp->icmp6_type); in parse_icmpv6() 414 key->tp.dst = htons(icm in parse_icmpv6() [all...] |
/kernel/linux/linux-5.10/net/6lowpan/ |
H A D | nhc_udp.c | 55 uh.dest = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress() 59 uh.source = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress() 64 uh.source = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val >> 4)); in udp_uncompress() 65 uh.dest = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val & 0x0f)); in udp_uncompress() 92 uh.len = htons(lowpan_802154_cb(skb)->d_size - in udp_uncompress() 95 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress() 98 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress()
|
/kernel/linux/linux-6.6/net/6lowpan/ |
H A D | nhc_udp.c | 54 uh.dest = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress() 58 uh.source = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress() 63 uh.source = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val >> 4)); in udp_uncompress() 64 uh.dest = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val & 0x0f)); in udp_uncompress() 91 uh.len = htons(lowpan_802154_cb(skb)->d_size - in udp_uncompress() 94 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress() 97 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress()
|
/kernel/linux/linux-6.6/drivers/net/wireless/intel/iwlwifi/mei/ |
H A D | net.c | 95 if (arp->ar_hrd != htons(ARPHRD_ETHER) || in iwl_mei_rx_filter_arp() 96 arp->ar_pro != htons(ETH_P_IP)) in iwl_mei_rx_filter_arp() 112 if (arp->ar_op == htons(ARPOP_REQUEST) && in iwl_mei_rx_filter_arp() 125 arp->ar_op == htons(ARPOP_REPLY)) { in iwl_mei_rx_filter_arp() 309 case htons(ETH_P_IP): in iwl_mei_rx_pass_to_csme() 312 case htons(ETH_P_ARP): in iwl_mei_rx_pass_to_csme() 315 case htons(ETH_P_IPV6): in iwl_mei_rx_pass_to_csme() 379 if (origskb->protocol != htons(ETH_P_IP) || in iwl_mei_tx_copy_to_csme() 381 udp_hdr(origskb)->source != htons(DHCP_CLIENT_PORT) || in iwl_mei_tx_copy_to_csme() 382 udp_hdr(origskb)->dest != htons(DHCP_SERVER_POR in iwl_mei_tx_copy_to_csme() [all...] |
/kernel/liteos_a/testsuites/unittest/net/netdb/full/ |
H A D | net_netdb_test_012.cpp | 54 int ret = getservbyport_r(htons(test_port_no), "tcp", &se, buf, sizeof buf, &result); in GetServByPortRTest() 64 ret = getservbyport_r(htons(test_port_no), "udp", &se, buf, sizeof buf, &result); in GetServByPortRTest() 67 ret = getservbyport_r(htons(test_port_no), "udp", &se, buf1, sizeof buf1, &result); in GetServByPortRTest() 70 ret = getservbyport_r(htons(test_port_no), "ud", &se, buf, sizeof buf, &result); in GetServByPortRTest()
|
/kernel/linux/linux-5.10/net/ipv4/netfilter/ |
H A D | nf_nat_h323.c | 204 htons(ntohs(info->rtp_port[i][dir]) + 1); in nat_rtp_rtcp() 223 rtp_exp->tuple.dst.u.udp.port = htons(nated_port); in nat_rtp_rtcp() 227 htons(nated_port + 1); in nat_rtp_rtcp() 253 htons((port & htons(1)) ? nated_port + 1 : in nat_rtp_rtcp() 262 info->rtp_port[i][!dir] = htons(nated_port); in nat_rtp_rtcp() 298 exp->tuple.dst.u.tcp.port = htons(nated_port); in nat_t120() 316 htons(nated_port)) < 0) { in nat_t120() 354 exp->tuple.dst.u.tcp.port = htons(nated_port); in nat_h245() 372 htons(nated_por in nat_h245() [all...] |