NAME
Farly::IPv4::Network - IPv4 network class
DESCRIPTION
This class represents an IPv4 network.
Inherits from Farly::IPv4::Object.
METHODS
new( <string> )
The constructor accepts a dotted decimal format address and mask or CIDR format network.
my
$ip_network
= Farly::IPv4::Network->new(
"10.0.0.0 255.0.0.0"
);
my
$ip_network
= Farly::IPv4::Network->new(
"10.0.0.0/8"
);
address()
Returns the 32 bit integer network address
$32bit_int_network_addr =
$ip_network
->address();
mask()
Returns the network mask Farly::IPv4:Address object
my
$mask_object
=
$ip_network
->inverse_mask()
inverse_mask()
Returns the bit wise logical not of the 32 bit integer network mask IP address
my
$32bit_int_inverse_mask =
$ip_network
->inverse_mask()
network_address()
Returns the network address as an Farly::IPv4::Address object
$ipv4_addr_object
=
$ip_network
->network_address();
broadcast_address
Returns the broadcast address as an Farly::IPv4::Address object
$ipv4_addr_object
=
$ip_network
->broadcast_address();
first()
Returns the 32 bit integer network address
$32bit_int_network_addr =
$ip_network
->first();
last()
Returns the 32 bit integer network broadcast IP address
$32bit_int_network_addr =
$ip_network
->
last
();
start()
Returns the network address as an Farly::IPv4::Address object
$ipv4_addr_object
=
$ip_network
->start();
end()
Returns the broadcast address as an Farly::IPv4::Address object
$ipv4_addr_object
=
$ip_network
->end();
as_string()
Returns the current Farly::IPv4::Network as a dotted decimal format string
$ip_network
->as_string();
as_wc_string
Returns the current Farly::IPv4::Network as a dotted decimal format string with a wild card mask
$ip_network
->as_wc_string();
iter()
Returns an array containing the current IP network as a Farly::IPv4::Range object.
my
@array
=
$ip
->iter();
COPYRIGHT AND LICENSE
Farly::IPv4::Network Copyright (C) 2012 Trystan Johnson
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.