Skip to content

Instantly share code, notes, and snippets.

@yunazuno
yunazuno / ethtool.py
Last active March 12, 2024 10:51
ethtool -S in Python
#!/usr/bin/env python
import socket
import fcntl
import struct
import array
SIOCETHTOOL = 0x8946
ETHTOOL_GSTRINGS = 0x0000001b
ETHTOOL_GSSET_INFO = 0x00000037
ETHTOOL_GSTATS = 0x0000001d