Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyroute2/netlink/rtnl/tcmsg/__pycache__/act_skbedit.cpython-39.pyc
Ðазад
a ]�h � @ sP d Z ddlmZ ddlmZ dZdZdZdZdd� Z d d � Z G dd� de�Zd S )ao skbedit +++++++ Usage:: from pyroute2 import IPRoute # Assume you are working with eth1 interface IFNAME = "eth1" ipr = IPRoute() ifindex = ipr.link_lookup(ifname=IFNAME) # First create parent qdisc ipr.tc("add", "htb", index=ifindex, handle=0x10000) # Then add a matchall filter with skbedit action # Simple action example action = {"kind": "skbedit", "priority": 0x10001 # Also known as "1:1" in TC format } ipr.tc("add-filter", "matchall", index=ifindex, parent=0x10000, prio=1, action=action) # Extended action example action = {"kind": "skbedit", "priority": 0x10001, # Also known as "1:1" in TC format "mark": 0x1337, "mask": 0xFFFFFFFF, "ptype": "host" } ipr.tc("add-filter", "matchall", index=ifindex, parent=0x10000, prio=1, action=action) NOTES: Here is the list of all supported options:: - mark: integer - mask: integer - priority: integer - ptype: "host", "otherhost", "broadcast" or "multicast" - queue: integer � )�nla)� tc_actions� � � c C s4 t tttd�}|�| �� �}|d ur(|S td��d S )N)�hostZ otherhost� broadcastZ multicastzBInvalid ptype specified! See tc-skbedit man page for valid values.)�PACKET_HOST�PACKET_OTHERHOST�PACKET_BROADCAST�PACKET_MULTICAST�get�lower� ValueError)�value�types�res� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyroute2/netlink/rtnl/tcmsg/act_skbedit.py� convert_ptype7 s ��r c C sv dg i}d}i }t d |d<