Manual Chains
Tom
Eastep
2007
Thomas M. Eastep
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
GNU Free Documentation
License
.
Introduction
Manual chains were introduced in Shorewall-perl 4.0.6; for Perl
programmers, manual chains provide an alternative to Actions with
extension scripts. Manual chains are chains which you create and populate
yourself using the low-level functions in Shorewall::Chains.
Manual chains work in conjunction with the
compile extension script and Inline PERL scripts.
The general idea is like this:
In the compile extension script, you define functions that you
can call later using Inline PERL. These functions create a
manual chain using
Shorewall::Chains::new_manual_chain() and populate it with rules using
Shorewall::Chains::add_rule().
The functions also call Shorewall::Config::shorewall() to create
and pass a rule to Shorewall. The TARGET in that rule is the name of
the chain just created.
The functions defined in the compile script are called by Inline
PERL statements. The arguments to those calls define the contents of
the manual chains and the rule(s) passed back to Shorewall for normal
processing.