Home
last modified time | relevance | path

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

12345678910>>...40

/linux/include/net/
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()
A Dinet_ecn.h97 check_add = (__force __be16)((__force u16)htons(0xFFFB) + in IP_ECN_set_ce()
98 (__force u16)htons(ecn)); in IP_ECN_set_ce()
110 iph->check = csum16_add(iph->check, htons(0x1)); in IP_ECN_set_ect1()
292 case htons(ETH_P_IP): in IP_ECN_decapsulate()
295 case htons(ETH_P_IPV6): in IP_ECN_decapsulate()
311 case htons(ETH_P_IP): in IP6_ECN_decapsulate()
314 case htons(ETH_P_IPV6): in IP6_ECN_decapsulate()
/linux/tools/testing/selftests/net/
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()
167 ip6hdr->ip6_plen = htons(frag_len); in send_fragment()
180 iphdr->ip_off = htons(offset / 8); in send_fragment()
185 iphdr->ip_len = htons(frag_len); in send_fragment()
236 iphdr->ip_id = htons(ip_id++); in send_udp_frags()
313 iphdr->ip_len = htons(frag_len); in send_udp_frags()
414 addr.sin_port = htons(cfg_port); in run_test_v4()
[all …]
A Dgro.c651 iph1->id = htons(8); in send_flush_id_case()
654 iph2->id = htons(9); in send_flush_id_case()
659 iph1->id = htons(8); in send_flush_id_case()
662 iph2->id = htons(8); in send_flush_id_case()
667 iph1->id = htons(8); in send_flush_id_case()
670 iph2->id = htons(9); in send_flush_id_case()
675 iph1->id = htons(8); in send_flush_id_case()
678 iph2->id = htons(8); in send_flush_id_case()
685 iph1->id = htons(8); in send_flush_id_case()
688 iph2->id = htons(9); in send_flush_id_case()
[all …]
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()
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()
202 laddr.sll_protocol = htons(ETH_P_IP); in do_send()
[all …]
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/net/lib/
A Dcsum.c177 sum += htons(proto); in checksum()
178 sum += htons(len); in checksum()
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()
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_dst); in build_packet_udp_encap()
283 uh->source = htons(cfg_port_src_encap); in build_packet_udp_encap()
285 uh->len = htons(sizeof(*uh) + in build_packet_udp_encap()
[all …]
/linux/net/8021q/
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()
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/samples/bpf/
A Dtc_l2_redirect_kern.c50 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()
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()
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/drivers/net/wireless/intel/iwlwifi/mei/
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/
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/net/core/
A Dselftests.c100 ehdr->h_proto = htons(ETH_P_IP); in net_test_get_skb()
103 thdr->source = htons(attr->sport); in net_test_get_skb()
104 thdr->dest = htons(attr->dport); in net_test_get_skb()
108 uhdr->source = htons(attr->sport); in net_test_get_skb()
109 uhdr->dest = htons(attr->dport); in net_test_get_skb()
112 uhdr->len = htons(attr->max_size - in net_test_get_skb()
133 ihdr->tot_len = htons(iplen); in net_test_get_skb()
163 skb->protocol = htons(ETH_P_IP); in net_test_get_skb()
213 if (thdr->dest != htons(tpriv->packet->dport)) in net_test_loopback_validate()
222 if (uhdr->dest != htons(tpriv->packet->dport)) in net_test_loopback_validate()
[all …]
A Dtso.c18 iph->id = htons(tso->ip_id); in tso_build_hdr()
19 iph->tot_len = htons(size + hdr_len - mac_hdr_len); in tso_build_hdr()
24 iph->payload_len = htons(size + tso->tlen); in tso_build_hdr()
41 uh->len = htons(sizeof(*uh) + size); in tso_build_hdr()
73 tso->ipv6 = vlan_get_protocol(skb) == htons(ETH_P_IPV6); in tso_start()
A Dflow_dissector.c1189 case htons(ETH_P_IP): { in __skb_flow_dissect()
1237 case htons(ETH_P_IPV6): { in __skb_flow_dissect()
1287 case htons(ETH_P_8021AD): in __skb_flow_dissect()
1410 case htons(ETH_P_TIPC): { in __skb_flow_dissect()
1441 case htons(ETH_P_FCOE): in __skb_flow_dissect()
1451 case htons(ETH_P_ARP): in __skb_flow_dissect()
1452 case htons(ETH_P_RARP): in __skb_flow_dissect()
1458 case htons(ETH_P_BATMAN): in __skb_flow_dissect()
1478 case htons(ETH_P_PRP): in __skb_flow_dissect()
1479 case htons(ETH_P_HSR): { in __skb_flow_dissect()
[all …]
/linux/net/openvswitch/
A Dflow.c499 key->eth.vlan.tci = htons(skb->vlan_tci) | htons(VLAN_CFI_MASK); in parse_vlan()
535 return htons(ETH_P_802_2); in parse_ethertype()
538 return htons(0); in parse_ethertype()
544 return htons(ETH_P_802_2); in parse_ethertype()
551 return htons(ETH_P_802_2); in parse_ethertype()
562 key->tp.src = htons(icmp->icmp6_type); in parse_icmpv6()
563 key->tp.dst = htons(icmp->icmp6_code); in parse_icmpv6()
717 if (nh->frag_off & htons(IP_MF) || in key_extract_l3l4()
756 key->tp.src = htons(icmp->type); in key_extract_l3l4()
757 key->tp.dst = htons(icmp->code); in key_extract_l3l4()
[all …]
A Dflow_netlink.c1033 if (!(tci & htons(VLAN_CFI_MASK))) { in validate_vlan_from_nlattrs()
1056 htons(VLAN_CFI_MASK)); in validate_vlan_mask_from_nlattrs()
1058 htons(VLAN_CFI_MASK)); in validate_vlan_mask_from_nlattrs()
1077 if (tpid != htons(0xffff)) { in validate_vlan_mask_from_nlattrs()
1082 if (!(tci & htons(VLAN_CFI_MASK))) { in validate_vlan_mask_from_nlattrs()
1158 eth_type = htons(0xffff); in parse_eth_type_from_nlattrs()
2933 if (eth_type != htons(ETH_P_IP)) in validate_set()
3013 if (eth_type != htons(ETH_P_NSH)) in validate_set()
3291 vlan_tci = htons(0); in __ovs_nla_copy_actions()
3373 if (proto == htons(ETH_P_TEB) && in __ovs_nla_copy_actions()
[all …]
/linux/net/ipv4/
A Darp.c569 skb->protocol = htons(ETH_P_ARP); in arp_create()
593 arp->ar_hrd = htons(dev->type); in arp_create()
594 arp->ar_pro = htons(ETH_P_IP); in arp_create()
599 arp->ar_hrd = htons(ARPHRD_AX25); in arp_create()
600 arp->ar_pro = htons(AX25_P_IP); in arp_create()
605 arp->ar_hrd = htons(ARPHRD_NETROM); in arp_create()
606 arp->ar_pro = htons(AX25_P_IP); in arp_create()
613 arp->ar_hrd = htons(ARPHRD_ETHER); in arp_create()
614 arp->ar_pro = htons(ETH_P_IP); in arp_create()
621 arp->ar_op = htons(type); in arp_create()
[all …]
/linux/net/bridge/
A Dbr_netfilter_hooks.c260 skb->protocol = htons(ETH_P_8021Q); in nf_bridge_update_protocol()
263 skb->protocol = htons(ETH_P_PPP_SES); in nf_bridge_update_protocol()
487 if (skb->protocol == htons(ETH_P_8021Q)) in setup_pre_routing()
556 skb->protocol = htons(ETH_P_IP); in br_nf_pre_routing()
669 if (skb->protocol == htons(ETH_P_IP)) in br_nf_forward_finish()
672 if (skb->protocol == htons(ETH_P_IPV6)) in br_nf_forward_finish()
731 skb->protocol = htons(ETH_P_IP); in br_nf_forward_ip()
736 skb->protocol = htons(ETH_P_IPV6); in br_nf_forward_ip()
891 skb->protocol == htons(ETH_P_IP)) { in br_nf_dev_queue_xmit()
990 skb->protocol = htons(ETH_P_IP); in br_nf_post_routing()
[all …]
/linux/drivers/net/ethernet/stmicro/stmmac/
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()
140 tag[1] = htons(ETH_P_IP); in stmmac_test_get_udp_skb()
143 tag[1] = htons(ETH_P_8021Q); in stmmac_test_get_udp_skb()
145 tag[3] = htons(ETH_P_IP); in stmmac_test_get_udp_skb()
180 ihdr->tot_len = htons(iplen); in stmmac_test_get_udp_skb()
1279 tpriv->pt.type = svlan ? htons(ETH_P_8021Q) : htons(ETH_P_IP); in stmmac_test_vlanoff_common()
1300 skb->protocol = htons(proto); in stmmac_test_vlanoff_common()
1510 keys.key.src = htons(src); in __stmmac_test_l4filt()
[all …]
/linux/net/dsa/
A Dtag_rzn1_a5psw.c64 ptag->ctrl_tag = htons(ETH_P_DSA_A5PSW); in a5psw_tag_xmit()
65 ptag->ctrl_data = htons(A5PSW_CTRL_DATA_FORCE_FORWARD); in a5psw_tag_xmit()
66 ptag->ctrl_data2_lo = htons(data2_val); in a5psw_tag_xmit()
86 if (tag->ctrl_tag != htons(ETH_P_DSA_A5PSW)) { in a5psw_tag_rcv()
/linux/drivers/net/ethernet/qualcomm/rmnet/
A Drmnet_map_data.c192 ul_header->csum_start_offset = htons(skb_network_header_len(skb)); in rmnet_map_ipv4_ul_csum_header()
193 ul_header->csum_info = htons(val); in rmnet_map_ipv4_ul_csum_header()
228 ul_header->csum_info = htons(val); in rmnet_map_ipv6_ul_csum_header()
261 if (skb->protocol == htons(ETH_P_IP)) { in rmnet_map_v5_checksum_uplink_packet()
267 skb->protocol == htons(ETH_P_IPV6)) { in rmnet_map_v5_checksum_uplink_packet()
313 map_header->pkt_len = htons(map_datalen); in rmnet_map_add_map_header()
329 map_header->pkt_len = htons(map_datalen + padding); in rmnet_map_add_map_header()
420 if (skb->protocol == htons(ETH_P_IP)) in rmnet_map_checksum_downlink_packet()
451 if (skb->protocol == htons(ETH_P_IP)) { in rmnet_map_v4_checksum_uplink_packet()
617 port->skbagg_head->protocol = htons(ETH_P_MAP); in rmnet_map_tx_aggregate()
[all …]
/linux/net/ipv6/
A Dseg6_iptunnel.c157 if (skb->protocol == htons(ETH_P_IPV6)) { in seg6_do_srh_encap()
246 if (skb->protocol == htons(ETH_P_IPV6)) { in seg6_do_srh_encap_red()
384 if (skb->protocol != htons(ETH_P_IPV6)) in seg6_do_srh()
397 if (skb->protocol == htons(ETH_P_IPV6)) in seg6_do_srh()
399 else if (skb->protocol == htons(ETH_P_IP)) in seg6_do_srh()
414 skb->protocol = htons(ETH_P_IPV6); in seg6_do_srh()
437 skb->protocol = htons(ETH_P_IPV6); in seg6_do_srh()
504 case htons(ETH_P_IP): in seg6_input_nf()
507 case htons(ETH_P_IPV6): in seg6_input_nf()
586 case htons(ETH_P_IP): in seg6_output_nf()
[all …]

Completed in 72 milliseconds

12345678910>>...40