Mark Pfeiffer > Cisco-ShowIPRoute-Parser > Cisco::ShowIPRoute::Parser

Download:
cisco/Cisco-ShowIPRoute-Parser-1.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.02   Source  

NAME ^

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

SYNOPSIS ^

        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 ^

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 ^

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 ^

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 ^

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

Rajiv Santiago <batrax@hotmail.com>

COPYRIGHT ^

Copyright (c) 2003 Rajiv Santiago and Mark Pfeiffer. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Cisco is a registered trade mark of Cisco Systems, Inc.

This code is in no way associated with Cisco Systems, Inc.

All other trademarks mentioned in this document are the property of their respective owners.

We make no warranties, implied or otherwise, about the suitability of this software. We shall not in any case be liable for special, incidental, consequential, indirect or other similar damages arising from the transfer, storage, or use of this code.

This code is offered in good faith and in the hope that it may be of use.

syntax highlighting: