|
NAMENet::Packet::Target - an object for all network related stuffSYNOPSISuse Net::Packet::Target; # Create multiple targets, with multiple port my $t1 = Net::Packet::Target->new; $t1->ip('www.google.com'); $t1->portRange('21,22,25,70-90'); $t1->protocol('tcp'); print $t1->isMultiple."\n"; for my $port ($t1->portList) { print $t1->ip.' do stuff for port '.$port."\n"; } # Create multiple targets, with only one port my $t2 = Net::Packet::Target->new; $t2->ipRange('127.0.0.1-10'); $t2->port(22); $t2->protocol('tcp'); print $t2->isMultiple."\n"; for my $ip ($t2->ipList) { print $t2->port.'/'.$t2->protocol.' do stuff for IPv4 '.$ip."\n"; } # Create a single target my $t3 = Net::Packet::Target->new; $t3->ip('127.0.0.1'); $t3->port(22); $t3->protocol('tcp'); print $t3->isMultiple."\n"; print $t3->port.':'.$t3->protocol.' do stuff for IPv4 '.$t3->ip."\n"; DESCRIPTIONA Net::Packet::Target object can be used to describe one target, or multiple targets. They are mainly used when you use some automated tasks you which to use on a range of IPs/ports.To describe multiple targets, you simply enter an IP range, or a port range, or the two. To describe a single target, you enter one IP address, and one port. You can also avoid totally ports, or avoid totally IPs, you do what you want. It also handles IP name resolution for IPv4 and IPv6, if available. ATTRIBUTES
METHODS
SEE ALSONet::PacketAUTHORPatrice <GomoR> AuffretCOPYRIGHT AND LICENSECopyright (c) 2006, Patrice <GomoR> AuffretYou may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
Visit the GSP FreeBSD Man Page Interface. |