OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
pyroute2
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
01/09/2025 02:18:04 AM
rwxr-xr-x
📄
__init__.py
2.81 KB
05/14/2024 03:18:01 PM
rw-r--r--
📁
__pycache__
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📄
arp.py
2.42 KB
05/14/2024 03:18:01 PM
rw-r--r--
📁
bsd
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📁
cli
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📄
common.py
17.44 KB
05/14/2024 03:18:01 PM
rw-r--r--
📁
config
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📄
conntrack.py
6.68 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
devlink.py
2.02 KB
05/14/2024 03:18:01 PM
rw-r--r--
📁
dhcp
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📁
ethtool
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📁
ext
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
inotify
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
ipdb
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
iproute
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📄
ipset.py
23.57 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
iwutil.py
22.85 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
lab.py
958 bytes
05/14/2024 03:18:01 PM
rw-r--r--
📄
loader.py
1.11 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
minimal.py
1.79 KB
05/14/2024 03:18:01 PM
rw-r--r--
📁
ndb
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
netlink
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
netns
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
nftables
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
nslink
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
protocols
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
remote
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📁
requests
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📄
wiset.py
19.16 KB
05/14/2024 03:18:01 PM
rw-r--r--
Editing: devlink.py
Close
import logging from pyroute2.netlink import NLM_F_DUMP, NLM_F_REQUEST from pyroute2.netlink.devlink import DEVLINK_NAMES, DevlinkSocket, devlinkcmd log = logging.getLogger(__name__) class DL(DevlinkSocket): def __init__(self, *argv, **kwarg): # get specific groups kwarg if 'groups' in kwarg: groups = kwarg['groups'] del kwarg['groups'] else: groups = None # get specific async kwarg if 'async' in kwarg: # FIXME # raise deprecation error after 0.5.3 # log.warning( 'use "async_cache" instead of "async", ' '"async" is a keyword from Python 3.7' ) kwarg['async_cache'] = kwarg.pop('async') if 'async_cache' in kwarg: async_cache = kwarg.pop('async_cache') else: async_cache = False # align groups with async_cache if groups is None: groups = ~0 if async_cache else 0 # continue with init super(DL, self).__init__(*argv, **kwarg) # do automatic bind # FIXME: unfortunately we can not omit it here try: self.bind(groups, async_cache=async_cache) except: # thanks to jtluka at redhat.com and the LNST # team for the fixed fd leak super(DL, self).close() raise def list(self): return self.get_dump() def get_dump(self): msg = devlinkcmd() msg['cmd'] = DEVLINK_NAMES['DEVLINK_CMD_GET'] return tuple( self.nlm_request( msg, msg_type=self.prid, msg_flags=NLM_F_REQUEST | NLM_F_DUMP ) ) def port_list(self): return self.get_port_dump() def get_port_dump(self): msg = devlinkcmd() msg['cmd'] = DEVLINK_NAMES['DEVLINK_CMD_PORT_GET'] return tuple( self.nlm_request( msg, msg_type=self.prid, msg_flags=NLM_F_REQUEST | NLM_F_DUMP ) )