Lines Matching refs:udp_sock
169 int udp_sock; member
201 if (sendto(iapp->udp_sock, buf, (char *) (add + 1) - buf, 0, in iapp_send_add()
315 len = recvfrom(iapp->udp_sock, buf, sizeof(buf), 0, in iapp_receive_udp()
390 iapp->udp_sock = iapp->packet_sock = -1; in iapp_init()
396 iapp->udp_sock = socket(PF_INET, SOCK_DGRAM, 0); in iapp_init()
397 if (iapp->udp_sock < 0) { in iapp_init()
406 if (ioctl(iapp->udp_sock, SIOCGIFINDEX, &ifr) != 0) { in iapp_init()
414 if (ioctl(iapp->udp_sock, SIOCGIFADDR, &ifr) != 0) { in iapp_init()
429 if (ioctl(iapp->udp_sock, SIOCGIFBRDADDR, &ifr) != 0) { in iapp_init()
448 if (setsockopt(iapp->udp_sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, in iapp_init()
459 if (bind(iapp->udp_sock, (struct sockaddr *) &uaddr, in iapp_init()
471 if (setsockopt(iapp->udp_sock, SOL_IP, IP_ADD_MEMBERSHIP, &mreq, in iapp_init()
498 if (eloop_register_read_sock(iapp->udp_sock, iapp_receive_udp, in iapp_init()
523 if (iapp->udp_sock >= 0) { in iapp_deinit()
528 if (setsockopt(iapp->udp_sock, SOL_IP, IP_DROP_MEMBERSHIP, in iapp_deinit()
534 eloop_unregister_read_sock(iapp->udp_sock); in iapp_deinit()
535 close(iapp->udp_sock); in iapp_deinit()