Home
last modified time | relevance | path

Searched refs:htons (Results 1 – 200 of 618) sorted by relevance

1234

/linux-4.4.14/include/linux/
Dif_vlan.h277 if (proto == htons(ETH_P_8021Q) && features & NETIF_F_HW_VLAN_CTAG_TX) in vlan_hw_offload_capable()
279 if (proto == htons(ETH_P_8021AD) && features & NETIF_F_HW_VLAN_STAG_TX) in vlan_hw_offload_capable()
313 veth->h_vlan_TCI = htons(vlan_tci); in __vlan_insert_tag()
427 if (veth->h_vlan_proto != htons(ETH_P_8021Q) && in __vlan_get_tag()
428 veth->h_vlan_proto != htons(ETH_P_8021AD)) in __vlan_get_tag()
490 if (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { in __vlan_get_protocol()
508 } while (type == htons(ETH_P_8021Q) || in __vlan_get_protocol()
509 type == htons(ETH_P_8021AD)); in __vlan_get_protocol()
556 skb->protocol = htons(ETH_P_802_3); in vlan_set_encap_proto()
561 skb->protocol = htons(ETH_P_802_2); in vlan_set_encap_proto()
[all …]
Detherdevice.h205 proto &= htons(0xFF00); in eth_proto_is_802_3()
208 return (__force u16)proto >= (__force u16)htons(ETH_P_802_3_MIN); in eth_proto_is_802_3()
Dhdlc.h117 return htons(ETH_P_HDLC); in hdlc_type_trans()
/linux-4.4.14/net/8021q/
Dvlan_mvrp.c31 .pkttype.type = htons(ETH_P_MVRP),
39 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_join()
41 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_join()
50 __be16 vlan_id = htons(vlan->vlan_id); in vlan_mvrp_request_leave()
52 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_mvrp_request_leave()
Dvlan_gvrp.c33 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_join()
35 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_join()
44 __be16 vlan_id = htons(vlan->vlan_id); in vlan_gvrp_request_leave()
46 if (vlan->vlan_proto != htons(ETH_P_8021Q)) in vlan_gvrp_request_leave()
Dvlan_netlink.c59 case htons(ETH_P_8021Q): in vlan_validate()
60 case htons(ETH_P_8021AD): in vlan_validate()
136 proto = htons(ETH_P_8021Q); in vlan_newlink()
Dvlan.h41 case htons(ETH_P_8021Q): in vlan_proto_idx()
43 case htons(ETH_P_8021AD): in vlan_proto_idx()
Dvlan.c223 err = vlan_check_real_dev(real_dev, htons(ETH_P_8021Q), vlan_id); in register_vlan_device()
267 vlan->vlan_proto = htons(ETH_P_8021Q); in register_vlan_device()
371 vlan_vid_add(dev, htons(ETH_P_8021Q), 0); in vlan_device_event()
421 vlan_vid_del(dev, htons(ETH_P_8021Q), 0); in vlan_device_event()
Dvlan_core.c164 if (vid_info->proto == htons(ETH_P_8021Q) && in vlan_hw_filter_capable()
167 if (vid_info->proto == htons(ETH_P_8021AD) && in vlan_hw_filter_capable()
/linux-4.4.14/net/bridge/
Dbr_netfilter_hooks.c65 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_IP))
68 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_IPV6))
71 (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_ARP))
77 else if (skb->protocol == htons(ETH_P_8021Q)) in vlan_proto()
84 (vlan_proto(skb) == htons(ETH_P_IP) && \
88 (vlan_proto(skb) == htons(ETH_P_IPV6) && \
92 (vlan_proto(skb) == htons(ETH_P_ARP) && \
102 (skb->protocol == htons(ETH_P_PPP_SES) && \
103 pppoe_proto(skb) == htons(PPP_IP) && \
107 (skb->protocol == htons(ETH_P_PPP_SES) && \
[all …]
Dbr_multicast.c61 case htons(ETH_P_IP): in br_ip_equal()
64 case htons(ETH_P_IPV6): in br_ip_equal()
91 case htons(ETH_P_IP): in br_ip_hash()
94 case htons(ETH_P_IPV6): in br_ip_hash()
129 br_dst.proto = htons(ETH_P_IP); in br_mdb_ip4_get()
143 br_dst.proto = htons(ETH_P_IPV6); in br_mdb_ip6_get()
166 case htons(ETH_P_IP): in br_mdb_get()
170 case htons(ETH_P_IPV6): in br_mdb_get()
376 skb->protocol = htons(ETH_P_IP); in br_ip4_multicast_alloc_query()
388 eth->h_proto = htons(ETH_P_IP); in br_ip4_multicast_alloc_query()
[all …]
Dbr_mdb.c89 if (p->addr.proto == htons(ETH_P_IP)) in br_mdb_fill_info()
92 if (p->addr.proto == htons(ETH_P_IPV6)) in br_mdb_fill_info()
322 if (entry->addr.proto == htons(ETH_P_IP)) { in is_valid_mdb_entry()
328 } else if (entry->addr.proto == htons(ETH_P_IPV6)) { in is_valid_mdb_entry()
451 if (ip.proto == htons(ETH_P_IP)) in __br_mdb_add()
525 if (ip.proto == htons(ETH_P_IP)) in __br_mdb_del()
Dbr_input.c89 if (parp->ar_pro != htons(ETH_P_IP) || in br_do_proxy_arp()
90 parp->ar_op != htons(ARPOP_REQUEST) || in br_do_proxy_arp()
168 if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) in br_handle_frame_finish()
Dbr_forward.c50 (skb->protocol == htons(ETH_P_8021Q) || in br_dev_queue_push_xmit()
51 skb->protocol == htons(ETH_P_8021AD))) { in br_dev_queue_push_xmit()
Dbr_vlan.c605 if (!br->vlan_enabled || br->vlan_proto == htons(ETH_P_8021Q)) { in recalculate_group_addr()
618 if (!br->vlan_enabled || br->vlan_proto == htons(ETH_P_8021Q)) in br_recalculate_fwd_mask()
708 err = __br_vlan_set_proto(br, htons(val)); in br_vlan_set_proto()
872 br->vlan_proto = htons(ETH_P_8021Q); in br_vlan_init()
/linux-4.4.14/net/openvswitch/
Dflow.c68 #define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF))
278 if (frag_off & htons(~0x7)) in parse_ipv6hdr()
321 key->eth.tci = qp->tci | htons(VLAN_TAG_PRESENT); in parse_vlan()
346 return htons(ETH_P_802_2); in parse_ethertype()
349 return htons(0); in parse_ethertype()
355 return htons(ETH_P_802_2); in parse_ethertype()
362 return htons(ETH_P_802_2); in parse_ethertype()
373 key->tp.src = htons(icmp->icmp6_type); in parse_icmpv6()
374 key->tp.dst = htons(icmp->icmp6_code); in parse_icmpv6()
485 key->eth.tci = htons(skb->vlan_tci); in key_extract()
[all …]
Dflow_netlink.c149 if (match->key->eth.type == htons(ETH_P_ARP) in match_validate()
150 || match->key->eth.type == htons(ETH_P_RARP)) { in match_validate()
152 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
158 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
162 if (match->key->eth.type == htons(ETH_P_IP)) { in match_validate()
164 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
197 if (match->key->eth.type == htons(ETH_P_IPV6)) { in match_validate()
199 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
230 htons(NDISC_NEIGHBOUR_SOLICITATION) || in match_validate()
231 match->key->tp.src == htons(NDISC_NEIGHBOUR_ADVERTISEMENT)) { in match_validate()
[all …]
Dactions.c132 key->eth.type = htons(0); in invalidate_flow_key()
293 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
383 csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); in set_ip_ttl()
688 if (ethertype == htons(ETH_P_IP)) { in ovs_fragment()
703 } else if (ethertype == htons(ETH_P_IPV6)) { in ovs_fragment()
/linux-4.4.14/net/6lowpan/
Dnhc_udp.c60 uh.dest = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress()
64 uh.source = htons(val + LOWPAN_NHC_UDP_8BIT_PORT); in udp_uncompress()
69 uh.source = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val >> 4)); in udp_uncompress()
70 uh.dest = htons(LOWPAN_NHC_UDP_4BIT_PORT + (val & 0x0f)); in udp_uncompress()
97 uh.len = htons(lowpan_802154_cb(skb)->d_size - in udp_uncompress()
100 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress()
103 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress()
Diphc.c553 hdr.payload_len = htons(lowpan_802154_cb(skb)->d_size - in lowpan_header_decompress()
556 hdr.payload_len = htons(skb->len); in lowpan_header_decompress()
559 hdr.payload_len = htons(skb->len); in lowpan_header_decompress()
750 if (skb->protocol != htons(ETH_P_IPV6)) in lowpan_header_compress()
/linux-4.4.14/net/bridge/netfilter/
Dnf_log_bridge.c28 case htons(ETH_P_IP): in nf_log_bridge_packet()
32 case htons(ETH_P_IPV6): in nf_log_bridge_packet()
36 case htons(ETH_P_ARP): in nf_log_bridge_packet()
37 case htons(ETH_P_RARP): in nf_log_bridge_packet()
Debt_arp.c42 if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP)) in ebt_arp_mt()
70 if (ah->ar_hln != ETH_ALEN || ah->ar_hrd != htons(ARPHRD_ETHER)) in ebt_arp_mt()
108 if ((e->ethproto != htons(ETH_P_ARP) && in ebt_arp_mt_check()
109 e->ethproto != htons(ETH_P_RARP)) || in ebt_arp_mt_check()
Dnft_reject_bridge.c69 niph->tot_len = htons(nskb->len); in nft_reject_br_send_v4_tcp_reset()
93 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET)) in nft_reject_br_send_v4_unreach()
136 niph->tot_len = htons(nskb->len); in nft_reject_br_send_v4_unreach()
171 nip6h->payload_len = htons(nskb->len - sizeof(struct ipv6hdr)); in nft_reject_br_send_v6_tcp_reset()
196 if (thoff < 0 || thoff >= skb->len || (fo & htons(~0x7)) != 0) in reject6_br_csum_ok()
244 nip6h->payload_len = htons(nskb->len - sizeof(struct ipv6hdr)); in nft_reject_br_send_v6_unreach()
271 case htons(ETH_P_IP): in nft_reject_bridge_eval()
289 case htons(ETH_P_IPV6): in nft_reject_bridge_eval()
Debt_log.c99 htons(ETH_P_IP)) { in ebt_log_packet()
116 htons(ETH_P_IPV6)) { in ebt_log_packet()
140 ((eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) || in ebt_log_packet()
141 (eth_hdr(skb)->h_proto == htons(ETH_P_RARP)))) { in ebt_log_packet()
156 if (ah->ar_hrd == htons(1) && in ebt_log_packet()
Debt_arpreply.c33 if (ap->ar_op != htons(ARPOP_REQUEST) || in ebt_arpreply_tg()
35 ap->ar_pro != htons(ETH_P_IP) || in ebt_arpreply_tg()
67 if (e->ethproto != htons(ETH_P_ARP) || in ebt_arpreply_tg_check()
Debt_among.c72 if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { in get_ip_dst()
80 } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { in get_ip_dst()
103 if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { in get_ip_src()
111 } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { in get_ip_src()
Dnf_tables_bridge.c97 case htons(ETH_P_IP): in nft_do_chain_bridge()
100 case htons(ETH_P_IPV6): in nft_do_chain_bridge()
Debt_snat.c29 eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { in ebt_snat_tg()
Debt_vlan.c94 if (e->ethproto != htons(ETH_P_8021Q)) { in ebt_vlan_mt_check()
/linux-4.4.14/include/scsi/
Dfc_encode.h118 ct->hdr.ct_cmd = htons((u16) op); in fc_ct_hdr_fill()
549 csp->sp_bb_cred = htons(10); /* this gets set by gateway */ in fc_plogi_fill()
550 csp->sp_bb_data = htons((u16) lport->mfs); in fc_plogi_fill()
552 cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); in fc_plogi_fill()
553 csp->sp_features = htons(FC_SP_FT_CIRO); in fc_plogi_fill()
554 csp->sp_tot_seq = htons(255); /* seq. we accept */ in fc_plogi_fill()
555 csp->sp_rel_off = htons(0x1f); in fc_plogi_fill()
558 cp->cp_rdfs = htons((u16) lport->mfs); in fc_plogi_fill()
559 cp->cp_con_seq = htons(255); in fc_plogi_fill()
580 sp->sp_bb_cred = htons(10); /* this gets set by gateway */ in fc_flogi_fill()
[all …]
/linux-4.4.14/net/ipv4/
Darp.c544 skb->protocol = htons(ETH_P_ARP); in arp_create()
568 arp->ar_hrd = htons(dev->type); in arp_create()
569 arp->ar_pro = htons(ETH_P_IP); in arp_create()
574 arp->ar_hrd = htons(ARPHRD_AX25); in arp_create()
575 arp->ar_pro = htons(AX25_P_IP); in arp_create()
580 arp->ar_hrd = htons(ARPHRD_NETROM); in arp_create()
581 arp->ar_pro = htons(AX25_P_IP); in arp_create()
588 arp->ar_hrd = htons(ARPHRD_ETHER); in arp_create()
589 arp->ar_pro = htons(ETH_P_IP); in arp_create()
596 arp->ar_op = htons(type); in arp_create()
[all …]
Dxfrm4_output.c28 if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->ignore_df) in xfrm4_tunnel_check_size()
33 skb->protocol = htons(ETH_P_IP); in xfrm4_tunnel_check_size()
68 skb->protocol = htons(ETH_P_IP); in xfrm4_prepare_output()
Dxfrm4_state.c32 sel->dport_mask = htons(0xffff); in __xfrm4_init_tempsel()
34 sel->sport_mask = htons(0xffff); in __xfrm4_init_tempsel()
76 .eth_proto = htons(ETH_P_IP),
Dip_output.c103 iph->tot_len = htons(skb->len); in __ip_local_out()
155 iph->frag_off = htons(IP_DF); in ip_build_and_send_pkt()
299 skb->protocol = htons(ETH_P_IP); in ip_mc_output()
357 skb->protocol = htons(ETH_P_IP); in ip_output()
435 *((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff)); in ip_queue_xmit()
437 iph->frag_off = htons(IP_DF); in ip_queue_xmit()
499 if ((iph->frag_off & htons(IP_DF)) == 0) in ip_fragment()
604 iph->tot_len = htons(first_len); in ip_do_fragment()
605 iph->frag_off = htons(IP_MF); in ip_do_fragment()
618 iph->tot_len = htons(frag->len); in ip_do_fragment()
[all …]
Dipip.c183 .proto = htons(ETH_P_IP),
220 if (unlikely(skb->protocol != htons(ETH_P_IP))) in ipip_tunnel_xmit()
250 p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF))) in ipip_tunnel_ioctl()
334 parms->iph.frag_off = htons(IP_DF); in ipip_netlink_parms()
341 parms->iph.frag_off = htons(IP_DF); in ipip_netlink_parms()
456 !!(parm->iph.frag_off & htons(IP_DF)))) in ipip_fill_info()
Dip_tunnel.c616 if (skb->protocol == htons(ETH_P_IP)) { in tnl_update_pmtu()
618 (inner_iph->frag_off & htons(IP_DF)) && in tnl_update_pmtu()
626 else if (skb->protocol == htons(ETH_P_IPV6)) { in tnl_update_pmtu()
677 if (skb->protocol == htons(ETH_P_IP)) { in ip_tunnel_xmit()
682 else if (skb->protocol == htons(ETH_P_IPV6)) { in ip_tunnel_xmit()
721 if (skb->protocol == htons(ETH_P_IP)) { in ip_tunnel_xmit()
724 } else if (skb->protocol == htons(ETH_P_IPV6)) { in ip_tunnel_xmit()
773 if (skb->protocol == htons(ETH_P_IP)) in ip_tunnel_xmit()
776 else if (skb->protocol == htons(ETH_P_IPV6)) in ip_tunnel_xmit()
784 if (skb->protocol == htons(ETH_P_IP)) in ip_tunnel_xmit()
[all …]
Dxfrm4_input.c53 iph->tot_len = htons(skb->len); in xfrm4_transport_finish()
134 iph->tot_len = htons(ntohs(iph->tot_len) - len); in xfrm4_udp_encap_rcv()
Dipconfig.c528 if (rarp->ar_op != htons(ARPOP_RREPLY)) in ic_rarp_recv()
532 if (rarp->ar_pro != htons(ETH_P_IP)) in ic_rarp_recv()
830 h->tot_len = htons(sizeof(struct bootp_pkt)); in ic_bootp_send_if()
831 h->frag_off = htons(IP_DF); in ic_bootp_send_if()
838 b->udph.source = htons(68); in ic_bootp_send_if()
839 b->udph.dest = htons(67); in ic_bootp_send_if()
840 b->udph.len = htons(sizeof(struct bootp_pkt) - sizeof(struct iphdr)); in ic_bootp_send_if()
857 b->secs = htons(jiffies_diff / HZ); in ic_bootp_send_if()
870 skb->protocol = htons(ETH_P_IP); in ic_bootp_send_if()
1003 if (b->udph.source != htons(67) || b->udph.dest != htons(68)) in ic_bootp_recv()
Dip_gre.c235 if (greh->flags == 0 && tpi->proto == htons(ETH_P_WCCP)) { in parse_gre_header()
236 tpi->proto = htons(ETH_P_IP); in parse_gre_header()
299 if (tpi->proto == htons(ETH_P_TEB)) in ipgre_err()
392 if (tpi->proto == htons(ETH_P_TEB)) in ipgre_rcv()
566 build_header(skb, tunnel_hlen, flags, htons(ETH_P_TEB), in gre_fb_xmit()
569 df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; in gre_fb_xmit()
663 __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB)); in gre_tap_xmit()
683 p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF)) || in ipgre_tunnel_ioctl()
740 greh->protocol = htons(type); in ipgre_header()
998 parms->iph.frag_off = htons(IP_DF); in ipgre_netlink_parms()
[all …]
Dping.c179 if (skb->protocol == htons(ETH_P_IP)) { in ping_lookup()
183 } else if (skb->protocol == htons(ETH_P_IPV6)) { in ping_lookup()
198 if (skb->protocol == htons(ETH_P_IP) && in ping_lookup()
208 } else if (skb->protocol == htons(ETH_P_IPV6) && in ping_lookup()
453 isk->inet_sport = htons(isk->inet_num); in ping_bind()
497 if (skb->protocol == htons(ETH_P_IP)) { in ping_err()
502 } else if (skb->protocol == htons(ETH_P_IPV6)) { in ping_err()
531 if (skb->protocol == htons(ETH_P_IP)) { in ping_err()
570 } else if (skb->protocol == htons(ETH_P_IPV6)) { in ping_err()
925 if (skb->protocol == htons(ETH_P_IPV6) && in ping_recvmsg()
[all …]
Dinet_lro.c118 csum_replace2(&iph->check, iph->tot_len, htons(lro_desc->ip_tot_len)); in lro_update_tcp_ip_header()
119 iph->tot_len = htons(lro_desc->ip_tot_len); in lro_update_tcp_ip_header()
315 if ((skb->protocol == htons(ETH_P_8021Q)) && in __lro_proc_skb()
Daf_inet.c185 inet->inet_sport = htons(inet->inet_num); in inet_autobind()
371 inet->inet_sport = htons(inet->inet_num); in inet_create()
507 inet->inet_sport = htons(inet->inet_num); in inet_bind()
1270 iph->id = htons(id); in inet_gso_segment()
1271 iph->frag_off = htons(offset >> 3); in inet_gso_segment()
1273 iph->frag_off |= htons(IP_MF); in inet_gso_segment()
1276 iph->id = htons(id++); in inet_gso_segment()
1278 iph->tot_len = htons(skb->len - nhoff); in inet_gso_segment()
1351 ((iph->frag_off ^ iph2->frag_off) & htons(IP_DF)); in inet_gro_receive()
1399 __be16 newlen = htons(skb->len - nhoff); in inet_gro_complete()
Dxfrm4_mode_transport.c52 ip_hdr(skb)->tot_len = htons(skb->len + ihl); in xfrm4_transport_input()
Dfou.c58 iph->tot_len = htons(ntohs(iph->tot_len) - len); in fou_recv_pull()
139 ip_hdr(skb)->tot_len = htons(ntohs(ip_hdr(skb)->tot_len) - len); in gue_udp_recv()
776 uh->len = htons(skb->len); in fou_build_udp()
863 pd[0] = htons(csum_start); in gue_build_header()
864 pd[1] = htons(csum_start + skb->csum_offset); in gue_build_header()
/linux-4.4.14/include/net/
Dinet_ecn.h94 check += (__force u16)htons(0xFFFB) + (__force u16)htons(ecn); in IP_ECN_set_ce()
215 if (skb->protocol == htons(ETH_P_IP)) in IP_ECN_decapsulate()
217 else if (skb->protocol == htons(ETH_P_IPV6)) in IP_ECN_decapsulate()
230 if (skb->protocol == htons(ETH_P_IP)) in IP6_ECN_decapsulate()
232 else if (skb->protocol == htons(ETH_P_IPV6)) in IP6_ECN_decapsulate()
Ddsfield.h38 iph->check = (__force __sum16)htons(check); in ipv4_change_dsfield()
48 *p = (*p & htons((((u16)mask << 4) | 0xf00f))) | htons((u16)value << 4); in ipv6_change_dsfield()
Dmpls.h24 return eth_type == htons(ETH_P_MPLS_UC) || in eth_p_mpls()
25 eth_type == htons(ETH_P_MPLS_MC); in eth_p_mpls()
Dvxlan.h220 case htons(ETH_P_IP): in vxlan_features_check()
223 case htons(ETH_P_IPV6): in vxlan_features_check()
232 skb->inner_protocol != htons(ETH_P_TEB) || in vxlan_features_check()
Dudplite.h85 udp_hdr(skb)->len = htons(up->pcslen); in udplite_csum_outgoing()
123 udp_hdr(skb)->len = htons(up->pcslen); in udplite_csum()
Dx25device.h15 return htons(ETH_P_X25); in x25_type_trans()
Dllc_pdu.h253 if (skb->protocol == htons(ETH_P_802_2)) in llc_pdu_decode_sa()
266 if (skb->protocol == htons(ETH_P_802_2)) in llc_pdu_decode_da()
340 if (ev_skb->protocol == htons(ETH_P_802_2)) { in llc_pdu_init_as_test_rsp()
Dgue.h55 #define GUE_FLAG_PRIV htons(1<<0) /* Private flags are in options */
Dip.h263 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0; in ip_is_fragment()
275 check += (__force u32)htons(0x0100); in ip_decrease_ttl()
341 if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) { in ip_select_ident_segs()
348 iph->id = htons(inet_sk(sk)->inet_id); in ip_select_ident_segs()
Dip_tunnels.h259 if (skb->protocol == htons(ETH_P_IP)) in ip_tunnel_get_dsfield()
261 else if (skb->protocol == htons(ETH_P_IPV6)) in ip_tunnel_get_dsfield()
/linux-4.4.14/net/core/
Dflow_dissector.c170 case htons(ETH_P_IP): { in __skb_flow_dissect()
194 if (iph->frag_off & htons(IP_OFFSET)) { in __skb_flow_dissect()
208 case htons(ETH_P_IPV6): { in __skb_flow_dissect()
254 case htons(ETH_P_8021AD): in __skb_flow_dissect()
255 case htons(ETH_P_8021Q): { in __skb_flow_dissect()
276 case htons(ETH_P_PPP_SES): { in __skb_flow_dissect()
287 case htons(PPP_IP): in __skb_flow_dissect()
289 case htons(PPP_IPV6): in __skb_flow_dissect()
295 case htons(ETH_P_TIPC): { in __skb_flow_dissect()
315 case htons(ETH_P_MPLS_UC): in __skb_flow_dissect()
[all …]
Dtso.c26 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 + tcp_hdrlen(skb)); in tso_build_hdr()
71 tso->ipv6 = vlan_get_protocol(skb) == htons(ETH_P_IPV6); in tso_start()
Dnetpoll.c409 udph->source = htons(np->local_port); in netpoll_send_udp()
410 udph->dest = htons(np->remote_port); in netpoll_send_udp()
411 udph->len = htons(udp_len); in netpoll_send_udp()
432 ip6h->payload_len = htons(sizeof(struct udphdr) + len); in netpoll_send_udp()
440 skb->protocol = eth->h_proto = htons(ETH_P_IPV6); in netpoll_send_udp()
457 put_unaligned(htons(ip_len), &(iph->tot_len)); in netpoll_send_udp()
458 iph->id = htons(atomic_inc_return(&ip_ident)); in netpoll_send_udp()
469 skb->protocol = eth->h_proto = htons(ETH_P_IP); in netpoll_send_udp()
Dpktgen.c2673 iph->tot_len = htons(skb->len - ETH_HLEN); in process_ipsec()
2697 return htons(id | (cfi << 12) | (prio << 13)); in build_tci()
2805 __be16 protocol = htons(ETH_P_IP); in fill_packet_ipv4()
2814 protocol = htons(ETH_P_MPLS_UC); in fill_packet_ipv4()
2817 protocol = htons(ETH_P_8021Q); in fill_packet_ipv4()
2849 *svlan_encapsulated_proto = htons(ETH_P_8021Q); in fill_packet_ipv4()
2856 *vlan_encapsulated_proto = htons(ETH_P_IP); in fill_packet_ipv4()
2877 udph->source = htons(pkt_dev->cur_udp_src); in fill_packet_ipv4()
2878 udph->dest = htons(pkt_dev->cur_udp_dst); in fill_packet_ipv4()
2879 udph->len = htons(datalen + 8); /* DATA + udphdr */ in fill_packet_ipv4()
[all …]
/linux-4.4.14/net/ipv4/netfilter/
Dnf_nat_h323.c205 htons(ntohs(info->rtp_port[i][dir]) + 1); in nat_rtp_rtcp()
224 rtp_exp->tuple.dst.u.udp.port = htons(nated_port); in nat_rtp_rtcp()
228 htons(nated_port + 1); in nat_rtp_rtcp()
254 htons((port & htons(1)) ? nated_port + 1 : in nat_rtp_rtcp()
258 info->rtp_port[i][!dir] = htons(nated_port); in nat_rtp_rtcp()
299 exp->tuple.dst.u.tcp.port = htons(nated_port); in nat_t120()
317 htons(nated_port)) < 0) { in nat_t120()
355 exp->tuple.dst.u.tcp.port = htons(nated_port); in nat_h245()
373 htons(nated_port)) == 0) { in nat_h245()
376 info->sig_port[!dir] = htons(nated_port); in nat_h245()
[all …]
Dnf_reject_ipv4.c25 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET)) in nf_reject_ip_tcphdr_get()
57 niph->frag_off = htons(IP_DF); in nf_reject_iphdr_put()
64 nskb->protocol = htons(ETH_P_IP); in nf_reject_iphdr_put()
152 niph->tot_len = htons(nskb->len); in nf_send_reset()
174 if (skb_in->csum_bad || iph->frag_off & htons(IP_OFFSET)) in nf_send_unreach()
Dnf_dup_ipv4.c48 skb->protocol = htons(ETH_P_IP); in nf_dup_ipv4_route()
87 iph->frag_off |= htons(IP_DF); in nf_dup_ipv4()
Dipt_ECN.c41 csum_replace2(&iph->check, htons(oldtos), htons(iph->tos)); in set_ect_ip()
Dipt_SYNPROXY.c31 iph->frag_off = htons(IP_DF); in synproxy_build_ip()
56 nskb->protocol = htons(ETH_P_IP); in synproxy_send_tcp()
189 nth->window = htons(state->seen[IP_CT_DIR_ORIGINAL].td_maxwin); in synproxy_send_server_ack()
227 nth->window = htons(ntohs(th->window) >> opts->wscale); in synproxy_send_client_ack()
Dipt_CLUSTERIP.c520 if (arp->ar_hrd != htons(ARPHRD_ETHER) || in arp_mangle()
521 arp->ar_pro != htons(ETH_P_IP) || in arp_mangle()
526 if (arp->ar_op != htons(ARPOP_REPLY) && in arp_mangle()
527 arp->ar_op != htons(ARPOP_REQUEST)) in arp_mangle()
Dnf_nat_proto_icmp.c48 tuple->src.u.icmp.id = htons(ntohs(range->min_proto.icmp.id) + in icmp_unique_tuple()
Dnf_nat_proto_gre.c74 *keyptr = htons(min + key % range_size); in gre_unique_tuple()
/linux-4.4.14/include/uapi/linux/
Dtipc_config.h282 tlv->tlv_len = htons(len); in TLV_SET_LEN()
292 tlv->tlv_type = htons(type); in TLV_SET_TYPE()
302 tlv_ptr->tlv_type = htons(type); in TLV_SET()
303 tlv_ptr->tlv_len = htons(tlv_len); in TLV_SET()
400 tcm_hdr->tcm_type = htons(cmd); in TCM_SET()
401 tcm_hdr->tcm_flags = htons(flags); in TCM_SET()
/linux-4.4.14/drivers/net/ethernet/mellanox/mlx4/
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()
/linux-4.4.14/net/appletalk/
Daarp.c127 skb->protocol = htons(ETH_P_ATALK); in __aarp_send_query()
132 eah->hw_type = htons(AARP_HW_TYPE_ETHERNET); in __aarp_send_query()
133 eah->pa_type = htons(ETH_P_ATALK); in __aarp_send_query()
136 eah->function = htons(AARP_REQUEST); in __aarp_send_query()
174 skb->protocol = htons(ETH_P_ATALK); in aarp_send_reply()
179 eah->hw_type = htons(AARP_HW_TYPE_ETHERNET); in aarp_send_reply()
180 eah->pa_type = htons(ETH_P_ATALK); in aarp_send_reply()
183 eah->function = htons(AARP_REPLY); in aarp_send_reply()
225 skb->protocol = htons(ETH_P_ATALK); in aarp_send_probe()
230 eah->hw_type = htons(AARP_HW_TYPE_ETHERNET); in aarp_send_probe()
[all …]
Dddp.c269 atif->address.s_net = htons(probe_net); in atif_probe_device()
318 proxy_addr->s_net = htons(probe_net); in atif_proxy_probe_device()
492 atrtr_default.gateway.s_net = htons(0); in atrtr_set_default()
763 if (nr->nr_firstnet == htons(0) && in atif_ioctl()
764 nr->nr_lastnet == htons(0xFFFE)) { in atif_ioctl()
778 sa->sat_addr.s_net = htons(ct); in atif_ioctl()
1004 return sum ? htons((unsigned short)sum) : htons(0xFFFF); in atalk_checksum()
1117 if (!ap || ap->s_net == htons(ATADDR_ANYNET)) in atalk_autobind()
1146 if (addr->sat_addr.s_net == htons(ATADDR_ANYNET)) { in atalk_bind()
1298 skb->protocol = htons(ETH_P_IP); in handle_ip_over_ddp()
[all …]
/linux-4.4.14/net/netfilter/ipvs/
Dip_vs_proto_ah_esp.c50 &iph->saddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
51 &iph->daddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto()
54 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
55 &iph->saddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto()
Dip_vs_proto_udp.c186 htons(oldlen), in udp_snat_handler()
187 htons(skb->len - udphoff)); in udp_snat_handler()
270 htons(oldlen), in udp_dnat_handler()
271 htons(skb->len - udphoff)); in udp_dnat_handler()
Dip_vs_sync.c345 sb->mesg->size = htons(sizeof(struct ip_vs_sync_mesg)); in ip_vs_sync_buff_create()
430 mesg->size = htons(sizeof(struct ip_vs_sync_mesg_v0)); in ip_vs_sync_buff_create_v0()
597 s->flags = htons(cp->flags & ~IP_VS_CONN_F_HASHED); in ip_vs_sync_conn_v0()
598 s->state = htons(cp->state); in ip_vs_sync_conn_v0()
606 m->size = htons(ntohs(m->size) + len); in ip_vs_sync_conn_v0()
710 m->size = htons(ntohs(m->size) + pad + len); in ip_vs_sync_conn()
719 s->v4.ver_size = htons(len & SVER_MASK); /* Version 0 */ in ip_vs_sync_conn()
721 s->v4.state = htons(cp->state); in ip_vs_sync_conn()
1475 .sin6_port = htons(c->mcast_port + id), in get_mcast_sockaddr()
1482 .sin_port = htons(c->mcast_port + id), in get_mcast_sockaddr()
Dip_vs_ftp.c394 htons(ntohs(cp->vport)-1), &p); in ip_vs_ftp_in()
399 htons(ntohs(cp->dport)-1), in ip_vs_ftp_in()
Dip_vs_proto_tcp.c192 htons(oldlen), in tcp_snat_handler()
193 htons(skb->len - tcphoff)); in tcp_snat_handler()
275 htons(oldlen), in tcp_dnat_handler()
276 htons(skb->len - tcphoff)); in tcp_dnat_handler()
/linux-4.4.14/net/phonet/
Dpep-gprs.c53 return htons(0); in gprs_type_trans()
57 return htons(ETH_P_IP); in gprs_type_trans()
59 return htons(ETH_P_IPV6); in gprs_type_trans()
61 return htons(0); in gprs_type_trans()
193 case htons(ETH_P_IP): in gprs_xmit()
194 case htons(ETH_P_IPV6): in gprs_xmit()
/linux-4.4.14/drivers/net/wan/lmc/
Dlmc_proto.c108 return htons(ETH_P_802_2); in lmc_proto_type()
111 return htons(ETH_P_802_2); in lmc_proto_type()
115 return htons(ETH_P_802_2); in lmc_proto_type()
/linux-4.4.14/net/tipc/
Dudp_media.c167 skb_set_inner_protocol(skb, htons(ETH_P_TIPC)); in tipc_udp_send_msg()
173 if (dst->proto == htons(ETH_P_IP)) { in tipc_udp_send_msg()
308 local->proto = htons(ETH_P_IP); in parse_options()
313 remote->proto = htons(ETH_P_IP); in parse_options()
323 local->proto = htons(ETH_P_IPV6); in parse_options()
329 remote->proto = htons(ETH_P_IPV6); in parse_options()
372 if (local.proto == htons(ETH_P_IP)) { in tipc_udp_enable()
387 } else if (local.proto == htons(ETH_P_IPV6)) { in tipc_udp_enable()
/linux-4.4.14/samples/bpf/
Dtcbpf1_kern.c26 bpf_l3_csum_replace(skb, IP_CSUM_OFF, htons(old_tos), htons(new_tos), 2); in set_ip_tos()
47 __u16 old_port = htons(load_half(skb, TCP_DPORT_OFF)); in set_tcp_dest_port()
Dlibbpf.c130 sock = socket(PF_PACKET, SOCK_RAW | SOCK_NONBLOCK | SOCK_CLOEXEC, htons(ETH_P_ALL)); in open_raw_sock()
139 sll.sll_protocol = htons(ETH_P_ALL); in open_raw_sock()
/linux-4.4.14/net/netfilter/
Dxt_TCPMSS.c146 htons(oldmss), htons(newmss), in tcpmss_mangle_packet()
188 htons(len), htons(len + TCPOLEN_MSS), true); in tcpmss_mangle_packet()
218 newlen = htons(ntohs(iph->tot_len) + ret); in tcpmss_tg4()
247 ipv6h->payload_len = htons(ntohs(ipv6h->payload_len) + ret); in tcpmss_tg6()
Dnft_queue.c89 if (nla_put_be16(skb, NFTA_QUEUE_NUM, htons(priv->queuenum)) || in nft_queue_dump()
90 nla_put_be16(skb, NFTA_QUEUE_TOTAL, htons(priv->queues_total)) || in nft_queue_dump()
91 nla_put_be16(skb, NFTA_QUEUE_FLAGS, htons(priv->flags))) in nft_queue_dump()
Dnf_nat_helper.c65 ip_hdr(skb)->tot_len = htons(skb->len); in mangle_contents()
69 htons(skb->len - sizeof(struct ipv6hdr)); in mangle_contents()
175 udph->len = htons(datalen); in nf_nat_mangle_udp_packet()
Dxt_HL.c60 csum_replace2(&iph->check, htons(iph->ttl << 8), in ttl_tg()
61 htons(new_ttl << 8)); in ttl_tg()
Dxt_TCPOPTSTRIP.c82 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
83 htons(n), false); in tcpoptstrip_mangle_packet()
Dxt_AUDIT.c149 case htons(ETH_P_IP): in audit_tg()
153 case htons(ETH_P_IPV6): in audit_tg()
Dnft_log.c153 if (nla_put_be16(skb, NFTA_LOG_GROUP, htons(li->u.ulog.group))) in nft_log_dump()
163 htons(li->u.ulog.qthreshold))) in nft_log_dump()
Dnf_tables_netdev.c98 case htons(ETH_P_IP): in nft_do_chain_netdev()
101 case htons(ETH_P_IPV6): in nft_do_chain_netdev()
Dnf_nat_sip.c245 htons(n) == ct->tuplehash[dir].tuple.dst.u.udp.port && in nf_nat_sip()
246 htons(n) != ct->tuplehash[!dir].tuple.src.u.udp.port) { in nf_nat_sip()
384 exp->tuple.dst.u.udp.port = htons(port); in nf_nat_sip_expect()
577 rtp_exp->tuple.dst.u.udp.port = htons(port); in nf_nat_sdp_media()
585 rtcp_exp->tuple.dst.u.udp.port = htons(port + 1); in nf_nat_sdp_media()
Dnf_nat_amanda.c50 exp->tuple.dst.u.tcp.port = htons(port); in help()
Dnf_conntrack_irc.c204 port = htons(dcc_port); in help()
257 irc[i].tuple.src.u.tcp.port = htons(ports[i]); in nf_conntrack_irc_init()
Dnf_conntrack_broadcast.c66 exp->mask.src.u.udp.port = htons(0xFFFF); in nf_conntrack_broadcast_help()
Dnf_nat_irc.c53 exp->tuple.dst.u.tcp.port = htons(port); in help()
Dnf_nat_proto_common.c88 *portptr = htons(min + off % range_size); in nf_nat_l4proto_unique_tuple()
/linux-4.4.14/net/ethernet/
Deth.c86 eth->h_proto = htons(type); in eth_header()
88 eth->h_proto = htons(len); in eth_header()
181 return htons(ETH_P_XDSA); in eth_type_trans()
194 return htons(ETH_P_802_3); in eth_type_trans()
199 return htons(ETH_P_802_2); in eth_type_trans()
232 if (type == htons(ETH_P_802_3)) in eth_header_cache()
/linux-4.4.14/net/ipv6/
Dxfrm6_state.c33 sel->dport_mask = htons(0xffff); in __xfrm6_init_tempsel()
35 sel->sport_mask = htons(0xffff); in __xfrm6_init_tempsel()
162 XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); in xfrm6_extract_header()
175 .eth_proto = htons(ETH_P_IPV6),
Dxfrm6_output.c82 skb->protocol = htons(ETH_P_IPV6); in xfrm6_tunnel_check_size()
118 skb->protocol = htons(ETH_P_IPV6); in xfrm6_prepare_output()
159 if (skb->protocol == htons(ETH_P_IPV6)) in __xfrm6_output()
Dip6_offload.c120 ipv6h->payload_len = htons(skb->len - nhoff - sizeof(*ipv6h)); in ipv6_gso_segment()
126 fptr->frag_off = htons(offset); in ipv6_gso_segment()
128 fptr->frag_off |= htons(IP6_MF); in ipv6_gso_segment()
270 iph->payload_len = htons(skb->len - nhoff - sizeof(*iph)); in ipv6_gro_complete()
Dip6_udp_tunnel.c89 uh->len = htons(skb->len); in udp_tunnel6_xmit_skb()
102 ip6h->payload_len = htons(skb->len); in udp_tunnel6_xmit_skb()
Dip6_output.c68 skb->protocol = htons(ETH_P_IPV6); in ip6_finish_output2()
216 hdr->payload_len = htons(seg_len); in ip6_xmit()
223 skb->protocol = htons(ETH_P_IPV6); in ip6_xmit()
663 fh->frag_off = htons(IP6_MF); in ip6_fragment()
669 ipv6_hdr(skb)->payload_len = htons(first_len - in ip6_fragment()
688 fh->frag_off = htons(offset); in ip6_fragment()
690 fh->frag_off |= htons(IP6_MF); in ip6_fragment()
693 htons(frag->len - in ip6_fragment()
810 fh->frag_off = htons(offset); in ip6_fragment()
812 fh->frag_off |= htons(IP6_MF); in ip6_fragment()
[all …]
Dila.c98 if (skb->protocol != htons(ETH_P_IPV6)) in ila_output()
114 if (skb->protocol != htons(ETH_P_IPV6)) in ila_input()
Dsit.c684 skb->protocol = htons(ETH_P_IPV6); in ipip6_rcv()
725 .proto = htons(ETH_P_IP),
784 if (v6dst->s6_addr16[0] == htons(0x2002)) { in check_6rd()
827 if (skb->protocol != htons(ETH_P_IPV6)) in ipip6_tunnel_xmit()
1023 case htons(ETH_P_IP): in sit_tunnel_xmit()
1026 case htons(ETH_P_IPV6): in sit_tunnel_xmit()
1200 p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF))) in ipip6_tunnel_ioctl()
1203 p.iph.frag_off |= htons(IP_DF); in ipip6_tunnel_ioctl()
1454 parms->iph.frag_off = htons(IP_DF); in ipip6_netlink_parms()
1461 parms->iph.frag_off = htons(IP_DF); in ipip6_netlink_parms()
[all …]
Dxfrm6_mode_transport.c56 ipv6_hdr(skb)->payload_len = htons(skb->len + ihl - in xfrm6_transport_input()
Ddatagram.c248 skb->protocol = htons(ETH_P_IPV6); in ipv6_icmp_error()
283 skb->protocol = htons(ETH_P_IPV6); in ipv6_local_error()
375 if (skb->protocol == htons(ETH_P_IPV6)) in ip6_datagram_support_cmsg()
422 if (skb->protocol == htons(ETH_P_IPV6)) { in ipv6_recv_error()
447 if (skb->protocol == htons(ETH_P_IPV6)) { in ipv6_recv_error()
531 bool is_ipv6 = skb->protocol == htons(ETH_P_IPV6); in ip6_datagram_recv_common_ctl()
/linux-4.4.14/drivers/net/ethernet/sfc/
Dfilter.h190 spec->ether_type = htons(ETH_P_IP); in efx_filter_set_ipv4_local()
215 spec->ether_type = htons(ETH_P_IP); in efx_filter_set_ipv4_full()
242 spec->outer_vid = htons(vid); in efx_filter_set_eth_local()
Drx.c856 if (skb->protocol == htons(ETH_P_8021Q)) { in efx_filter_rfs()
872 if (ether_type != htons(ETH_P_IP) && ether_type != htons(ETH_P_IPV6)) in efx_filter_rfs()
884 if (ether_type == htons(ETH_P_IP)) { in efx_filter_rfs()
920 if (ether_type == htons(ETH_P_IP)) in efx_filter_rfs()
988 if (spec->ether_type == htons(ETH_P_IP) && in efx_filter_is_mc_recipient()
991 if (spec->ether_type == htons(ETH_P_IPV6) && in efx_filter_is_mc_recipient()
Dtx.c858 if (protocol == htons(ETH_P_8021Q)) { in efx_tso_check_protocol()
863 if (protocol == htons(ETH_P_IP)) { in efx_tso_check_protocol()
866 EFX_BUG_ON_PARANOID(protocol != htons(ETH_P_IPV6)); in efx_tso_check_protocol()
1026 if (st->protocol == htons(ETH_P_IP)) { in tso_start()
1184 if (st->protocol == htons(ETH_P_IP)) { in tso_start_new_packet()
1188 tsoh_iph->tot_len = htons(ip_length); in tso_start_new_packet()
1189 tsoh_iph->id = htons(st->ipv4_id); in tso_start_new_packet()
1194 tsoh_iph->payload_len = htons(ip_length); in tso_start_new_packet()
Dselftest.c379 payload->header.h_proto = htons(ETH_P_IP); in efx_iterate_state()
384 payload->ip.check = (__force __sum16) htons(0xdead); in efx_iterate_state()
385 payload->ip.tot_len = htons(sizeof(*payload) - sizeof(struct ethhdr)); in efx_iterate_state()
391 payload->udp.len = htons(sizeof(*payload) - sizeof(struct ethhdr) - in efx_iterate_state()
396 payload->iteration = htons(ntohs(payload->iteration) + 1); in efx_iterate_state()
/linux-4.4.14/net/sctp/
Dsm_make_chunk.c146 err.length = htons(len); in sctp_init_cause()
164 err.length = htons(len); in sctp_init_cause_fixed()
250 init.num_outbound_streams = htons(asoc->c.sinit_num_ostreams); in sctp_make_init()
251 init.num_inbound_streams = htons(asoc->c.sinit_max_instreams); in sctp_make_init()
338 sat.param_hdr.length = htons(SCTP_SAT_LEN(num_types)); in sctp_make_init()
350 htons(sizeof(sctp_supported_ext_param_t) + num_ext); in sctp_make_init()
361 aiparam.param_hdr.length = htons(sizeof(aiparam)); in sctp_make_init()
409 initack.num_outbound_streams = htons(asoc->c.sinit_num_ostreams); in sctp_make_init_ack()
410 initack.num_inbound_streams = htons(asoc->c.sinit_max_instreams); in sctp_make_init_ack()
492 htons(sizeof(sctp_supported_ext_param_t) + num_ext); in sctp_make_init_ack()
[all …]
Dendpointola.c94 htons(sizeof(sctp_paramhdr_t) + 2); in sctp_endpoint_init()
95 auth_hmacs->hmac_ids[0] = htons(SCTP_AUTH_HMAC_ID_SHA1); in sctp_endpoint_init()
99 auth_chunks->param_hdr.length = htons(sizeof(sctp_paramhdr_t)); in sctp_endpoint_init()
108 htons(sizeof(sctp_paramhdr_t) + 2); in sctp_endpoint_init()
306 if ((htons(ep->base.bind_addr.port) == laddr->v4.sin_port) && in sctp_endpoint_is_match()
Dtsnmap.c346 gabs[ngaps].start = htons(start); in sctp_tsnmap_num_gabs()
347 gabs[ngaps].end = htons(end); in sctp_tsnmap_num_gabs()
Dipv6.c260 fl6->fl6_sport = htons(asoc->base.bind_addr.port); in sctp_v6_get_dst()
286 sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port)); in sctp_v6_get_dst()
489 param->v6.param_hdr.length = htons(length); in sctp_v6_to_addr_param()
751 addr->v4.sin_port = htons(asoc->peer.port); in sctp_inet6_event_msgname()
760 addr->v6.sin6_port = htons(asoc->peer.port); in sctp_inet6_event_msgname()
/linux-4.4.14/net/netfilter/ipset/
Dip_set_getport.c73 *port = (__force __be16)htons((ic->type << 8) | ic->code); in get_port()
85 htons((ic->icmp6_type << 8) | ic->icmp6_code); in get_port()
143 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) in ip_set_get_ip6_port()
Dip_set_bitmap_port.c92 htons(map->first_port + id)); in bitmap_port_do_list()
98 return nla_put_net16(skb, IPSET_ATTR_PORT, htons(map->first_port)) || in bitmap_port_do_head()
99 nla_put_net16(skb, IPSET_ATTR_PORT_TO, htons(map->last_port)); in bitmap_port_do_head()
/linux-4.4.14/net/batman-adv/
Dgateway_client.c689 if (proto == htons(ETH_P_8021Q)) { in batadv_gw_dhcp_recipient_get()
700 case htons(ETH_P_IP): in batadv_gw_dhcp_recipient_get()
712 case htons(ETH_P_IPV6): in batadv_gw_dhcp_recipient_get()
736 case htons(ETH_P_IP): in batadv_gw_dhcp_recipient_get()
737 if (udphdr->dest == htons(67)) in batadv_gw_dhcp_recipient_get()
739 else if (udphdr->source == htons(67)) in batadv_gw_dhcp_recipient_get()
742 case htons(ETH_P_IPV6): in batadv_gw_dhcp_recipient_get()
743 if (udphdr->dest == htons(547)) in batadv_gw_dhcp_recipient_get()
745 else if (udphdr->source == htons(547)) in batadv_gw_dhcp_recipient_get()
Dmain.c346 case htons(ETH_P_8021Q): in batadv_skb_set_priority()
354 case htons(ETH_P_IP): in batadv_skb_set_priority()
361 case htons(ETH_P_IPV6): in batadv_skb_set_priority()
807 tvlv_new->tvlv_hdr.len = htons(tvlv_value_len); in batadv_tvlv_container_register()
1170 unicast_tvlv_packet->tvlv_len = htons(tvlv_len); in batadv_tvlv_unicast_send()
1179 tvlv_hdr->len = htons(tvlv_value_len); in batadv_tvlv_unicast_send()
1207 if (ethhdr->h_proto != htons(ETH_P_8021Q)) in batadv_get_vid()
Ddistributed-arp-table.c854 if (ethhdr->h_proto != htons(ETH_P_ARP)) in batadv_arp_get_type()
865 if (arphdr->ar_hrd != htons(ARPHRD_ETHER)) in batadv_arp_get_type()
868 if (arphdr->ar_pro != htons(ETH_P_IP)) in batadv_arp_get_type()
893 if (arphdr->ar_op != htons(ARPOP_REQUEST)) { in batadv_arp_get_type()
995 skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), in batadv_dat_snoop_outgoing_arp_request()
1075 skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q), in batadv_dat_snoop_incoming_arp_request()
Dbridge_loop_avoidance.c356 skb = vlan_insert_tag(skb, htons(ETH_P_8021Q), in batadv_bla_send_claim()
556 crc = htons(backbone_gw->crc); in batadv_bla_send_announce()
909 } while (proto == htons(ETH_P_8021Q)); in batadv_bla_process_claim()
912 if (proto != htons(ETH_P_ARP)) in batadv_bla_process_claim()
927 if (arphdr->ar_hrd != htons(ARPHRD_ETHER)) in batadv_bla_process_claim()
929 if (arphdr->ar_pro != htons(ETH_P_IP)) in batadv_bla_process_claim()
1114 group = htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN)); in batadv_bla_update_orig_address()
1252 bat_priv->bla.claim_dest.group = htons(crc); in batadv_bla_init()
Dsoft-interface.c188 __be16 ethertype = htons(ETH_P_BATMAN); in batadv_interface_tx()
389 __be16 ethertype = htons(ETH_P_BATMAN); in batadv_interface_rx()
618 if (proto != htons(ETH_P_8021Q)) in batadv_interface_add_vid()
675 if (proto != htons(ETH_P_8021Q)) in batadv_interface_kill_vid()
/linux-4.4.14/drivers/net/arcnet/
Drfc1201.c111 return htons(ETH_P_IP); in type_trans()
113 return htons(ETH_P_IPV6); in type_trans()
115 return htons(ETH_P_ARP); in type_trans()
117 return htons(ETH_P_RARP); in type_trans()
121 return htons(ETH_P_802_3); in type_trans()
128 return htons(ETH_P_IP); in type_trans()
423 soft->sequence = htons(lp->rfc1201.sequence++); in build_header()
458 excsoft.sequence = htons(0xffff); in load_pkt()
Drfc1051.c107 return htons(ETH_P_IP); in type_trans()
109 return htons(ETH_P_ARP); in type_trans()
117 return htons(ETH_P_IP); in type_trans()
/linux-4.4.14/net/x25/
Dx25_dev.c174 skb->protocol = htons(ETH_P_X25); in x25_establish_link()
201 skb->protocol = htons(ETH_P_X25); in x25_terminate_link()
228 skb->protocol = htons(ETH_P_X25); in x25_send_frame()
/linux-4.4.14/drivers/net/ethernet/cisco/enic/
Dvnic_vic.c65 tlv->type = htons(type); in vic_provinfo_add_tlv()
66 tlv->length = htons(length); in vic_provinfo_add_tlv()
/linux-4.4.14/drivers/net/wan/
Dhdlc_ppp.c147 return htons(ETH_P_HDLC); in ppp_type_trans()
150 return htons(ETH_P_HDLC); in ppp_type_trans()
155 return htons(ETH_P_IP); in ppp_type_trans()
159 return htons(ETH_P_IPV6); in ppp_type_trans()
162 return htons(ETH_P_HDLC); in ppp_type_trans()
183 data->protocol = htons(PID_IP); in ppp_hard_header()
186 data->protocol = htons(PID_IPV6); in ppp_hard_header()
191 data->protocol = htons(type); in ppp_hard_header()
234 cp->len = htons(sizeof(struct cp_header) + magic_len + len); in ppp_tx_cp()
/linux-4.4.14/drivers/scsi/csiostor/
Dcsio_mb.c322 cmdp->fcoecaps |= htons(FW_CAPS_CONFIG_FCOE_CTRL_OFLD); in csio_mb_caps_config()
324 cmdp->fcoecaps |= htons(FW_CAPS_CONFIG_FCOE_INITIATOR); in csio_mb_caps_config()
326 cmdp->fcoecaps |= htons(FW_CAPS_CONFIG_FCOE_TARGET); in csio_mb_caps_config()
460 cmdp->fl0size = htons(iq_params->fl0size); in csio_mb_iq_alloc()
461 cmdp->fl0size = htons(iq_params->fl1size); in csio_mb_iq_alloc()
509 cmdp->iqid |= htons(iq_params->iqid); in csio_mb_iq_write()
510 cmdp->fl0id |= htons(iq_params->fl0id); in csio_mb_iq_write()
511 cmdp->fl1id |= htons(iq_params->fl1id); in csio_mb_iq_write()
517 cmdp->iqdroprss_to_iqesize |= htons( in csio_mb_iq_write()
525 cmdp->iqsize |= htons(iq_params->iqsize); in csio_mb_iq_write()
[all …]
/linux-4.4.14/net/ipv6/netfilter/
Dnf_reject_ipv6.c85 nskb->protocol = htons(ETH_P_IPV6); in nf_reject_ip6hdr_put()
201 nskb->protocol = htons(ETH_P_IPV6); in nf_send_reset6()
202 ip6h->payload_len = htons(sizeof(struct tcphdr)); in nf_send_reset6()
229 if (thoff < 0 || thoff >= skb->len || (fo & htons(~0x7)) != 0) in reject6_csum_ok()
Dip6t_eui64.c36 if (eth_hdr(skb)->h_proto == htons(ETH_P_IPV6)) { in eui64_mt6()
Dnf_conntrack_l3proto_ipv6.c88 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) { in ipv6_get_l4proto()
126 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) { in ipv6_helper()
150 if (protoff < 0 || (frag_off & htons(~0x7)) != 0) { in ipv6_confirm()
Dnf_dup_ipv6.c44 skb->protocol = htons(ETH_P_IPV6); in nf_dup_ipv6_route()
Dnf_nat_proto_icmpv6.c50 tuple->src.u.icmp.id = htons(ntohs(range->min_proto.icmp.id) + in icmpv6_unique_tuple()
Dnf_nat_l3proto_ipv6.c98 if ((frag_off & htons(~0x7)) == 0 && in nf_nat_ipv6_manip_pkt()
158 htons(oldlen), htons(datalen), true); in nf_nat_ipv6_csum_recalc()
/linux-4.4.14/drivers/net/ethernet/mellanox/mlx5/core/
Den_rx.c110 if (eth->h_proto == htons(ETH_P_IP)) { in mlx5e_lro_update_hdr()
158 return (ethertype == htons(ETH_P_IP) || ethertype == htons(ETH_P_IPV6)); in is_first_ethertype_ip()
214 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), in mlx5e_build_rx_skb()
/linux-4.4.14/drivers/net/usb/
Dcdc_mbim.c213 case htons(ETH_P_IP): in is_ip_proto()
214 case htons(ETH_P_IPV6): in is_ip_proto()
326 netdev = __vlan_find_dev_deep_rcu(dev->net, htons(ETH_P_8021Q), in do_neigh_solicit()
368 __be16 proto = htons(ETH_P_802_3); in cdc_mbim_process_dgram()
377 proto = htons(ETH_P_IP); in cdc_mbim_process_dgram()
382 proto = htons(ETH_P_IPV6); in cdc_mbim_process_dgram()
405 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tci); in cdc_mbim_process_dgram()
Dlg-vl600.c213 ethhdr->h_proto = htons(ETH_P_IPV6); in vl600_rx_fixup()
303 packet->h_proto = htons(ETH_P_IP); in vl600_tx_fixup()
/linux-4.4.14/drivers/net/slip/
Dslhc.c349 || (ip->frag_off & htons(0x4000)) != (cs->cs_ip.frag_off & htons(0x4000)) in slhc_compress()
560 thp->urg_ptr = htons(x); in slhc_uncompress()
567 thp->window = htons( ntohs(thp->window) + x); in slhc_uncompress()
587 ip->id = htons (ntohs (ip->id) + x); in slhc_uncompress()
589 ip->id = htons (ntohs (ip->id) + 1); in slhc_uncompress()
601 ip->tot_len = htons(len); in slhc_uncompress()
/linux-4.4.14/drivers/staging/gdm724x/
Dgdm_lte.c143 arp_out->ar_op = htons(ARPOP_REPLY); in gdm_lte_emulate_arp()
304 ipv6_out.payload_len = htons(sizeof(struct icmp6hdr) + in gdm_lte_emulate_ndp()
646 vlan_eth.h_vlan_TCI = htons(nic->vlan_id); in gdm_lte_netif_rx()
647 vlan_eth.h_vlan_proto = htons(ETH_P_8021Q); in gdm_lte_netif_rx()
653 eth.h_proto = htons(ETH_P_ARP); in gdm_lte_netif_rx()
654 vlan_eth.h_vlan_encapsulated_proto = htons(ETH_P_ARP); in gdm_lte_netif_rx()
658 eth.h_proto = htons(ETH_P_IP); in gdm_lte_netif_rx()
659 vlan_eth.h_vlan_encapsulated_proto = htons(ETH_P_IP); in gdm_lte_netif_rx()
661 eth.h_proto = htons(ETH_P_IPV6); in gdm_lte_netif_rx()
662 vlan_eth.h_vlan_encapsulated_proto = htons(ETH_P_IPV6); in gdm_lte_netif_rx()
/linux-4.4.14/net/bluetooth/bnep/
Dnetdev.c80 r->len = htons(ETH_ALEN * 2); in bnep_net_set_mc_list()
101 r->len = htons(skb->len - len); in bnep_net_set_mc_list()
142 if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF)) in bnep_net_eth_proto()
/linux-4.4.14/net/sched/
Dact_vlan.c103 case htons(ETH_P_8021Q): in tcf_vlan_init()
104 case htons(ETH_P_8021AD): in tcf_vlan_init()
110 push_proto = htons(ETH_P_8021Q); in tcf_vlan_init()
Dem_ipset.c63 case htons(ETH_P_IP): in em_ipset_match()
69 case htons(ETH_P_IPV6): in em_ipset_match()
Dact_connmark.c48 if (skb->protocol == htons(ETH_P_IP)) { in tcf_connmark()
53 } else if (skb->protocol == htons(ETH_P_IPV6)) { in tcf_connmark()
Dsch_dsmark.c203 case htons(ETH_P_IP): in dsmark_enqueue()
211 case htons(ETH_P_IPV6): in dsmark_enqueue()
291 case htons(ETH_P_IP): in dsmark_dequeue()
295 case htons(ETH_P_IPV6): in dsmark_dequeue()
Dact_nat.c145 } else if ((iph->frag_off & htons(IP_OFFSET)) || in tcf_nat()
153 switch (iph->frag_off & htons(IP_OFFSET) ? 0 : iph->protocol) { in tcf_nat()
Dcls_flow.c155 case htons(ETH_P_IP): in flow_get_nfct_src()
157 case htons(ETH_P_IPV6): in flow_get_nfct_src()
167 case htons(ETH_P_IP): in flow_get_nfct_dst()
169 case htons(ETH_P_IPV6): in flow_get_nfct_dst()
/linux-4.4.14/drivers/net/wireless/ipw2x00/
Dlibipw_tx.c139 if (h_proto == htons(ETH_P_AARP) || h_proto == htons(ETH_P_IPX)) in libipw_copy_snap()
229 if (eth->h_proto != htons(ETH_P_IP)) in libipw_classify()
299 encrypt = !(ether_type == htons(ETH_P_PAE) && ieee->ieee802_1x) && in libipw_xmit()
306 ieee->drop_unencrypted && ether_type != htons(ETH_P_PAE)) { in libipw_xmit()
/linux-4.4.14/drivers/scsi/fnic/
Dfnic_fcs.c358 vlan->eth.h_proto = htons(ETH_P_FIP); in fnic_fcoe_send_vlan_req()
361 vlan->fip.fip_op = htons(FIP_OP_VLAN); in fnic_fcoe_send_vlan_req()
363 vlan->fip.fip_dl_len = htons(sizeof(vlan->desc) / FIP_BPW); in fnic_fcoe_send_vlan_req()
375 skb->protocol = htons(ETH_P_FIP); in fnic_fcoe_send_vlan_req()
595 if (eh->h_proto == htons(ETH_P_FIP)) { in fnic_handle_fip_frame()
638 if (eh->h_proto == htons(ETH_P_8021Q)) { in fnic_import_rq_eth_pkt()
643 if (eh->h_proto == htons(ETH_P_FIP)) { in fnic_import_rq_eth_pkt()
658 if (eh->h_proto != htons(ETH_P_FCOE)) in fnic_import_rq_eth_pkt()
1003 vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); in fnic_eth_send()
1005 vlan_hdr->h_vlan_TCI = htons(fnic->vlan_id); in fnic_eth_send()
[all …]
/linux-4.4.14/fs/afs/
Dfsclient.c297 call->port = htons(AFS_FS_PORT); in afs_fs_fetch_file_status()
472 call->port = htons(AFS_FS_PORT); in afs_fs_fetch_data64()
517 call->port = htons(AFS_FS_PORT); in afs_fs_fetch_data()
585 call->port = htons(AFS_FS_PORT); in afs_fs_give_up_callbacks()
691 call->port = htons(AFS_FS_PORT); in afs_fs_create()
780 call->port = htons(AFS_FS_PORT); in afs_fs_remove()
865 call->port = htons(AFS_FS_PORT); in afs_fs_link()
962 call->port = htons(AFS_FS_PORT); in afs_fs_symlink()
1070 call->port = htons(AFS_FS_PORT); in afs_fs_rename()
1179 call->port = htons(AFS_FS_PORT); in afs_fs_store_data64()
[all …]
Dvlclient.c173 call->port = htons(AFS_VL_PORT); in afs_vl_get_entry_by_name()
209 call->port = htons(AFS_VL_PORT); in afs_vl_get_entry_by_id()
/linux-4.4.14/net/hsr/
Dhsr_main.h83 ht->path_and_LSDU_size = htons( in set_hsr_tag_path()
89 ht->path_and_LSDU_size = htons( in set_hsr_tag_LSDU_size()
Dhsr_forward.c132 hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); in hsr_fill_tag()
134 hsr_ethhdr->ethhdr.h_proto = htons(ETH_P_PRP); in hsr_fill_tag()
318 if (ethhdr->h_proto == htons(ETH_P_8021Q)) { in hsr_fill_frame_info()
323 if (ethhdr->h_proto == htons(ETH_P_PRP)) { in hsr_fill_frame_info()
/linux-4.4.14/tools/testing/selftests/net/
Dpsock_lib.h84 saddr.sin_port = htons(port); in pair_udp_open()
89 daddr.sin_port = htons(port + 1); in pair_udp_open()
Dpsock_tpacket.c113 int ret, sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in pfsocket()
146 if (eth->h_proto != htons(ETH_P_IP)) { in test_payload()
166 eth->h_proto = htons(ETH_P_IP); in create_payload()
176 ip->tot_len = htons((uint16_t) *len - sizeof(*eth)); in create_payload()
367 rcv_sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in walk_v1_v2_tx()
689 ring->ll.sll_protocol = htons(ETH_P_ALL); in bind_ring()
/linux-4.4.14/include/linux/byteorder/
Dgeneric.h131 #undef htons
140 #define htons(x) ___htons(x) macro
/linux-4.4.14/net/rds/
Dtcp_connect.c91 src.sin_port = (__force u16)htons(0); in rds_tcp_conn_connect()
102 dest.sin_port = (__force u16)htons(RDS_TCP_PORT); in rds_tcp_conn_connect()
/linux-4.4.14/drivers/net/ethernet/fujitsu/
Dfmvj18x_cs.c779 htons(inw(ioaddr + TX_STATUS)), in fjn_tx_timeout()
784 htons(inw(ioaddr + 0)), htons(inw(ioaddr + 2)), in fjn_tx_timeout()
785 htons(inw(ioaddr + 4)), htons(inw(ioaddr + 6)), in fjn_tx_timeout()
786 htons(inw(ioaddr + 8)), htons(inw(ioaddr + 10)), in fjn_tx_timeout()
787 htons(inw(ioaddr + 12)), htons(inw(ioaddr + 14))); in fjn_tx_timeout()
/linux-4.4.14/net/802/
Dfddi.c71 fddi->hdr.llc_snap.ethertype = htons(type); in fddi_header()
113 type = htons(ETH_P_802_2); in fddi_type_trans()
Dfc.c57 fcllc->ethertype = htons(type); in fc_header()
/linux-4.4.14/include/linux/can/
Ddev.h89 if (skb->protocol == htons(ETH_P_CAN)) { in can_dropped_invalid_skb()
93 } else if (skb->protocol == htons(ETH_P_CANFD)) { in can_dropped_invalid_skb()
/linux-4.4.14/include/linux/sunrpc/
Daddr.h38 ((struct sockaddr_in *)sap)->sin_port = htons(port); in rpc_set_port()
41 ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); in rpc_set_port()
/linux-4.4.14/drivers/net/ipvlan/
Dipvlan_core.c126 case htons(ETH_P_ARP): { in ipvlan_get_L3_hdr()
137 case htons(ETH_P_IP): { in ipvlan_get_L3_hdr()
155 case htons(ETH_P_IPV6): { in ipvlan_get_L3_hdr()
445 if (skb->protocol == htons(ETH_P_IPV6)) in ipvlan_process_outbound()
447 else if (skb->protocol == htons(ETH_P_IP)) in ipvlan_process_outbound()
461 if (skb->protocol == htons(ETH_P_PAUSE)) { in ipvlan_multicast_enqueue()
/linux-4.4.14/drivers/scsi/fcoe/
Dfcoe_ctlr.c407 sol->eth.h_proto = htons(ETH_P_FIP); in fcoe_ctlr_solicit()
410 sol->fip.fip_op = htons(FIP_OP_DISC); in fcoe_ctlr_solicit()
412 sol->fip.fip_dl_len = htons(sizeof(sol->desc) / FIP_BPW); in fcoe_ctlr_solicit()
413 sol->fip.fip_flags = htons(FIP_FL_FPMA); in fcoe_ctlr_solicit()
415 sol->fip.fip_flags |= htons(FIP_FL_SPMA); in fcoe_ctlr_solicit()
428 sol->desc.size.fd_size = htons(fcoe_size); in fcoe_ctlr_solicit()
431 skb->protocol = htons(ETH_P_FIP); in fcoe_ctlr_solicit()
563 kal->eth.h_proto = htons(ETH_P_FIP); in fcoe_ctlr_send_keep_alive()
566 kal->fip.fip_op = htons(FIP_OP_CTRL); in fcoe_ctlr_send_keep_alive()
568 kal->fip.fip_dl_len = htons((sizeof(kal->mac) + in fcoe_ctlr_send_keep_alive()
[all …]
/linux-4.4.14/drivers/net/ethernet/intel/fm10k/
Dfm10k_main.c503 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); in fm10k_process_skb_fields()
505 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), in fm10k_process_skb_fields()
687 #define FM10K_NVGRE_RESERVED0_FLAGS htons(0x9FFF)
688 #define NVGRE_TNI htons(0x2000)
701 if (vlan_get_protocol(skb) != htons(ETH_P_IP)) in fm10k_gre_is_nvgre()
724 skb->inner_protocol != htons(ETH_P_TEB)) in fm10k_tx_encap_offload()
728 case htons(ETH_P_IP): in fm10k_tx_encap_offload()
731 case htons(ETH_P_IPV6): in fm10k_tx_encap_offload()
753 case htons(ETH_P_IP): in fm10k_tx_encap_offload()
756 case htons(ETH_P_IPV6): in fm10k_tx_encap_offload()
[all …]
/linux-4.4.14/net/ipx/
Daf_ipx.c660 skb->protocol = htons(ETH_P_IPX); in ipxitf_send()
925 case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break; in ipx_map_frame_type()
926 case IPX_FRAME_8022: rc = htons(ETH_P_802_2); break; in ipx_map_frame_type()
927 case IPX_FRAME_SNAP: rc = htons(ETH_P_SNAP); break; in ipx_map_frame_type()
928 case IPX_FRAME_8023: rc = htons(ETH_P_802_3); break; in ipx_map_frame_type()
968 dlink_type = htons(ETH_P_802_2); in ipxitf_create()
973 dlink_type = htons(ETH_P_IPX); in ipxitf_create()
979 dlink_type = htons(ETH_P_SNAP); in ipxitf_create()
983 dlink_type = htons(ETH_P_802_3); in ipxitf_create()
1214 __u32 sum = p[1] + (p[2] & (__force u16)htons(0x00ff)); in ipx_cksum()
[all …]
Dipx_route.c207 ipx->ipx_pktsize = htons(len + sizeof(struct ipxhdr)); in ipxrtr_route_packet()
240 intrfc->if_dlink_type == htons(IPX_FRAME_8023)) in ipxrtr_route_packet()
241 ipx->ipx_checksum = htons(0xFFFF); in ipxrtr_route_packet()
Dpe2.c15 skb->protocol = htons(ETH_P_IPX); in pEII_request()
/linux-4.4.14/arch/unicore32/include/asm/
Dchecksum.h33 : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto)) in csum_tcpudp_nofold()
/linux-4.4.14/drivers/net/ppp/
Dpptp.c245 hdr->protocol = htons(PPTP_GRE_PROTO); in pptp_xmit()
246 hdr->call_id = htons(opt->dst_addr.call_id); in pptp_xmit()
256 hdr->payload_len = htons(len); in pptp_xmit()
270 iph->frag_off = htons(IP_DF); in pptp_xmit()
278 iph->tot_len = htons(skb->len); in pptp_xmit()
405 po = lookup_chan(htons(header->call_id), iph->saddr); in pptp_rcv()
/linux-4.4.14/drivers/staging/octeon/
Dethernet-tx.c398 if ((skb->protocol == htons(ETH_P_IP)) && in cvm_oct_xmit()
402 (ip_hdr(skb)->frag_off == htons(1 << 14))) && in cvm_oct_xmit()
611 if (skb->protocol == htons(ETH_P_IP)) { in cvm_oct_xmit_pow()
664 work->word2.snoip.is_rarp = skb->protocol == htons(ETH_P_RARP); in cvm_oct_xmit_pow()
665 work->word2.snoip.is_arp = skb->protocol == htons(ETH_P_ARP); in cvm_oct_xmit_pow()
/linux-4.4.14/drivers/net/ethernet/brocade/bna/
Dbfa_msgq.c201 dbell->idx.cmdq_pi = htons(cmdq->producer_index); in bfa_msgq_cmdq_dbell()
294 rsp->mh.mtag.i2htok = htons(cmdq->token); in bfa_msgq_cmdq_copy_rsp()
459 dbell->idx.rspq_ci = htons(rspq->consumer_index); in bfa_msgq_rspq_dbell()
526 msgq_cfg->cmdq.q_depth = htons(msgq->cmdq.depth); in bfa_msgq_init()
528 msgq_cfg->rspq.q_depth = htons(msgq->rspq.depth); in bfa_msgq_init()
Dbna_tx_rx.c193 req->mh.num_entries = htons( in bna_bfi_ucast_req()
209 req->mh.num_entries = htons( in bna_bfi_mcast_add_req()
225 req->mh.num_entries = htons( in bna_bfi_mcast_del_req()
227 req->handle = htons(handle); in bna_bfi_mcast_del_req()
240 req->mh.num_entries = htons( in bna_bfi_mcast_filter_req()
255 req->mh.num_entries = htons( in bna_bfi_rx_promisc_req()
272 req->mh.num_entries = htons( in bna_bfi_rx_vlan_filter_set()
295 req->mh.num_entries = htons( in bna_bfi_vlan_strip_enable()
310 req->mh.num_entries = htons( in bna_bfi_rit_cfg()
312 req->size = htons(rxf->rit_size); in bna_bfi_rit_cfg()
[all …]
/linux-4.4.14/net/atm/
Dbr2684.c395 if (type == htons(ETH_P_IP) && in packet_fails_filter()
399 if (type == htons(ETH_P_ARP)) in packet_fails_filter()
458 skb->protocol = htons(ETH_P_IPV6); in br2684_push()
461 skb->protocol = htons(ETH_P_IP); in br2684_push()
486 skb->protocol = htons(ETH_P_IP); in br2684_push()
488 skb->protocol = htons(ETH_P_IPV6); in br2684_push()
/linux-4.4.14/arch/arc/include/asm/
Dchecksum.h89 "r"(htons(proto)) in csum_tcpudp_nofold()
/linux-4.4.14/drivers/infiniband/hw/nes/
Dnes_cm.c467 skb->protocol = htons(0x800); in form_cm_frame()
473 ethh->h_proto = htons(0x0800); in form_cm_frame()
478 iph->tot_len = htons(packetsize); in form_cm_frame()
479 iph->id = htons(++cm_node->tcp_cntxt.loc_id); in form_cm_frame()
481 iph->frag_off = htons(0x4000); in form_cm_frame()
488 tcph->source = htons(cm_node->mapped_loc_port); in form_cm_frame()
489 tcph->dest = htons(cm_node->mapped_rem_port); in form_cm_frame()
516 tcph->window = htons(cm_node->tcp_cntxt.rcv_wnd); in form_cm_frame()
548 nes_create_sockaddr(htonl(cm_info->loc_addr), htons(cm_info->loc_port), in nes_create_mapinfo()
551 htons(cm_info->mapped_loc_port), &mapped_sockaddr); in nes_create_mapinfo()
[all …]
/linux-4.4.14/drivers/atm/
Datmtcp.c128 msg.hdr.vpi = htons(vpi); in atmtcp_v_open()
130 msg.hdr.vci = htons(vci); in atmtcp_v_open()
221 hdr->vpi = htons(vcc->vpi); in atmtcp_v_send()
222 hdr->vci = htons(vcc->vci); in atmtcp_v_send()
/linux-4.4.14/net/ax25/
Dax25_in.c130 skb->protocol = htons(ETH_P_IP); in ax25_rx_iframe()
248 skb->protocol = htons(ETH_P_IP); in ax25_rcv()
258 skb->protocol = htons(ETH_P_ARP); in ax25_rcv()
/linux-4.4.14/net/ieee802154/6lowpan/
Drx.c31 skb->protocol = htons(ETH_P_IPV6); in lowpan_give_skb_to_device()
319 .type = htons(ETH_P_IEEE802154),
/linux-4.4.14/drivers/net/wireless/mwifiex/
Dsta_rx.c47 if (arp->hdr.ar_op == htons(ARPOP_REPLY) || in mwifiex_discard_gratuitous_arp()
48 arp->hdr.ar_op == htons(ARPOP_REQUEST)) { in mwifiex_discard_gratuitous_arp()
/linux-4.4.14/net/xfrm/
Dxfrm_output.c238 if (skb->protocol == htons(ETH_P_IP)) in xfrm_local_error()
240 else if (skb->protocol == htons(ETH_P_IPV6)) in xfrm_local_error()
/linux-4.4.14/drivers/net/
Dvrf.c158 case htons(ETH_P_IP): in is_ip_rx_frame()
160 case htons(ETH_P_IPV6): in is_ip_rx_frame()
334 case htons(ETH_P_IP): in is_ip_tx_frame()
336 case htons(ETH_P_IPV6): in is_ip_tx_frame()
413 skb->protocol = htons(ETH_P_IPV6); in vrf_finish_output6()
563 skb->protocol = htons(ETH_P_IP); in vrf_output()
Dgeneve.c320 if (unlikely(geneveh->proto_type != htons(ETH_P_TEB))) in geneve_udp_encap_recv()
325 htons(ETH_P_TEB))) in geneve_udp_encap_recv()
633 geneveh->proto_type = htons(ETH_P_TEB); in geneve_build_header()
666 skb_set_inner_protocol(skb, htons(ETH_P_TEB)); in geneve_build_skb()
702 skb_set_inner_protocol(skb, htons(ETH_P_TEB)); in geneve6_build_skb()
864 df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; in geneve_xmit_skb()
1224 __be16 dst_port = htons(GENEVE_UDP_PORT); in geneve_newlink()
1358 0, 0, 0, htons(dst_port), true); in geneve_dev_create_fb()
/linux-4.4.14/drivers/net/appletalk/
Dipddp.c152 ddp->deh_len_hops = htons(skb->len + (1<<10)); in ipddp_xmit()
176 skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */ in ipddp_xmit()
/linux-4.4.14/net/rxrpc/
Dar-peer.c45 htons(7000), htons(7001), in rxrpc_assess_MTU_size()
/linux-4.4.14/drivers/net/ethernet/qlogic/qlcnic/
Dqlcnic_io.c527 vh->h_vlan_proto = htons(ETH_P_8021Q); in qlcnic_tx_pkt()
528 vh->h_vlan_TCI = htons(vlan_tci); in qlcnic_tx_pkt()
1244 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); in qlcnic_process_rcv()
1323 ipv6h->payload_len = htons(length); in qlcnic_process_lro()
1328 csum_replace2(&iph->check, iph->tot_len, htons(length)); in qlcnic_process_lro()
1329 iph->tot_len = htons(length); in qlcnic_process_lro()
1338 if (skb->protocol == htons(ETH_P_IPV6)) in qlcnic_process_lro()
1345 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); in qlcnic_process_lro()
1770 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); in qlcnic_83xx_process_rcv()
1846 ipv6h->payload_len = htons(length); in qlcnic_83xx_process_lro()
[all …]
/linux-4.4.14/drivers/staging/wlan-ng/
Dp80211conv.c153 e_snap->type = htons(proto); in skb_ether_to_p80211()
412 e_hdr->type = htons(payload_length); in skb_p80211_to_ether()
479 e_hdr->type = htons(payload_length); in skb_p80211_to_ether()
/linux-4.4.14/drivers/scsi/bnx2fc/
Dbnx2fc_els.c86 rrq.rrq_ox_id = htons(aborted_io_req->xid); in bnx2fc_send_rrq()
87 rrq.rrq_rx_id = htons(aborted_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_rrq()
599 rec.rec_ox_id = htons(orig_io_req->xid); in bnx2fc_send_rec()
600 rec.rec_rx_id = htons(orig_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_rec()
639 srr.srr_ox_id = htons(orig_io_req->xid); in bnx2fc_send_srr()
640 srr.srr_rx_id = htons(orig_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_srr()
/linux-4.4.14/net/sunrpc/
Daddr.c348 ((struct sockaddr_in *)sap)->sin_port = htons(port); in rpc_uaddr2sockaddr()
351 ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); in rpc_uaddr2sockaddr()
/linux-4.4.14/net/mac802154/
Drx.c35 skb->protocol = htons(ETH_P_IEEE802154); in ieee802154_deliver_skb()
233 skb->protocol = htons(ETH_P_IEEE802154); in ieee802154_monitors_rx()
/linux-4.4.14/drivers/infiniband/ulp/ipoib/
Dipoib_main.c962 if ((header->proto != htons(ETH_P_IP)) && in ipoib_start_xmit()
963 (header->proto != htons(ETH_P_IPV6)) && in ipoib_start_xmit()
964 (header->proto != htons(ETH_P_ARP)) && in ipoib_start_xmit()
965 (header->proto != htons(ETH_P_RARP)) && in ipoib_start_xmit()
966 (header->proto != htons(ETH_P_TIPC))) { in ipoib_start_xmit()
985 case htons(ETH_P_IP): in ipoib_start_xmit()
986 case htons(ETH_P_IPV6): in ipoib_start_xmit()
987 case htons(ETH_P_TIPC): in ipoib_start_xmit()
994 case htons(ETH_P_ARP): in ipoib_start_xmit()
995 case htons(ETH_P_RARP): in ipoib_start_xmit()
[all …]
/linux-4.4.14/drivers/net/ethernet/intel/i40e/
Di40e_fcoe.c237 if (eth_hdr(skb)->h_proto == htons(ETH_P_8021Q)) in i40e_fcoe_fc_frame_header()
1292 if (skb->protocol == htons(ETH_P_FCOE)) { in i40e_fcoe_tx_map()
1325 if (protocol == htons(ETH_P_8021Q)) { in i40e_fcoe_set_skb_header()
1333 if ((protocol != htons(ETH_P_FIP)) && in i40e_fcoe_set_skb_header()
1334 (protocol != htons(ETH_P_FCOE))) in i40e_fcoe_set_skb_header()
1339 if (protocol == htons(ETH_P_FIP)) in i40e_fcoe_set_skb_header()
1381 if (skb->protocol == htons(ETH_P_FIP)) in i40e_fcoe_xmit_frame()
/linux-4.4.14/arch/m32r/include/asm/
Dflat.h91 return htons(*(unsigned short *)rp) & 0xFFFF; in m32r_flat_get_addr_from_rp()
/linux-4.4.14/arch/um/drivers/
Dslip_kern.c44 return htons(ETH_P_IP); in slip_protocol()
Dslirp_kern.c49 return htons(ETH_P_IP); in slirp_protocol()
/linux-4.4.14/drivers/net/hyperv/
Dnetvsc_drv.c243 !(flow.basic.n_proto == htons(ETH_P_IP) || in netvsc_set_hash()
244 flow.basic.n_proto == htons(ETH_P_IPV6))) in netvsc_set_hash()
392 if ((eth_hdr(skb)->h_proto != htons(ETH_P_IP)) && in get_net_transport_info()
393 (eth_hdr(skb)->h_proto != htons(ETH_P_IPV6))) { in get_net_transport_info()
399 if ((eth_hdr(skb)->h_proto == htons(ETH_P_IP))) { in get_net_transport_info()
732 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), in netvsc_recv_callback()
/linux-4.4.14/net/l2tp/
Dl2tp_core.c992 *bufp++ = htons(flags); in l2tp_build_l2tpv2_header()
993 *bufp++ = htons(tunnel_id); in l2tp_build_l2tpv2_header()
994 *bufp++ = htons(session_id); in l2tp_build_l2tpv2_header()
996 *bufp++ = htons(session->ns); in l2tp_build_l2tpv2_header()
1018 *((__be16 *) bufp) = htons(flags); in l2tp_build_l2tpv3_header()
1157 uh->len = htons(udp_len); in l2tp_xmit_skb()
1391 udp_conf.local_udp_port = htons(cfg->local_udp_port); in l2tp_tunnel_sock_create()
1392 udp_conf.peer_udp_port = htons(cfg->peer_udp_port); in l2tp_tunnel_sock_create()
/linux-4.4.14/drivers/staging/wilc1000/
Dlinux_mon.c136 skb->protocol = htons(ETH_P_802_2); in WILC_WFI_monitor_rx()
275 skb2->protocol = htons(ETH_P_802_2); in WILC_WFI_mon_xmit()
/linux-4.4.14/drivers/scsi/libfc/
Dfc_exch.c308 fh->fh_ox_id = htons(ep->oxid); in fc_exch_setup_hdr()
309 fh->fh_rx_id = htons(ep->rxid); in fc_exch_setup_hdr()
311 fh->fh_seq_cnt = htons(ep->seq.cnt); in fc_exch_setup_hdr()
1044 fh->fh_rx_id = htons(FC_XID_UNKNOWN); in fc_seq_lookup_recip()
1398 ap->ba_high_seq_cnt = htons(0xffff); in fc_exch_recv_abts()
1403 ap->ba_low_seq_cnt = htons(sp->cnt); in fc_exch_recv_abts()
1485 if (fh->fh_rx_id == htons(FC_XID_UNKNOWN)) in fc_exch_recv_req()
1986 acc->reca_rx_id = htons(ep->rxid); in fc_exch_els_rec()
2156 rrq->rrq_ox_id = htons(ep->oxid); in fc_exch_rrq()
2157 rrq->rrq_rx_id = htons(ep->rxid); in fc_exch_rrq()
/linux-4.4.14/drivers/infiniband/hw/cxgb4/
Dcm.c891 mpa->private_data_size = htons(ep->plen); in send_mpa_req()
899 mpa->private_data_size = htons(ntohs(mpa->private_data_size) + in send_mpa_req()
903 mpa_v2_params.ird = htons((u16)ep->ird); in send_mpa_req()
904 mpa_v2_params.ord = htons((u16)ep->ord); in send_mpa_req()
907 mpa_v2_params.ird |= htons(MPA_V2_PEER2PEER_MODEL); in send_mpa_req()
910 htons(MPA_V2_RDMA_WRITE_RTR); in send_mpa_req()
913 htons(MPA_V2_RDMA_READ_RTR); in send_mpa_req()
985 mpa->private_data_size = htons(plen); in send_mpa_reject()
989 mpa->private_data_size = htons(ntohs(mpa->private_data_size) + in send_mpa_reject()
991 mpa_v2_params.ird = htons(((u16)ep->ird) | in send_mpa_reject()
[all …]
/linux-4.4.14/drivers/scsi/qla2xxx/
Dqla_dbg.c465 *buf++ = htons(RD_REG_WORD(dmp_reg++)); in qla2xxx_read_window()
720 fw->hccr = htons(RD_REG_WORD(&reg->hccr)); in qla2300_fw_dump()
741 fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2300_fw_dump()
745 fw->risc_host_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2300_fw_dump()
749 fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2300_fw_dump()
760 fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2300_fw_dump()
890 fw->hccr = htons(RD_REG_WORD(&reg->hccr)); in qla2100_fw_dump()
904 fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2100_fw_dump()
911 fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2100_fw_dump()
916 fw->dma_reg[cnt] = htons(RD_REG_WORD(dmp_reg++)); in qla2100_fw_dump()
[all …]
/linux-4.4.14/drivers/net/bonding/
Dbond_3ad.c726 lacpdu->actor_system_priority = htons(port->actor_system_priority); in __update_lacpdu_from_port()
728 lacpdu->actor_key = htons(port->actor_oper_port_key); in __update_lacpdu_from_port()
729 lacpdu->actor_port_priority = htons(port->actor_port_priority); in __update_lacpdu_from_port()
730 lacpdu->actor_port = htons(port->actor_port_number); in __update_lacpdu_from_port()
740 lacpdu->partner_system_priority = htons(partner->system_priority); in __update_lacpdu_from_port()
742 lacpdu->partner_key = htons(partner->key); in __update_lacpdu_from_port()
743 lacpdu->partner_port_priority = htons(partner->port_priority); in __update_lacpdu_from_port()
744 lacpdu->partner_port = htons(partner->port_number); in __update_lacpdu_from_port()
1755 .collector_max_delay = htons(AD_COLLECTOR_MAX_DELAY), in ad_initialize_port()
/linux-4.4.14/arch/x86/lib/
Dcsum-wrappers_64.c142 rest = (__force __u64)htonl(len) + (__force __u64)htons(proto) + in csum_ipv6_magic()
/linux-4.4.14/drivers/media/dvb-core/
Ddvb_net.c166 return htons(ETH_P_802_3); in dvb_net_eth_type_trans()
171 return htons(ETH_P_802_2); in dvb_net_eth_type_trans()
576 __be16 ulen = htons(priv->ule_sndu_len); in dvb_net_ule()
577 __be16 utype = htons(priv->ule_sndu_type); in dvb_net_ule()
588 ulen |= htons(0x8000); in dvb_net_ule()
717 ethh->h_proto = htons(priv->ule_sndu_type); in dvb_net_ule()

1234