/external/iputils/ |
ping.c | 319 int probe_fd = socket(AF_INET, SOCK_DGRAM, 0); local 321 if (probe_fd < 0) { 333 rc = setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1); 339 if (ioctl(probe_fd, SIOCGIFINDEX, &ifr) < 0) { 345 if (setsockopt(probe_fd, SOL_IP, IP_MULTICAST_IF, &imr, sizeof(imr)) == -1) { 357 setsockopt(probe_fd, IPPROTO_IP, IP_TOS, (char *)&settos, sizeof(int)) < 0) 363 if (connect(probe_fd, (struct sockaddr*)&dst, sizeof(dst)) == -1) { 370 if (setsockopt(probe_fd, SOL_SOCKET, SO_BROADCAST, 375 if (connect(probe_fd, (struct sockaddr*)&dst, sizeof(dst)) == -1) { 385 if (getsockname(probe_fd, (struct sockaddr*)&source, &alen) == -1) [all...] |
traceroute6.c | 544 int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0); local 546 if (probe_fd < 0) { 551 if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1) == -1) 555 if (connect(probe_fd, (struct sockaddr*)&firsthop, sizeof(firsthop)) == -1) { 560 if (getsockname(probe_fd, (struct sockaddr*)&saddr, &alen) == -1) { 565 close(probe_fd);
|
arping.c | 1124 int probe_fd = socket(AF_INET, SOCK_DGRAM, 0); local 1126 if (probe_fd < 0) { 1133 if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device.name, strlen(device.name)+1) == -1) 1142 if (bind(probe_fd, (struct sockaddr*)&saddr, sizeof(saddr)) == -1) { 1153 if (setsockopt(probe_fd, SOL_SOCKET, SO_DONTROUTE, (char*)&on, sizeof(on)) == -1) 1155 if (connect(probe_fd, (struct sockaddr*)&saddr, sizeof(saddr)) == -1) { 1159 if (getsockname(probe_fd, (struct sockaddr*)&saddr, &alen) == -1) { 1165 close(probe_fd);
|
ping6.c | 957 int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0); local 959 if (probe_fd < 0) { 982 setsockopt(probe_fd, IPPROTO_IPV6, IPV6_PKTINFO, &ipi, sizeof(ipi)) == -1 && 984 setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1) == -1) { 991 if (connect(probe_fd, (struct sockaddr*)&firsthop, sizeof(firsthop)) == -1) { 996 if (getsockname(probe_fd, (struct sockaddr*)&source, &alen) == -1) { 1001 close(probe_fd); [all...] |