Searched refs:sock (Results 1 - 13 of 13) sorted by relevance

/system/security/keystore/
H A Dkeystore_get.h44 int sock; local
49 sock = socket_local_client("keystore", ANDROID_SOCKET_NAMESPACE_RESERVED,
51 if (sock == -1) {
54 if (send(sock, &code, 1, 0) == 1 && send(sock, bytes, 2, 0) == 2 &&
55 send(sock, key, length, 0) == length && shutdown(sock, SHUT_WR) == 0 &&
56 recv(sock, &code, 1, 0) == 1 && code == /* NO_ERROR */ 1 &&
57 recv(sock, &bytes[0], 1, 0) == 1 && recv(sock,
[all...]
H A Dkeystore_cli.cpp51 int sock = socket_local_client("keystore", ANDROID_SOCKET_NAMESPACE_RESERVED, local
53 if (sock == -1) {
58 send(sock, argv[1], 1, 0);
64 send(sock, &bytes, 2, 0);
65 send(sock, argv[i], length, 0);
67 shutdown(sock, SHUT_WR);
70 if (recv(sock, &code, 1, 0) != 1) {
76 while ((i = recv(sock, &bytes[0], 1, 0)) == 1) {
79 if ((i = recv(sock, &bytes[1], 1, 0)) != 1) {
85 i = recv(sock,
[all...]
H A Dkeystore_client.cpp26 int sock; local
28 sock = socket_local_client("keystore", ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_STREAM);
29 if (sock == -1) {
33 if (TEMP_FAILURE_RETRY(send(sock, &cmd, 1, MSG_NOSIGNAL)) != 1) {
34 close(sock);
46 close(sock);
51 if (TEMP_FAILURE_RETRY(send(sock, bytes, 2, MSG_NOSIGNAL)) != 2
52 || TEMP_FAILURE_RETRY(send(sock, arg, argLen, MSG_NOSIGNAL))
55 close(sock);
62 if (shutdown(sock, SHUT_W
[all...]
H A Dkeystore.cpp853 static int recv_code(int sock, int8_t* code) { argument
854 return recv(sock, code, 1, 0) == 1;
857 static int recv_message(int sock, uint8_t* message, int length) { argument
859 if (recv(sock, &bytes[0], 1, 0) != 1 ||
860 recv(sock, &bytes[1], 1, 0) != 1) {
870 int n = recv(sock, &message[offset], length - offset, 0);
880 static int recv_end_of_file(int sock) { argument
882 return recv(sock, &byte, 1, 0) == 0;
885 static void send_code(int sock, int8_t code) { argument
886 send(sock,
889 send_message(int sock, const uint8_t* message, int length) argument
939 get(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value*, Value*) argument
980 saw(KeyStore*, int sock, uid_t uid, Value* keyPrefix, Value*, Value*) argument
1052 unlock(KeyStore* keyStore, int sock, uid_t uid, Value* pw, Value* unused, Value* unused2) argument
1114 get_pubkey(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value*, Value*) argument
1180 sign(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value* data, Value*) argument
1276 getmtime(KeyStore*, int sock, uid_t uid, Value* keyName, Value*, Value*) argument
1375 process(KeyStore* keyStore, int sock, uid_t uid, int8_t code) argument
1441 int sock; local
[all...]
/system/vold/
H A 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; local
45 if ((sock = socket_local_client("vold",
53 exit(do_monitor(sock, 0));
54 exit(do_cmd(sock, argc, argv));
57 static int do_cmd(int sock, int argc, char **argv) { argument
76 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) {
81 return do_monitor(sock, 1);
84 static int do_monitor(int sock, in argument
[all...]
/system/netd/
H A 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; local
47 if ((sock = socket_local_client(argv[1],
50 if ((sock = socket_local_client("netd",
63 exit(do_monitor(sock, 0));
64 exit(do_cmd(sock, argc-cmdOffset, &(argv[cmdOffset])));
67 static int do_cmd(int sock, int argc, char **argv) { argument
96 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) {
103 return do_monitor(sock,
106 do_monitor(int sock, int stop_after_cmd) argument
[all...]
H A DNetlinkManager.cpp53 NetlinkHandler *NetlinkManager::setupSocket(int *sock, int netlinkFamily, argument
65 if ((*sock = socket(PF_NETLINK, SOCK_DGRAM, netlinkFamily)) < 0) {
70 if (setsockopt(*sock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
72 close(*sock);
76 if (setsockopt(*sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
78 close(*sock);
82 if (bind(*sock, (struct sockaddr *) &nladdr, sizeof(nladdr)) < 0) {
84 close(*sock);
88 NetlinkHandler *handler = new NetlinkHandler(this, *sock, format);
91 close(*sock);
[all...]
H A DNetlinkManager.h59 NetlinkHandler* setupSocket(int *sock, int netlinkFamily, int groups,
/system/core/include/sysutils/
H A DFrameworkClient.h13 FrameworkClient(int sock);
H A DSocketClient.h33 SocketClient(int sock, bool owned);
34 SocketClient(int sock, bool owned, bool useCmdNum);
/system/core/libnl_2/genl/
H A Dgenl.c93 int genl_ctrl_alloc_cache(struct nl_sock *sock, struct nl_cache **result) argument
114 nlmhdr.nlmsg_seq = sock->s_seq_next;
115 nlmhdr.nlmsg_pid = sock->s_local.nl_pid;
131 msg.msg_name = (void *) &sock->s_peer;
132 msg.msg_namelen = sizeof(sock->s_peer);
140 num_char = sendmsg(sock->s_fd, &msg, 0);
167 recvmsg_len = recvmsg(sock->s_fd, &msg, 0);
/system/core/libcutils/
H A Dproperties.c95 int sock = -1; local
100 sock = socket(AF_UNIX, SOCK_STREAM, 0);
101 if (sock < 0) {
109 cc = connect(sock, (struct sockaddr*) &addr, SUN_LEN(&addr));
115 close(sock);
119 return sock;
/system/core/libnetutils/
H A Ddhcpclient.c342 static int send_message(int sock, int if_index, dhcp_msg *msg, int size) argument
347 return send_packet(sock, if_index, msg, size, INADDR_ANY, INADDR_BROADCAST,

Completed in 1037 milliseconds