| /xnu-8020.101.4/osfmk/i386/ |
| H A D | endian.h | 52 #if !defined(ntohs) 53 static __inline__ unsigned short ntohs(unsigned short); 56 ntohs(unsigned short w_int) in ntohs() function 64 #define htons ntohs 89 #define NTOHS(x) (x) = ntohs((unsigned short)x)
|
| /xnu-8020.101.4/bsd/dev/dtrace/scripts/ |
| H A D | ip.d | 53 dport = (P != NULL) ? ntohs(P->inp_fport) : 0; 54 sport = (P != NULL) ? ntohs(P->inp_lport) : 0; 81 (ntohs(ip->ip_len) - (((*(uint8_t *) ip) & 0x0f) << 2)) : 0; 89 ip_plength = (ip6 != NULL) ? (ntohs(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen)) : 0; 103 ntohs(((struct ip *)i)->ip_len) - 106 ntohs(((struct ip6_hdr *)i)->ip6_ctlun.ip6_un1.ip6_un1_plen) : 0)) : 0; 162 ipv4_length = (ip != NULL) ? ntohs(ip->ip_len) : 0; 164 ipv4_flags = (ip != NULL) ? (ntohs(ip->ip_off) & 0xe000) : 0; 165 ipv4_offset = (ip != NULL) ? (ntohs(ip->ip_off) & 0x1fff) : 0; 178 ipv4_checksum = (ip != NULL) ? ntohs(ip->ip_sum) : 0; [all …]
|
| H A D | tcp.d | 131 tcp_sport = ntohs(T->th_sport); 132 tcp_dport = ntohs(T->th_dport); 137 tcp_window = ntohs(T->th_win); 138 tcp_checksum = ntohs(T->th_sum); 139 tcp_urgent = ntohs(T->th_urp);
|
| /xnu-8020.101.4/bsd/sys/ |
| H A D | _endian.h | 102 __uint16_t ntohs(__uint16_t); 111 #define ntohs(x) ((__uint16_t)(x)) 133 #define ntohs(x) __DARWIN_OSSwapInt16(x) 139 #define ntohs(x) ((__uint16_t)__builtin_bswap16((__uint16_t)(x))) 157 #define NTOHS(x) (x) = ntohs((__uint16_t)x)
|
| /xnu-8020.101.4/bsd/net/ |
| H A D | restricted_in_port.c | 434 ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid); in current_task_can_use_restricted_in_port() 452 if (rpe->rpe_port != ntohs(port)) { in current_task_can_use_restricted_in_port() 468 ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid); in current_task_can_use_restricted_in_port() 480 ntohs(port), protocol, port_flag_str(port_flags)); in current_task_can_use_restricted_in_port() 486 … ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid, rpe->rpe_entitlement); in current_task_can_use_restricted_in_port() 491 ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid); in current_task_can_use_restricted_in_port() 496 ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid); in current_task_can_use_restricted_in_port() 502 ntohs(port), protocol, port_flag_str(port_flags), proc_best_name(p), pid); in current_task_can_use_restricted_in_port()
|
| H A D | nat464_utils.c | 358 mtu = ntohs(icmp4->icmp_nextmtu); in nat464_translate_icmp() 531 __func__, ntohs(ip4->ip_len), ip4->ip_p, ntohs(ip4->ip_sum), in nat464_translate_icmp_ip() 558 __func__, ntohs(ip6->ip6_plen), ip6->ip6_nxt, in nat464_translate_icmp_ip() 616 p_ip6h->ip6_plen = htons(ntohs(p_ip6h->ip6_plen) + in nat464_insert_frag46() 658 ip_frag_off = (ntohs(frag6.ip6f_offlg & IP6F_OFF_MASK)) >> 3; in nat464_translate_64() 707 ntohs(ip4->ip_len), ip4->ip_p, ntohs(ip4->ip_sum), in nat464_translate_64() 757 ntohs(ip6->ip6_plen), ip6->ip6_nxt, in nat464_translate_46() 803 plen = ntohs(iph->ip_len) - hlen; in nat464_translate_proto() 804 tot_len = ntohs(iph->ip_len); in nat464_translate_proto() 813 plen = ntohs(ip6h->ip6_plen); in nat464_translate_proto() [all …]
|
| H A D | pf_norm.c | 324 ntohs(frag->fr_id), in pf_purge_expired_fragments() 348 ntohs(frag->fr_id), in pf_purge_expired_fragments() 500 #define FR_IP_OFF(fr) ((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3) 510 u_int16_t off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; in pf_reassemble() 511 u_int16_t ip_len = ntohs(ip->ip_len) - ip->ip_hl * 4; in pf_reassemble() 534 int32_t trailer = (m_pktlen(m) - ntohs(ip->ip_len)); in pf_reassemble() 640 FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - frep->fr_ip->ip_hl * in pf_reassemble() 644 precut = FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - in pf_reassemble() 652 ip->ip_off = htons(ntohs(ip->ip_off) + (precut >> 3)); in pf_reassemble() 653 off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; in pf_reassemble() [all …]
|
| H A D | sixxlowpan.c | 626 printf("source/remote ports %u/%u\n", ntohs(udp->uh_sport), ntohs(udp->uh_dport)); in compress_hdr_hc1() 627 if (ntohs(udp->uh_sport) >= SICSLOWPAN_UDP_PORT_MIN && in compress_hdr_hc1() 628 ntohs(udp->uh_sport) < SICSLOWPAN_UDP_PORT_MAX && in compress_hdr_hc1() 629 ntohs(udp->uh_dport) >= SICSLOWPAN_UDP_PORT_MIN && in compress_hdr_hc1() 630 ntohs(udp->uh_dport) < SICSLOWPAN_UDP_PORT_MAX) { in compress_hdr_hc1() 639 (uint8_t)((ntohs(udp->uh_sport) - SICSLOWPAN_UDP_PORT_MIN) << 4) + in compress_hdr_hc1() 640 (uint8_t)((ntohs(udp->uh_dport) - SICSLOWPAN_UDP_PORT_MIN)); in compress_hdr_hc1()
|
| H A D | if_ports_used.c | 189 #define NPE_HASH_VAL(_lport) (ntohs(_lport) & NPE_HASH_MASK) 386 ntohs(npi->npi_local_port), in net_port_info_add_entry() 400 ntohs(npi->npi_local_port), in net_port_info_add_entry() 428 ntohs(npi->npi_local_port), in net_port_info_add_entry() 440 ntohs(npi->npi_local_port), in net_port_info_add_entry() 915 lbuf, ntohs(npi->npi_local_port), in net_port_info_log_npi() 916 fbuf, ntohs(npi->npi_foreign_port), in net_port_info_log_npi() 1249 if ((ntohs(iphdr.ip_off) & ~(IP_DF | IP_RF)) && in if_ports_used_match_mbuf() 1250 (ntohs(iphdr.ip_off) & IP_OFFMASK) != 0) { in if_ports_used_match_mbuf() 1296 if (ntohs(uh.uh_dport) == PORT_ISAKMP_NATT || in if_ports_used_match_mbuf() [all …]
|
| H A D | restricted_in_port.h | 47 #define IS_RESTRICTED_IN_PORT(x) (bitmap_test(restricted_port_bitmap, ntohs((uint16_t)(x))))
|
| H A D | pf_osfp.c | 136 fp.fp_psize = ntohs(ip->ip_len); in pf_osfp_fingerprint_hdr() 145 fp.fp_psize = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); in pf_osfp_fingerprint_hdr() 154 fp.fp_wsize = ntohs(tcp->th_win); in pf_osfp_fingerprint_hdr() 222 srcname, ntohs(tcp->th_sport), in pf_osfp_fingerprint_hdr()
|
| H A D | ether_if_module.c | 418 ntohs(evl->evl_proto) == ETHERTYPE_VLAN || in ether_demux() 419 EVL_VLANOFTAG(ntohs(evl->evl_tag)) != 0) { in ether_demux() 442 if (ntohs(ether_type) <= 1500) { in ether_demux()
|
| H A D | ether_inet_pr_module.c | 128 if (ntohs(ea->arp_hrd) != ARPHRD_ETHER || in ether_inet_arp_input() 129 ntohs(ea->arp_pro) != ETHERTYPE_IP || in ether_inet_arp_input() 159 arp_ip_handle_input(ifp, ntohs(ea->arp_op), &sender_hw, &sender_ip, in ether_inet_arp_input()
|
| /xnu-8020.101.4/bsd/netinet6/ |
| H A D | esp_input.c | 165 ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - stripsiz); in esp6_input_strip_udp_encap() 198 ntohs(th.th_sport), ntohs(th.th_dport), in esp_input_log() 410 ip->ip_len = htons(ntohs(ip->ip_len) - siz); in esp4_input_extended() 520 ip->ip_len = htons(ntohs(ip->ip_len) - taillen); in esp4_input_extended() 544 ntohs(encap_uh->uh_sport) != sav->remote_ike_port) { in esp4_input_extended() 545 sav->remote_ike_port = ntohs(encap_uh->uh_sport); in esp4_input_extended() 590 sum = ~ntohs(ip->ip_sum) & 0xffff; in esp4_input_extended() 747 ip->ip_len = htons(ntohs(ip->ip_len) - stripsiz); in esp4_input_extended() 954 if (ntohs(ip6->ip6_plen) == 0) { in esp6_input_extended() 980 ntohs(ip6->ip6_src.__u6_addr.__u6_addr16[0]), ntohs(ip6->ip6_src.__u6_addr.__u6_addr16[1]), in esp6_input_extended() [all …]
|
| H A D | mld6.h | 82 #define MLD_MRC_EXP(x) ((ntohs((x)) >> 12) & 0x0007) 83 #define MLD_MRC_MANT(x) (ntohs((x)) & 0x0fff)
|
| H A D | esp_output.c | 548 if (esphlen < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output() 549 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)esphlen); in esp_output() 738 if (extendsiz < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output() 739 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)extendsiz); in esp_output() 870 if (siz < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output() 871 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)siz); in esp_output() 894 udp->uh_ulen = htons((u_int16_t)(ntohs(ip->ip_len) - (IP_VHL_HL(ip->ip_vhl) << 2))); in esp_output() 900 udp->uh_sum = in6_pseudo(&ip6->ip6_src, &ip6->ip6_dst, htonl(ntohs(udp->uh_ulen) + IPPROTO_UDP)); in esp_output() 914 ntohs(th.th_sport), ntohs(th.th_dport), in esp_output()
|
| H A D | udp6_usrreq.c | 272 plen = ntohs(ip6->ip6_plen) - off + sizeof(*ip6); in udp6_input() 274 ulen = ntohs((u_short)uh->uh_ulen); in udp6_input() 505 (uh->uh_dport == ntohs((u_short)esp_udp_encap_port) || in udp6_input() 506 uh->uh_sport == ntohs((u_short)esp_udp_encap_port))) { in udp6_input() 514 if (uh->uh_dport != ntohs((u_short)esp_udp_encap_port)) { in udp6_input() 569 ntohs(uh->uh_dport), in udp6_input() 571 ntohs(uh->uh_sport)); in udp6_input() 576 ntohs(uh->uh_dport), in udp6_input() 578 ntohs(uh->uh_sport)); in udp6_input()
|
| H A D | ah_input.c | 306 ip->ip_len = ntohs(ip->ip_len) - hlen; in ah4_input() 307 ip->ip_off = ntohs(ip->ip_off); in ah4_input() 401 sum = ~ntohs(ip->ip_sum) & 0xffff; in ah4_input() 510 ip->ip_len = htons(ntohs(ip->ip_len) - stripsiz); in ah4_input() 613 if (ntohs(ip6->ip6_plen) == 0) { in ah6_input() 901 ip6->ip6_plen = htons((u_int16_t)(ntohs(ip6->ip6_plen) - stripsiz)); in ah6_input()
|
| /xnu-8020.101.4/bsd/skywalk/nexus/flowswitch/flow/ |
| H A D | flow_classifier.c | 211 l3tlen = ntohs(iph->ip_len); in flow_pkt_classify() 233 if (__improbable(ntohs(iph->ip_off) & ~(IP_DF | IP_RF))) { in flow_pkt_classify() 237 if ((ntohs(iph->ip_off) & IP_OFFMASK) != 0) { in flow_pkt_classify() 250 l3tlen = l3hlen + ntohs(ip6->ip6_plen); in flow_pkt_classify() 374 pkt->pkt_flow_ip_proto, ntohs(pkt->pkt_flow_tcp_src), in flow_pkt_classify() 375 ntohs(pkt->pkt_flow_tcp_dst)); in flow_pkt_classify()
|
| H A D | flow_agg.c | 617 start - spkt->pkt_flow_tcp_hlen, l4len, ntohs(csum)); in copy_pkt_csum_packed() 999 if ((ntohs(siph->ip_off) & (IP_DF | IP_RF)) != in can_agg_slowpath() 1000 (ntohs(iph->ip_off) & (IP_DF | IP_RF))) { in can_agg_slowpath() 1003 ntohs(siph->ip_off), uint16_t, ntohs(iph->ip_off)); in can_agg_slowpath() 1018 sl3tlen = ntohs(siph->ip_len); in can_agg_slowpath() 1058 sl3tlen = (sizeof(struct ip6_hdr) + ntohs(sip6->ip6_plen)); in can_agg_slowpath() 1074 uint32_t, ntohl(tcp->th_ack), uint16_t, ntohs(stcp->th_win), in can_agg_slowpath() 1075 uint16_t, ntohs(tcp->th_win)); in can_agg_slowpath() 1236 old_l3len = ntohs(siph->ip_len); in flow_agg_merge_hdr() 1237 uint16_t l3tlen = ntohs(siph->ip_len) + pkt->pkt_flow_ulen; in flow_agg_merge_hdr() [all …]
|
| /xnu-8020.101.4/tests/ |
| H A D | net_bridge.c | 782 arphrd = ntohs(arp_p->ar_hrd); in arp_frame_validate() 783 T_LOG("%s type=0x%x proto=0x%x", arpop_name(ntohs(arp_p->ar_op)), in arp_frame_validate() 784 arphrd, ntohs(arp_p->ar_pro)); in arp_frame_validate() 815 ip_len = ntohs(ip_udp->ip.ip_len); in ip_frame_validate() 823 ntohs(ip_udp->ip.ip_id)); in ip_frame_validate() 838 udp_len = ntohs(ip_udp->udp.uh_ulen); in ip_frame_validate() 845 ntohs(ip_udp->udp.uh_sport), in ip_frame_validate() 846 ntohs(ip_udp->udp.uh_dport), in ip_frame_validate() 848 ntohs(ip_udp->udp.uh_sum), in ip_frame_validate() 865 ip6_len = ntohs(ip6->ip6_plen); in ip6_frame_validate() [all …]
|
| /xnu-8020.101.4/osfmk/kdp/ |
| H A D | kdp_udp.h | 62 #define ntohs(x) OSSwapBigToHostInt16(x) macro
|
| /xnu-8020.101.4/bsd/net/classq/ |
| H A D | classq_util.c | 184 sum = ~ntohs(ip->ip_sum) & 0xffff; in write_dsfield() 276 sum = ~ntohs(ip->ip_sum) & 0xffff; in mark_ecn()
|
| /xnu-8020.101.4/bsd/skywalk/nexus/flowswitch/ |
| H A D | fsw_ip_frag.c | 294 offflag = ntohs(ip4->ip_off); in fsw_ip_frag_reass_v4() 296 fragpartlen = ntohs(ip4->ip_len) - (uint16_t)(ip4->ip_hl << 2); in fsw_ip_frag_reass_v4() 309 p->pkt_flow_ulen = ntohs(iph->ip_len) - in fsw_ip_frag_reass_v4() 358 fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK); in fsw_ip_frag_reass_v6() 359 fragpartlen = ntohs(ip6->ip6_plen) - in fsw_ip_frag_reass_v6() 387 p->pkt_flow_ulen = ntohs(ip6h->ip6_plen) - in fsw_ip_frag_reass_v6()
|
| /xnu-8020.101.4/bsd/netinet/ |
| H A D | tcp_log.h | 107 if (ntohs(tp->t_inpcb->inp_lport) != tcp_log_port && in tcp_is_log_enabled() 108 ntohs(tp->t_inpcb->inp_fport) != tcp_log_port) { in tcp_is_log_enabled()
|