[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

snmpconf return values from policyCondition and policyAction scripts




Issue 49: While the proper behavior can be more or less deduced from various
parts of the document, I would like to have some clarifying text
on handing the return values from scripts. 

I posit the following as a straw-man.


6.n  Execution Environment

A PolicyScript script execution is normally ended by the execution
of a return statement, or by having the flow of execution reach
the end of the final statement in the script.  A normal script
execution always returns a Boolean value.  If no explicit value is
specified in the return statement, or if the flow of control proceeds
through the end of the script, the return value is implicitly
zero.  If a expression is provided with the return statement,
the expression is evaluated, and the result of the expression
is implicitly converted with the ToBoolean operator before
being returned to the script execution environment.

The return value of a policyCondition script is used to determine
whether the associated policyAction script is executed.  If the
returned value is zero, the asssociated policyAction script is not
executed.  If the returned value is one, the associated policyAction
script will be executed.

The return value of a policyAction script is ignored.

A RTE or invocation of the die() accessor function will cause
the return value of the script to be set to zero.   Note however,
that execution of the defer() or die() accessor functions may set
the defer attribute so that the lower precedence script may be
executed.  This is independent of the return value of the policy script
execution.


---
Steve Moulton        SNMP Research, Inc            voice: +1 865 573 1434
Sr Software Engineer 3001 Kimberlin Heights Rd.    fax: +1 865 573 9197
moulton@snmp.com     Knoxville, TN 37920-9716 USA  http://www.snmp.com