NethServer::TrustedNetworks -- extensible module for trusted networks


  A network can be trusted for disparate reasons, and cannot be defined a
  priori. This module defines an API to
  • register a custom “provider” function, that returns some trusted networks when invoked
  • retrieve the complete list of trusted networks from the registered providers
  To define a provider function, add a Perl module under TrustedNetworks/
  directory, with namespace prefix NethServer::TrustedNetworks.
  For a real example, see the file


  This is an example provider "Provider1" definition.
   package NethServer::TrustedNetworks::Provider1;
   use NethServer::TrustedNetworks qw(register_callback);
   sub provider1
      my $results = shift;
      ... # do something with $results (array ref)
  The $results variable is a reference to an array. Each array item must be
  an hash reference. And the hash must have two keys
  1. cidr, a string, representing the trusted network in CIDR form
  2. provider, a string that identifies the entry provider
  User code example, that retrieves the list of trusted networks in CIDR
   use NethServer::TrustedNetworks;
   print join(",", NethServer::TrustedNetworks::list_cidr()) . "\n";


  • registercallback($funcref, $order = undef)
  • list_cidr() returns the trusted networks list with CIDR format (i.e.
  • list_mask() returns the trusted networks list with netmask format (i.e
  • list_full() returns the complete $results list

The last documentation

perldoc NethServer::Directory