NAME

Net::Frame::Device - get network device information and gateway

SYNOPSIS

use Net::Frame::Device;

# Get default values from system
my $device = Net::Frame::Device->new;

# Get values from a specific device
my $device2 = Net::Frame::Device->new(dev => 'vmnet1');

# Get values from a specific target
my $device3 = Net::Frame::Device->new(target => '192.168.10.2');

print "dev: ", $device->dev, "\n";
print "mac: ", $device->mac, "\n";
print "ip : ", $device->ip,  "\n";
print "ip6: ", $device->ip6, "\n";
print "gatewayIp:  ", $device->gatewayIp,  "\n";
print "gatewayMac: ", $device->gatewayMac, "\n" if $device->gatewayMac;

DESCRIPTION

Basically, this module is used to tell where to inject a frame. XXX: todo

ATTRIBUTES

dev

The network device.

ip

The IPv4 address of dev.

ip6

The IPv6 address of dev. If none found, it defaults to '::1'.

mac

The MAC address of dev. If none found, it defaults to 'ff:ff:ff:ff:ff:ff'.

subnet

The subnet of IPv4 address ip.

gatewayIp

The gateway IPv4 address. It defaults to default gateway that let you access Internet.

gatewayMac

The MAC address gatewayIp. The MAC is looked up from cache. If no entry is found, attribute will be undef.

target

This attribute is used when you want to detect which dev, ip, mac attributes to use for a specific target. See SYNOPSIS.

METHODS

new

Object constructor. Default values:

dev: if not user provided, default interface is used, by calling getDevInfo method. If user provided, all ip, ip6 and mac attributes will be used for that dev.

ip: if not user provided, default interface IP is used, by calling getIp method. If user provided, it is overwritten by the user.

ip6: if not user provided, default interface IPv6 is used, by calling getIp6 method. If user provided, it is overwritten by the user.

mac: if not user provided, default interface MAC is used, by calling getMac method. If user provided, it is overwritten by the user.

updateFromDefault
updateFromDev
updateFromTarget
lookupMac
debugDeviceList

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.