The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

NetworkInfo::Discovery::Host - holds all the data we know about a host

SYNOPSIS

  use NetworkInfo::Discovery::Host;

  my $host = new NetworkInfo::Discovery::Host('interface'=> '192.168.1.3',
                                      'mac'=> '11:11:11:11:11:11',
                                      'dnsname' => 'someotherhost' ) 
                    || warn ("failed to make host");

DESCRIPTION

NetworkInfo::Discovery::Host has all the information we could ever want to know about a host.

dnsname

this it the name that DNS knows this host by.

interface

this is the software address of the host (a.k.a its IP address)

mac

this is the hardware Media Access Control address (MAC address) of the host

open_ports

these are ports that we know this host to be listening on

METHODS

new

returns a new Host object, and takes the arguments shown in this example:

    $obj = NetworkInfo::Discovery::Host->new( [dnsname  => $text,]
                                [interface      => $ipaddress_text,]
                                [mac            => $mac_text,]
                                [open_ports     => $array_numbers,] );
dnsname ([$name])

get set this dns name

interface ([$name])

get set this ip address in the form "111.222.333.444"

mac ([$mac])

get set this mac address in the form "aa:bb:bb:dd:ee:ff"

open_ports ([@ports])

get/set the open listening ports for this host

id

returns the "hopefully" unique address for this host. this is a real design flaw that needs to be worked out. the id right now is either just the ip address or "ipaddress+macaddress" if we know the mac address.

get_attributes

returns a hash of attributes about this host. it is currently used only by the NetworkInfo::Discovery module to store our graph info.

AUTHOR

Tom Scanlan <tscanlan@openreach.com>

SEE ALSO

NetworkInfo::Discovery::Host

NetworkInfo::Discovery::Detect

NetworkInfo::Discovery::Sniff

NetworkInfo::Discovery::Traceroute

BUGS

Please send any bugs to Tom Scanlan <tscanlan@they.gotdns.org>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 47:

'=item' outside of any '=over'

Around line 174:

You forgot a '=back' before '=head1'