Home
last modified time | relevance | path

Searched refs:ntohs (Results 1 – 25 of 109) sorted by relevance

12345

/xnu-10063.101.15/osfmk/i386/
H A Dendian.h52 #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-10063.101.15/bsd/dev/dtrace/scripts/
H A Dip.d53 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 Dtcp.d131 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-10063.101.15/bsd/sys/
H A D_endian.h103 __uint16_t ntohs(__uint16_t);
112 #define ntohs(x) ((__uint16_t)(x))
134 #define ntohs(x) __DARWIN_OSSwapInt16(x)
140 #define ntohs(x) ((__uint16_t)__builtin_bswap16((__uint16_t)(x)))
158 #define NTOHS(x) (x) = ntohs((__uint16_t)x)
/xnu-10063.101.15/tests/
H A Dudp_disconnect.c200 l_addr_str, ntohs(sin_local.sin_port), in udp_disconnect_v4()
201 f_addr_str, ntohs(sin_peer.sin_port)); in udp_disconnect_v4()
227 T_LOG("listening on port: %u", ntohs(sin.sin_port)); in udp_connect_v4()
231 sin_to->sin_len, sin_to->sin_family, ntohs(sin_to->sin_port), ntohl(sin_to->sin_addr.s_addr)); in udp_connect_v4()
244 l_addr_str, ntohs(sin_local.sin_port), in udp_connect_v4()
245 f_addr_str, ntohs(sin_peer.sin_port)); in udp_connect_v4()
290 l_addr_str, ntohs(sin6_local.sin6_port), in udp_disconnect_v6()
291 f_addr_str, ntohs(sin6_peer.sin6_port)); in udp_disconnect_v6()
320 T_LOG("listening on port: %u", ntohs(sin6.sin6_port)); in udp_connect_v6()
325 sin6_to->sin6_len, sin6_to->sin6_family, ntohs(sin6_to->sin6_port), l_addr_str); in udp_connect_v6()
[all …]
H A Dtcp_send_implied_connect.c85 T_LOG("listening on port: %u", ntohs(sin.sin_port)); in tcp_send_implied_connect_v4()
93 …sin_to->sin_len, sin_to->sin_family, ntohs(sin_to->sin_port), ntohl(sin_to->sin_addr.s_addr), expe… in tcp_send_implied_connect_v4()
132 l_addr_str, ntohs(sin_local.sin_port), in tcp_send_implied_connect_v4()
133 f_addr_str, ntohs(sin_peer.sin_port)); in tcp_send_implied_connect_v4()
169 T_LOG("listening on port: %u", ntohs(sin6.sin6_port)); in tcp_send_implied_connect_v6()
193 … sin6_to->sin6_len, sin6_to->sin6_family, ntohs(sin6_to->sin6_port), l_addr_str, expected_error); in tcp_send_implied_connect_v6()
213 l_addr_str, ntohs(sin6_local.sin6_port), in tcp_send_implied_connect_v6()
214 f_addr_str, ntohs(sin6_peer.sin6_port)); in tcp_send_implied_connect_v6()
H A Dtcp_bind_connect.c85 T_LOG("listening on port: %u", ntohs(sin.sin_port)); in tcp_connect_v4()
93 …sin_to->sin_len, sin_to->sin_family, ntohs(sin_to->sin_port), ntohl(sin_to->sin_addr.s_addr), expe… in tcp_connect_v4()
107 l_addr_str, ntohs(sin_local.sin_port), in tcp_connect_v4()
108 f_addr_str, ntohs(sin_peer.sin_port)); in tcp_connect_v4()
141 T_LOG("listening on port: %u", ntohs(sin6.sin6_port)); in tcp_connect_v6()
150 … sin6_to->sin6_len, sin6_to->sin6_family, ntohs(sin6_to->sin6_port), l_addr_str, expected_error); in tcp_connect_v6()
164 l_addr_str, ntohs(sin6_local.sin6_port), in tcp_connect_v6()
165 f_addr_str, ntohs(sin6_peer.sin6_port)); in tcp_connect_v6()
H A Dudp_bind_connect.c194 T_LOG("listening on port: %u", ntohs(sin.sin_port)); in udp_connect_v4()
198 …sin_to->sin_len, sin_to->sin_family, ntohs(sin_to->sin_port), ntohl(sin_to->sin_addr.s_addr), expe… in udp_connect_v4()
212 l_addr_str, ntohs(sin_local.sin_port), in udp_connect_v4()
213 f_addr_str, ntohs(sin_peer.sin_port)); in udp_connect_v4()
243 T_LOG("listening on port: %u", ntohs(sin6.sin6_port)); in udp_connect_v6()
248 … sin6_to->sin6_len, sin6_to->sin6_family, ntohs(sin6_to->sin6_port), l_addr_str, expected_error); in udp_connect_v6()
262 l_addr_str, ntohs(sin6_local.sin6_port), in udp_connect_v6()
263 f_addr_str, ntohs(sin6_peer.sin6_port)); in udp_connect_v6()
H A Dnet_bridge.c686 arphrd = ntohs(arp_p->ar_hrd); in arp_frame_validate()
687 T_LOG("%s type=0x%x proto=0x%x", arpop_name(ntohs(arp_p->ar_op)), in arp_frame_validate()
688 arphrd, ntohs(arp_p->ar_pro)); in arp_frame_validate()
719 ip_len = ntohs(ip_udp->ip.ip_len); in ip_frame_validate()
727 ntohs(ip_udp->ip.ip_id)); in ip_frame_validate()
742 udp_len = ntohs(ip_udp->udp.uh_ulen); in ip_frame_validate()
749 ntohs(ip_udp->udp.uh_sport), in ip_frame_validate()
750 ntohs(ip_udp->udp.uh_dport), in ip_frame_validate()
752 ntohs(ip_udp->udp.uh_sum), in ip_frame_validate()
769 ip6_len = ntohs(ip6->ip6_plen); in ip6_frame_validate()
[all …]
/xnu-10063.101.15/bsd/net/
H A Drestricted_in_port.c434 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()
486ntohs(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 Dnat464_utils.c358 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 Dpf_norm.c324 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 Dif_ports_used.c203 #define NPE_HASH_VAL(_lport) (ntohs(_lport) & NPE_HASH_MASK)
408 ntohs(npi->npi_local_port), in net_port_info_add_entry()
422 ntohs(npi->npi_local_port), in net_port_info_add_entry()
450 ntohs(npi->npi_local_port), in net_port_info_add_entry()
462 ntohs(npi->npi_local_port), in net_port_info_add_entry()
937 lbuf, ntohs(npi->npi_local_port), in net_port_info_log_npi()
938 fbuf, ntohs(npi->npi_foreign_port), in net_port_info_log_npi()
1119 lbuf, ntohs(ev->una_wake_pkt_local_port), in net_port_info_log_una_wake_event()
1120 fbuf, ntohs(ev->una_wake_pkt_foreign_port), in net_port_info_log_una_wake_event()
1147 lbuf, ntohs(ev->wake_pkt_port), in net_port_info_log_wake_event()
[all …]
H A Drestricted_in_port.h47 #define IS_RESTRICTED_IN_PORT(x) (bitmap_test(restricted_port_bitmap, ntohs((uint16_t)(x))))
/xnu-10063.101.15/bsd/netinet6/
H A Desp_input.c169 ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - stripsiz); in esp6_input_strip_udp_encap()
202 ntohs(th.th_sport), ntohs(th.th_dport), in esp_input_log()
423 ip->ip_len = htons(ntohs(ip->ip_len) - siz); in esp4_input_extended()
534 ip->ip_len = htons(ntohs(ip->ip_len) - taillen); in esp4_input_extended()
558 ntohs(encap_uh->uh_sport) != sav->remote_ike_port) { in esp4_input_extended()
559 sav->remote_ike_port = ntohs(encap_uh->uh_sport); in esp4_input_extended()
604 sum = ~ntohs(ip->ip_sum) & 0xffff; in esp4_input_extended()
760 ip->ip_len = htons(ntohs(ip->ip_len) - stripsiz); in esp4_input_extended()
963 if (__improbable(ntohs(ip6->ip6_plen) == 0)) { in esp6_input_extended()
990 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 Desp_output.c552 if (esphlen < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output()
553 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)esphlen); in esp_output()
742 if (extendsiz < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output()
743 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)extendsiz); in esp_output()
874 if (siz < (IP_MAXPACKET - ntohs(ip->ip_len))) { in esp_output()
875 ip->ip_len = htons(ntohs(ip->ip_len) + (u_short)siz); in esp_output()
898 udp->uh_ulen = htons((u_int16_t)(ntohs(ip->ip_len) - (IP_VHL_HL(ip->ip_vhl) << 2))); in esp_output()
904 udp->uh_sum = in6_pseudo(&ip6->ip6_src, &ip6->ip6_dst, htonl(ntohs(udp->uh_ulen) + IPPROTO_UDP)); in esp_output()
918 ntohs(th.th_sport), ntohs(th.th_dport), in esp_output()
1151 if (__probable(ntohs(ip->ip_len) + add_ip_len <= IP_MAXPACKET)) { in esp_kpipe_output()
[all …]
H A Dmld6.h82 #define MLD_MRC_EXP(x) ((ntohs((x)) >> 12) & 0x0007)
83 #define MLD_MRC_MANT(x) (ntohs((x)) & 0x0fff)
H A Dudp6_usrreq.c279 plen = ntohs(ip6->ip6_plen) - off + sizeof(*ip6); in udp6_input()
281 ulen = ntohs((u_short)uh->uh_ulen); in udp6_input()
516 (uh->uh_dport == ntohs((u_short)esp_udp_encap_port) || in udp6_input()
517 uh->uh_sport == ntohs((u_short)esp_udp_encap_port))) { in udp6_input()
525 if (uh->uh_dport != ntohs((u_short)esp_udp_encap_port)) { in udp6_input()
580 ntohs(uh->uh_dport), in udp6_input()
582 ntohs(uh->uh_sport)); in udp6_input()
587 ntohs(uh->uh_dport), in udp6_input()
589 ntohs(uh->uh_sport)); in udp6_input()
H A Dah_input.c306 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-10063.101.15/bsd/netinet/
H A Dudp_log.c122 laddr_buf, ntohs(local_port), faddr_buf, ntohs(foreign_port), \
178 if (ntohs(inp->inp_lport) == udp_log_local_port_included || in udp_log_port_allowed()
179 ntohs(inp->inp_fport) == udp_log_remote_port_included) { in udp_log_port_allowed()
187 if (ntohs(inp->inp_lport) == udp_log_local_port_excluded || in udp_log_port_allowed()
188 ntohs(inp->inp_fport) == udp_log_remote_port_excluded) { in udp_log_port_allowed()
H A Dtcp_ccdbg.c103 dbg_state.ccd_srcport = ntohs(inp->inp_lport); in tcp_ccdbg_trace()
109 dbg_state.ccd_destport = ntohs(inp->inp_fport); in tcp_ccdbg_trace()
/xnu-10063.101.15/bsd/skywalk/nexus/flowswitch/flow/
H A Dflow_classifier.c212 l3tlen = ntohs(iph->ip_len); in flow_pkt_classify()
234 if (__improbable(ntohs(iph->ip_off) & ~(IP_DF | IP_RF))) { in flow_pkt_classify()
238 if ((ntohs(iph->ip_off) & IP_OFFMASK) != 0) { in flow_pkt_classify()
251 l3tlen = l3hlen + ntohs(ip6->ip6_plen); in flow_pkt_classify()
375 pkt->pkt_flow_ip_proto, ntohs(pkt->pkt_flow_tcp_src), in flow_pkt_classify()
376 ntohs(pkt->pkt_flow_tcp_dst)); in flow_pkt_classify()
H A Dflow_agg.c643 start - spkt->pkt_flow_tcp_hlen, l4len, ntohs(csum)); in copy_pkt_csum_packed()
1047 if ((ntohs(siph->ip_off) & (IP_DF | IP_RF)) != in can_agg_slowpath()
1048 (ntohs(iph->ip_off) & (IP_DF | IP_RF))) { in can_agg_slowpath()
1051 ntohs(siph->ip_off), uint16_t, ntohs(iph->ip_off)); in can_agg_slowpath()
1066 sl3tlen = ntohs(siph->ip_len); in can_agg_slowpath()
1106 sl3tlen = (sizeof(struct ip6_hdr) + ntohs(sip6->ip6_plen)); in can_agg_slowpath()
1122 uint32_t, ntohl(tcp->th_ack), uint16_t, ntohs(stcp->th_win), in can_agg_slowpath()
1123 uint16_t, ntohs(tcp->th_win)); in can_agg_slowpath()
1319 old_l3len = ntohs(siph->ip_len); in flow_agg_merge_hdr()
1320 uint16_t l3tlen = ntohs(siph->ip_len) + pkt->pkt_flow_ulen; in flow_agg_merge_hdr()
[all …]
/xnu-10063.101.15/osfmk/kdp/
H A Dkdp_udp.h62 #define ntohs(x) OSSwapBigToHostInt16(x) macro
/xnu-10063.101.15/bsd/net/classq/
H A Dclassq_util.c184 sum = ~ntohs(ip->ip_sum) & 0xffff; in write_dsfield()
276 sum = ~ntohs(ip->ip_sum) & 0xffff; in mark_ecn()

12345