From 221f4909b518cebbf5e3135887741218865cfb84 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 29 Jan 2013 09:12:04 -0800 Subject: [PATCH] Document perl_action_helper Signed-off-by: Tom Eastep --- docs/Actions.xml | 65 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/docs/Actions.xml b/docs/Actions.xml index addf7e410..dea6b284e 100644 --- a/docs/Actions.xml +++ b/docs/Actions.xml @@ -30,6 +30,8 @@ 2012 + 2013 + Thomas M. Eastep @@ -684,7 +686,7 @@ bar:debug The Shorewall compiler provides a set of services that are available to Perl code embedded in an action file. These services are not available - in in-line actions. + in in-line actions when running Shorewall 4.5.12 or earlier. @@ -744,7 +746,9 @@ bar:debug [, $expandports ] ) - This function adds a rule to a chain. Arguments are: + This function adds a rule to a chain. As of Shoreall 4.5.13, + it is deprecated in favor of Shorewall::Rules::perl_action_helper(). + Arguments are: @@ -774,6 +778,11 @@ bar:debug + + + Do not call this function in a inline action. Use + perl_action_helper() instead (see below). + @@ -788,8 +797,9 @@ bar:debug $matches ) - This function adds a logging rule to a chain. Arguments - are: + This function adds a logging rule to a chain. As of Shoreall + 4.5.13, it is deprecated in favor of + Shorewall::Rules::perl_action_helper(). Arguments are: @@ -875,7 +885,7 @@ bar:debug Shorewall::Chains::allow::optimize( - chainref ) + $chainref ) This allows the passed action chain to be optimized away @@ -884,6 +894,51 @@ bar:debug from get_action_chain() described above. + + + Shorewall::Rules::perl_action_helper( $target, $matches ) + + + This function adds a rule to the current chain. For a regular + action, the chain will be an action chain; for an inline action, the + chain is determined by the invoking rule. + + To use this function, you must include: + + + use + Shorewall::Rules; + + + Arguments are: + + + + $target + + + The target of the rule. Legal values are anything that + can appear in the TARGET column of in an action body and may + include log level, tag, and parameters. + + + + + $matches + + + ip[6]tables matches to be included in the rule. When + called in an inline action, these matches are augmented by + matches generated by the invoking rule. + + + The matches must end with a space character. + + + + + + For an example of using these services, look at the standard action