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()
80 if (setsockopt(fd, SOL_SOCKET, SO_MARK, &daemon->listen_mark, sizeof(daemon->listen_mark)) == -1) in dhcp_init()
84 daemon->dhcpfd = fd; in dhcp_init()
91 if (daemon->options & OPT_NO_PING) in dhcp_init()
92 daemon->dhcp_icmp_fd = -1; in dhcp_init()
93 else if ((daemon->dhcp_icmp_fd = make_icmp_sock()) == -1 || in dhcp_init()
94 setsockopt(daemon->dhcp_icmp_fd, SOL_SOCKET, SO_RCVBUF, &oneopt, sizeof(oneopt)) == -1 ) in dhcp_init()
103 daemon->dhcp_packet.iov_len = sizeof(struct dhcp_packet); in dhcp_init()
104 daemon->dhcp_packet.iov_base = safe_malloc(daemon->dhcp_packet.iov_len); in dhcp_init()
137 msg.msg_iov = &daemon->dhcp_packet; in dhcp_packet()
143 while ((sz = recvmsg(daemon->dhcpfd, &msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR); in dhcp_packet()
153 if ((size_t)sz == daemon->dhcp_packet.iov_len) in dhcp_packet()
155 if (!expand_buf(&daemon->dhcp_packet, sz + 100)) in dhcp_packet()
160 expand_buf(&daemon->dhcp_packet, sz); in dhcp_packet()
166 mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_packet()
173 while ((sz = recvmsg(daemon->dhcpfd, &msg, 0)) == -1 && errno == EINTR); in dhcp_packet()
203 if (!indextoname(daemon->dhcpfd, iface_index, ifr.ifr_name)) in dhcp_packet()
213 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) != -1 ) in dhcp_packet()
222 for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next) in dhcp_packet()
229 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) == -1) in dhcp_packet()
239 for (context = daemon->dhcp; context; context = context->next) in dhcp_packet()
263 iov.iov_base = daemon->dhcp_packet.iov_base; in dhcp_packet()
266 mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_packet()
275 dest.sin_port = htons(daemon->dhcp_server_port); in dhcp_packet()
287 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
307 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
315 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
321 ioctl(daemon->dhcpfd, SIOCSARP, &req); in dhcp_packet()
328 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
340 dest.sin_port = htons(daemon->dhcp_client_port); in dhcp_packet()
345 ioctl(daemon->dhcpfd, SIOCSARP, &req); in dhcp_packet()
356 setsockopt(daemon->dhcpfd, IPPROTO_IP, IP_BOUND_IF, &iface_index, sizeof(iface_index)); in dhcp_packet()
359 while(sendmsg(daemon->dhcpfd, &msg, 0) == -1 && retry_send()); in dhcp_packet()
378 for (context = daemon->dhcp; context; context = context->next) in complete_context()
388 strcpy(daemon->dhcp_buff, inet_ntoa(context->start)); in complete_context()
389 strcpy(daemon->dhcp_buff2, inet_ntoa(context->end)); in complete_context()
391 daemon->dhcp_buff, daemon->dhcp_buff2, inet_ntoa(netmask)); in complete_context()
578 !config_find_by_address(daemon->dhcp_conf, addr) && in address_allocate()
588 if (daemon->options & OPT_NO_PING) in address_allocate()
597 for (count = 0, r = daemon->ping_results; r; r = r->next) in address_allocate()
614 victim->next = daemon->ping_results; in address_allocate()
615 daemon->ping_results = victim; in address_allocate()
727 char *buff = daemon->namebuff; in dhcp_read_ethers()
744 for (up = &daemon->dhcp_conf, config = daemon->dhcp_conf; config; config = tmp) in dhcp_read_ethers()
796 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
813 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
826 for (config = daemon->dhcp_conf; config; config = config->next) in dhcp_read_ethers()
845 config->next = daemon->dhcp_conf; in dhcp_read_ethers()
846 daemon->dhcp_conf = config; in dhcp_read_ethers()
892 for (configs = daemon->dhcp_conf; configs; configs = configs->next) in check_dhcp_hosts()
906 inet_ntoa(cp->addr), daemon->dhcp_hosts_file); in check_dhcp_hosts()
934 if (daemon->port != 0) in dhcp_update_configs()
973 if (daemon->port == 0) in host_from_dns()
979 hostname = daemon->dhcp_buff; in host_from_dns()