new([%args])set_encapsulation($encapsulation)get_encapsulation()set_duplex($duplex)get_duplex()set_dsubandwidth($dsubandwidth)get_dsubandwidth()set_crc($crc)get_crc()unit()print_data()
IPDevice::RouterBase::Interface
use IPDevice::RouterBase::Interface; my $interface = new IPDevice::RouterBase::Interface(name => '0/1/2'); $interface->set_ip('192.168.0.1', '255.255.255.252'); $interface->set_encapsulation('ppp'); my($ip, $mask) = $interface->get_ip();
This module provides routines for storing informations regarding an IP router interface. If you have a logical interface, use the IPDevice::RouterBase::LogicalInterface implementation instead.
new([%args])Object constructor. Valid arguments:
name: Store the interface name in the initial object.
set_encapsulation($encapsulation)Save the interface encapsulation.
get_encapsulation()Returns the interface encapsulation.
set_duplex($duplex)Safe the interface duplex status. Valid values for $duplex are 'half' or 'full'. Any other value will be translated to 'unknown'.
get_duplex()Returns the interface duplex status ('half', 'full', 'unknown' or undef).
set_dsubandwidth($dsubandwidth)Safe the interface's configured dsu-bandwidth.
get_dsubandwidth()Returns the interface's configured dsu-bandwidth.
set_crc($crc)Safe the interface crc length. $crc must be an integer value.
get_crc()Returns the interface crc length as an integer value.
unit()Returns the IPDevice::RouterBase::LogicalInterface with the given number. If it does not exist yet, it will be created.
Walks through all IPDevice::RouterBase::LogicalInterface calling the function $func. Args passed to $func are:
$unit: The IPDevice::RouterBase::LogicalInterface. %data: The given data, just piped through.
If $func returns FALSE, list evaluation will be stopped.
print_data()Prints all data regarding the interface to STDOUT (e.g. for debugging).
Copyright (c) 2004 Samuel Abels. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Samuel Abels <spam debain org>