/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/drivers/ |
H A D | netlink.c | 19 int sock; member 36 static void netlink_receive(int sock, void *eloop_ctx, void *sock_ctx) in netlink_receive() argument 48 left = recvfrom(sock, buf, sizeof(buf), MSG_DONTWAIT, in netlink_receive() 100 netlink->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in netlink_init() 101 if (netlink->sock < 0) { in netlink_init() 111 if (bind(netlink->sock, (struct sockaddr *) &local, sizeof(local)) < 0) in netlink_init() 119 eloop_register_read_sock(netlink->sock, netlink_receive, netlink, in netlink_init() 132 if (netlink->sock >= 0) { in netlink_deinit() 133 eloop_unregister_read_sock(netlink->sock); in netlink_deinit() 134 close(netlink->sock); in netlink_deinit() [all...] |
H A D | driver_wired.c | 120 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx) in handle_read() argument 125 len = recv(sock, buf, sizeof(buf), 0); in handle_read() 135 static void handle_dhcp(int sock, void *eloop_ctx, void *sock_ctx) in handle_dhcp() argument 143 len = recv(sock, buf, sizeof(buf), 0); in handle_dhcp() 176 drv->common.sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_PAE)); in wired_init_sockets() 177 if (drv->common.sock < 0) { in wired_init_sockets() 183 if (eloop_register_read_sock(drv->common.sock, handle_read, in wired_init_sockets() 191 if (ioctl(drv->common.sock, SIOCGIFINDEX, &ifr) != 0) { in wired_init_sockets() 203 if (bind(drv->common.sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) in wired_init_sockets() 210 if (wired_multicast_membership(drv->common.sock, if in wired_init_sockets() [all...] |
/third_party/ltp/testcases/kernel/syscalls/setsockopt/ |
H A D | setsockopt06.c | 28 static int sock = -1; variable 54 ret = setsockopt(sock, SOL_PACKET, PACKET_RX_RING, &req, in thread_run() 72 sock = SAFE_SOCKET(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in run() 73 TEST(setsockopt(sock, SOL_PACKET, PACKET_VERSION, &val3, in run() 85 setsockopt(sock, SOL_PACKET, PACKET_VERSION, &val1, in run() 88 SAFE_CLOSE(sock); in run() 106 if (sock >= 0) in cleanup() 107 SAFE_CLOSE(sock); in cleanup()
|
H A D | setsockopt05.c | 62 int sock, i; in run() local 68 sock = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0); in run() 69 SAFE_CONNECT(sock, (struct sockaddr *)&addr, sizeof(addr)); in run() 70 SAFE_SEND(1, sock, buf, BUFSIZE, MSG_MORE); in run() 71 SAFE_SETSOCKOPT_INT(sock, SOL_SOCKET, SO_NO_CHECK, 1); in run() 72 send(sock, buf, 1, 0); in run() 73 SAFE_CLOSE(sock); in run()
|
/third_party/lwip/src/core/distributed_net/ |
H A D | distributed_net.c | 59 int sock = lwip_socket(AF_INET, SOCK_STREAM, 0); in try_connect_to_local_tcp_server() local 60 if (sock < 0) { in try_connect_to_local_tcp_server() 64 int ret = lwip_connect_internal(sock, (struct sockaddr *)&addr, sizeof(addr)); in try_connect_to_local_tcp_server() 65 (void)lwip_close_internal(sock); in try_connect_to_local_tcp_server() 70 void set_distributed_net_socket(int sock) in set_distributed_net_socket() argument 72 int index = SOCKET_TO_INDEX(sock); in set_distributed_net_socket() 80 void reset_distributed_net_socket(int sock) in reset_distributed_net_socket() argument 82 int index = SOCKET_TO_INDEX(sock); in reset_distributed_net_socket()
|
/third_party/python/Lib/ |
H A D | poplib.py | 104 self.sock = self._create_socket(timeout) 105 self.file = self.sock.makefile('rb') 117 self.sock.sendall(line + CRLF) 291 sock = self.sock 292 self.sock = None 293 if sock is not None: 295 sock.shutdown(socket.SHUT_RDWR) 304 sock.close() 410 self.sock [all...] |
H A D | ftplib.py | 102 sock = None variable in FTP 130 if self.sock is not None: 136 if self.sock is not None: 158 self.sock = socket.create_connection((self.host, self.port), self.timeout, 160 self.af = self.sock.family 161 self.file = self.sock.makefile('r', encoding=self.encoding) 202 self.sock.sendall(line.encode(self.encoding)) 272 self.sock.sendall(line, MSG_OOB) 313 sock = socket.create_server(("", 0), family=self.af, backlog=1) 314 port = sock [all...] |
/third_party/libuv/test/ |
H A D | test-poll-closesocket.c | 29 static uv_os_sock_t sock; variable 48 closesocket(sock); in poll_cb() 67 sock = socket(AF_INET, SOCK_STREAM, 0); in TEST_IMPL() 68 ASSERT_NE(sock, INVALID_SOCKET); in TEST_IMPL() 70 r = ioctlsocket(sock, FIONBIO, &on); in TEST_IMPL() 76 r = connect(sock, (const struct sockaddr*) &addr, sizeof addr); in TEST_IMPL() 80 r = uv_poll_init_socket(uv_default_loop(), &handle, sock); in TEST_IMPL()
|
H A D | test-poll-close-doesnt-corrupt-stack.c | 35 static uv_os_sock_t sock; variable 61 r = closesocket(sock); in close_socket_and_verify_stack() 84 sock = socket(AF_INET, SOCK_STREAM, 0); in TEST_IMPL() 85 ASSERT_NE(sock, INVALID_SOCKET); in TEST_IMPL() 87 r = ioctlsocket(sock, FIONBIO, &on); in TEST_IMPL() 93 r = connect(sock, (const struct sockaddr*) &addr, sizeof addr); in TEST_IMPL() 97 r = uv_poll_init_socket(uv_default_loop(), &handle, sock); in TEST_IMPL()
|
H A D | test-poll-multiple-handles.c | 47 uv_os_sock_t sock; in TEST_IMPL() local 58 sock = socket(AF_INET, SOCK_STREAM, 0); in TEST_IMPL() 60 ASSERT_NE(sock, INVALID_SOCKET); in TEST_IMPL() 62 ASSERT_NE(sock, -1); in TEST_IMPL() 66 sock)); in TEST_IMPL() 69 sock)); in TEST_IMPL()
|
/third_party/node/test/parallel/ |
H A D | test-gc-net-timeout.js | 12 function serverHandler(sock) { 13 sock.setTimeout(120000); 14 sock.resume(); 15 sock.on('close', function() { 18 sock.on('end', function() { 21 sock.on('error', function(err) { 25 sock.end('hello\n');
|
/third_party/python/Tools/ccbench/ |
H A D | ccbench.py | 264 def _sendto(sock, s, addr): 265 sock.sendto(s.encode('ascii'), addr) 267 def _recv(sock, n): 268 return sock.recv(n).decode('ascii') 271 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 276 _sendto(sock, "%r\n" % _time(), addr) 284 _sendto(sock, LAT_END + "\n", addr) 286 sock.close() 297 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 298 sock [all...] |
/third_party/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/ |
H A D | tirpc_svc_vc_create.c | 43 int sock; in main() local 45 sock = bound_socket(AF_INET, SOCK_STREAM); in main() 46 if (sock < 0) { in main() 51 if (listen(sock, 10) < 0) { in main() 56 transp = svc_vc_create(sock, 0, 0); in main() 62 close(sock); in main()
|
/third_party/curl/tests/libtest/ |
H A D | lib677.c | 38 curl_socket_t sock = CURL_SOCKET_BAD; in test() local 65 curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sock); in test() 66 if(sock == CURL_SOCKET_BAD) in test() 72 if(sock != CURL_SOCKET_BAD) { in test() 75 curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sock); in test() 76 waitfd.fd = sock; in test() 78 curl_multi_wait(mcurl, &waitfd, sock == CURL_SOCKET_BAD ? 0 : 1, 500, in test() 80 if((sock != CURL_SOCKET_BAD) && (waitfd.revents & waitfd.events)) { in test() 114 sock = CURL_SOCKET_BAD; in test()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/drivers/ |
H A D | driver_wired.c | 120 static void handle_read(int sock, void *eloop_ctx, void *sock_ctx) in handle_read() argument 125 len = recv(sock, buf, sizeof(buf), 0); in handle_read() 135 static void handle_dhcp(int sock, void *eloop_ctx, void *sock_ctx) in handle_dhcp() argument 143 len = recv(sock, buf, sizeof(buf), 0); in handle_dhcp() 176 drv->common.sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_PAE)); in wired_init_sockets() 177 if (drv->common.sock < 0) { in wired_init_sockets() 183 if (eloop_register_read_sock(drv->common.sock, handle_read, in wired_init_sockets() 191 if (ioctl(drv->common.sock, SIOCGIFINDEX, &ifr) != 0) { in wired_init_sockets() 203 if (bind(drv->common.sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) in wired_init_sockets() 210 if (wired_multicast_membership(drv->common.sock, if in wired_init_sockets() [all...] |
/third_party/ltp/testcases/kernel/syscalls/sendto/ |
H A D | sendto03.c | 34 static int dst_sock = -1, sock = -1; variable 44 sock = SAFE_SOCKET(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in setup() 47 SAFE_IOCTL(sock, SIOCSIFFLAGS, &ifr); in setup() 48 SAFE_IOCTL(sock, SIOCGIFINDEX, &ifr); in setup() 49 SAFE_CLOSE(sock); in setup() 166 sock = SAFE_SOCKET(AF_PACKET, SOCK_RAW, IPPROTO_RAW); in check_vnet_hdr() 167 SAFE_SENDTO(1, sock, buf, BUFSIZE, 0, (struct sockaddr *)&addr, in check_vnet_hdr() 170 SAFE_CLOSE(sock); in check_vnet_hdr() 192 if (sock != -1) in cleanup() 193 SAFE_CLOSE(sock); in cleanup() [all...] |
/third_party/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/lib/ |
H A D | librpc-tirpc.c | 28 int sock; in bound_socket() local 59 sock = socket(domain, type, 0); in bound_socket() 60 if (sock < 0) in bound_socket() 63 if (bind(sock, (struct sockaddr *)&addr, slen) < 0) { in bound_socket() 64 close(sock); in bound_socket() 68 return sock; in bound_socket()
|
/third_party/ltp/testcases/kernel/security/smack/ |
H A D | smack_set_socket_labels.c | 74 int sock; in set_socket_labels() local 78 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); in set_socket_labels() 79 if (sock < 0) in set_socket_labels() 82 flistxattr(sock, buf, 256); in set_socket_labels() 86 rc = fsetxattr(sock, anin, avin, strlen(avin) + 1, 0); in set_socket_labels() 92 rc = fsetxattr(sock, anout, avout, strlen(avout) + 1, 0); in set_socket_labels() 98 rc = fsetxattr(sock, annot, avnot, strlen(avnot) + 1, 0); in set_socket_labels()
|
/third_party/python/Lib/test/test_asyncio/ |
H A D | functional.py | 59 sock = socket.create_server(addr, family=family, backlog=backlog) 64 sock.settimeout(timeout) 67 self, sock, server_prog, timeout, max_clients) 73 sock = socket.socket(family, socket.SOCK_STREAM) 79 sock.settimeout(timeout) 82 self, sock, client_prog, timeout) 97 fn = os.path.join(td, 'sock') 120 def __init__(self, sock): 121 self.__sock = sock 174 def __init__(self, test, sock, pro [all...] |
/third_party/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/ |
H A D | tirpc_svc_dg_create.c | 43 int sock; in main() local 45 sock = bound_socket(AF_INET, SOCK_DGRAM); in main() 46 if (sock < 0) { in main() 51 transp = svc_dg_create(sock, 0, 0); in main() 57 close(sock); in main()
|
/third_party/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/ |
H A D | tirpc_bottomlevel_clnt_call.c | 57 int sock; in main() local 79 sock = bound_socket(AF_INET, SOCK_DGRAM); in main() 80 if (sock < 0) { in main() 85 client = clnt_dg_create(sock, &svcaddr, in main() 91 close(sock); in main() 105 close(sock); in main()
|
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/utils/ |
H A D | eloop.h | 39 * @sock: File descriptor number for the socket 43 typedef void (*eloop_sock_handler)(int sock, void *eloop_ctx, void *sock_ctx); 78 * @sock: File descriptor number for the socket 90 int eloop_register_read_sock(int sock, eloop_sock_handler handler, 95 * @sock: File descriptor number for the socket 100 void eloop_unregister_read_sock(int sock); 104 * @sock: File descriptor number for the socket 117 int eloop_register_sock(int sock, eloop_event_type type, 123 * @sock: File descriptor number for the socket 124 * @type: Type of event for which sock wa [all...] |
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/utils/ |
H A D | eloop.h | 39 * @sock: File descriptor number for the socket 43 typedef void (*eloop_sock_handler)(int sock, void *eloop_ctx, void *sock_ctx); 78 * @sock: File descriptor number for the socket 90 int eloop_register_read_sock(int sock, eloop_sock_handler handler, 95 * @sock: File descriptor number for the socket 100 void eloop_unregister_read_sock(int sock); 104 * @sock: File descriptor number for the socket 117 int eloop_register_sock(int sock, eloop_event_type type, 123 * @sock: File descriptor number for the socket 124 * @type: Type of event for which sock wa [all...] |
/third_party/python/Lib/test/ |
H A D | test_socket.py | 587 and bindSock(sock) to bind it to an unused address. 694 def bindSock(self, sock): 696 socket_helper.bind_unix_socket(sock, path) 715 def bindSock(self, sock): 716 socket_helper.bind_port(sock, host=self.host) 1208 with socket.socket() as sock: 1209 self.assertEqual(sock.gettimeout(), 10) 1214 with socket.socket() as sock: 1215 self.assertEqual(sock.gettimeout(), None) 1392 sock [all...] |
/third_party/curl/tests/server/ |
H A D | socksd.c | 291 curl_socket_t sock = socket(AF_INET, SOCK_STREAM, 0); in socksconnect() local 292 if(sock == CURL_SOCKET_BAD) in socksconnect() 300 rc = connect(sock, &me.sa, sizeof(me.sa4)); in socksconnect() 309 return sock; in socksconnect() 804 static curl_socket_t sockdaemon(curl_socket_t sock, in sockdaemon() argument 824 rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, in sockdaemon() 837 sclose(sock); in sockdaemon() 842 sclose(sock); in sockdaemon() 866 rc = bind(sock, &listener.sa, sizeof(listener.sa4)); in sockdaemon() 874 rc = bind(sock, in sockdaemon() 959 curl_socket_t sock = CURL_SOCKET_BAD; main() local [all...] |