-
-
25 Jun 2004 21:16:05 UTC
- Distribution: IPDevice
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (404 / 0 / 0)
- Kwalitee
Bus factor: 0- % Coverage
- License: unknown
- Activity
24 month- Tools
- Download (23.47KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- SYNOPSIS
- DESCRIPTION
- CONSTRUCTOR AND METHODS
- new([%args])
- set_hostname($hostname)
- get_hostname()
- set_vendor($vendor)
- get_vendor()
- set_model($model)
- get_model()
- set_os($os)
- get_os()
- set_cfgversion($version)
- get_cfgversion()
- card($cardnumber)
- isis()
- bgp($localas)
- prefixlist($name)
- add_staticroute($ip, $mask, $destination)
- get_staticroute($ip, $mask)
- ip_host($name, $port)
- foreach_ip_host($func, %data)
- foreach_bgp($func, %data)
- foreach_prefixlist($func, %data)
- foreach_card($func, %data)
- foreach_module($func, %data)
- foreach_interface($func, %data)
- foreach_unit($func, %data)
- print_data()
- COPYRIGHT
- AUTHOR
NAME
IPDevice::RouterBase
SYNOPSIS
use IPDevice::RouterBase; my $router = new IPDevice::RouterBase; $router->set_hostname('hostname'); my $card = $router->card(0); $card->module(1);
DESCRIPTION
This module provides a base class, providing routines for storing informations regarding an IP router.
CONSTRUCTOR AND METHODS
new([%args])
Object constructor. Valid arguments:
hostname: The initial router hostname.
set_hostname($hostname)
Set the hostname.
get_hostname()
Returns the hostname.
set_vendor($vendor)
Defines the vendor.
get_vendor()
Returns the vendor.
set_model($model)
Defines the model name.
get_model()
Returns the model name.
set_os($os)
Defines the operating system name and version.
get_os()
Returns the operating system name and version.
set_cfgversion($version)
Defines the configuration version.
get_cfgversion()
Returns the configuration version.
card($cardnumber)
Returns the IPDevice::RouterBase::Card with the given number. If it does not exist, it will be created. If no card number is given, a virtual card will be returned anyway. You can, for example, add modules/interfaces that do not have a pysical card there.
isis()
Returns the IPDevice::RouterBase::ISIS instance. If that ISIS instance does not yet exist, a new one will be created/returned.
bgp($localas)
Returns the IPDevice::RouterBase::BGP instance with the given local as number. If that BGP instance does not yet exist, a new one will be created/returned.
prefixlist($name)
Returns the IPDevice::RouterBase::Prefixlist with the given name. If the IPDevice::RouterBase::Prefixlist does not exist yet, it will be created and returned.
add_staticroute($ip, $mask, $destination)
Add a new static route to the router. Returns the newly created IPDevice::RouterBase::StaticRoute.
get_staticroute($ip, $mask)
Returns the IPDevice::RouterBase::StaticRoute with the given ip and mask.
ip_host($name, $port)
Returns the IPDevice::RouterBase::IPHost with the given hostname/port. If it does not exist yet, a new one will be created.
foreach_ip_host($func, %data)
Walks through all hostname <-> IP mappings calling the function $func. Args passed to $func are:
$card: The IPDevice::RouterBase::IPHost. %data: The given data, just piped through.
If $func returns FALSE, the hostname <-> IP mapping list evaluation will be stopped.
foreach_bgp($func, %data)
Walks through all BGP instances calling the function $func. Args passed to $func are:
$card: The IPDevice::RouterBase::BGP. %data: The given data, just piped through.
If $func returns FALSE, the BGP instance list evaluation will be stopped.
foreach_prefixlist($func, %data)
Walks through all prefixlists calling the function $func. Args passed to $func are:
$pfxlist: The IPDevice::RouterBase::Prefixlist. %data: The given data, just piped through.
If $func returns FALSE, the list evaluation will be stopped.
foreach_card($func, %data)
Walks through all cards calling the function $func. Args passed to $func are:
$card: The IPDevice::RouterBase::Card. %data: The given data, just piped through.
If $func returns FALSE, the card list evaluation will be stopped.
foreach_module($func, %data)
Walks through all modules calling the function $func. Args passed to $func are:
$module: The IPDevice::RouterBase::Module. %data: The given data, just piped through.
If $func returns FALSE, the module list evaluation will be stopped.
foreach_interface($func, %data)
Walks through all interfaces calling the function $func. Args passed to $func are:
$interface: The IPDevice::RouterBase::Interface. %data: The given data, just piped through.
If $func returns FALSE, the interface list evaluation will be stopped.
foreach_unit($func, %data)
Walks through all IPDevice::RouterBase::LogicalInterface calling the function $func. Args passed to $func are:
$interface: 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 router to STDOUT (e.g. for debugging).
COPYRIGHT
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.
AUTHOR
Samuel Abels <spam debain org>
Module Install Instructions
To install IPDevice::IPv4, copy and paste the appropriate command in to your terminal.
cpanm IPDevice::IPv4
perl -MCPAN -e shell install IPDevice::IPv4
For more information on module installation, please visit the detailed CPAN module installation guide.