PoliceAction¶
The PoliceAction supports policing.
- class PoliceAction(action_index: Optional[int] = None, *, rate: Optional[int] = None, burst: Optional[int] = None, mtu: Optional[int] = None, decision: ActionDecision, overhead: Optional[int] = None)[source]¶
This class supports the tc(8)
policeaction as documented in tc-police(8).- Parameters:
action_index – an integer that effectively names the action
rate – rate
burst – burst
mtu – MTU
decision – control action to take
overhead – overhead
- get_decision() ActionDecision[source]¶
Returns the decision (e.g.
ActionDecision.DROP) for this action
- get_action_index() Optional[int]¶
Returns the action index
- get_kind() str¶
Returns the action type
- class ActionDecision(value)[source]¶
List of decisions for tc(8) actions (see tc-actions(8)); there are also referred-to as control actions.
- RECLASSIFY = 'reclassify'¶
Reclassify packet
- PIPE = 'pipe'¶
Pass packet to next action
- DROP = 'drop'¶
Drop packet
- CONTINUE = 'continue'¶
Pass packet to next filter
- PASS = 'pass'¶
End packet classification (packet returned to queuing discipline/class)
- classmethod create_from_string(decision_str: str) ActionDecision[source]¶
Convert from a string to an
ActionDecisionmember.- Parameters:
decision_str – the string representation of
ActionDecisionmember.- Return type:
a
ActionDecisionmember
Raises a
ValueErrorif no match is found.