Documentation ¶
Index ¶
- Constants
- func GetActiveConnectionIDs() []string
- func GetPidOfConnection(localIP net.IP, localPort uint16, protocol uint8) (pid int, status uint8)
- func GetPidOfIncomingConnection(localIP net.IP, localPort uint16, protocol uint8) (pid int, status uint8)
- func GetPidOfInode(uid, inode int) (int, bool)
- func GetTCP4PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, ...) (pid int, direction bool, err error)
- func GetTCP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, ...) (pid int, direction bool, err error)
- func GetUDP4PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, ...) (pid int, direction bool, err error)
- func GetUDP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, ...) (pid int, direction bool, err error)
Constants ¶
View Source
const ( Success uint8 = iota NoSocket NoProcess )
PID querying return codes
View Source
const ( TCP4 uint8 = iota UDP4 TCP6 UDP6 ICMP4 ICMP6 TCP4Data = "/proc/net/tcp" UDP4Data = "/proc/net/udp" TCP6Data = "/proc/net/tcp6" UDP6Data = "/proc/net/udp6" ICMP4Data = "/proc/net/icmp" ICMP6Data = "/proc/net/icmp6" )
Network Related Constants
Variables ¶
This section is empty.
Functions ¶
func GetActiveConnectionIDs ¶
func GetActiveConnectionIDs() []string
GetActiveConnectionIDs returns all connection IDs that are still marked as active by the OS.
func GetPidOfConnection ¶
GetPidOfConnection returns the PID of the given connection.
func GetPidOfIncomingConnection ¶
func GetPidOfIncomingConnection(localIP net.IP, localPort uint16, protocol uint8) (pid int, status uint8)
GetPidOfIncomingConnection returns the PID of the given incoming connection.
func GetPidOfInode ¶
GetPidOfInode returns the pid of the given uid and socket inode.
func GetTCP4PacketInfo ¶
func GetTCP4PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)
GetTCP4PacketInfo searches the network state tables for a TCP4 connection
func GetTCP6PacketInfo ¶
func GetTCP6PacketInfo(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, pktDirection bool) (pid int, direction bool, err error)
GetTCP6PacketInfo searches the network state tables for a TCP6 connection
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.