Home
last modified time | relevance | path

Searched refs:sock (Results 1 – 22 of 22) sorted by relevance

/system/bt/btif/src/
Dbtif_sock_l2cap.c90 static bt_status_t btSock_start_l2cap_server_l(l2cap_socket *sock);
109 static char packet_get_head_l(l2cap_socket *sock, uint8_t **data, uint32_t *len) in packet_get_head_l() argument
111 struct packet *p = sock->first_packet; in packet_get_head_l()
117 *data = sock->first_packet->data; in packet_get_head_l()
119 *len = sock->first_packet->len; in packet_get_head_l()
120 sock->first_packet = p->next; in packet_get_head_l()
121 if (sock->first_packet) in packet_get_head_l()
122 sock->first_packet->prev = NULL; in packet_get_head_l()
124 sock->last_packet = NULL; in packet_get_head_l()
127 sock->bytes_buffered -= *len; in packet_get_head_l()
[all …]
/system/vold/
Dvdc.c36 static int do_monitor(int sock, int stop_after_cmd);
37 static int do_cmd(int sock, int argc, char **argv);
40 int sock; in main() local
62 while ((sock = socket_local_client(sockname, in main()
74 exit(do_monitor(sock, 0)); in main()
76 exit(do_cmd(sock, argc, argv)); in main()
80 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
100 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
105 return do_monitor(sock, 1); in do_cmd()
108 static int do_monitor(int sock, int stop_after_cmd) { in do_monitor() argument
[all …]
/system/netd/server/
Dndc.c35 static int do_monitor(int sock, int stop_after_cmd);
36 static int do_cmd(int sock, int argc, char **argv);
39 int sock; in main() local
47 if ((sock = socket_local_client(argv[1], in main()
50 if ((sock = socket_local_client("netd", in main()
63 exit(do_monitor(sock, 0)); in main()
64 exit(do_cmd(sock, argc-cmdOffset, &(argv[cmdOffset]))); in main()
67 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
106 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
114 return do_monitor(sock, 1); in do_cmd()
[all …]
DNetlinkManager.cpp67 NetlinkHandler *NetlinkManager::setupSocket(int *sock, int netlinkFamily, in setupSocket() argument
79 if ((*sock = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, netlinkFamily)) < 0) { in setupSocket()
84 if (setsockopt(*sock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) { in setupSocket()
86 close(*sock); in setupSocket()
90 if (setsockopt(*sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { in setupSocket()
92 close(*sock); in setupSocket()
96 if (bind(*sock, (struct sockaddr *) &nladdr, sizeof(nladdr)) < 0) { in setupSocket()
98 close(*sock); in setupSocket()
103 if (android_nflog_send_config_cmd(*sock, 0, NFULNL_CFG_CMD_PF_UNBIND, AF_INET) < 0) { in setupSocket()
107 if (android_nflog_send_config_cmd(*sock, 0, NFULNL_CFG_CMD_PF_BIND, AF_INET) < 0) { in setupSocket()
[all …]
DNetlinkManager.h59 NetlinkHandler* setupSocket(int *sock, int netlinkFamily, int groups,
DRouteController.cpp200 int sock = socket(AF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_ROUTE); in sendNetlinkRequest() local
201 if (sock != -1 && in sendNetlinkRequest()
202 connect(sock, reinterpret_cast<const sockaddr*>(&NETLINK_ADDRESS), in sendNetlinkRequest()
204 writev(sock, iov, iovlen) != -1 && in sendNetlinkRequest()
205 (ret = recv(sock, &response, sizeof(response), 0)) != -1) { in sendNetlinkRequest()
220 if (sock != -1) { in sendNetlinkRequest()
221 close(sock); in sendNetlinkRequest()
/system/extras/ext4_utils/
Dext4_crypt_init_extensions.cpp26 int sock = -1; in vold_command() local
29 sock = socket_local_client("cryptd", in vold_command()
32 if (sock >= 0) { in vold_command()
38 if (sock < 0) { in vold_command()
47 CloseSocket(int sock) : sock_(sock) {} in vold_command() argument
51 CloseSocket cs(sock); in vold_command()
56 if (write(sock, actual_command.c_str(), actual_command.size() + 1) < 0) { in vold_command()
61 struct pollfd poll_sock = {sock, POLLIN, 0}; in vold_command()
75 rc = TEMP_FAILURE_RETRY(read(sock, buffer, sizeof(buffer))); in vold_command()
/system/bt/tools/hci/
Dmain.c144 int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in write_hci_command() local
145 if (sock == INVALID_FD) in write_hci_command()
152 if (connect(sock, (const struct sockaddr *)&addr, sizeof(addr)) == -1) in write_hci_command()
155 if (send(sock, &type, 1, 0) != 1) in write_hci_command()
158 if (send(sock, &length, 2, 0) != 2) in write_hci_command()
161 if (send(sock, packet, length, 0) != (ssize_t)length) in write_hci_command()
164 close(sock); in write_hci_command()
168 close(sock); in write_hci_command()
/system/core/liblog/
Dlog_read.c252 int sock; member
290 int sock = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_RESERVED, in send_log_msg() local
292 if (sock < 0) { in send_log_msg()
293 return sock; in send_log_msg()
301 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg()
308 while ((ret = TEMP_FAILURE_RETRY(read(sock, cp, len))) > 0) { in send_log_msg()
319 p.fd = sock; in send_log_msg()
343 close(sock); in send_log_msg()
545 logger_list->sock = -1; in android_logger_list_alloc()
566 logger_list->sock = -1; in android_logger_list_alloc_time()
[all …]
/system/core/logd/tests/
Dlogd_test.cpp37 int sock = socket_local_client("logd", in my_android_logger_get_statistics() local
40 if (sock >= 0) { in my_android_logger_get_statistics()
41 if (write(sock, buf, strlen(buf) + 1) > 0) { in my_android_logger_get_statistics()
43 while ((ret = read(sock, buf, len)) > 0) { in my_android_logger_get_statistics()
51 .fd = sock, in my_android_logger_get_statistics()
62 close(sock); in my_android_logger_get_statistics()
485 int sock = socket_local_client("logd", in TEST() local
489 ASSERT_TRUE(sock >= 0); in TEST()
492 if (write(sock, getPruneList, sizeof(getPruneList)) > 0) { in TEST()
495 read(sock, buffer, sizeof(buffer)); in TEST()
[all …]
/system/core/logd/
DLogListener.cpp112 int sock = android_get_control_socket(socketName); in getLogSocket() local
114 if (sock < 0) { in getLogSocket()
115 sock = socket_local_server(socketName, in getLogSocket()
121 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { in getLogSocket()
124 return sock; in getLogSocket()
DLogReader.cpp186 int sock = android_get_control_socket(socketName); in getLogSocket() local
188 if (sock < 0) { in getLogSocket()
189 sock = socket_local_server(socketName, in getLogSocket()
194 return sock; in getLogSocket()
Dmain.cpp339 int sock = TEMP_FAILURE_RETRY( in main() local
343 if (sock < 0) { in main()
347 ssize_t ret = TEMP_FAILURE_RETRY(write(sock, reinit, sizeof(reinit))); in main()
353 p.fd = sock; in main()
365 ret = TEMP_FAILURE_RETRY(read(sock, buffer, sizeof(buffer))); in main()
DCommandListener.cpp320 int sock = android_get_control_socket(socketName); in getLogSocket() local
322 if (sock < 0) { in getLogSocket()
323 sock = socket_local_server(socketName, in getLogSocket()
328 return sock; in getLogSocket()
/system/bt/tools/bdtool/
Dbdtool.c199 const btsock_interface_t *sock = bt_interface->get_profile_interface(BT_PROFILE_SOCKETS_ID); in main() local
202 … int error = sock->listen(BTSOCK_RFCOMM, "meow", (const uint8_t *)&HFP_AG_UUID, 0, &rfcomm_fd, 0); in main()
209 error = sock->listen(BTSOCK_SCO, NULL, NULL, 5, &sock_fd, 0); in main()
227 const btsock_interface_t *sock = bt_interface->get_profile_interface(BT_PROFILE_SOCKETS_ID); in main() local
230 …int error = sock->connect(&bt_remote_bdaddr, BTSOCK_RFCOMM, (const uint8_t *)&HFP_AG_UUID, 0, &rfc… in main()
241 error = sock->connect(&bt_remote_bdaddr, BTSOCK_SCO, NULL, 5, &sock_fd, 0); in main()
/system/core/include/sysutils/
DSocketClient.h34 SocketClient(int sock, bool owned);
35 SocketClient(int sock, bool owned, bool useCmdNum);
DFrameworkClient.h13 FrameworkClient(int sock);
DFrameworkListener.h39 FrameworkListener(int sock);
/system/core/libsysutils/src/
DFrameworkListener.cpp42 FrameworkListener::FrameworkListener(int sock) : in FrameworkListener() argument
43 SocketListener(sock, true) { in FrameworkListener()
/system/extras/tests/net_test/
Diproute.py363 self.sock = socket.socket(socket.AF_NETLINK, socket.SOCK_RAW,
365 self.sock.connect((0, 0)) # The kernel.
366 self.pid = self.sock.getsockname()[1]
371 self.sock.send(msg)
374 data = self.sock.recv(self.BUFSIZE)
Dnet_test.py83 def SetSocketTimeout(sock, ms): argument
86 sock.setsockopt(SOL_SOCKET, SO_RCVTIMEO, struct.pack("LL", s, us))
/system/core/libnetutils/
Ddhcpclient.c344 static int send_message(int sock, int if_index, dhcp_msg *msg, int size) in send_message() argument
349 return send_packet(sock, if_index, msg, size, INADDR_ANY, INADDR_BROADCAST, in send_message()