Trigger(trigger_type, trigger_field, trigger_proto, trigger_value=0, environment_id=None, gas=None)¶
__init__(trigger_type, trigger_field, trigger_proto, trigger_value=0, environment_id=None, gas=None)¶
- trigger_type: the type of trigger. Only “field” (matching based on a field value) is currently supported.
- trigger_field: the field the trigger should check in a packet to trigger on
- trigger_proto: the protocol the trigger should look in to retrieve the trigger field
- trigger_value: the value in the trigger_field that, upon a match, will cause the trigger to fire
- environment_id: environment_id the current trigger is running under. Used to retrieve previously saved packets
- gas: how many times this trigger can fire before it stops triggering. gas=None disables gas (unlimited triggers.)
- has_wildcard: represents if the trigger will match a specific value, or any value containing trigger_value
Adds gas to this trigger, gas is an integer
Disables the use of gas.
Sets gas to 0
Returns a random value for gas for this trigger.
Creates a random trigger.
Checks if this trigger is applicable to a given packet.
Mutates this trigger object by picking a new protocol, field, and value.
Given a string representation of a trigger, define a new Trigger represented by this string.
Sets the gas to the specified value