Geneva superclass object for defining a packet-level action.
Defines the superclass for a Geneva Action.
Initializes this action object.
- action_name (str) – Name of this action (“duplicate”)
- direction (str) – Direction of this action (“out”, “both”, “in”)
Returns whether this action applies to the given direction, as branching actions are not supported on inbound trees.
Parameters: direction (str) – Direction to check if this action applies (“out”, “in”, “both”) Returns: whether or not this action can be used to a given direction Return type: bool
get_actions(direction, disabled=None, allow_terminal=True)¶
Dynamically imports all of the Action classes in this directory.
Will only return terminal actions if terminal is set to True.
- direction (str) – Limit imported actions to just those that can run to this direction (“out”, “in”, “both”)
- disabled (list, optional) – list of actions that are disabled
- allow_terminal (bool) – whether or not terminal actions (“drop”) should be imported
Dictionary of imported actions
parse_action(str_action, direction, logger)¶
Parses a string action into the action object.
- str_action (str) – String representation of an action to parse
- direction (str) – Limit actions searched through to just those that can run to this direction (“out”, “in”, “both”)
- logger (
logging.Logger) – a logger to log with
A parsed action object