Home
last modified time | relevance | path

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

12

/system/netd/resolv/
Dres_mkquery.cpp125 hp->id = htons(arc4random_uniform(65536)); in res_nmkquery()
146 *reinterpret_cast<uint16_t*>(cp) = htons(type); in res_nmkquery()
148 *reinterpret_cast<uint16_t*>(cp) = htons(cl); in res_nmkquery()
150 hp->qdcount = htons(1); in res_nmkquery()
159 *reinterpret_cast<uint16_t*>(cp) = htons(ns_t_null); in res_nmkquery()
161 *reinterpret_cast<uint16_t*>(cp) = htons(cl); in res_nmkquery()
165 *reinterpret_cast<uint16_t*>(cp) = htons(0); in res_nmkquery()
167 hp->arcount = htons(1); in res_nmkquery()
176 *reinterpret_cast<uint16_t*>(cp) = htons(type); in res_nmkquery()
178 *reinterpret_cast<uint16_t*>(cp) = htons(cl); in res_nmkquery()
[all …]
/system/netd/bpf_progs/
Dclatd.c46 #define htons(x) (__builtin_constant_p(x) ? ___constant_swab16(x) : __builtin_bswap16(x)) macro
48 #define ntohs(x) htons(x)
63 if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK; in nat64()
69 if (is_ethernet && (eth->h_proto != htons(ETH_P_IPV6))) return TC_ACT_OK; in nat64()
108 eth2.h_proto = htons(ETH_P_IP); // But replace the ethertype in nat64()
115 .tot_len = htons(ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16 in nat64()
117 .frag_off = htons(IP_DF), // u16 in nat64()
139 if (bpf_skb_change_proto(skb, htons(ETH_P_IP), 0)) return TC_ACT_SHOT; in nat64()
/system/core/libnetutils/
Dpacket.c47 if((s = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { in open_raw_socket()
53 bindaddr.sll_protocol = htons(ETH_P_IP); in open_raw_socket()
103 ip.tot_len = htons(sizeof(ip) + sizeof(udp) + size); in send_packet()
113 udp.source = htons(sport); in send_packet()
114 udp.dest = htons(dport); in send_packet()
115 udp.len = htons(sizeof(udp) + size); in send_packet()
121 temp = htons(IPPROTO_UDP); in send_packet()
141 destaddr.sll_protocol = htons(ETH_P_IP); in send_packet()
196 } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) { in receive_packet()
Dchecksum.c114 temp_protocol = htons(ip->protocol); in ipv4_pseudo_header_checksum()
115 temp_length = htons(len); in ipv4_pseudo_header_checksum()
Ddhcpmsg.c35 msg->flags = htons(FLAGS_BROADCAST); in init_dhcp_msg()
/system/netd/tests/
Dsock_diag_test.cpp38 sockaddr_in6 sin6 = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in bindAndListen()
79 sockaddr_in server4 = { .sin_family = AF_INET, .sin_port = htons(port) }; in TEST_F()
80 sockaddr_in6 server6 = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in TEST_F()
113 src, htons(msg->id.idiag_sport), in TEST_F()
114 dst, htons(msg->id.idiag_dport), in TEST_F()
134 seenServer46 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
135 seenServer6 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
139 src, htons(msg->id.idiag_sport), in TEST_F()
140 dst, htons(msg->id.idiag_dport), in TEST_F()
189 sockaddr_in6 server = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in TEST_F()
/system/netd/server/
DSockDiagTest.cpp46 sockaddr_in6 sin6 = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in bindAndListen()
87 sockaddr_in server4 = { .sin_family = AF_INET, .sin_port = htons(port) }; in TEST_F()
88 sockaddr_in6 server6 = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in TEST_F()
117 src, htons(msg->id.idiag_sport), in TEST_F()
118 dst, htons(msg->id.idiag_dport), in TEST_F()
136 seenServer46 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
137 seenServer6 |= (msg->id.idiag_sport == htons(port)); in TEST_F()
141 src, htons(msg->id.idiag_sport), in TEST_F()
142 dst, htons(msg->id.idiag_dport), in TEST_F()
467 sockaddr_in6 server = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in TEST_P()
DNFLogListener.cpp94 msg.nfhdr.res_id = htons(nfLogGroup); in cfgMode()
115 msg.nfhdr.res_id = htons(nfLogGroup); in cfgCmdBind()
135 msg.nfhdr.res_id = htons(nfLogGroup); in cfgCmdUnbind()
DWakeupControllerTest.cpp189 msg.packetHeader.hw_protocol = htons(kEthertype); in TEST_F()
193 msg.hardwareAddr.hw_addrlen = htons(kMacAddr.size()); in TEST_F()
203 msg.tcpHeader.th_sport = htons(kSrcPort); in TEST_F()
204 msg.tcpHeader.th_dport = htons(kDstPort); in TEST_F()
DNFLogListenerTest.cpp91 msg.nfmsg.res_id = htons(type); in sendEmptyMsg()
/system/core/libcutils/
Dsocket_inaddr_any_server_unix.cpp40 addr.sin6_port = htons(port); in socket_inaddr_any_server()
Dsocket_inaddr_any_server_windows.cpp65 addr.sin6_port = htons(port); in socket_inaddr_any_server()
/system/bt/vendor_libs/test_vendor_lib/test/
Dasync_manager_unittest.cc49 serv_addr.sin_port = htons(kPort); in StartServer()
111 serv_addr.sin_port = htons(kPort); in ConnectClient()
Dlink_layer_socket_device_test.cc81 serv_addr.sin_port = htons(kPort); in StartServer()
157 serv_addr.sin_port = htons(kPort); in ConnectClient()
/system/core/adb/sysdeps/posix/
Dnetwork.cpp44 addr4->sin_port = htons(port); in loopback_addr4()
54 addr6->sin6_port = htons(port); in loopback_addr6()
/system/netd/resolv/dns_responder/
Ddns_responder.cpp274 *reinterpret_cast<uint16_t*>(buffer_cur) = htons(qtype); in write()
276 htons(qclass); in write()
370 intfields.rtype = htons(rtype); in writeIntFields()
371 intfields.rclass = htons(rclass); in writeIntFields()
373 intfields.rdlen = htons(rdlen); in writeIntFields()
472 header.id = htons(id); in write()
481 header.qdcount = htons(questions.size()); in write()
482 header.ancount = htons(answers.size()); in write()
483 header.nscount = htons(authorities.size()); in write()
484 header.arcount = htons(additionals.size()); in write()
/system/netd/tests/benchmarks/
Dconnect_benchmark.cpp120 sockaddr_in server = { .sin_family = AF_INET, .sin_port = htons(port) }; in ipv4_loopback()
177 sockaddr_in6 server = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in ipv6_loopback()
/system/core/base/include/android-base/
Dendian.h55 #define htons(x) __builtin_bswap16(x) macro
/system/core/base/
Dendian_test.cpp38 ASSERT_EQ(be16, htons(le16)); in TEST()
/system/bt/hci/src/
Dbtsnoop_net.cc114 addr.sin_port = htons(LISTEN_PORT_); in listen_fn_()
/system/bt/vendor_libs/test_vendor_lib/model/devices/
Dserver_port_factory.cc52 listen_address.sin_port = htons(port); in SetUp()
/system/bt/vendor_libs/test_vendor_lib/model/setup/
Dtest_channel_transport.cc46 listen_address.sin_port = htons(port); in SetUp()
/system/bt/vendor_libs/test_vendor_lib/desktop/
Dtest_environment.cc129 serv_addr.sin_port = htons(port); in ConnectToRemoteServer()
/system/bt/tools/hci/
Dmain.c184 addr.sin_port = htons(8873); in write_hci_command()
/system/netd/libnetdutils/include/netdutils/
DInternetAddresses.h260 reinterpret_cast<sockaddr_in*>(&ss)->sin_port = htons(mData.port); in sockaddr_storage()
264 reinterpret_cast<sockaddr_in6*>(&ss)->sin6_port = htons(mData.port); in sockaddr_storage()

12