Home
last modified time | relevance | path

Searched refs:port (Results 1 – 25 of 191) sorted by relevance

12345678

/system/libbase/
Dparsenetaddress_test.cpp25 int port = 123; in TEST() local
28 ParseNetAddress("www.google.com", &host, &port, &canonical, &error)); in TEST()
31 EXPECT_EQ(123, port); in TEST()
34 ParseNetAddress("www.google.com:666", &host, &port, &canonical, &error)); in TEST()
37 EXPECT_EQ(666, port); in TEST()
42 int port = 123; in TEST() local
44 EXPECT_TRUE(ParseNetAddress("1.2.3.4", &host, &port, &canonical, &error)); in TEST()
47 EXPECT_EQ(123, port); in TEST()
49 EXPECT_TRUE(ParseNetAddress("1.2.3.4:666", &host, &port, &canonical, &error)); in TEST()
52 EXPECT_EQ(666, port); in TEST()
[all …]
Dparsenetaddress.cpp27 bool ParseNetAddress(const std::string& address, std::string* host, int* port, in ParseNetAddress() argument
65 if (sscanf(port_str.c_str(), "%d", port) != 1 || *port <= 0 || in ParseNetAddress()
66 *port > 65535) { in ParseNetAddress()
75 StringPrintf(ipv6 ? "[%s]:%d" : "%s:%d", host->c_str(), *port); in ParseNetAddress()
/system/core/adb/
Dsocket_spec_test.cpp29 int port; in TEST() local
30 EXPECT_FALSE(parse_tcp_socket_spec("sneakernet:5037", &hostname, &port, &serial, &error)); in TEST()
36 int port; in TEST() local
37 EXPECT_TRUE(parse_tcp_socket_spec("tcp:5037", &hostname, &port, &serial, &error)); in TEST()
39 EXPECT_EQ(5037, port); in TEST()
45 int port; in TEST() local
46 EXPECT_FALSE(parse_tcp_socket_spec("tcp:", &hostname, &port, &serial, &error)); in TEST()
47 EXPECT_FALSE(parse_tcp_socket_spec("tcp:-1", &hostname, &port, &serial, &error)); in TEST()
48 EXPECT_FALSE(parse_tcp_socket_spec("tcp:65536", &hostname, &port, &serial, &error)); in TEST()
53 int port; in TEST() local
[all …]
Dsocket_spec.cpp78 bool parse_tcp_socket_spec(std::string_view spec, std::string* hostname, int* port, in parse_tcp_socket_spec() argument
113 if (port) { in parse_tcp_socket_spec()
114 *port = port_value; in parse_tcp_socket_spec()
121 int port; in get_host_socket_spec_port() local
123 if (!parse_tcp_socket_spec(spec, nullptr, &port, nullptr, error)) { in get_host_socket_spec_port()
134 if (!android::base::ParseInt(fragments[1], &port)) { in get_host_socket_spec_port()
139 if (port < 0) { in get_host_socket_spec_port()
152 return port; in get_host_socket_spec_port()
186 bool socket_spec_connect(unique_fd* fd, std::string_view address, int* port, std::string* serial, in socket_spec_connect() argument
190 int port_value = port ? *port : 0; in socket_spec_connect()
[all …]
Dtest_adb.py45 def fake_adbd(protocol=socket.AF_INET, port=0): argument
51 serversock.bind(("127.0.0.1", port))
53 serversock.bind(("::1", port))
98 port = serversock.getsockname()[1]
103 yield port, writesock
136 port = find_open_port()
148 proc = subprocess.Popen(["adb", "-L", "tcp:localhost:{}".format(port),
155 yield port
231 port = find_open_port()
239 proc = subprocess.Popen(["adb", "-P", str(port), "start-server"],
[all …]
Dadb_wifi.h38 uint16_t port = 0; member
40 MdnsInfo(std::string_view name, std::string_view type, std::string_view addr, uint16_t port) in MdnsInfo()
41 : service_name(name), service_type(type), addr(addr), port(port) {} in MdnsInfo()
/system/core/adb/client/
Dtransport_local.cpp76 bool local_connect(int port) { in local_connect() argument
78 return local_connect_arbitrary_ports(port - 1, port, &dummy) == 0; in local_connect()
89 int port; in connect_device() local
99 socket_spec_connect(&fd, prefix_addr, &port, &serial, response); in connect_device()
106 int port; in connect_device() local
108 socket_spec_connect(&fd, prefix_addr, &port, &serial, &response); in connect_device()
117 return init_socket_transport(t, std::move(fd), port, 0) >= 0 ? ReconnectResult::Success in connect_device()
122 if (!register_socket_transport(std::move(fd), serial, port, 0, std::move(reconnect), false, in connect_device()
169 for (int port = DEFAULT_ADB_LOCAL_TRANSPORT_PORT; port <= adb_local_transport_max_port; in PollAllLocalPortsForEmulator() local
170 port += 2) { in PollAllLocalPortsForEmulator()
[all …]
Dconsole.cpp60 int port; in adb_get_emulator_console_port() local
61 return (sscanf(serial, "emulator-%d", &port) == 1) ? port : -1; in adb_get_emulator_console_port()
74 int port = -1; in adb_get_emulator_console_port() local
77 if (sscanf(device.c_str(), "emulator-%d", &port) == 1) { in adb_get_emulator_console_port()
91 return port; in adb_get_emulator_console_port()
95 int port = adb_get_emulator_console_port(serial); in connect_to_console() local
96 if (port == -1) { in connect_to_console()
101 int fd = network_loopback_client(port, SOCK_STREAM, &error); in connect_to_console()
103 fprintf(stderr, "error: could not connect to TCP port %d: %s\n", port, in connect_to_console()
/system/core/adb/sysdeps/posix/
Dnetwork.cpp38 static sockaddr* loopback_addr4(sockaddr_storage* addr, socklen_t* addrlen, int port) { in loopback_addr4() argument
44 addr4->sin_port = htons(port); in loopback_addr4()
48 static sockaddr* loopback_addr6(sockaddr_storage* addr, socklen_t* addrlen, int port) { in loopback_addr6() argument
54 addr6->sin6_port = htons(port); in loopback_addr6()
58 static int _network_loopback_client(bool ipv6, int port, int type, std::string* error) { in _network_loopback_client() argument
74 addr = (ipv6 ? loopback_addr6 : loopback_addr4)(&addr_storage, &addrlen, port); in _network_loopback_client()
84 int network_loopback_client(int port, int type, std::string* error) { in network_loopback_client() argument
86 int rc = _network_loopback_client(false, port, type, error); in network_loopback_client()
88 return _network_loopback_client(true, port, type, error); in network_loopback_client()
93 static int _network_loopback_server(bool ipv6, int port, int type, std::string* error) { in _network_loopback_server() argument
[all …]
/system/core/adb/daemon/
Drestart_service.cpp57 void restart_tcp_service(unique_fd fd, int port) { in restart_tcp_service() argument
58 if (port <= 0) { in restart_tcp_service()
59 WriteFdFmt(fd.get(), "invalid port %d\n", port); in restart_tcp_service()
63 LOG(INFO) << "adbd restarting in TCP mode (port = " << port << ")"; in restart_tcp_service()
64 android::base::SetProperty("service.adb.tcp.port", android::base::StringPrintf("%d", port)); in restart_tcp_service()
65 WriteFdFmt(fd.get(), "restarting in TCP mode port: %d\n", port); in restart_tcp_service()
Dmain.cpp167 int port = -1; in setup_adb() local
170 port = get_host_socket_spec_port(addr, &error); in setup_adb()
171 if (port != -1) { in setup_adb()
175 if (port == -1) { in setup_adb()
176 port = DEFAULT_ADB_LOCAL_TRANSPORT_PORT; in setup_adb()
178 LOG(INFO) << "Setup mdns on port= " << port; in setup_adb()
179 setup_mdns(port); in setup_adb()
257 int port; in adbd_main() local
258 if (sscanf(prop_port.c_str(), "%d", &port) == 1 && port > 0) { in adbd_main()
259 D("using tcp port=%d", port); in adbd_main()
[all …]
Dadb_wifi.cpp54 explicit TlsServer(int port);
57 uint16_t port() { return port_; }; in port() function in __anond60ce5ca0111::TlsServer
67 TlsServer::TlsServer(int port) : port_(port) {} in TlsServer() argument
97 int port = socket_get_local_port(fd.get()); in Start() local
98 if (port <= 0 || port > 65535) { in Start()
102 port_ = static_cast<uint16_t>(port); in Start()
171 register_adb_secure_connect_service(sTlsServer->port()); in enable_wifi_debugging()
172 LOG(INFO) << "adb wifi started on port " << sTlsServer->port(); in enable_wifi_debugging()
173 SetProperty(kWifiPortProp, std::to_string(sTlsServer->port())); in enable_wifi_debugging()
Dtransport_qemu.cpp74 int port = get_host_socket_spec_port(addr, &error); in qemu_socket_thread() local
75 if (port == -1) { in qemu_socket_thread()
76 port = DEFAULT_ADB_LOCAL_TRANSPORT_PORT; in qemu_socket_thread()
80 snprintf(con_name, sizeof(con_name), "pipe:qemud:adb:%d", port); in qemu_socket_thread()
109 std::move(fd), std::move(serial), port, 1, in qemu_socket_thread()
Dmdns.cpp36 static int port; variable
65 static void register_mdns_service(int index, int port, const std::string service_name) { in register_mdns_service() argument
98 htobe16((uint16_t)port), (uint16_t)txtRecord.size(), in register_mdns_service()
124 register_mdns_service(kADBTransportServiceRefIndex, port, hostname); in register_base_mdns_transport()
194 port = port_in; in setup_mdns()
201 void register_adb_secure_connect_service(int port) { in register_adb_secure_connect_service() argument
202 std::thread([port]() { in register_adb_secure_connect_service()
208 register_mdns_service(kADBSecureConnectServiceRefIndex, port, service_name); in register_adb_secure_connect_service()
/system/bt/stack/rfcomm/
Drfc_utils.cc144 rfc_cb.port.rfc_mcb[i].state); in rfc_alloc_multiplexer_channel()
146 << rfc_cb.port.rfc_mcb[i].bd_addr; in rfc_alloc_multiplexer_channel()
148 if ((rfc_cb.port.rfc_mcb[i].state != RFC_MX_STATE_IDLE) && in rfc_alloc_multiplexer_channel()
149 rfc_cb.port.rfc_mcb[i].bd_addr == bd_addr) { in rfc_alloc_multiplexer_channel()
152 if (rfc_cb.port.rfc_mcb[i].state == RFC_MX_STATE_CONNECTED) in rfc_alloc_multiplexer_channel()
153 rfc_timer_stop(&rfc_cb.port.rfc_mcb[i]); in rfc_alloc_multiplexer_channel()
157 is_initiator, rfc_cb.port.rfc_mcb[i].state, &rfc_cb.port.rfc_mcb[i]); in rfc_alloc_multiplexer_channel()
158 return (&rfc_cb.port.rfc_mcb[i]); in rfc_alloc_multiplexer_channel()
166 p_mcb = &rfc_cb.port.rfc_mcb[j]; in rfc_alloc_multiplexer_channel()
167 if (rfc_cb.port.rfc_mcb[j].state == RFC_MX_STATE_IDLE) { in rfc_alloc_multiplexer_channel()
[all …]
Dport_utils.cc71 tPORT* p_port = &rfc_cb.port.port[port_index]; in port_allocate_port()
283 for (tRFC_MCB& mcb : rfc_cb.port.rfc_mcb) { in port_find_mcb()
327 return &rfc_cb.port.port[handle - 1]; in port_find_mcb_dlci_port()
340 for (tPORT& port : rfc_cb.port.port) { in port_find_dlci_port()
341 if (port.in_use && (port.rfc.p_mcb == nullptr)) { in port_find_dlci_port()
342 if (port.dlci == dlci) { in port_find_dlci_port()
343 return &port; in port_find_dlci_port()
344 } else if ((dlci & 0x01) && (port.dlci == (dlci - 1))) { in port_find_dlci_port()
345 port.dlci++; in port_find_dlci_port()
346 return &port; in port_find_dlci_port()
[all …]
Dport_api.cc251 p_port = &rfc_cb.port.port[handle - 1]; in RFCOMM_RemoveConnection()
280 tPORT* p_port = &rfc_cb.port.port[handle - 1]; in RFCOMM_RemoveServer()
323 p_port = &rfc_cb.port.port[port_handle - 1]; in PORT_SetEventCallback()
353 p_port = &rfc_cb.port.port[port_handle - 1]; in PORT_ClearKeepHandleFlag()
383 p_port = &rfc_cb.port.port[port_handle - 1]; in PORT_SetDataCOCallback()
415 p_port = &rfc_cb.port.port[port_handle - 1]; in PORT_SetEventMask()
444 tPORT* p_port = &rfc_cb.port.port[handle - 1]; in PORT_CheckConnection()
480 for (auto& multiplexer_cb : rfc_cb.port.rfc_mcb) { in PORT_IsOpening()
491 for (tPORT& port : rfc_cb.port.port) { in PORT_IsOpening()
492 if (port.rfc.p_mcb == &multiplexer_cb) { in PORT_IsOpening()
[all …]
/system/bt/vendor_libs/test_vendor_lib/desktop/
Droot_canal_main.cc79 int port = atoi(argv[arg]); in main() local
80 LOG_INFO("%d: %s (%d)", arg, argv[arg], port); in main()
81 if (port < 0 || port > 0xffff) { in main()
88 test_port = port; in main()
91 hci_server_port = port; in main()
94 link_server_port = port; in main()
/system/extras/multinetwork/
Dcommon.cpp125 char port[sizeof("65535")]; in inetSockaddrToString() local
128 port, sizeof(port), in inetSockaddrToString()
131 if (port[0] == '0' || port[0] == '\0') { in inetSockaddrToString()
134 return (is_ipv6 ? "[" : "") + std::string(host) + (is_ipv6 ? "]:" : ":") + std::string(port); in inetSockaddrToString()
/system/netd/tests/
Dsock_diag_test.cpp37 uint16_t port = 1024 + arc4random_uniform(0xffff - 1024); in bindAndListen() local
38 sockaddr_in6 sin6 = { .sin6_family = AF_INET6, .sin6_port = htons(port) }; in bindAndListen()
41 return port; in bindAndListen()
75 uint16_t port = bindAndListen(listensocket); in TEST_F() local
76 ASSERT_NE(0, port) << "Can't bind to server port"; in TEST_F()
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()
99 port, ntohs(client46.sin6_port), ntohs(client6.sin6_port)); 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()
[all …]
/system/media/camera/docs/
DREADME.md25 sudo port install py27-beautifulsoup4
26 sudo port install py27-mako
27 sudo port install py27-markdown
28 sudo port install tidy
29 sudo port install libxml2 #xmllint
/system/bt/vendor_libs/test_vendor_lib/scripts/
Dsimple_stack.py114 def __init__(self, port): argument
116 self._socket.connect(("localhost", port))
135 def __init__(self, port): argument
136 self._connection = Connection(port)
220 port = int(argv[1])
225 raw_port = RawPort(port)
Dsimple_link_layer_socket.py80 def __init__(self, port): argument
82 self._socket.connect(('localhost', port))
102 def __init__(self, port): argument
103 self._connection = Connection(port)
179 port = int(argv[1])
184 raw_port = RawPort(port)
/system/netd/libnetdutils/include/netdutils/
DInternetAddresses.h38 in_port_t port{0U}; // written and read in host-byte order
48 if ((a.family != b.family) || (a.cidrlen != b.cidrlen) || (a.port != b.port) ||
95 if (a.port != b.port) return (a.port < b.port);
176 mData.port = 0U; in IPAddress()
250 static IPSockAddr toIPSockAddr(const std::string& repr, in_port_t port) { in toIPSockAddr() argument
251 return IPSockAddr(IPAddress::forString(repr), port); in toIPSockAddr()
272 IPSockAddr(const IPAddress& ip, in_port_t port) : mData(ip.mData) { mData.port = port; } in IPSockAddr() argument
283 constexpr in_port_t port() const noexcept { return mData.port; } in port() function
292 reinterpret_cast<sockaddr_in*>(&ss)->sin_port = htons(mData.port); in sockaddr_storage()
296 reinterpret_cast<sockaddr_in6*>(&ss)->sin6_port = htons(mData.port); in sockaddr_storage()
/system/bt/test/rootcanal/
Dbluetooth_hci.h78 void SetUpTestChannel(int port);
79 void SetUpHciServer(int port, const std::function<void(int)>& on_connect);
80 void SetUpLinkLayerServer(int port, const std::function<void(int)>& on_connect);
81 int ConnectToRemoteServer(const std::string& server, int port);
113 [this](const std::string& server, int port) {
114 return ConnectToRemoteServer(server, port);

12345678