Home
last modified time | relevance | path

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

12

/system/netd/bpf_progs/
Dclatd.c50 if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK; in nat64()
56 if (is_ethernet && (eth->h_proto != htons(ETH_P_IPV6))) return TC_ACT_OK; in nat64()
93 eth2.h_proto = htons(ETH_P_IP); // But replace the ethertype in nat64()
100 .tot_len = htons(ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16 in nat64()
102 .frag_off = htons(IP_DF), // u16 in nat64()
132 if (bpf_skb_change_proto(skb, htons(ETH_P_IP), 0)) return TC_ACT_OK; in nat64()
203 if (skb->protocol != htons(ETH_P_IP)) return TC_ACT_OK; in sched_cls_egress_clat_rawip()
229 if (ip4->frag_off & ~htons(IP_DF)) return TC_ACT_OK; in sched_cls_egress_clat_rawip()
270 .payload_len = htons(ntohs(ip4->tot_len) - 20), // __be16 in sched_cls_egress_clat_rawip()
290 if (bpf_skb_change_proto(skb, htons(ETH_P_IPV6), 0)) return TC_ACT_OK; in sched_cls_egress_clat_rawip()
Dbpf_net_helpers.h51 #define htons(x) (__builtin_constant_p(x) ? ___constant_swab16(x) : __builtin_bswap16(x)) macro
53 #define ntohs(x) htons(x)
Doffload.c45 if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK; in do_forward()
51 if (is_ethernet && (eth->h_proto != htons(ETH_P_IPV6))) return TC_ACT_OK; in do_forward()
Dnetd.c113 bool is_ipv6 = (skb->protocol == htons(ETH_P_IPV6)); \
139 if (skb->protocol == htons(ETH_P_IP)) { in DEFINE_UPDATE_STATS()
156 } else if (skb->protocol == htons(ETH_P_IPV6)) { in DEFINE_UPDATE_STATS()
/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/core/libnetutils/
Dpacket.c48 .sll_protocol = htons(ETH_P_IP), in open_raw_socket()
100 ip.tot_len = htons(sizeof(ip) + sizeof(udp) + size); in send_packet()
110 udp.source = htons(sport); in send_packet()
111 udp.dest = htons(dport); in send_packet()
112 udp.len = htons(sizeof(udp) + size); in send_packet()
118 temp = htons(IPPROTO_UDP); in send_packet()
138 destaddr.sll_protocol = htons(ETH_P_IP); in send_packet()
193 } 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/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()
468 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()
DOffloadUtils.cpp309 .tcm_info = static_cast<__u32>((prio << 16) | htons(proto)), in tcFilterAddDevBpf()
384 .tcm_info = static_cast<__u32>((prio << 16) | htons(proto)), in tcFilterDelDev()
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/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/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/libbase/include/android-base/
Dendian.h58 #define htons(x) __builtin_bswap16(x) macro
/system/libbase/
Dendian_test.cpp38 ASSERT_EQ(be16, htons(le16)); in TEST()
/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.cc78 serv_addr.sin_port = htons(kPort); in StartServer()
154 serv_addr.sin_port = htons(kPort); in ConnectClient()
/system/bt/hci/src/
Dbtsnoop_net.cc112 addr.sin_port = htons(LISTEN_PORT_); in listen_fn_()
/system/bt/vendor_libs/test_vendor_lib/model/devices/
Dserver_port_factory.cc48 listen_address.sin_port = htons(port); in SetUp()
/system/bt/gd/facade/
Dfacade_main.cc132 addr.sin_port = htons(signal_port); in main()
/system/bt/vendor_libs/test_vendor_lib/model/setup/
Dtest_channel_transport.cc50 listen_address.sin_port = htons(port); in SetUp()

12