Subject: | Bugs/fetaure requests for Net::DHCP::Info |
Date: | Wed, 7 Nov 2007 09:54:12 -0800 |
To: | bug-Net-DHCP-Info [...] rt.cpan.org |
From: | "Peter C. Norton" <spacey-rt.cpan.org [...] ssr.com> |
I've just started using Net::DHCP::Info to save time in writing a
parser for the file format of my own, and have needed to extend it a
bit.
In my organization, we use dhcpd.conf files that include global
options and group options. I've hacked together some changes that
allow for a couple of changes to accomodate this:
1) Reads the entire dhcpd.conf to find any options defined at the top
level, and assign those options to all subnets (to be overridden by
each subnet when/if those options are present as subnets are
parsed). Then rewind the file object.
2) When encountering a group statement, read all options defined in
the group and assign those to subnets that are defined within the
group scope, overriding any globally-scoped options, but which can
be overridden if defined by the subnet. I don't believe that dhcpd
will honor nested group scopes, so I don't allow that either.
This should allow for option spaces to be accommodated as
well. However it doesn't cover the complete list of declarations
possible in the dhcpd.conf file. It could be added, but I've done this
under a tight deadline, so I don't want to add to the testing I need
to do :(
I'm not sure my approach is the best, but if these improvements are
useful please let me know and I'll send the patches to you for
approval.
Thanks,
-Peter
--
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.