PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/extras-3.10/pyroute2/netlink/rtnl/tcmsg/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/extras-3.10/pyroute2/netlink/rtnl/tcmsg/act_bpf.py

from pyroute2.netlink import nla
from pyroute2.netlink.rtnl.tcmsg.common import tc_actions


class options(nla):
    nla_map = (
        ('TCA_ACT_BPF_UNSPEC', 'none'),
        ('TCA_ACT_BPF_TM,', 'none'),
        ('TCA_ACT_BPF_PARMS', 'tca_act_bpf_parms'),
        ('TCA_ACT_BPF_OPS_LEN', 'uint16'),
        ('TCA_ACT_BPF_OPS', 'hex'),
        ('TCA_ACT_BPF_FD', 'uint32'),
        ('TCA_ACT_BPF_NAME', 'asciiz'),
    )

    class tca_act_bpf_parms(nla):
        fields = (
            ('index', 'I'),
            ('capab', 'I'),
            ('action', 'i'),
            ('refcnt', 'i'),
            ('bindcnt', 'i'),
        )


def get_parameters(kwarg):
    ret = {'attrs': []}
    if 'fd' in kwarg:
        ret['attrs'].append(['TCA_ACT_BPF_FD', kwarg['fd']])
    if 'name' in kwarg:
        ret['attrs'].append(['TCA_ACT_BPF_NAME', kwarg['name']])
    a = tc_actions[kwarg.get('action', 'drop')]
    ret['attrs'].append(['TCA_ACT_BPF_PARMS', {'action': a}])
    return ret