Net
Re-implements some psutil functionality to be able to get information from remote debugging sessions.
NETLINK_TYPES = {0: 'NETLINK_ROUTE', 1: 'NETLINK_UNUSED', 2: 'NETLINK_USERSOCK', 3: 'NETLINK_FIREWALL', 4: 'NETLINK_SOCK_DIAG', 5: 'NETLINK_NFLOG', 6: 'NETLINK_XFRM', 7: 'NETLINK_SELINUX', 8: 'NETLINK_ISCSI', 9: 'NETLINK_AUDIT', 10: 'NETLINK_FIB_LOOKUP', 11: 'NETLINK_CONNECTOR', 12: 'NETLINK_NETFILTER', 13: 'NETLINK_IP6_FW', 14: 'NETLINK_DNRTMSG', 15: 'NETLINK_KOBJECT_UEVENT', 16: 'NETLINK_GENERIC', 18: 'NETLINK_SCSITRANSPORT', 19: 'NETLINK_ECRYPTFS', 20: 'NETLINK_RDMA', 21: 'NETLINK_CRYPTO'}
module-attribute
¶
TCP_STATUSES = {'01': 'established', '02': 'syn_sent', '03': 'syn_recv', '04': 'fin_wait1', '05': 'fin_wait2', '06': 'time_wait', '07': 'close', '08': 'close_wait', '09': 'last_ack', '0A': 'listen', '0B': 'closing'}
module-attribute
¶
Connection
¶
Bases: inode
family: str | None = None
class-attribute
instance-attribute
¶
inode: int | None = None
class-attribute
instance-attribute
¶
lhost: str | None = None
class-attribute
instance-attribute
¶
lport: int | None = None
class-attribute
instance-attribute
¶
rhost: str | None = None
class-attribute
instance-attribute
¶
rport: int | None = None
class-attribute
instance-attribute
¶
status: str | None = None
class-attribute
instance-attribute
¶
__repr__()
¶
__str__()
¶
Netlink
¶
UnixSocket
¶
netlink(data)
¶
tcp(data)
¶
It will first list all listening TCP sockets, and next list all established TCP connections. A typical entry of /proc/net/tcp would look like this (split up into 3 parts because of the length of the line):