Home
last modified time | relevance | path

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

12

/packages/modules/Connectivity/clatd/
Ddump.c46 frag_flags = ntohs(header->frag_off); in dump_ip()
52 printf("tot_len = %x\n", ntohs(header->tot_len)); in dump_ip()
53 printf("id = %x\n", ntohs(header->id)); in dump_ip()
67 printf("checksum = %x\n", ntohs(header->check)); in dump_ip()
82 printf("payload len = %x\n", ntohs(header->ip6_plen)); in dump_ip6()
107 printf("icmp.checksum = %x\n", ntohs(icmp->checksum)); in dump_icmp()
109 printf("icmp.un.echo.id = %x\n", ntohs(icmp->un.echo.id)); in dump_icmp()
110 printf("icmp.un.echo.sequence = %x\n", ntohs(icmp->un.echo.sequence)); in dump_icmp()
144 printf("source = %x\n", ntohs(udp->source)); in dump_udp_generic()
145 printf("dest = %x\n", ntohs(udp->dest)); in dump_udp_generic()
[all …]
Dclatd_test.cpp189 return ntohs(ip->frag_off) & (IP_OFFMASK | IP_MF); in is_ipv4_fragment()
202 return ntohs(ip->frag_off) & IP_OFFMASK; in ipv4_fragment_offset()
206 return ntohs((frag->ip6f_offlg & IP6F_OFF_MASK) >> 3); in ipv6_fragment_offset()
220 EXPECT_EQ(len, ntohs(ip->tot_len)) << msg << ": Incorrect IPv4 length\n"; in check_packet()
289 EXPECT_EQ(payload_length, ntohs(udp->len)) << msg << ": Incorrect UDP length\n"; in check_packet()
411 pseudo_checksum = ipv4_pseudo_header_checksum(ip, ntohs(udp->len)); in fix_udp_checksum()
417 pseudo_checksum = ipv6_pseudo_header_checksum(ip6, ntohs(udp->len), IPPROTO_UDP); in fix_udp_checksum()
426 udp->check = ip_checksum_finish(ip_checksum_add(pseudo_checksum, udp, ntohs(udp->len))); in fix_udp_checksum()
Dtranslate.c181 uint16_t frag_flags = ntohs(old_header->frag_off); in maybe_fill_frag_header()
195 frag_hdr->ip6f_ident = htonl(ntohs(old_header->id)); in maybe_fill_frag_header()
209 uint16_t frag_off = (ntohs(frag_hdr->ip6f_offlg & IP6F_OFF_MASK) >> 3); in parse_frag_header()
Dipv6.c175 ip_targ->tot_len = htons(ntohs(ip_targ->tot_len) + packet_length(out, pos)); in ipv6_packet()
Dclatd.c183 uint16_t proto = ntohs(buf.pi.proto); in process_packet_4_to_6()
/packages/modules/Connectivity/tests/native/connectivity_native_test/
Dconnectivity_native_test.cpp101 blockedPort = ntohs(port); in runSocketTest()
152 EXPECT_NE(0, ntohs(sin.sin_port)); in openSocket()
153 if (*port != 0) EXPECT_EQ(*port, ntohs(sin.sin_port)); in openSocket()
154 *port = ntohs(sin.sin_port); in openSocket()
159 EXPECT_NE(0, ntohs(sin.sin6_port)); in openSocket()
160 if (*port != 0) EXPECT_EQ(*port, ntohs(sin.sin6_port)); in openSocket()
161 *port = ntohs(sin.sin6_port); in openSocket()
/packages/modules/DnsResolver/
Dres_query.cpp168 if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { in res_nquery()
170 << "), counts = an:" << ntohs(hp->ancount) << " ns:" << ntohs(hp->nscount) in res_nquery()
171 << " ar:" << ntohs(hp->arcount); in res_nquery()
Dgethnamaddr.cpp151 ancount = ntohs(hp->ancount); in getanswer()
152 qdcount = ntohs(hp->qdcount); in getanswer()
187 int type = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
189 int cl = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
191 n = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
Dres_send.cpp367 int qdcount = ntohs(((const HEADER*)(const void*)msg)->qdcount); in res_nameinquery()
375 int ttype = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in res_nameinquery()
377 int tclass = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in res_nameinquery()
398 int qdcount = ntohs(((const HEADER*) (const void*) buf1)->qdcount); in res_queriesmatch()
410 if (qdcount != ntohs(((const HEADER*) (const void*) buf2)->qdcount)) return (0); in res_queriesmatch()
417 int ttype = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in res_queriesmatch()
419 int tclass = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in res_queriesmatch()
845 uint16_t resplen = ntohs(*reinterpret_cast<const uint16_t*>(ans.data())); in send_vc()
Dgetaddrinfo.cpp855 ancount = ntohs(hp->ancount); in getanswer()
856 qdcount = ntohs(hp->qdcount); in getanswer()
896 type = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
898 int cl = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
900 n = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
1641 if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { in doQuery()
1654 LOG(INFO) << __func__ << ": rcode=" << rcode << ", ancount=" << ntohs(hp->ancount) in doQuery()
1659 .ancount = ntohs(hp->ancount), in doQuery()
Dres_mkquery.cpp241 hp->arcount = htons(ntohs(hp->arcount) + 1); in res_nopt()
/packages/modules/Connectivity/bpf_progs/
Dclatd.c96 if (ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr)) return TC_ACT_PIPE; in nat64()
116 __u16 tot_len = ntohs(ip6->payload_len) + sizeof(struct iphdr); // cannot overflow, see above in nat64()
133 frag_off = ntohs(frag->frag_off); in nat64()
334 if (ntohs(ip4->tot_len) < sizeof(*ip4)) return TC_ACT_PIPE;
379 .payload_len = htons(ntohs(ip4->tot_len) - 20), // __be16
DdscpPolicy.c109 dport = ntohs(udp->dest); in DEFINE_BPF_MAP_GRW()
116 dport = ntohs(tcp->dest); in DEFINE_BPF_MAP_GRW()
Doffload.c287 bpf_csum_update(skb, 0xFFFF - ntohs(old_hl) + ntohs(new_hl));
606 if (ntohs(ip->tot_len) < sizeof(*ip)) TC_PUNT(TRUNCATED_IPV4); in do_forward4()
Doffload@mainline.c287 bpf_csum_update(skb, 0xFFFF - ntohs(old_hl) + ntohs(new_hl));
606 if (ntohs(ip->tot_len) < sizeof(*ip)) TC_PUNT(TRUNCATED_IPV4); in do_forward4()
Dbpf_net_helpers.h76 #define ntohs(x) htons(x) macro
/packages/modules/Connectivity/service-t/native/libs/libnetworkstats/
DNetworkTraceHandler.cpp94 localPort = ntohs(pkt.egress ? pkt.sport : pkt.dport); in BundleKey()
95 remotePort = ntohs(pkt.egress ? pkt.dport : pkt.sport); in BundleKey()
99 icmpType = ntohs(pkt.sport); in BundleKey()
100 icmpCode = ntohs(pkt.dport); in BundleKey()
/packages/modules/DnsResolver/tests/dns_responder/
Ddns_responder.cpp262 qtype = ntohs(*reinterpret_cast<const uint16_t*>(cur)); in read()
263 qclass = ntohs(*reinterpret_cast<const uint16_t*>(cur + sizeof(uint16_t))); in read()
331 rtype = ntohs(intfields.rtype); in readIntFields()
332 rclass = ntohs(intfields.rclass); in readIntFields()
334 *rdlen = ntohs(intfields.rdlen); in readIntFields()
463 id = ntohs(header.id); in readHeader()
475 *qdcount = ntohs(header.qdcount); in readHeader()
476 *ancount = ntohs(header.ancount); in readHeader()
477 *nscount = ntohs(header.nscount); in readHeader()
478 *arcount = ntohs(header.arcount); in readHeader()
/packages/modules/ImsMedia/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/
DImsMediaNetworkUtil.cpp50 port = ntohs(sin.sin_port); in GetIpPortFromSockAddr()
55 port = ntohs(sin6.sin6_port); in GetIpPortFromSockAddr()
/packages/modules/Connectivity/staticlibs/netd/libnetdutils/
DNetfilter.cpp28 << static_cast<int>(msg.version) << ", res_id: 0x" << ntohs(msg.res_id) << "]" in operator <<()
/packages/modules/adb/client/openscreen/platform/
Dudp_socket.cpp76 return ntohs(sa.sin_port); in GetPortFromFromSockAddr()
88 return ntohs(sa.sin6_port); in GetPortFromFromSockAddr()
200 local_endpoint_.port = ntohs(address.sin_port); in GetLocalEndpoint()
214 local_endpoint_.port = ntohs(address.sin6_port); in GetLocalEndpoint()
/packages/modules/Bluetooth/tools/rootcanal/net/posix/
Dposix_async_socket_server.cc77 port_ = ntohs(sin.sin_port); in PosixAsyncSocketServer()
/packages/modules/Connectivity/staticlibs/netd/libnetdutils/include/netdutils/
DInternetAddresses.h281 : IPSockAddr(IPAddress(ipv4sa.sin_addr), ntohs(ipv4sa.sin_port)) {} in IPSockAddr()
283 : IPSockAddr(IPAddress(ipv6sa.sin6_addr, ipv6sa.sin6_scope_id), ntohs(ipv6sa.sin6_port)) {} in IPSockAddr()
/packages/modules/DnsResolver/tests/
Dtun_forwarder.cpp230 switch (uint16_t proto = ntohs(tunHeader->proto); proto) { in validatePacket()
315 switch (uint16_t proto = ntohs(tunHeader->proto); proto) { in translatePacket()
/packages/modules/Bluetooth/system/gd/hal/
Dsnoop_logger_socket.cc177 (int)ntohs(client_addr.sin_port)); in AcceptIncomingConnection()

12