Lines Matching refs:daemon

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