-
Notifications
You must be signed in to change notification settings - Fork 176
/
drop.py
26 lines (22 loc) · 735 Bytes
/
drop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from actions.action import Action
class DropAction(Action):
"""
Geneva action to drop the given packet.
"""
frequency = 1
def __init__(self, environment_id=None):
"""
Initializes this drop action.
Args:
environment_id (str, optional): Environment ID of the strategy we are a part of
"""
Action.__init__(self, "drop", "both")
self.terminal = True
self.branching = False
def run(self, packet, logger):
"""
The drop action returns None for both it's left and right children, and
does not pass the packet along for continued use.
"""
logger.debug(" - Dropping given packet.")
return None, None