Home
last modified time | relevance | path

Searched refs:sock_fd (Results 1 – 17 of 17) sorted by relevance

/external/ltp/testcases/network/stress/ns-tools/
Dns-udpserver.c141 void respond_to_client(sock_fd) in respond_to_client() argument
151 if (getsockopt(sock_fd, SOL_SOCKET, SO_RCVBUF, in respond_to_client()
154 close(sock_fd); in respond_to_client()
162 close(sock_fd); in respond_to_client()
168 if ((msglen = recvfrom(sock_fd, msgbuf, msgbuf_size, 0, in respond_to_client()
178 if (sendto(sock_fd, msgbuf, msglen, 0, in respond_to_client()
196 int sock_fd; /* socket binded open ports */ in main() local
296 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
297 if (sock_fd < 0) in main()
305 (sock_fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(int))) in main()
[all …]
Dns-tcpclient.c135 int sock_fd; /* socket descriptor for a connection */ in main() local
270 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
271 if (sock_fd < 0) in main()
276 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) in main()
281 maximize_sockbuf(sock_fd); in main()
284 if (connect(sock_fd, res->ai_addr, res->ai_addrlen) < 0) in main()
298 (sock_fd, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &sock_optlen) < 0) in main()
301 fprintf(stderr, "recvbuf size of socket(%d) is %d\n", sock_fd, in main()
319 recvbyte_size = recv(sock_fd, recvbuf, recvbuf_size, 0); in main()
337 if (close(sock_fd) < 0) in main()
Dns-icmpv4_sender.c315 int sock_fd; /* Socket for ioctl() */ in complete_eth_addrs() local
318 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) in complete_eth_addrs()
329 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFHWADDR); in complete_eth_addrs()
333 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFINDEX); in complete_eth_addrs()
337 close(sock_fd); in complete_eth_addrs()
546 int sock_fd; in send_packets() local
552 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); in send_packets()
553 if (sock_fd < 0) in send_packets()
557 retval = bind(sock_fd, (struct sockaddr *)&(fake_p->saddr_ll), in send_packets()
582 retval = sendto(sock_fd, &pkt, fake_p->pkt_size, 0, in send_packets()
[all …]
Dns-udpclient.c148 int sock_fd; /* socket descriptor to access */ in main() local
274 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
275 if (sock_fd < 0) in main()
280 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) in main()
309 if (sendto(sock_fd, message, MESSAGE_LEN, 0, in main()
320 if ((recvlen = recvfrom(sock_fd, recvbuf, MESSAGE_LEN, 0, in main()
Dns-icmpv6_sender.c176 int sock_fd; /* Socket for ioctl() */ in specify_hw_addr() local
179 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) in specify_hw_addr()
189 get_ifinfo(&ifinfo, sock_fd, ifname, SIOCGIFHWADDR); in specify_hw_addr()
194 close(sock_fd); in specify_hw_addr()
716 int sock_fd; in send_packets() local
722 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IPV6)); in send_packets()
723 if (sock_fd < 0) in send_packets()
727 retval = bind(sock_fd, (struct sockaddr *)&(info_p->saddr_ll), in send_packets()
752 retval = sendto(sock_fd, &pkt, info_p->pkt_size, 0, in send_packets()
772 close(sock_fd); in send_packets()
Dns-tcpserver.c291 int communicate_client(struct server_info *info_p, int sock_fd) in communicate_client() argument
304 (sock_fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, in communicate_client()
307 if (close(sock_fd)) in communicate_client()
319 if (close(sock_fd)) in communicate_client()
333 sntbyte_size = send(sock_fd, sendmsg, sndbuf_size, 0); in communicate_client()
362 if (close(sock_fd)) in communicate_client()
Dns-common.c304 void get_ifinfo(struct ifreq *ans, int sock_fd, const char *ifname, int query) in get_ifinfo() argument
309 if (ioctl(sock_fd, query, ans) < 0) in get_ifinfo()
Dns-traffic.h232 void get_ifinfo(struct ifreq *ans, int sock_fd, const char *ifname, int query);
/external/mesa3d/src/gallium/winsys/virgl/vtest/
Dvirgl_vtest_socket.c99 virgl_block_write(vws->sock_fd, &buf, sizeof(buf)); in virgl_vtest_send_init()
100 virgl_block_write(vws->sock_fd, (void *)cmdline, strlen(cmdline) + 1); in virgl_vtest_send_init()
124 vws->sock_fd = sock; in virgl_vtest_connect()
139 virgl_block_write(vws->sock_fd, &get_caps_buf, sizeof(get_caps_buf)); in virgl_vtest_send_get_caps()
141 ret = virgl_block_read(vws->sock_fd, resp_buf, sizeof(resp_buf)); in virgl_vtest_send_get_caps()
145 ret = virgl_block_read(vws->sock_fd, &caps->caps, sizeof(union virgl_caps)); in virgl_vtest_send_get_caps()
178 virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_send_resource_create()
179 virgl_block_write(vws->sock_fd, &res_create_buf, sizeof(res_create_buf)); in virgl_vtest_send_resource_create()
192 virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_submit_cmd()
193 virgl_block_write(vws->sock_fd, cbuf->buf, cbuf->base.cdw * 4); in virgl_vtest_submit_cmd()
[all …]
Dvirgl_vtest_winsys.h46 int sock_fd; member
/external/ltp/testcases/kernel/containers/share/
Dns_ifmove.c52 int sock_fd; in get_intf_index_from_name() local
58 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in get_intf_index_from_name()
59 if (sock_fd == -1) { in get_intf_index_from_name()
65 if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { in get_intf_index_from_name()
67 close(sock_fd); in get_intf_index_from_name()
71 close(sock_fd); in get_intf_index_from_name()
/external/libpcap/
Dpcap-linux.c430 static int has_wext(int sock_fd, const char *device, char *ebuf);
432 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
679 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
683 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument
691 ifindex = iface_get_id(sock_fd, device, handle->errbuf);
780 del_mon_if(handle, sock_fd, state, device, mondevice);
794 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument
801 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf);
848 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device) argument
886 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice);
[all …]
/external/python/cpython2/Modules/
Dsocketmodule.c495 #define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0.0)
629 sendsegmented(int sock_fd, char *buf, int len, int flags) in sendsegmented() argument
638 n = send(sock_fd, buf, segment, flags); in sendsegmented()
664 setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK, in internal_setblocking()
671 ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block)); in internal_setblocking()
674 ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block); in internal_setblocking()
676 delay_flag = fcntl(s->sock_fd, F_GETFL, 0); in internal_setblocking()
681 fcntl(s->sock_fd, F_SETFL, delay_flag); in internal_setblocking()
685 ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block); in internal_setblocking()
689 socketioctl(s->sock_fd, FIONBIO, (u_long*)&block); in internal_setblocking()
[all …]
Dsocketmodule.h126 SOCKET_T sock_fd; /* Socket file descriptor */ member
D_ssl.c570 SSL_set_fd(self->ssl, Py_SAFE_DOWNCAST(sock->sock_fd, SOCKET_T, int)); in newPySSLSocket()
1624 if (s->sock_fd < 0) in check_socket_and_wait_for_timeout()
1634 pollfd.fd = s->sock_fd; in check_socket_and_wait_for_timeout()
1648 if (!_PyIsSelectable_fd(s->sock_fd)) in check_socket_and_wait_for_timeout()
1655 FD_SET(s->sock_fd, &fds); in check_socket_and_wait_for_timeout()
1660 rc = select(s->sock_fd+1, NULL, &fds, NULL, &tv); in check_socket_and_wait_for_timeout()
1662 rc = select(s->sock_fd+1, &fds, NULL, NULL, &tv); in check_socket_and_wait_for_timeout()
1900 if (sock->sock_fd < 0) { in PySSL_SSLshutdown()
/external/ppp/pppd/
Dsys-linux.c179 static int sock_fd = -1; /* socket for doing interface ioctls */ variable
317 sock_fd = socket(AF_INET, SOCK_DGRAM, 0); in sys_init()
318 if (sock_fd < 0) in sys_init()
369 if (sock_fd >= 0) in sys_close()
370 close(sock_fd); in sys_close()
1200 if (ifunit >= 0 && ioctl(sock_fd, SIOCSIFMTU, (caddr_t) &ifr) < 0) in netif_set_mtu()
1215 if (ifunit >= 0 && ioctl(sock_fd, SIOCGIFMTU, (caddr_t) &ifr) < 0) { in netif_get_mtu()
1383 if (ioctl(sock_fd, SIOCGPPPSTATS, &req) < 0) {
1649 if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { in sifdefaultroute()
1682 if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { in cifdefaultroute()
[all …]
/external/compiler-rt/lib/sanitizer_common/
Dsanitizer_common_interceptors.inc2168 INTERCEPTOR(int, getsockname, int sock_fd, void *addr, int *addrlen) {
2170 COMMON_INTERCEPTOR_ENTER(ctx, getsockname, sock_fd, addr, addrlen);
2176 int res = REAL(getsockname)(sock_fd, addr, addrlen);