/opt/imh-python/lib/python3.9/site-packages/pyroute2
NameSizeModeActions
bsd/-0755rm
cli/-0755rm
config/-0755rm
dhcp/-0755rm
ethtool/-0755rm
ext/-0755rm
inotify/-0755rm
ipdb/-0755rm
iproute/-0755rm
ndb/-0755rm
netlink/-0755rm
netns/-0755rm
nftables/-0755rm
nslink/-0755rm
protocols/-0755rm
remote/-0755rm
requests/-0755rm
__pycache__/-0755rm
arp.py24740644editdlrm
common.py178590644editdlrm
conntrack.py68450644editdlrm
devlink.py20710644editdlrm
ipset.py241320644editdlrm
iwutil.py233950644editdlrm
lab.py9580644editdlrm
loader.py11390644editdlrm
minimal.py18340644editdlrm
wiset.py196220644editdlrm
__init__.py28760644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/pyroute2/loader.py (1139B)
import struct import sys ## # # Logging setup # # See the history: # * https://github.com/svinota/pyroute2/issues/246 # * https://github.com/svinota/pyroute2/issues/255 # * https://github.com/svinota/pyroute2/issues/270 # * https://github.com/svinota/pyroute2/issues/573 # * https://github.com/svinota/pyroute2/issues/601 # from pyroute2.config import log ## # # Windows platform specific: socket module monkey patching # # To use the library on Windows, run:: # pip install win-inet-pton # if sys.platform.startswith('win'): # noqa: E402 import win_inet_pton # noqa: F401 def init(): try: # probe, if the bytearray can be used in struct.unpack_from() struct.unpack_from('I', bytearray((1, 0, 0, 0)), 0) except Exception: if sys.version_info[0] < 3: # monkeypatch for old Python versions log.warning('patching struct.unpack_from()') def wrapped(fmt, buf, offset=0): return struct._u_f_orig(fmt, str(buf), offset) struct._u_f_orig = struct.unpack_from struct.unpack_from = wrapped else: raise