Skip to main content

Module peer_process

Module peer_process 

Source
Expand description

Which process holds the other end of a loopback connection: the one that connected from peer to server. It is read from the operating system’s own connection table (Windows: the extended TCP table; Linux: /proc/net/tcp and the descriptors under /proc; macOS: lsof). None when it cannot be said: the lookup is not supported, the table could not be read, the peer is not an IPv4 loopback address, or no process was found (a proxy or a tunnel holds the connection).

The tables are read by the pure functions below, so their tests need no connection.

ModulesΒ§

os πŸ”’

StructsΒ§

TcpRow πŸ”’
One row of the Windows extended TCP table, in the fields the lookup reads.

EnumsΒ§

Descriptors πŸ”’
Whether this process can read pid’s open descriptors. Hidden is a process that hides them from others (Linux: a process that is not dumpable, as a packaged srv is). A system that does not hide them says Readable.
Listeners πŸ”’
Who listens on an address.

FunctionsΒ§

descriptors_of πŸ”’
inode_in_proc_net_tcp πŸ”’
The socket inode of the connection from peer to server in the text of /proc/net/tcp.
listeners_at πŸ”’
Who listens on addr, if the system says: the listener that answers a request sent to that address. None when it cannot be said (not supported, the table could not be read, the address is not an IPv4 loopback address, or nothing listens there).
listeners_in_rows πŸ”’
The processes of the rows that listen on addr: a local end on that port (on that address or on every address) and no remote end.
listening_inodes_in_proc_net_tcp πŸ”’
The socket inodes that listen on addr in the text of /proc/net/tcp (state 0A, on that address or on every address).
owner_in_rows πŸ”’
The process of the row that is the client’s end: its local end is peer and its remote end is server.
owner_of πŸ”’
The process that connected from peer to server, if the system says.
parse_tcp_table πŸ”’
The rows of a MIB_TCPTABLE_OWNER_PID buffer (a count, then 24 bytes a row: state, local address, local port, remote address, remote port, owning process; ports in network order in the low 16 bits).
pids_in_lsof πŸ”’
The process ids lsof -Fp named, one p<pid> line each.