/kernel/linux/linux-5.10/include/net/ |
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_UC): in tun_p_from_eth_p()
|
D | inet_ecn.h | 96 check += (__force u16)htons(0xFFFB) + (__force u16)htons(ecn); in IP_ECN_set_ce() 110 check += (__force u16)htons(0x1); in IP_ECN_set_ect1() 277 case htons(ETH_P_IP): in IP_ECN_decapsulate() 280 case htons(ETH_P_IPV6): in IP_ECN_decapsulate() 296 case htons(ETH_P_IP): in IP6_ECN_decapsulate() 299 case htons(ETH_P_IPV6): in IP6_ECN_decapsulate()
|
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
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(offset / 8 | IP4_MF); in send_fragment() [all …]
|
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_IP); in do_bind() [all …]
|
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/samples/bpf/ |
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()
|
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()
|
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()
|
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()
|
D | xdp_fwd_kern.c | 38 check += (__force u32)htons(0x0100); in ip_decrease_ttl() 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()
|
/kernel/linux/linux-5.10/net/8021q/ |
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()
|
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-5.10/net/6lowpan/ |
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-5.10/net/openvswitch/ |
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(icmp->icmp6_code); in parse_icmpv6() 537 if (key->eth.type == htons(ETH_P_IP)) { in key_extract_l3l4() [all …]
|
/kernel/liteos_a/testsuites/unittest/net/netdb/full/ |
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/include/scsi/ |
D | fc_encode.h | 106 ct->hdr.ct_cmd = htons((u16) op); in fc_ct_hdr_fill() 537 csp->sp_bb_cred = htons(10); /* this gets set by gateway */ in fc_plogi_fill() 538 csp->sp_bb_data = htons((u16) lport->mfs); in fc_plogi_fill() 540 cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); in fc_plogi_fill() 541 csp->sp_features = htons(FC_SP_FT_CIRO); in fc_plogi_fill() 542 csp->sp_tot_seq = htons(255); /* seq. we accept */ in fc_plogi_fill() 543 csp->sp_rel_off = htons(0x1f); in fc_plogi_fill() 546 cp->cp_rdfs = htons((u16) lport->mfs); in fc_plogi_fill() 547 cp->cp_con_seq = htons(255); in fc_plogi_fill() 568 sp->sp_bb_cred = htons(10); /* this gets set by gateway */ in fc_flogi_fill() [all …]
|
/kernel/linux/linux-5.10/net/ipv4/ |
D | arp.c | 547 skb->protocol = htons(ETH_P_ARP); in arp_create() 571 arp->ar_hrd = htons(dev->type); in arp_create() 572 arp->ar_pro = htons(ETH_P_IP); in arp_create() 577 arp->ar_hrd = htons(ARPHRD_AX25); in arp_create() 578 arp->ar_pro = htons(AX25_P_IP); in arp_create() 583 arp->ar_hrd = htons(ARPHRD_NETROM); in arp_create() 584 arp->ar_pro = htons(AX25_P_IP); in arp_create() 591 arp->ar_hrd = htons(ARPHRD_ETHER); in arp_create() 592 arp->ar_pro = htons(ETH_P_IP); in arp_create() 599 arp->ar_op = htons(type); in arp_create() [all …]
|
/kernel/linux/linux-5.10/net/bridge/ |
D | br_netfilter_hooks.c | 67 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_IP)) 70 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_IPV6)) 73 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_ARP)) 79 else if (skb->protocol == htons(ETH_P_8021Q)) in vlan_proto() 89 return vlan_proto(skb) == htons(ETH_P_IP) && brnet->filter_vlan_tagged; in is_vlan_ip() 97 return vlan_proto(skb) == htons(ETH_P_IPV6) && in is_vlan_ipv6() 105 return vlan_proto(skb) == htons(ETH_P_ARP) && brnet->filter_vlan_tagged; in is_vlan_arp() 118 return skb->protocol == htons(ETH_P_PPP_SES) && in is_pppoe_ip() 119 pppoe_proto(skb) == htons(PPP_IP) && brnet->filter_pppoe_tagged; in is_pppoe_ip() 127 return skb->protocol == htons(ETH_P_PPP_SES) && in is_pppoe_ipv6() [all …]
|
/kernel/linux/linux-5.10/net/core/ |
D | tso.c | 26 iph->id = htons(tso->ip_id); in tso_build_hdr() 27 iph->tot_len = htons(size + hdr_len - mac_hdr_len); in tso_build_hdr() 32 iph->payload_len = htons(size + tso->tlen); in tso_build_hdr() 49 uh->len = htons(sizeof(*uh) + size); in tso_build_hdr() 81 tso->ipv6 = vlan_get_protocol(skb) == htons(ETH_P_IPV6); in tso_start()
|
D | flow_dissector.c | 484 if (arp->ar_hrd != htons(ARPHRD_ETHER) || in __skb_flow_dissect_arp() 485 arp->ar_pro != htons(ETH_P_IP) || in __skb_flow_dissect_arp() 488 (arp->ar_op != htons(ARPOP_REPLY) && in __skb_flow_dissect_arp() 489 arp->ar_op != htons(ARPOP_REQUEST))) in __skb_flow_dissect_arp() 583 if (*p_proto == htons(ETH_P_TEB)) { in __skb_flow_dissect_gre() 617 *p_proto = htons(ETH_P_IP); in __skb_flow_dissect_gre() 620 *p_proto = htons(ETH_P_IPV6); in __skb_flow_dissect_gre() 710 key_tcp->flags = (*(__be16 *) &tcp_flag_word(th) & htons(0x0FFF)); in __skb_flow_dissect_tcp() 932 proto == htons(ETH_P_XDSA))) { in __skb_flow_dissect() 1030 case htons(ETH_P_IP): { in __skb_flow_dissect() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/ |
D | en_selftest.c | 133 ethh->h_proto = htons(ETH_P_IP); in mlx5e_test_get_udp_skb() 136 udph->source = htons(9); in mlx5e_test_get_udp_skb() 137 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb() 138 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb() 148 iph->tot_len = htons(iplen); in mlx5e_test_get_udp_skb() 165 skb->protocol = htons(ETH_P_IP); in mlx5e_test_get_udp_skb() 205 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate() 243 lbtp->pt.type = htons(ETH_P_IP); in mlx5e_test_loopback_setup()
|
/kernel/linux/linux-5.10/net/ipv4/netfilter/ |
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_port))) { in nat_h245() 379 info->sig_port[!dir] = htons(nated_port); in nat_h245() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/stmicro/stmmac/ |
D | stmmac_selftests.c | 119 ehdr->h_proto = htons(ETH_P_IP); in stmmac_test_get_udp_skb() 124 ptr[3] = htons(ETH_P_IP); in stmmac_test_get_udp_skb() 138 proto[0] = htons(ETH_P_8021Q); in stmmac_test_get_udp_skb() 139 tag[0] = htons(attr->vlan_id_out); in stmmac_test_get_udp_skb() 140 tag[1] = htons(ETH_P_IP); in stmmac_test_get_udp_skb() 142 proto[0] = htons(ETH_P_8021AD); in stmmac_test_get_udp_skb() 143 tag[1] = htons(ETH_P_8021Q); in stmmac_test_get_udp_skb() 144 tag[2] = htons(attr->vlan_id_in); in stmmac_test_get_udp_skb() 145 tag[3] = htons(ETH_P_IP); in stmmac_test_get_udp_skb() 150 thdr->source = htons(attr->sport); in stmmac_test_get_udp_skb() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/qualcomm/rmnet/ |
D | rmnet_map_data.c | 203 offset = htons((__force u16)(skb_transport_header(skb) - in rmnet_map_ipv4_ul_csum_header() 215 *hdr = htons((__force u16)*hdr); in rmnet_map_ipv4_ul_csum_header() 245 offset = htons((__force u16)(skb_transport_header(skb) - in rmnet_map_ipv6_ul_csum_header() 258 *hdr = htons((__force u16)*hdr); in rmnet_map_ipv6_ul_csum_header() 283 map_header->pkt_len = htons(map_datalen); in rmnet_map_add_map_header() 299 map_header->pkt_len = htons(map_datalen + padding); in rmnet_map_add_map_header() 369 if (skb->protocol == htons(ETH_P_IP)) { in rmnet_map_checksum_downlink_packet() 371 } else if (skb->protocol == htons(ETH_P_IPV6)) { in rmnet_map_checksum_downlink_packet() 407 if (skb->protocol == htons(ETH_P_IP)) { in rmnet_map_checksum_uplink_packet() 410 } else if (skb->protocol == htons(ETH_P_IPV6)) { in rmnet_map_checksum_uplink_packet()
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ |
D | en_accel.h | 63 case htons(ETH_P_IP): in mlx5e_tx_tunnel_accel() 66 case htons(ETH_P_IPV6): in mlx5e_tx_tunnel_accel() 80 swp_spec.tun_l3_proto = htons(ETH_P_IPV6); in mlx5e_tx_tunnel_accel() 83 swp_spec.tun_l3_proto = htons(ETH_P_IP); in mlx5e_tx_tunnel_accel() 105 udp_hdr(skb)->len = htons(payload_len); in mlx5e_udp_gso_handle_tx_skb()
|