Proc - The PCXFireWall Proc VFS interface.
use PCXFireWall::Proc; my $proc = PCXFireWall::Proc->new;
# turn off ip_forward'ing in the Nat module before any nat rules
$proc->sysNetIPv4(file => "ip_forward", value => "0",
module => "Nat", required => "true");
# you define some Nat rules ...
# turn ip_forward'ing on now after the nat rules
$proc->sysNetIPv4(file => "ip_forward", value => "1",
module => "Nat", required => "true",
when => "Post");
Proc is the Proc VFS generic interface Object for the PCXFireWall.
scalar new(void)
Creates a new instance of the PCXFireWall::Proc object.
Initializes the modules hash.
void display(fh, module, when)
This routine will write the rules to the file via fh. This is
called by the generator script.
module and when determine which branch to display so that the
Pre and Post rules get displayed at the correct time.
void displayShellFunctions(fh)
This routine will output the necessary shell functions to the file.
This is called by the generator script.
sysNetIPv4(file, value, module, required, when)
required: file, value
optional: module, required, when
directory: /proc/sys/net/ipv4
summary: Generates the shell script code to update the specified
file with the specified value. The code is generated
and stored in the Pre or Post array for the module.
If module is not specified, it defaults to Filter.
If when is not specified, it defaults to Pre.
If required is not specified, it defaults to false.
If the file must exist then the code is written to
generate an error and then stop running otherwise the
code will just generate an error if the file is not
found when it executes.
valid values:
module (Filter, Nat)
required (true, false)
when (Pre, Post)
sysNetIPv4Conf(file, value, module, required, when, iface)
required: file, value
optional: module, required, when, iface
directory: /proc/sys/net/ipv4/conf
summary: See sysNetIPv4 for info on everything but iface.
iface allows you to specify the interface to work with.
valid values:
iface (all or any valid interface defined on the system)
modules - hash of modules (Filter, Nat) with hash entries
Pre and Post that represent the /proc files
that should be modified before or after the
modules rules are output.
NOTE: All data fields are accessible by specifying the object
and pointing to the data member to be modified on the
left-hand side of the assignment.
Ex. $obj->variable($newValue); or $value = $obj->variable;
Xperience, Inc. (mailto:admin at pcxperience.com)
perl(1)