Home | History | Annotate | Download | only in iputils

Lines Matching full:sock

87 static int join(int sock, struct sockaddr_in *sin);
1103 int sock;
1112 sock = socket(AF_INET, SOCK_DGRAM, 0);
1113 if (sock < 0) {
1118 if (ioctl(sock, SIOCGIFNUM, (char *)&numifs) < 0) {
1128 (void) close(sock);
1137 (void) close(sock);
1145 if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
1147 (void) close(sock);
1156 if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
1174 if (ioctl(sock, SIOCGIFINDEX, (char *)&ifreq) < 0) {
1180 if (ioctl(sock, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
1195 if (ioctl(sock, SIOCGIFNETMASK, (char *)&ifreq) < 0) {
1202 if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
1223 (void) close(sock);
1228 join(int sock, struct sockaddr_in *sin)
1251 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
1264 int sock;
1267 sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
1268 if (sock < 0) {
1273 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
1275 (void) close(sock);
1278 (void) close(sock);
1492 int sock;
1504 sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
1505 if (sock < 0) {
1509 if (ioctl(sock, op, (char *)&rt) < 0) {
1513 (void) close(sock);