logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Net::Route - Portable interface to the routing table

Author

       Created by Alexandre Storoz, "<astoroz@straton-it.fr>"

       Maintained by Thomas Equeter, "<tequeter@straton-it.fr>"

Bugs

       Please report any bugs or feature  requests  to  "bug-net-route  at  rt.cpan.org",  or  through  the  web
       interface  at  <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Route>.  I  will be notified, and then
       you'll automatically be notified of progress on your bug as I make changes.

Description

TheNet::RouteModule
       Every OS provides its custom interface to the routing table: Linux' "route" utility is different from
       BSD's "route show", from Windows' "route print", etc. Parsing all these different output styles in an
       (otherwise portable) script can quickly become inconvenient.

       Net::Route abstracts the system specifics and provides a single, portable interface.

   TheNet::RouteClass
       Net::Route objects represent single entries from a Net::Route::Table.

Installing Dependencies On Sun Solaris Systems With Gcc

       The perl interpreter shipped with Solaris was compiled with Sun's proprietary C compiler, and therefore
       attempts to compile XS modules with the same tool and options. However, Solaris comes by default with the
       GNU C Compiler ("gcc") only, which has its own set of incompatible command-line arguments. Mixing these
       two to compile "XS" Perl modules doesn't work.

       Therefore, when you need to install CPAN modules (such as Net::Route's dependencies) which make use of
       "XS" (C code) on a system without the Sun C Compiler, you have to use the wrapper script provided by Sun
       which will invoke "gcc" correctly (replace "Module" as needed):

         /usr/perl5/bin/perlgcc -MCPAN -e 'install Module'.

Interface

       This documents Net::Route as a class. To know how to use the module, refer to the synopsis or
       Net::Route::Table (the entry point from a user perspective).

   ObjectMethodsdestination()gateway()metric()interface()is_active()is_dynamic()

Name

       Net::Route - Portable interface to the routing table

Status And Roadmap

       Please refer to the Changes file for a detailed history.

   0.01-FirstPublicRelease
       Net::Route meets our goals for a first public release:

       •   It can list all routes

       •   It can get the default route

       •   It can provide the most common characteristics of routes

       •   It is portable on Linux, Solaris and Windows

       Net::Route  is  used  in  other  Straton IT (<http://en.straton-it.fr/>) software, such as Cancerbero 0.7
       (<http://en.straton-it.fr/open-source/cancerbero-07>)                  and                   Confdump/Sys
       (<http://confdump.sourceforge.net/>).

   0.xx-CommunityReleases
       These  releases  will  include  features  and  bugfixes  suggested,  reported  and/or  contributed by the
       community. For example:

       •   Differentiating between "Net::Route"-as-a-class and "Net::Route"-as-a-module

       •   Support for more operating systems

       •   Getting rid of CPAN dependencies that are troublesome to install on some platforms.

       •   Your idea (<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Route>) here...

       The API might change somewhat, if necessary.

   1.0-APIFreeze
       When appropriate (according to the user reports), we will freeze the interface and release version 1.0.

Support

       You can find documentation for this module with the perldoc command.

           perldoc Net::Route

       You can also look for information at:

       •   RT: CPAN's request tracker

           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Route>

       •   AnnoCPAN: Annotated CPAN documentation

           <http://annocpan.org/dist/Net-Route>

       •   CPAN Ratings

           <http://cpanratings.perl.org/d/Net-Route>

       •   Search CPAN

           <http://search.cpan.org/dist/Net-Route>

Synopsis

           use Net::Route::Table;
           my $table_ref = Net::Route::Table->from_system();
           my $route_ref = $table_ref->default_route();
           print "Default gateway: ", $route_ref->gateway(), "\n";

Version

       Version 0.02, $Revision: 372 $

See Also