lease file -> XML?

Phil Benchoff benchoff at vt.edu
Tue Aug 24 01:02:24 UTC 2004


I have Apache servers running on all of the hosts we are using for dhcpd.
The apache server is used to provide access to the lease and config
files for applications running on other hosts that display info about the
state of dhcpd.  Data are currently output as XML by a TCL script that
parses the lease file.  After that file gets over about 100k lines, the
TCL script is a bit slow.

In an effort to come up with a faster parser with the least amount of
work, I hacked another option into dhcpd today.  In a nutshell, it
is similar to the -T option except that it calls expire_all_pools()
and write_leases().  The bulk of the mods are in server/db.c where
I check a global variable and  output XML to stdout rather than
using the current code that writes to the lease file in the the various
write_(lease|failover_state|<whatever>) functions.

Does this sound remotely useful to anyone?  I'm pretty close to getting
it to do what I need it to do, but it wouldn't be a major project to
clean it up enough that it could be integrated into the distribution.

Phil


More information about the dhcp-hackers mailing list