/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/act_mirred.py (1725B)
from pyroute2.netlink import NLA_F_NESTED, nla from pyroute2.netlink.rtnl.tcmsg.common import tc_actions """ Mirred - mirror/redirect action see tc-mirred(8) Use like any other action, with the following parameters available: - direction (mandatory): ingress or egress - action (mandatory): mirror or redirect - ifindex (mandatory): destination interface for mirrored or redirected packets - index: explicit index for this action """ # see tc_mirred.h MIRRED_EACTIONS = { ("egress", "redirect"): 1, # redirect packet to egress ("egress", "mirror"): 2, # mirror packet to egress ("ingress", "redirect"): 3, # redirect packet to ingress ("ingress", "mirror"): 4, # mirror packet to ingress } class options(nla): nla_flags = NLA_F_NESTED nla_map = ( ('TCA_MIRRED_UNSPEC', 'none'), ('TCA_MIRRED_TM', 'none'), ('TCA_MIRRED_PARMS', 'tca_mirred_parms'), ) class tca_mirred_parms(nla): fields = ( ('index', 'I'), ('capab', 'I'), ('action', 'i'), ('refcnt', 'i'), ('bindcnt', 'i'), ('eaction', 'i'), ('ifindex', 'I'), ) def get_parameters(kwarg): ret = {'attrs': []} # direction, action and ifindex are mandatory parms = { 'eaction': MIRRED_EACTIONS[(kwarg['direction'], kwarg['action'])], 'ifindex': kwarg['ifindex'], } if 'index' in kwarg: parms['index'] = int(kwarg['index']) # From m_mirred.c if kwarg['action'] == 'redirect': parms['action'] = tc_actions['stolen'] else: # mirror parms['action'] = tc_actions['pipe'] ret['attrs'].append(['TCA_MIRRED_PARMS', parms]) return ret