Home
last modified time | relevance | path

Searched refs:sockaddr (Results 1 – 25 of 84) sorted by relevance

1234

/system/netd/libnetdutils/include/netdutils/
DSocket.h29 inline sockaddr* asSockaddrPtr(void* addr) { in asSockaddrPtr()
30 return reinterpret_cast<sockaddr*>(addr); in asSockaddrPtr()
33 inline const sockaddr* asSockaddrPtr(const void* addr) { in asSockaddrPtr()
34 return reinterpret_cast<const sockaddr*>(addr); in asSockaddrPtr()
DMockSyscalls.h39 MOCK_CONST_METHOD3(getsockname, Status(Fd sock, sockaddr* addr, socklen_t* addrlen));
45 MOCK_CONST_METHOD3(bind, Status(Fd sock, const sockaddr* addr, socklen_t addrlen));
46 MOCK_CONST_METHOD3(connect, Status(Fd sock, const sockaddr* addr, socklen_t addrlen));
57 const sockaddr* dst, socklen_t dstlen));
58 MOCK_CONST_METHOD5(recvfrom, StatusOr<Slice>(Fd sock, const Slice dst, int flags, sockaddr* src,
DSyscalls.h50 virtual Status getsockname(Fd sock, sockaddr* addr, socklen_t* addrlen) const = 0;
58 virtual Status bind(Fd sock, const sockaddr* addr, socklen_t addrlen) const = 0;
60 virtual Status connect(Fd sock, const sockaddr* addr, socklen_t addrlen) const = 0;
74 virtual StatusOr<size_t> sendto(Fd sock, const Slice buf, int flags, const sockaddr* dst,
77 virtual StatusOr<Slice> recvfrom(Fd sock, const Slice dst, int flags, sockaddr* src,
/system/core/adb/sysdeps/posix/
Dnetwork.cpp38 static sockaddr* loopback_addr4(sockaddr_storage* addr, socklen_t* addrlen, int port) { in loopback_addr4()
45 return reinterpret_cast<sockaddr*>(addr); in loopback_addr4()
48 static sockaddr* loopback_addr6(sockaddr_storage* addr, socklen_t* addrlen, int port) { in loopback_addr6()
55 return reinterpret_cast<sockaddr*>(addr); in loopback_addr6()
67 sockaddr* addr = (ipv6 ? loopback_addr6 : loopback_addr4)(&addr_storage, &addrlen, 0); in _network_loopback_client()
105 sockaddr* addr = (ipv6 ? loopback_addr6 : loopback_addr4)(&addr_storage, &addrlen, port); in _network_loopback_server()
/system/netd/tests/benchmarks/
Dconnect_benchmark.cpp84 if (bind(s, (sockaddr*) &sin6, sizeof(sin6)) == 0) { in bindAndListen()
90 if (getsockname(s, (sockaddr*) &sin, &len)) { in bindAndListen()
121 if (connect(sock, (sockaddr*) &server, sizeof(server))) { in ipv4_loopback()
136 int accepted = accept4(listensocket, (sockaddr*) &client, &clientlen, SOCK_CLOEXEC); in ipv4_loopback()
178 if (connect(sock, (sockaddr*) &server, sizeof(server))) { in ipv6_loopback()
193 int accepted = accept4(listensocket, (sockaddr*) &client, &clientlen, SOCK_CLOEXEC); in ipv6_loopback()
/system/core/liblog/tests/
Dlogd_writer_test.cpp49 TEMP_FAILURE_RETRY(bind(server_socket, reinterpret_cast<sockaddr*>(&server_sockaddr), in TEST()
64 TEMP_FAILURE_RETRY(connect(client_socket, reinterpret_cast<sockaddr*>(&client_sockaddr), in TEST()
88 TEMP_FAILURE_RETRY(connect(client_socket, reinterpret_cast<sockaddr*>(&client_sockaddr), in TEST()
/system/netd/include/
DFwmarkCommand.h29 sockaddr s;
36 FwmarkConnectInfo(const int connectErrno, const unsigned latency, const sockaddr* saddr) { in FwmarkConnectInfo()
/system/netd/client/
DNetdClient.cpp65 typedef int (*Accept4FunctionType)(int, sockaddr*, socklen_t*, int);
66 typedef int (*ConnectFunctionType)(int, const sockaddr*, socklen_t);
72 typedef int (*SendtoFunctionType)(int, const void*, size_t, int, const sockaddr*, socklen_t);
113 bool shouldMarkSocket(int socketFd, const sockaddr* dst) { in shouldMarkSocket()
126 int netdClientAccept4(int sockfd, sockaddr* addr, socklen_t* addrlen, int flags) { in netdClientAccept4()
149 int netdClientConnect(int sockfd, const sockaddr* addr, socklen_t addrlen) { in netdClientConnect()
206 const sockaddr* addr = nullptr; in netdClientSendmmsg()
208 addr = reinterpret_cast<const sockaddr*>(msgs[0].msg_hdr.msg_name); in netdClientSendmmsg()
221 const sockaddr* addr = nullptr; in netdClientSendmsg()
223 addr = reinterpret_cast<const sockaddr*>(msg->msg_name); in netdClientSendmsg()
[all …]
/system/netd/tests/
Dsock_diag_test.cpp39 if (bind(s, (sockaddr *) &sin6, sizeof(sin6)) == 0) { in bindAndListen()
81 ASSERT_EQ(0, connect(v4socket, (sockaddr *) &server4, sizeof(server4))) in TEST_F()
83 ASSERT_EQ(0, connect(v6socket, (sockaddr *) &server6, sizeof(server6))) in TEST_F()
88 int accepted4 = accept(listensocket, (sockaddr *) &client46, &clientlen); in TEST_F()
89 int accepted6 = accept(listensocket, (sockaddr *) &client6, &clientlen); in TEST_F()
202 ASSERT_EQ(0, connect(s, (sockaddr *) &server, sizeof(server))) in TEST_F()
204 serversockets[i] = accept(listensocket, (sockaddr *) &client, &clientlen); in TEST_F()
Dtun_interface.cpp63 if (getnameinfo((sockaddr *) &src6, sizeof(src6), srcStr, sizeof(srcStr), nullptr, 0, flags) || in init()
64 getnameinfo((sockaddr *) &dst6, sizeof(dst6), dstStr, sizeof(dstStr), nullptr, 0, flags)) { in init()
133 if (bind(s, reinterpret_cast<sockaddr*>(&groups), sizeof(groups)) == -1) return -errno; in addAddress()
136 if (connect(s, reinterpret_cast<sockaddr*>(&kernel), sizeof(kernel)) == -1) return -errno; in addAddress()
Dnetd_client_test.cpp47 int ret = connect(sock, reinterpret_cast<const sockaddr*>(&server6), sizeof(server6)); in checkNetworkConnectivity()
55 ret = connect(sock, reinterpret_cast<const sockaddr*>(&server4), sizeof(server4)); in checkNetworkConnectivity()
/system/netd/server/
DSockDiagTest.cpp47 if (bind(s, (sockaddr *) &sin6, sizeof(sin6)) == 0) { in bindAndListen()
89 ASSERT_EQ(0, connect(v4socket, (sockaddr *) &server4, sizeof(server4))) in TEST_F()
91 ASSERT_EQ(0, connect(v6socket, (sockaddr *) &server6, sizeof(server6))) in TEST_F()
97 listensocket, (sockaddr *) &client46, &clientlen, SOCK_CLOEXEC); in TEST_F()
99 listensocket, (sockaddr *) &client6, &clientlen, SOCK_CLOEXEC); in TEST_F()
183 bool fillDiagAddr(__be32 addr[4], const sockaddr *sa) { in fillDiagAddr()
200 inet_diag_msg makeDiagMessage(__u8 family, const sockaddr *src, const sockaddr *dst) { in makeDiagMessage()
481 ASSERT_EQ(0, connect(s, (sockaddr *) &server, sizeof(server))) in TEST_P()
485 listensocket, (sockaddr *) &client, &clientlen, SOCK_CLOEXEC); in TEST_P()
/system/extras/tests/tcp_nuke_addr/
Dtcp_nuke_addr_test.cpp62 if (bind(listensock, (sockaddr *) &sin, sizeof(sin)) == -1) PERROR_EXIT("bind"); in bindRandomAddr()
101 if (connect(s, (sockaddr *) &listenaddr, sizeof(listenaddr)) == -1) PERROR_EXIT("connect"); in connectLoop()
133 if (getsockname(listensock, (sockaddr *) &sin, &len) == -1) PERROR_EXIT("getsockname"); in main()
/system/netd/libnetdutils/
DSyscalls.cpp60 Status getsockname(Fd sock, sockaddr* addr, socklen_t* addrlen) const override { in getsockname()
86 Status bind(Fd sock, const sockaddr* addr, socklen_t addrlen) const override { in bind()
94 Status connect(Fd sock, const sockaddr* addr, socklen_t addrlen) const override { in connect()
153 StatusOr<size_t> sendto(Fd sock, const Slice buf, int flags, const sockaddr* dst, in sendto()
162 StatusOr<Slice> recvfrom(Fd sock, const Slice dst, int flags, sockaddr* src, in recvfrom()
/system/core/libcutils/
Dsockets.cpp38 if (getsockname(sock, reinterpret_cast<sockaddr*>(&addr), &addr_size) == 0) { in socket_get_local_port()
Dsocket_inaddr_any_server_unix.cpp49 if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { in socket_inaddr_any_server()
Dsockets_test.cpp47 reinterpret_cast<sockaddr*>(&addr), &addr_size)); in TestConnectedSockets()
56 reinterpret_cast<sockaddr*>(&addr), addr_size)); in TestConnectedSockets()
Dsocket_inaddr_any_server_windows.cpp67 if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR) { in socket_inaddr_any_server()
Dsocket_local_server_unix.cpp82 if(bind(s, (struct sockaddr *) &addr, alen) < 0) {
/system/core/adb/sysdeps/
Dvm_sockets.h41 unsigned char svm_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(unsigned short) -
/system/core/logd/
Dlibaudit.cpp107 sendto(fd, &req, req.nlh.nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr))); in audit_send()
185 recvfrom(fd, rep, sizeof(*rep), flags, (struct sockaddr*)&nladdr, &nladdrlen)); in audit_get_reply()
/system/extras/multinetwork/
Dcommon.h53 std::string inetSockaddrToString(const sockaddr* sa);
/system/bt/vendor_libs/test_vendor_lib/model/devices/
Dserver_port_factory.cc51 if (bind(listen_fd_, reinterpret_cast<sockaddr*>(&listen_address), sockaddr_in_size) < 0) { in SetUp()
81 …OSI_NO_INTR(accept_fd = accept(listen_fd_, reinterpret_cast<sockaddr*>(&test_channel_address), &so… in Accept()
/system/bt/vendor_libs/test_vendor_lib/test/
Dasync_manager_unittest.cc52 EXPECT_FALSE(bind(fd, (sockaddr*)&serv_addr, sizeof(serv_addr)) < 0); in StartServer()
63 int connection_fd = accept(fd, (struct sockaddr*)&cli_addr, &clilen); in AcceptConnection()
113 int result = connect(socket_cli_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); in ConnectClient()
/system/bt/osi/src/socket_utils/
Dsocket_local_server.cc68 if (bind(s, (struct sockaddr*)&addr, alen) < 0) {

1234