Lines Matching refs:daemon
34 daemon->dhcp_buff = safe_malloc(256); in lease_init()
35 daemon->dhcp_buff2 = safe_malloc(256); in lease_init()
37 leases_left = daemon->dhcp_max; in lease_init()
39 if (daemon->options & OPT_LEASE_RO) in lease_init()
46 if (daemon->lease_change_command) in lease_init()
48 strcpy(daemon->dhcp_buff, daemon->lease_change_command); in lease_init()
49 strcat(daemon->dhcp_buff, " init"); in lease_init()
50 leasestream = popen(daemon->dhcp_buff, "r"); in lease_init()
63 leasestream = daemon->lease_stream = fopen(daemon->lease_file, "a+"); in lease_init()
66 die(_("cannot open or create lease file %s: %s"), daemon->lease_file, EC_FILE); in lease_init()
76 &ei, daemon->dhcp_buff2, daemon->namebuff, in lease_init()
77 daemon->dhcp_buff, daemon->packet) == 5) in lease_init()
79 …hw_len = parse_hex(daemon->dhcp_buff2, (unsigned char *)daemon->dhcp_buff2, DHCP_CHADDR_MAX, NULL,… in lease_init()
84 addr.s_addr = inet_addr(daemon->namebuff); in lease_init()
88 if (strcmp(daemon->packet, "*") != 0) in lease_init()
89 clid_len = parse_hex(daemon->packet, (unsigned char *)daemon->packet, 255, NULL, NULL); in lease_init()
106 …lease_set_hwaddr(lease, (unsigned char *)daemon->dhcp_buff2, (unsigned char *)daemon->packet, hw_l… in lease_init()
108 if (strcmp(daemon->dhcp_buff, "*") != 0) in lease_init()
109 lease_set_hostname(lease, daemon->dhcp_buff, 0); in lease_init()
117 if (!daemon->lease_stream) in lease_init()
128 die(_("cannot run lease-init script %s: %s"), daemon->lease_change_command, EC_FILE); in lease_init()
133 sprintf(daemon->dhcp_buff, "%d", WEXITSTATUS(rc)); in lease_init()
134 …die(_("lease-init script returned exit code %s"), daemon->dhcp_buff, WEXITSTATUS(rc) + EC_INIT_OFF… in lease_init()
154 if ((config = find_config(daemon->dhcp_conf, NULL, lease->clid, lease->clid_len, in lease_update_from_configs()
168 if (!(*errp) && vfprintf(daemon->lease_stream, format, ap) < 0) in ourprintf()
179 if (file_dirty != 0 && daemon->lease_stream) in lease_update_file()
182 rewind(daemon->lease_stream); in lease_update_file()
183 if (errno != 0 || ftruncate(fileno(daemon->lease_stream), 0) != 0) in lease_update_file()
215 if (fflush(daemon->lease_stream) != 0 || in lease_update_file()
216 fsync(fileno(daemon->lease_stream)) < 0) in lease_update_file()
235 daemon->lease_file, strerror(err), in lease_update_file()
247 if (daemon->port != 0 && dns_dirty) in lease_update_dns()
256 if (!(daemon->options & OPT_DHCP_FQDN) && lease->hostname) in lease_update_dns()
472 if (daemon->options & OPT_DHCP_FQDN) in lease_set_hostname()
580 (lease->aux_changed && (daemon->options & OPT_LEASE_RO))) in do_script_run()