Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/netutil.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Linux network utilities. | """Linux network utilities. | ||||
Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal | Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal | ||||
""" | """ | ||||
import sys | |||||
import socket | |||||
import fcntl | |||||
import struct | |||||
import array | import array | ||||
import os | |||||
from binascii import unhexlify, hexlify | from binascii import unhexlify, hexlify | ||||
import fcntl | |||||
import os | |||||
import socket | |||||
import struct | |||||
import sys | |||||
# STATE_ESTABLISHED = '01' | # STATE_ESTABLISHED = '01' | ||||
# STATE_SYN_SENT = '02' | # STATE_SYN_SENT = '02' | ||||
# STATE_SYN_RECV = '03' | # STATE_SYN_RECV = '03' | ||||
# STATE_FIN_WAIT1 = '04' | # STATE_FIN_WAIT1 = '04' | ||||
# STATE_FIN_WAIT2 = '05' | # STATE_FIN_WAIT2 = '05' | ||||
# STATE_TIME_WAIT = '06' | # STATE_TIME_WAIT = '06' | ||||
# STATE_CLOSE = '07' | # STATE_CLOSE = '07' | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |