[Ferm] How to do things without global variables
Kiss Gabor (Bitman)
kissg at ssg.ki.iif.hu
Wed Dec 9 11:54:46 CET 2009
> > 1. How these files are related each to other and to ferm.conf?
>
> They are all in a ferm.conf.d, and ferm.conf has
> @include 'ferm.conf.d/';
According to manual this is insufficient.
> Sorry for not mentioning that.
>
> > 2. Man page writes:
> > Include files are special - variables declared in an included file are
> > still available in the calling block. This is useful when you include a
> > file which only declares variables.
>
> I have read that, but that doesn't seem to be true here.
File globalvars should be included inside every block you want
to use its defines.
I use a ferm.conf like this:
domain ip {
@def $is_ipv4 = 1;
table filter {
@include 'valid_check.ferm';
@include 'internal2world.ferm';
@include 'dmz.ferm';
@include 'world2internal.ferm';
@include 'monitor.ferm';
...
}
}
domain ip6 {
@def $is_ipv6 = 1;
table filter {
@include 'valid_check.ferm';
@include 'internal2world.ferm';
@include 'world2internal.ferm';
@include 'monitor.ferm';
...
}
}
Gabor
More information about the Ferm
mailing list