Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/netutil.py
Show All 9 Lines | |||||
import sys | import sys | ||||
import socket | import socket | ||||
import fcntl | import fcntl | ||||
import struct | import struct | ||||
import array | import array | ||||
import os | import os | ||||
from binascii import unhexlify, hexlify | from binascii import unhexlify, hexlify | ||||
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' | ||||
STATE_CLOSE_WAIT = '08' | # STATE_CLOSE_WAIT = '08' | ||||
STATE_LAST_ACK = '09' | # STATE_LAST_ACK = '09' | ||||
STATE_LISTEN = '0A' | STATE_LISTEN = '0A' | ||||
STATE_CLOSING = '0B' | # STATE_CLOSING = '0B' | ||||
def get_socket_inodes(pid): | def get_socket_inodes(pid): | ||||
''' | ''' | ||||
Get list of socket inodes for process pid. | Get list of socket inodes for process pid. | ||||
''' | ''' | ||||
base = '/proc/%i/fd' % pid | base = '/proc/%i/fd' % pid | ||||
inodes = [] | inodes = [] | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |