/external/ltp/testcases/kernel/containers/share/ |
H A D | ns_ifmove.c | 52 int sock_fd; local 58 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); 59 if (sock_fd == -1) { 65 if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { 67 close(sock_fd); 71 close(sock_fd);
|
/external/ltp/testcases/network/stress/ns-tools/ |
H A D | ns-tcpclient.c | 135 int sock_fd; /* socket descriptor for a connection */ local 270 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); 271 if (sock_fd < 0) 276 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) 281 maximize_sockbuf(sock_fd); 284 if (connect(sock_fd, res->ai_addr, res->ai_addrlen) < 0) 298 (sock_fd, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &sock_optlen) < 0) 301 fprintf(stderr, "recvbuf size of socket(%d) is %d\n", sock_fd, 319 recvbyte_size = recv(sock_fd, recvbuf, recvbuf_size, 0); 337 if (close(sock_fd) < [all...] |
H A D | ns-udpclient.c | 148 int sock_fd; /* socket descriptor to access */ local 274 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); 275 if (sock_fd < 0) 280 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) 309 if (sendto(sock_fd, message, MESSAGE_LEN, 0, 320 if ((recvlen = recvfrom(sock_fd, recvbuf, MESSAGE_LEN, 0,
|
H A D | ns-udpserver.c | 136 * sock_fd: socket file descriptor 141 void respond_to_client(sock_fd) 151 if (getsockopt(sock_fd, SOL_SOCKET, SO_RCVBUF, 154 close(sock_fd); 162 close(sock_fd); 168 if ((msglen = recvfrom(sock_fd, msgbuf, msgbuf_size, 0, 178 if (sendto(sock_fd, msgbuf, msglen, 0, 196 int sock_fd; /* socket binded open ports */ local 296 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); 297 if (sock_fd < [all...] |
H A D | ns-icmpv4_sender.c | 315 int sock_fd; /* Socket for ioctl() */ local 318 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) 329 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFHWADDR); 333 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFINDEX); 337 close(sock_fd); 546 int sock_fd; local 552 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); 553 if (sock_fd < 0) 557 retval = bind(sock_fd, (struct sockaddr *)&(fake_p->saddr_ll), 582 retval = sendto(sock_fd, [all...] |
H A D | ns-tcpserver.c | 284 * sock_fd: socket descriptor to communicate with client 291 int communicate_client(struct server_info *info_p, int sock_fd) argument 304 (sock_fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, 307 if (close(sock_fd)) 319 if (close(sock_fd)) 333 sntbyte_size = send(sock_fd, sendmsg, sndbuf_size, 0); 362 if (close(sock_fd))
|
H A D | ns-common.c | 296 * sock_fd : socket file descriptor 304 void get_ifinfo(struct ifreq *ans, int sock_fd, const char *ifname, int query) argument 309 if (ioctl(sock_fd, query, ans) < 0)
|
H A D | ns-icmpv6_sender.c | 176 int sock_fd; /* Socket for ioctl() */ local 179 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) 189 get_ifinfo(&ifinfo, sock_fd, ifname, SIOCGIFHWADDR); 194 close(sock_fd); 716 int sock_fd; local 722 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IPV6)); 723 if (sock_fd < 0) 727 retval = bind(sock_fd, (struct sockaddr *)&(info_p->saddr_ll), 752 retval = sendto(sock_fd, &pkt, info_p->pkt_size, 0, 772 close(sock_fd); [all...] |
/external/libpcap/ |
H A D | pcap-linux.c | 419 static int has_wext(int sock_fd, const char *device, char *ebuf); 421 static int enter_rfmon_mode(pcap_t *handle, int sock_fd, 669 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument 676 ifindex = iface_get_id(sock_fd, device, handle->errbuf); 765 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, argument 772 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf); 819 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device) argument 857 ret = add_mon_if(handle, sock_fd, &nlstate, device, mondevice); 905 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr) == -1) { 909 del_mon_if(handle, sock_fd, 988 int sock_fd; local 2710 map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype, const char *device, int cooked_ok) argument 3145 int sock_fd = -1, arptype; local 5114 has_wext(int sock_fd, const char *device, char *ebuf) argument 5162 enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device) argument 5778 enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device) argument [all...] |
/external/ppp/pppd/ |
H A D | sys-linux.c | 179 static int sock_fd = -1; /* socket for doing interface ioctls */ variable 317 sock_fd = socket(AF_INET, SOCK_DGRAM, 0); 318 if (sock_fd < 0) 369 if (sock_fd >= 0) 370 close(sock_fd); 1200 if (ifunit >= 0 && ioctl(sock_fd, SIOCSIFMTU, (caddr_t) &ifr) < 0) 1215 if (ifunit >= 0 && ioctl(sock_fd, SIOCGIFMTU, (caddr_t) &ifr) < 0) { 1383 if (ioctl(sock_fd, SIOCGPPPSTATS, &req) < 0) { 1649 if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { 1682 if (ioctl(sock_fd, SIOCDELR 1871 int ret, sock_fd; local [all...] |