Cisco::ShowIPRoute::Parser - parse Cisco 'show ip route' command


Cisco-ShowIPRoute-Parser documentation  | view source Contained in the Cisco-ShowIPRoute-Parser distribution.

Index


NAME

Top

Cisco::ShowIPRoute::Parser - parse Cisco 'show ip route' command

SYNOPSIS

Top

	use Cisco::ShowIPRoute::Parser;

	# Router.log holds the output from 'show ip route'
	my $log = 'Router.log';
	my $r = new Cisco::ShowIPRoute::Parser($log);

	my $dest   = '10.159.25.44';
	my @routes = $r->getroutes($dest);

	print "@routes\n";

DESCRIPTION

Top

This File contains the encapsulation of Raj's route parser. It will parse the output from a Cisco 'show ip route' command and return all the routes to a specified IP address.

When collecting the routes please ensure it is in decimal format. This can be enabled by doing the following at the router prompt:

	term len 0
	terminal ip netmask-format decimal
	show ip route

Methods

Top

new()

Args:

the log file as a string

Rtns:

Handle to our object.

Description:

Define some initial states and open the log file that is to be used when parsing routes

getroutes()

Args:

the IP address to get the routes for as a string

Rtns:

An array of IP addresses, or "directly connected..." messages.

Or a null list if no routes found

Description:

We call ipRouteCheck() and routeIterate() to find all the routes. This is the main interface. You shouldn't need any other methods.

BUGS

Top

It is highly possible there are bugs. But we don't think so. We have tested this over 4000 routers and pulled routes across this network often. Whenever we think the code is wrong we invariably find we have a network routing problems.

AUTHORS

Top

Mark Pfeiffer <markpf@mlp-consulting.com.au>

Rajiv Santiago <batrax@hotmail.com>

COPYRIGHT

Top


Cisco-ShowIPRoute-Parser documentation  | view source Contained in the Cisco-ShowIPRoute-Parser distribution.