Lines Matching refs:daemon

54   if ((daemon->netlinkfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1)  in netlink_init()
56 if (bind(daemon->netlinkfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) in netlink_init()
59 if (errno != EPERM || bind(daemon->netlinkfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) in netlink_init()
60 daemon->netlinkfd = -1; in netlink_init()
64 if (daemon->netlinkfd == -1 || in netlink_init()
65 getsockname(daemon->netlinkfd, (struct sockaddr *)&addr, &slen) == 1) in netlink_init()
91 while ((rc = recvmsg(daemon->netlinkfd, &msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR); in netlink_recv()
108 while ((rc = recvmsg(daemon->netlinkfd, &msg, 0)) == -1 && errno == EINTR); in netlink_recv()
152 while((len = sendto(daemon->netlinkfd, (void *)&req, sizeof(req), 0, in iface_enumerate()
243 if ((flags = fcntl(daemon->netlinkfd, F_GETFL)) == -1 || in netlink_multicast()
244 fcntl(daemon->netlinkfd, F_SETFL, flags | O_NONBLOCK) == -1) in netlink_multicast()
257 fcntl(daemon->netlinkfd, F_SETFL, flags); in netlink_multicast()
284 daemon->last_resolv = 0; in nl_routechange()
286 if (daemon->srv_save) in nl_routechange()
288 if (daemon->srv_save->sfd) in nl_routechange()
289 fd = daemon->srv_save->sfd->fd; in nl_routechange()
290 else if (daemon->rfd_save && daemon->rfd_save->refcount != 0) in nl_routechange()
291 fd = daemon->rfd_save->fd; in nl_routechange()
295 while(sendto(fd, daemon->packet, daemon->packet_len, 0, in nl_routechange()
296 &daemon->srv_save->addr.sa, sa_len(&daemon->srv_save->addr)) == -1 && retry_send()); in nl_routechange()