/opt/imh-python/lib/python3.9/site-packages/pyroute2/netlink/rtnl/tcmsg
NameSizeModeActions
__pycache__/-0755rm
act_bpf.py9790644editdlrm
act_connmark.py12340644editdlrm
act_gact.py7090644editdlrm
act_mirred.py17250644editdlrm
act_police.py18660644editdlrm
act_skbedit.py33370644editdlrm
act_vlan.py14650644editdlrm
cls_basic.py84780644editdlrm
cls_flow.py46130644editdlrm
cls_fw.py14270644editdlrm
cls_matchall.py9860644editdlrm
cls_u32.py80340644editdlrm
common.py107280644editdlrm
common_act.py20630644editdlrm
common_ematch.py31480644editdlrm
em_cmp.py27760644editdlrm
em_ipset.py17410644editdlrm
em_meta.py59330644editdlrm
sched_bpf.py25710644editdlrm
sched_cake.py128330644editdlrm
sched_choke.py34320644editdlrm
sched_clsact.py10110644editdlrm
sched_codel.py16070644editdlrm
sched_drr.py7550644editdlrm
sched_fq_codel.py26580644editdlrm
sched_hfsc.py23530644editdlrm
sched_htb.py57390644editdlrm
sched_ingress.py2140644editdlrm
sched_netem.py51420644editdlrm
sched_pfifo.py1960644editdlrm
sched_pfifo_fast.py2150644editdlrm
sched_plug.py4460644editdlrm
sched_sfq.py27170644editdlrm
sched_tbf.py10870644editdlrm
sched_template.py12500644editdlrm
__init__.py27430644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/pyroute2/netlink/rtnl/tcmsg/common_act.py (2063B)
from pyroute2.netlink import nla from pyroute2.netlink.rtnl.tcmsg import ( act_bpf, act_connmark, act_gact, act_mirred, act_police, act_skbedit, act_vlan, ) from pyroute2.netlink.rtnl.tcmsg.common import TCA_ACT_MAX_PRIO, stats2 plugins = { 'gact': act_gact, 'bpf': act_bpf, 'police': act_police, 'mirred': act_mirred, 'connmark': act_connmark, 'vlan': act_vlan, 'skbedit': act_skbedit, } class nla_plus_tca_act_opt(object): @staticmethod def get_act_options(self, *argv, **kwarg): kind = self.get_attr('TCA_ACT_KIND') if kind in plugins: return plugins[kind].options return self.hex class tca_act_prio(nla): nla_map = tuple( [('TCA_ACT_PRIO_%i' % x, 'tca_act') for x in range(TCA_ACT_MAX_PRIO)] ) class tca_act(nla, nla_plus_tca_act_opt): nla_map = ( ('TCA_ACT_UNSPEC', 'none'), ('TCA_ACT_KIND', 'asciiz'), ('TCA_ACT_OPTIONS', 'get_act_options'), ('TCA_ACT_INDEX', 'hex'), ('TCA_ACT_STATS', 'stats2'), ) stats2 = stats2 def get_act_parms(kwarg): if 'kind' not in kwarg: raise Exception('action requires "kind" parameter') if kwarg['kind'] in plugins: return plugins[kwarg['kind']].get_parameters(kwarg) else: return [] # All filters can use any act type, this is a generic parser for all def get_tca_action(kwarg): ret = {'attrs': []} act = kwarg.get('action', 'drop') # convert simple action='..' to kwarg style if isinstance(act, str): act = {'kind': 'gact', 'action': act} # convert single dict action to first entry in a list of actions acts = act if isinstance(act, list) else [act] for i, act in enumerate(acts, start=1): opt = { 'attrs': [ ['TCA_ACT_KIND', act['kind']], ['TCA_ACT_OPTIONS', get_act_parms(act)], ] } ret['attrs'].append(['TCA_ACT_PRIO_%d' % i, opt]) return ret