GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::PACKET::TARGET (3)

.ds Aq ’

NAME

Net::Packet::Target - an object for all network related stuff

CONTENTS

SYNOPSIS



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



DESCRIPTION

A <B>Net::Packet::TargetB> 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

<B>macB> [ (scalar) ]
<B>portB> [ (scalar) ]
<B>protocolB> [ (scalar) ]
<B>hostnameB> [ (scalar) ] These 4 attributes store respectively the target mac address, port, protocol to use for port, and the hostname.
<B>ipListB> [ (arrayref) ]
<B>portListB> [ (arrayref) ] These 3 attributes store respectively an IPv4 address list, an IPv6 address list, and a port list. All this as array references. When called without parameter, they return an array.

METHODS

<B>newB> Object constructor. There are no default values, due to the nature of this object.
<B>isMultipleB> Because a <B>Net::Packet::TargetB> object can be used to describe one target, or multiple ones, we must have a way to know that. This method is used to answer the question. Returns 1 if the object is composed of either multiple IPs, or multiple ports, 0 otherwise.
<B>ipB> [ (scalar) ] Will take as a parameter an IPv4 address, or a hostname. Without argument, returns the stored value.
<B>ip6B> [ (scalar) ] Same as previous, for IPv6.
<B>ipRangeB> [ (scalar) ] Will take as a parameter an IPv4 address range. The format is for example: 127.0.0.1-254, or 127.0-10.1.50-70. It will store the result in <B>ipListB> attribute, to be easily used in a <B>forB> loop.
<B>portRangeB> [ (scalar) ] Same as previous, but for port ranges. The format is for example: 1-1024, 500-600,100-110. It will store the result in <B>portListB> attribute, to be easily used ina <B>forB> loop.

SEE ALSO

Net::Packet

AUTHOR

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Copyright (c) 2006, Patrice <GomoR> Auffret

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::PACKET::TARGET (3) 2006-11-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.