From c82b5108e1a40f3b299043770e01d7d7db35de04 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Jul 2007 17:05:57 +0000 Subject: udhcp: new config option "Rewrite the lease file at every new acknowledge" (Mats Erik Andersson (Blue2Net AB)) udhcp: consistently treat server_config.start/end IPs as host-order fix IP parsing for 64bit machines fix unsafe hton macro usage in read_opt() do not chdir("/") when daemonizing fix help text --- networking/udhcp/dhcpd.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'networking/udhcp/dhcpd.h') diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h index 7c4fe695a..05e3cf004 100644 --- a/networking/udhcp/dhcpd.h +++ b/networking/udhcp/dhcpd.h @@ -27,23 +27,24 @@ struct static_lease { struct server_config_t { uint32_t server; /* Our IP, in network order */ - uint32_t start; /* Start address of leases, network order */ - uint32_t end; /* End of leases, network order */ + /* start,end are in host order: we need to compare start <= ip <= end */ + uint32_t start_ip; /* Start address of leases, in host order */ + uint32_t end_ip; /* End of leases, in host order */ struct option_set *options; /* List of DHCP options loaded from the config file */ char *interface; /* The name of the interface to use */ int ifindex; /* Index number of the interface to use */ uint8_t arp[6]; /* Our arp address */ - unsigned long lease; /* lease time in seconds (host order) */ - unsigned long max_leases; /* maximum number of leases (including reserved address) */ char remaining; /* should the lease file be interpreted as lease time remaining, or * as the time the lease expires */ + unsigned long lease; /* lease time in seconds (host order) */ + unsigned long max_leases; /* maximum number of leases (including reserved address) */ unsigned long auto_time; /* how long should udhcpd wait before writing a config file. * if this is zero, it will only write one on SIGUSR1 */ unsigned long decline_time; /* how long an address is reserved if a client returns a * decline message */ unsigned long conflict_time; /* how long an arp conflict offender is leased for */ unsigned long offer_time; /* how long an offered address is reserved */ - unsigned long min_lease; /* minimum lease a client can request*/ + unsigned long min_lease; /* minimum lease a client can request */ char *lease_file; char *pidfile; char *notify_file; /* What to run whenever leases are written */ @@ -95,13 +96,6 @@ int send_inform(struct dhcpMessage *oldpacket); /*** files.h ***/ -struct config_keyword { - const char *keyword; - int (* const handler)(const char *line, void *var); - void *var; - const char *def; -}; - int read_config(const char *file); void write_leases(void); void read_leases(const char *file); -- cgit v1.2.3