NAME

Farly::Transport::PortRange - TCP/UDP port range class

DESCRIPTION

This class represents a TCP or UDP port number range.

Inherits from Farly::Transport::Object.

METHODS

new( <string> )

The constructor accepts port number range with the first port separated from the last port by a space or dash.

my $port_range = Farly::Transport::PortRange->new( "1024 65535" );
my $port_range = Farly::Transport::PortRange->new( "1024-65535" );

first()

Returns the first port in the range as an integer

$first_8_bit_int = $port_range->first();

last()

Returns the last port in the range as an integer

$last_8_bit_int = $port_range->last();

as_string()

Returns the current Farly::Transport::PortRange as a string

print $port_range->as_string();

iter()

Returns an array containing the all of the port objects in the current PortRange object. For use in Set calculations.

my @array = $port_range->iter();

COPYRIGHT AND LICENSE

Farly::Transport::PortRange 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/>.