Lines Matching refs:netlinkfd
52 if ((daemon->netlinkfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1) { in netlink_init()
53 if (bind(daemon->netlinkfd, (struct sockaddr*) &addr, sizeof(addr)) == -1) { in netlink_init()
56 bind(daemon->netlinkfd, (struct sockaddr*) &addr, sizeof(addr)) == -1) in netlink_init()
57 daemon->netlinkfd = -1; in netlink_init()
61 if (daemon->netlinkfd == -1 || in netlink_init()
62 getsockname(daemon->netlinkfd, (struct sockaddr*) &addr, &slen) == 1) in netlink_init()
86 … while ((rc = recvmsg(daemon->netlinkfd, &msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR) in netlink_recv()
101 while ((rc = recvmsg(daemon->netlinkfd, &msg, 0)) == -1 && errno == EINTR) in netlink_recv()
143 while ((len = sendto(daemon->netlinkfd, (void*) &req, sizeof(req), 0, (struct sockaddr*) &addr, in iface_enumerate()
221 if ((flags = fcntl(daemon->netlinkfd, F_GETFL)) == -1 || in netlink_multicast()
222 fcntl(daemon->netlinkfd, F_SETFL, flags | O_NONBLOCK) == -1) in netlink_multicast()
234 fcntl(daemon->netlinkfd, F_SETFL, flags); in netlink_multicast()