/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/sched_hfsc.py (2353B)
''' hfsc ++++ Simple HFSC example:: eth0 = ip.get_links(ifname="eth0")[0] ip.tc("add", "hfsc", eth0, handle="1:", default="1:1") ip.tc("add-class", "hfsc", eth0, handle="1:1", parent="1:0" rsc={"m2": "5mbit"}) HFSC curve nla types: * `rsc`: real-time curve * `fsc`: link-share curve * `usc`: upper-limit curve ''' from pyroute2.netlink import nla from pyroute2.netlink.rtnl import RTM_DELQDISC, RTM_NEWQDISC, TC_H_ROOT from pyroute2.netlink.rtnl.tcmsg.common import get_rate, get_time from pyroute2.netlink.rtnl.tcmsg.common import stats2 as c_stats2 parent = TC_H_ROOT def get_parameters(kwarg): defcls = kwarg.get('default', kwarg.get('defcls', 0x10)) defcls &= 0xFFFF return {'defcls': defcls} def get_class_parameters(kwarg): ret = {'attrs': []} for key in ('rsc', 'fsc', 'usc'): if key in kwarg: ret['attrs'].append( [ 'TCA_HFSC_%s' % key.upper(), { 'm1': get_rate(kwarg[key].get('m1', 0)), 'd': get_time(kwarg[key].get('d', 0)), 'm2': get_rate(kwarg[key].get('m2', 0)), }, ] ) return ret class options_hfsc(nla): fields = (('defcls', 'H'),) # default class class options_hfsc_class(nla): nla_map = ( ('TCA_HFSC_UNSPEC', 'none'), ('TCA_HFSC_RSC', 'hfsc_curve'), # real-time curve ('TCA_HFSC_FSC', 'hfsc_curve'), # link-share curve ('TCA_HFSC_USC', 'hfsc_curve'), ) # upper-limit curve class hfsc_curve(nla): fields = ( ('m1', 'I'), # slope of the first segment in bps ('d', 'I'), # x-projection of the first segment in us ('m2', 'I'), ) # slope of the second segment in bps def options(msg, *argv, **kwarg): if msg['header']['type'] in (RTM_NEWQDISC, RTM_DELQDISC): return options_hfsc else: return options_hfsc_class class stats2(c_stats2): class stats_app(nla): fields = ( ('work', 'Q'), # total work done ('rtwork', 'Q'), # total work done by real-time criteria ('period', 'I'), # current period ('level', 'I'), ) # class level in hierarchy