Lines Matching refs:daemon
57 if (daemon->options & OPT_NOWILD) in dhcp_init()
70 saddr.sin_port = htons(daemon->dhcp_server_port); in dhcp_init()
79 daemon->dhcpfd = fd; in dhcp_init()
86 if (daemon->options & OPT_NO_PING) in dhcp_init()
87 daemon->dhcp_icmp_fd = -1; in dhcp_init()
88 else if ((daemon->dhcp_icmp_fd = make_icmp_sock()) == -1 || in dhcp_init()
89 setsockopt(daemon->dhcp_icmp_fd, SOL_SOCKET, SO_RCVBUF, &oneopt, sizeof(oneopt)) == -1 ) in dhcp_init()
98 daemon->dhcp_packet.iov_len = sizeof(struct dhcp_packet); in dhcp_init()
99 daemon->dhcp_packet.iov_base = safe_malloc(daemon->dhcp_packet.iov_len); in dhcp_init()
132 msg.msg_iov = &daemon->dhcp_packet; in dhcp_packet()
138 while ((sz = recvmsg(daemon->dhcpfd, &msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR); in dhcp_packet()
148 if ((size_t)sz == daemon->dhcp_packet.iov_len) in dhcp_packet()
150 if (!expand_buf(&daemon->dhcp_packet, sz + 100)) in dhcp_packet()
155 expand_buf(&daemon->dhcp_packet, sz); in dhcp_packet()
161 mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_packet()
168 while ((sz = recvmsg(daemon->dhcpfd, &msg, 0)) == -1 && errno == EINTR); in dhcp_packet()
198 if (!indextoname(daemon->dhcpfd, iface_index, ifr.ifr_name)) in dhcp_packet()
208 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) != -1 ) in dhcp_packet()
217 for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next) in dhcp_packet()
224 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) == -1) in dhcp_packet()
234 for (context = daemon->dhcp; context; context = context->next) in dhcp_packet()
258 iov.iov_base = daemon->dhcp_packet.iov_base; in dhcp_packet()
261 mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_packet()
270 dest.sin_port = htons(daemon->dhcp_server_port); in dhcp_packet()
282 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
302 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
310 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
316 ioctl(daemon->dhcpfd, SIOCSARP, &req); in dhcp_packet()
323 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
335 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
340 ioctl(daemon->dhcpfd, SIOCSARP, &req); in dhcp_packet()
351 setsockopt(daemon->dhcpfd, IPPROTO_IP, IP_BOUND_IF, &iface_index, sizeof(iface_index)); in dhcp_packet()
354 while(sendmsg(daemon->dhcpfd, &msg, 0) == -1 && retry_send()); in dhcp_packet()
373 for (context = daemon->dhcp; context; context = context->next) in complete_context()
383 strcpy(daemon->dhcp_buff, inet_ntoa(context->start)); in complete_context()
384 strcpy(daemon->dhcp_buff2, inet_ntoa(context->end)); in complete_context()
386 daemon->dhcp_buff, daemon->dhcp_buff2, inet_ntoa(netmask)); in complete_context()
573 !config_find_by_address(daemon->dhcp_conf, addr) && in address_allocate()
583 if (daemon->options & OPT_NO_PING) in address_allocate()
592 for (count = 0, r = daemon->ping_results; r; r = r->next) in address_allocate()
609 victim->next = daemon->ping_results; in address_allocate()
610 daemon->ping_results = victim; in address_allocate()
722 char *buff = daemon->namebuff; in dhcp_read_ethers()
739 for (up = &daemon->dhcp_conf, config = daemon->dhcp_conf; config; config = tmp) in dhcp_read_ethers()
791 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
808 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
821 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
840 config->next = daemon->dhcp_conf; in dhcp_read_ethers()
841 daemon->dhcp_conf = config; in dhcp_read_ethers()
887 for (configs = daemon->dhcp_conf; configs; configs = configs->next) in check_dhcp_hosts()
901 inet_ntoa(cp->addr), daemon->dhcp_hosts_file); in check_dhcp_hosts()
929 if (daemon->port != 0) in dhcp_update_configs()
968 if (daemon->port == 0) in host_from_dns()
974 hostname = daemon->dhcp_buff; in host_from_dns()