Net::DHCP::Config::Utilities::Subnet - Represents a subnet.
Version 0.0.1
use Net::DHCP::Config::Utilities::Subnet; my $options={ base=>'10.0.0.0', mask=>'255.255.255.0', dns=>'10.0.0.1 , 10.0.10.1', desc=>'a example subnet', }; my $subnet = Net::DHCP::Config::Utilities::Subnet->new( $options );
This initiates the object.
my $options={ base=>'10.0.0.0', mask=>'255.255.255.0', dns=>'10.0.0.1 , 10.0.10.1', desc=>'a example subnet', }; my $subnet = Net::DHCP::Config::Utilities::Subnet->new( $options );
This returns the base IP for the subnet.
my $base_IP=$subnet->base;
Returns the CIDR for the subnet.
my $cidr=$subnet->cidr;
Returns the description.
If this was not defined when initialized, '' will be returned.
my $desc=$subnet->desc_get;
This returns the current subnet mask.
my $mask=$subnet->mask;
This returns the requested option.
If the requested option is not set, undef is returned.
Options are always saved internally using the short name, so if an option has both a long name and shortname, then the short name is used.
my $option_value=$subnet->option_get( $option ); if ( !defined( $option_value ) ){ print $option." is not set\n"; }
This list options that have been set, excluding mask.
my @options=$subnet->options_list;
This sets an option.
Two arguments are taken. The first is the option and the second is the value. If the value is left undefined, then the option is deleted.
eval{ $subnet->option_set( $option, $value ); }; if ( $@ ){ warn( 'Failed to set option "'.$option.'" with value "'.$value.'"... error='.$@ ); }
This returns a array with containing the ranges in questions.
my @ranges=$subnet->get_ranges; foreach my $range ( @range ){ print "range ".$range.";\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) 2019 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.