Home
last modified time | relevance | path

Searched refs:htons (Results 1 – 25 of 780) sorted by relevance

12345678910>>...32

/linux/include/net/
H A Dtun_proto.h20 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_UC): in tun_p_from_eth_p()
/linux/tools/testing/selftests/net/
H A Dip_defrag.c112 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 …]
H A Dpsock_snd.c108 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 …]
H A Dtxring_overwrite.c51 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()
/linux/tools/testing/selftests/drivers/net/
H A Dgro.c
/linux/tools/testing/selftests/net/lib/
H A Dcsum.c177 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...]
/linux/net/8021q/
H A Dvlan_mvrp.c28 .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 Dvlan_gvrp.c30 __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()
/linux/net/psp/
H A Dpsp_main.c171 uh->dest = htons(PSP_DEFAULT_UDP_PORT); in psp_write_headers()
205 uh->source = htons(reciprocal_scale(hash, max - min + 1) + min); in psp_write_headers()
210 uh->len = htons(udp_len); in psp_write_headers()
240 if (skb->protocol == htons(ETH_P_IP)) { in psp_dev_encapsulate()
246 } else if (skb->protocol == htons(ETH_P_IPV6)) { in psp_dev_encapsulate()
285 if (proto == htons(ETH_P_IP)) in psp_dev_rcv()
287 else if (proto == htons(ETH_P_IPV6)) in psp_dev_rcv()
295 if (proto == htons(ETH_P_IP)) { in psp_dev_rcv()
313 if (unlikely(uh->dest != htons(PSP_DEFAULT_UDP_PORT))) in psp_dev_rcv()
348 if (proto == htons(ETH_P_IP)) { in psp_dev_rcv()
[all …]
/linux/drivers/net/wireless/intel/iwlwifi/mei/
H A Dnet.c95 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_PORT)) in iwl_mei_tx_copy_to_csme()
/linux/net/6lowpan/
H A Dnhc_udp.c54 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()
/linux/samples/bpf/
H A Dparse_varlen.c28 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()
H A Dxdp_fwd_kern.c38 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()
/linux/net/core/
H A Dselftests.c65 ehdr->h_proto = htons(ETH_P_IP); in net_test_get_skb()
69 thdr->source = htons(attr->sport); in net_test_get_skb()
70 thdr->dest = htons(attr->dport); in net_test_get_skb()
73 uhdr->source = htons(attr->sport); in net_test_get_skb()
74 uhdr->dest = htons(attr->dport); in net_test_get_skb()
75 uhdr->len = htons(sizeof(*shdr) + sizeof(*uhdr) + attr->size); in net_test_get_skb()
77 uhdr->len = htons(attr->max_size - in net_test_get_skb()
98 ihdr->tot_len = htons(iplen); in net_test_get_skb()
151 skb->protocol = htons(ETH_P_IP); in net_test_get_skb()
202 if (thdr->dest != htons(tpriv->packet->dport)) in net_test_loopback_validate()
[all …]
H A Dflow_dissector.c596 if (arp->ar_hrd != htons(ARPHRD_ETHER) || in __skb_flow_dissect_arp()
597 arp->ar_pro != htons(ETH_P_IP) || in __skb_flow_dissect_arp()
600 (arp->ar_op != htons(ARPOP_REPLY) && in __skb_flow_dissect_arp()
601 arp->ar_op != htons(ARPOP_REQUEST))) in __skb_flow_dissect_arp()
719 if (*p_proto == htons(ETH_P_TEB)) { in __skb_flow_dissect_gre()
753 *p_proto = htons(ETH_P_IP); in __skb_flow_dissect_gre()
756 *p_proto = htons(ETH_P_IPV6); in __skb_flow_dissect_gre()
847 key_tcp->flags = (*(__be16 *) &tcp_flag_word(th) & htons(0x0FFF)); in __skb_flow_dissect_tcp()
1084 proto == htons(ETH_P_XDSA))) { in __skb_flow_dissect()
1199 case htons(ETH_P_I in __skb_flow_dissect()
[all...]
/linux/net/ipv4/
H A Darp.c569 skb->protocol = htons(ETH_P_ARP); in arp_create()
594 arp->ar_hrd = htons(dev->type); in arp_create()
595 arp->ar_pro = htons(ETH_P_IP); in arp_create()
600 arp->ar_hrd = htons(ARPHRD_AX25); in arp_create()
601 arp->ar_pro = htons(AX25_P_IP); in arp_create()
606 arp->ar_hrd = htons(ARPHRD_NETROM); in arp_create()
607 arp->ar_pro = htons(AX25_P_IP); in arp_create()
614 arp->ar_hrd = htons(ARPHRD_ETHER); in arp_create()
615 arp->ar_pro = htons(ETH_P_IP); in arp_create()
622 arp->ar_op = htons(type); in arp_create()
[all …]
/linux/drivers/net/ethernet/stmicro/stmmac/
H A Dstmmac_selftests.c119 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 …]
/linux/lib/tests/
H A Dblackhole_dev_kunit.c48 uh->source = uh->dest = htons(UDP_PORT); in test_blackholedev()
49 uh->len = htons(data_len); in test_blackholedev()
55 ip6h->payload_len = htons(data_len + sizeof(struct udphdr)); in test_blackholedev()
63 skb->protocol = htons(ETH_P_IPV6); in test_blackholedev()
/linux/net/netfilter/
H A Dnf_flow_table_ip.c178 case htons(ETH_P_8021Q): in nf_flow_tuple_encap()
185 case htons(ETH_P_PPP_SES): in nf_flow_tuple_encap()
195 case htons(ETH_P_IP): in nf_flow_tuple_encap()
203 case htons(ETH_P_IPV6): in nf_flow_tuple_encap()
399 case htons(ETH_P_8021Q): in nf_flow_skb_encap_protocol()
410 case htons(ETH_P_PPP_SES): in nf_flow_skb_encap_protocol()
420 case htons(ETH_P_IP): in nf_flow_skb_encap_protocol()
423 case htons(ETH_P_IPV6): in nf_flow_skb_encap_protocol()
446 case htons(ETH_P_8021Q): in nf_flow_encap_pop()
452 case htons(ETH_P_PPP_SES): in nf_flow_encap_pop()
[all …]
H A Dnf_flow_table_inet.c19 case htons(ETH_P_8021Q): in nf_flow_offload_inet_hook()
26 case htons(ETH_P_PPP_SES): in nf_flow_offload_inet_hook()
36 case htons(ETH_P_IP): in nf_flow_offload_inet_hook()
38 case htons(ETH_P_IPV6): in nf_flow_offload_inet_hook()
/linux/net/openvswitch/
H A Dflow_netlink.c192 if (match->key->eth.type == htons(ETH_P_ARP) in match_validate()
193 || match->key->eth.type == htons(ETH_P_RARP)) { in match_validate()
195 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
201 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
205 if (match->key->eth.type == htons(ETH_P_IP)) { in match_validate()
207 if (match->mask && match->mask->key.eth.type == htons(0xffff)) { in match_validate()
242 if (match->key->eth.type == htons(ETH_P_IPV6)) { in match_validate()
244 if (match->mask && match->mask->key.eth.type == htons(0xffff)) { in match_validate()
277 htons(NDISC_NEIGHBOUR_SOLICITATION) || in match_validate()
278 match->key->tp.src == htons(NDISC_NEIGHBOUR_ADVERTISEMENT)) { in match_validate()
[all …]
/linux/net/dsa/
H A Dtag_rzn1_a5psw.c63 ptag->ctrl_tag = htons(ETH_P_DSA_A5PSW); in a5psw_tag_xmit()
64 ptag->ctrl_data = htons(A5PSW_CTRL_DATA_FORCE_FORWARD); in a5psw_tag_xmit()
65 ptag->ctrl_data2_lo = htons(data2_val); in a5psw_tag_xmit()
85 if (tag->ctrl_tag != htons(ETH_P_DSA_A5PSW)) { in a5psw_tag_rcv()
/linux/drivers/net/ethernet/mellanox/mlx5/core/en_accel/
H A Dipsec_rxtx.c65 if (skb->protocol == htons(ETH_P_IP)) { in mlx5e_ipsec_remove_trailer()
66 ipv4hdr->tot_len = htons(ntohs(ipv4hdr->tot_len) - trailer_len); in mlx5e_ipsec_remove_trailer()
69 ipv6hdr->payload_len = htons(ntohs(ipv6hdr->payload_len) - in mlx5e_ipsec_remove_trailer()
94 if (skb->protocol == htons(ETH_P_IPV6)) in mlx5e_ipsec_set_swp()
237 (skb->protocol != htons(ETH_P_IP) && in mlx5e_ipsec_tx_build_eseg()
238 skb->protocol != htons(ETH_P_IPV6)))) in mlx5e_ipsec_tx_build_eseg()
284 (skb->protocol != htons(ETH_P_IP) && in mlx5e_ipsec_handle_tx_skb()
285 skb->protocol != htons(ETH_P_IPV6)))) { in mlx5e_ipsec_handle_tx_skb()
/linux/drivers/net/ethernet/mellanox/mlx5/core/
H A Den_selftest.c111 ethh->h_proto = htons(ETH_P_IP); in mlx5e_test_get_udp_skb()
114 udph->source = htons(9); in mlx5e_test_get_udp_skb()
115 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb()
116 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
126 iph->tot_len = htons(iplen); in mlx5e_test_get_udp_skb()
143 skb->protocol = htons(ETH_P_IP); in mlx5e_test_get_udp_skb()
186 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate()
224 lbtp->pt.type = htons(ETH_P_IP); in mlx5e_test_loopback_setup()
/linux/drivers/net/ethernet/mellanox/mlx4/
H A Dfw_qos.c134 htons(MLX4_RATELIMIT_100M_UNITS); in mlx4_SET_PORT_SCHEDULER()
138 htons(MLX4_RATELIMIT_1G_UNITS); in mlx4_SET_PORT_SCHEDULER()
140 tc->max_bw_value = htons(r); in mlx4_SET_PORT_SCHEDULER()
142 tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT); in mlx4_SET_PORT_SCHEDULER()
143 tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS); in mlx4_SET_PORT_SCHEDULER()
146 tc->pg = htons(pg[i]); in mlx4_SET_PORT_SCHEDULER()
147 tc->bw_precentage = htons(tc_tx_bw[i]); in mlx4_SET_PORT_SCHEDULER()

12345678910>>...32