Net::Route(3pm)

πŸ“¦
version 0.02 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Net::Route β€” a portable interface to the routing table, bestie πŸ’…


✨ 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 $ β€” yes she's an elder but she still slays πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

The Net::Route Module

okay so here's the tea β˜• every single OS has its own little custom way of showing you the routing table and it's honestly chaos. Linux's route utility? Completely different from BSD's route show. And Windows' route print? A whole other vibe. Trying to parse all these different output styles inside an otherwise portable script gets inconvenient so fast 😭

Net::Route handles all the system-specific nonsense for you and hands you one single, portable interface. iconic behaviour honestly πŸ‘‘

The Net::Route Class

Net::Route objects represent single entries from a Net::Route::Table. that's it, that's the vibe πŸŽ€


πŸ’… INTERFACE πŸ’…

This documents Net::Route as a class. To know how to actually use the module, go check the synopsis or Net::Route::Table β€” that's the entry point from a user perspective, iykyk ✨

Object Methods

  • destination()
  • gateway()
  • metric()
  • interface()
  • is_active()
  • is_dynamic()

🧚 INSTALLING DEPENDENCIES ON SUN SOLARIS SYSTEMS WITH GCC 🧚

ngl this part is a whole saga 😭 The perl interpreter that ships with Solaris was compiled with Sun's proprietary C compiler, so it tries to compile XS modules with that same tool and those same options. But plot twist: Solaris comes by default with the GNU C Compiler (gcc) only, and gcc has its own totally incompatible set of command-line arguments. Mixing these two together to compile XS Perl modules? It does not work. periodt πŸ’€

So when you need to install CPAN modules (like Net::Route's dependencies) that make use of XS (that's C code, bestie) on a system without the Sun C Compiler, you have to use the wrapper script Sun provides, which will invoke gcc correctly. Just swap in your Module as needed:

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

🌈 STATUS AND ROADMAP 🌈

Please refer to the Changes file for a detailed history, bestie πŸ“œ

0.01 - First Public Release

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 - Community Releases

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 - API Freeze

When appropriate (according to the user reports), we will freeze the interface and release version 1.0. β„οΈβœ¨


πŸ™ˆ 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. we love a feedback loop πŸ’–


πŸ’œ 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>


πŸ‘‘ AUTHOR πŸ‘‘

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

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


Copyright (C) 2009 Straton IT.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie β€” perl v5.36.0, dated 2023-06-15, brought to you under the Net::Route(3pm) manual 🫢 stay portable, stay slaying πŸ’…βœ¨

πŸ“¦ where this page comes from