The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::DHCP::Config::Utilities::INI_check - Runs various checks for DHCP info stored via INI.

VERSION

Version 0.0.1

SYNOPSIS

    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 );
    }

METHODS

new

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... ".$@;
    }

overlap_check

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 );
    }

cidr_in_file

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";
    }

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Net::DHCP::Config::Utilities

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2020 by Zane C. Bowers-Hadley.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)