NAME
Network::Generic - A generic networking module
SYNOPSIS
package Network::TypeA;
use base qw(Network::Generic);
my $networking = new Network::TypeA(%vars);
if($networking->footprint()) {$networking->setup();}
my @fileschanged = $networking->files();
DESCRIPTION
The Network::Generic module is the parent class of all Networking implementations in the System Configurator project. Network::Generic defines a very robust constructor, as well as an AUTOLOAD method which provides access to all the internal variables.
Any Network subclass should only need to implement footprint(), setup_global(), and setup_interface(). Each one of these functions is explained below.
METHODS
The following methods exist in this module:
- files()
-
If called with an arguement, it will add those files to the internal storage array for modified files.
files() always returns the files that have been modified so far.
- footprint()
-
This method will be specific to the particular subclass. The parent method croaks if it is not overwritten.
- setup()
-
Setup contains 3 processing phases. setup_dns, which is assumed to be handled by the generic class; setup_global which will be called once per setup call; setup_interfaces, which will in turn call setup_interface($interface) once for each interface. Do not change the behavior of setup in a sub class unless you really know what you are doing.
- setup_global()
-
setup_global() is called once per setup(). Here is where files which specify global options (like GATEWAY) should be modified.
- setup_dns()
-
setup_dns() is called by setup() once. It exists in Network::Generic because most distributions use exactly the same method to setup dns files. It can be overloaded if required by a sub class.
- setup_interfaces()
-
this method just calls setup_interface once per interface, with the interface object as the first item in the parameter list.
- setup_interface($interface)
-
This will be called once per interface. It will be passed a reference to the Network::Interface object that represents that interface.
- chroot
-
A utility method.
$this->chroot($string) returns the string with an attached root if the root is needed.
AUTHOR
Sean Dague <[email protected]>
SEE ALSO
SystemConifg::Network, Net::Netmask, perl