netstat

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Proto   string
	SrcIP   net.IP
	SrcPort uint
	DstIP   net.IP
	DstPort uint
	UserId  int
	INode   int
}

Entry holds the information of a /proc/net/* entry. For example, /proc/net/tcp: sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 0100007F:13AD 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 18083222

func FindEntry

func FindEntry(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPort uint) *Entry

FindEntry looks for the connection in the list of known connections in ProcFS.

func NewEntry

func NewEntry(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPort uint, userId int, iNode int) Entry

NewEntry creates a new entry with values from /proc/net/

func Parse

func Parse(proto string) ([]Entry, error)

Parse scans and retrieves the opened connections, from /proc/net/ files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL