Lines Matching refs:sock
88 static int join(int sock, struct sockaddr_in *sin);
1085 int sock;
1094 sock = socket(AF_INET, SOCK_DGRAM, 0);
1095 if (sock < 0) {
1100 if (ioctl(sock, SIOCGIFNUM, (char *)&numifs) < 0) {
1110 (void) close(sock);
1121 (void) close(sock);
1129 if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
1131 (void) close(sock);
1140 if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
1158 if (ioctl(sock, SIOCGIFINDEX, (char *)&ifreq) < 0) {
1164 if (ioctl(sock, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
1179 if (ioctl(sock, SIOCGIFNETMASK, (char *)&ifreq) < 0) {
1186 if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
1207 (void) close(sock);
1212 join(int sock, struct sockaddr_in *sin)
1225 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
1236 int sock;
1239 sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
1240 if (sock < 0) {
1245 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
1247 (void) close(sock);
1250 (void) close(sock);
1464 int sock;
1476 sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
1477 if (sock < 0) {
1481 if (ioctl(sock, op, (char *)&rt) < 0) {
1485 (void) close(sock);