#525687 ferm: please add a hook which gets executed while configuration is read

#525687#5
Date:
2009-04-26 15:42:16 UTC
From:
To:
Hi,

To _generate_ rules from outside ferm, it would be good to have a hook
which is executed immediately when the line is read to allow things
like:

@hook now "ferm-hook-create-rules";
@include "rules-created-by-ferm-hook";

I currently do this by inserting a dummy rule into a dummy chain:

chain dummy interface `ferm-hook-create-rules` NOP;
@include "rules-created-by-ferm-hook";

while the scripts empty output prevents any rules from being actually
created.

Greetings
Marc

#525687#10
Date:
2009-04-30 14:55:21 UTC
From:
To:
The problem is that this is not transparent to --shell.  I will
implement #525678 instead.

#525687#15
Date:
2009-04-30 22:38:35 UTC
From:
To:
I do not understand. The hook would be executed while the shell script
ie generated.

That would be another possibility, yes.

Greetings
Marc

#525687#20
Date:
2010-02-18 21:04:50 UTC
From:
To:
No.  Hooks are executed when the rules are installed, not necessarily
when ferm runs.  With --shell, ferm just prints the hook commands, to
be executed later by the generated shell script.

#525687#25
Date:
2010-02-19 06:49:52 UTC
From:
To:
Hi,

Can you give an example?

Greetings
Marc

#525687#30
Date:
2010-04-13 15:22:53 UTC
From:
To:
I have understood now. This hook should be different. The use of the
hook I outlined in the first bug report is addressed by @include now
being able to execute commands, but this hook (@now) could probably be
used to generate debug output during ferm run, or for other advanced
things.

Please consider implementing it nevertheless.

Greetings
Marc