Lines Matching refs:daemon
66 for (bridge = daemon->bridges; bridge; bridge = bridge->next) in iface_check()
90 if (daemon->if_names || (addr && daemon->if_addrs)) in iface_check()
94 for (tmp = daemon->if_names; tmp; tmp = tmp->next) in iface_check()
98 for (tmp = daemon->if_addrs; tmp; tmp = tmp->next) in iface_check()
115 for (tmp = daemon->if_except; tmp; tmp = tmp->next) in iface_check()
159 if (daemon->if_names && loopback) in iface_allowed()
162 for (lo = daemon->if_names; lo; lo = lo->next) in iface_allowed()
175 lo->next = daemon->if_names; in iface_allowed()
176 daemon->if_names = lo; in iface_allowed()
184 for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next) in iface_allowed()
226 addr.in6.sin6_port = htons(daemon->port); in iface_allowed_v6()
253 addr.in.sin_port = htons(daemon->port); in iface_allowed_v4()
261 return iface_enumerate(&daemon->interfaces, iface_allowed_v4, iface_allowed_v6); in enumerate_interfaces()
263 return iface_enumerate(&daemon->interfaces, iface_allowed_v4, NULL); in enumerate_interfaces()
343 addr.in.sin_port = htons(daemon->port); in create_wildcard_listeners()
348 if (daemon->port != 0) in create_wildcard_listeners()
360 !create_ipv6_listener(&l6, daemon->port) || in create_wildcard_listeners()
374 uint32_t mark = daemon->listen_mark; in create_wildcard_listeners()
392 if (daemon->options & OPT_TFTP) in create_wildcard_listeners()
450 if (daemon->port != 0) in create_bound_listener()
492 prettyprint_addr(&iface->addr, daemon->namebuff); in create_bound_listener()
493 die(_("failed to bind listening socket for %s: %s"), daemon->namebuff, EC_BADNET); in create_bound_listener()
496 uint32_t mark = daemon->listen_mark; in create_bound_listener()
507 if ((daemon->options & OPT_TFTP) && iface->addr.sa.sa_family == AF_INET && iface->dhcp_ok) in create_bound_listener()
535 for (l = daemon->listeners; l; l = l->next) { in fixup_possible_existing_listener()
556 int port = prettyprint_addr(&listener->iface->addr, daemon->namebuff); in delete_listener()
557 my_syslog(LOG_INFO, _("Closing listener [%s]:%d"), daemon->namebuff, port); in delete_listener()
596 struct listener **l = &daemon->listeners; in close_bound_listener()
627 for (iface = daemon->interfaces; iface; iface = iface->next) in create_bound_listeners()
641 if (daemon->port != 0) in create_bound_listeners()
681 prettyprint_addr(&iface->addr, daemon->namebuff); in create_bound_listeners()
683 daemon->namebuff, EC_BADNET); in create_bound_listeners()
691 if ((daemon->options & OPT_TFTP) && iface->addr.sa.sa_family == AF_INET && iface->dhcp_ok) in create_bound_listeners()
719 unsigned int ports_avail = 65536u - (unsigned short)daemon->min_port; in random_sock()
732 if (daemon->min_port != 0) in random_sock()
733 port = htons(daemon->min_port + (port % ((unsigned short)ports_avail))); in random_sock()
805 if (!daemon->osport && intname[0] == 0) in allocate_sfd()
823 for (sfd = daemon->sfds; sfd; sfd = sfd->next ) in allocate_sfd()
852 sfd->next = daemon->sfds; in allocate_sfd()
853 daemon->sfds = sfd; in allocate_sfd()
863 if (daemon->query_port != 0) in pre_allocate_sfds()
869 addr.in.sin_port = htons(daemon->query_port); in pre_allocate_sfds()
878 addr.in6.sin6_port = htons(daemon->query_port); in pre_allocate_sfds()
886 for (srv = daemon->servers; srv; srv = srv->next) in pre_allocate_sfds()
890 (daemon->options & OPT_NOWILD)) in pre_allocate_sfds()
892 prettyprint_addr(&srv->addr, daemon->namebuff); in pre_allocate_sfds()
895 strcat(daemon->namebuff, " "); in pre_allocate_sfds()
896 strcat(daemon->namebuff, srv->interface); in pre_allocate_sfds()
899 daemon->namebuff, EC_BADNET); in pre_allocate_sfds()
910 for (new = daemon->servers; new; new = tmp) in check_servers()
916 port = prettyprint_addr(&new->addr, daemon->namebuff); in check_servers()
926 for (iface = daemon->interfaces; iface; iface = iface->next) in check_servers()
931 my_syslog(LOG_WARNING, _("ignoring nameserver %s - local interface"), daemon->namebuff); in check_servers()
943 daemon->namebuff, strerror(errno)); in check_servers()
966 my_syslog(LOG_INFO, _("using nameserver %s#%d for %s %s"), daemon->namebuff, port, s1, s2); in check_servers()
969 my_syslog(LOG_INFO, _("using nameserver %s#%d(via %s)"), daemon->namebuff, port, new->interface); in check_servers()
971 my_syslog(LOG_INFO, _("using nameserver %s#%d"), daemon->namebuff, port); in check_servers()
974 daemon->servers = ret; in check_servers()
998 prev_if_names = daemon->if_names; in set_interfaces()
999 daemon->if_names = NULL; in set_interfaces()
1001 prev_interfaces = daemon->interfaces; in set_interfaces()
1002 daemon->interfaces = NULL; in set_interfaces()
1020 if_tmp->next = daemon->if_names; in set_interfaces()
1021 daemon->if_names = if_tmp; in set_interfaces()
1033 for (if_tmp = daemon->if_names; if_tmp; if_tmp = if_tmp->next) { in set_interfaces()
1043 for (new_iface = daemon->interfaces; new_iface; new_iface = new_iface->next) { in set_interfaces()
1065 if (was_wild) daemon->options |= OPT_NOWILD; in set_interfaces()
1068 for (new_iface = daemon->interfaces; new_iface; new_iface = new_iface->next) { in set_interfaces()
1086 create_bound_listener(&(daemon->listeners), new_iface); in set_interfaces()
1125 for (serv = daemon->servers; serv;) in set_servers()
1160 source_addr.in.sin_port = htons(daemon->query_port); in set_servers()
1168 source_addr.in6.sin6_port = htons(daemon->query_port); in set_servers()
1204 daemon->servers = new_servers; in set_servers()
1230 for (serv = daemon->servers; serv;) in reload_servers()
1248 while ((line = fgets(daemon->namebuff, MAXDNAME, f))) in reload_servers()
1268 source_addr.in.sin_port = htons(daemon->query_port); in reload_servers()
1276 source_addr.in6.sin6_port = htons(daemon->query_port); in reload_servers()
1313 daemon->servers = new_servers; in reload_servers()
1326 for (l = daemon->listeners; l && l->family != AF_INET; l = l->next); in get_ifaddr()