Net::DHCP::Config::Utilities::INI_check - Runs various checks for DHCP info stored via INI.
Version 0.0.1
use Net::DHCP::Config::Utilities::Options use Data::Dumper; my $ini_checker; eval { $ini_checker=Net::DHCP::Config::Utilities::INI_check->new( $dir )) }; if ( $@ ){ die "Initing the checker failed with... ".$@; } my %overlaps; eval { %overlaps = $ini_checker->overlap_check; }; if ($@){ warn('Overlap check failed... '); }else{ use Data::Dumper; $Data::Dumper::Terse=1; print Dumper( \%overlaps ); }
This initiates the object.
One arguments is required and that is the directory to process.
The section optional argument is the glob to use to match the files to process. If left undefined, "*.dhcp.ini" is used.
my $checker; eval { $checker=Net::DHCP::Config::Utilities::INI_check->new( $dir )) }; if ( $@ ){ die "Initing the checker failed with... ".$@; }
Finds every DHCP INI file in the directory file in the directory and checks for overlaps.
$returned{$file}{$section}{$file_containing_conflicts}[$sections]
The returned values is a hash. $file is the name of file containing the checked subnet. $subnet is the name of subnet in conflict. $file_containing_conflicts them the name of the file containing the conflict. $sections is the name of the INI sections in the previously mentioned file containing the conflict.
my %overlaps; eval { %overlaps = $ini_checker->overlap_check; }; if ($@){ warn('Overlap check failed... '); }else{ use Data::Dumper; $Data::Dumper::Terse=1; print Dumper( \%overlaps ); }
This goes through the INI file and checks the subnets there for any overlap with the specified CIDR.
Two arguments are required. The first is the CIDR to check for and the second is the INI DHCP file to check for overlaps in.
Any subnets with bad base/mask that don't convert properly to a CIDR are skipped.
The returned value is a array reference of any found conflicts.
my $overlaps=$ini_check->cidr_in_file( $cidr, $file ); if ( defined( $overlaps->[0] ) ){ print "Overlap(s) found\n"; }
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-net-dhcp-config-utilities at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-DHCP-Config-Utilities. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-dhcp-config-utilities at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::DHCP::Config::Utilities
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-DHCP-Config-Utilities
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-DHCP-Config-Utilities
CPAN Ratings
https://cpanratings.perl.org/d/Net-DHCP-Config-Utilities
Search CPAN
https://metacpan.org/release/Net-DHCP-Config-Utilities
This software is Copyright (c) 2020 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Net::DHCP::Config::Utilities, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DHCP::Config::Utilities
CPAN shell
perl -MCPAN -e shell install Net::DHCP::Config::Utilities
For more information on module installation, please visit the detailed CPAN module installation guide.