---
name: "Network::Generic"
section: "3pm"
platform: "linux"
package: "systemconfigurator"
version: "1.20-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/Network::Generic"
---

# Network::Generic(3pm)

A generic networking module

## 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 <japh@us.ibm.com>
```

## SEE ALSO

SystemConifg::Network, Net::Netmask, perl
