netstat

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TcpType  = "tcp"
	Tcp6Type = "tcp6"
	UdpType  = "udp"
	Udp6Type = "udp6"

	EstablishedState = "ESTABLISHED"
	SynSentState     = "SYN_SENT"
	SynRecvState     = "SYN_RECV"
	FinWait1State    = "FIN_WAIT1"
	FinWait2State    = "FIN_WAIT2"
	TimeWaitState    = "TIME_WAIT"
	CloseState       = "CLOSE"
	CloseWaitState   = "CLOSE_WAIT"
	LastAckState     = "LAST_ACK"
	ListenState      = "LISTEN"
	ClosingState     = "CLOSING"

	FileDescriptors = "/proc/[0-9]*/fd/[0-9]*"

	UnknownUser = "Unknown"
)

Variables

View Source
var AllowedTypes = []string{TcpType, Tcp6Type, UdpType, Udp6Type}
View Source
var State = map[string]string{
	"01": EstablishedState,
	"02": SynSentState,
	"03": SynRecvState,
	"04": FinWait1State,
	"05": FinWait2State,
	"06": TimeWaitState,
	"07": CloseState,
	"08": CloseWaitState,
	"09": LastAckState,
	"0A": ListenState,
	"0B": ClosingState,
}

Functions

This section is empty.

Types

type Process

type Process struct {
	User        string
	Name        string
	Pid         string
	Exe         string
	State       string
	Ip          string
	Port        int
	ForeignIp   string
	ForeignPort int
}

type Processes

type Processes []Process

func Tcp

func Tcp() (Processes, error)

func Tcp6

func Tcp6() (Processes, error)

func Udp

func Udp() (Processes, error)

func Udp6

func Udp6() (Processes, error)

Jump to

Keyboard shortcuts

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