host

package
v0.0.0-...-ddd92f3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP_ESTABLISHED = iota + 1
	TCP_SYN_SENT
	TCP_SYN_RECV
	TCP_FIN_WAIT1
	TCP_FIN_WAIT2
	TCP_TIME_WAIT
	TCP_CLOSE
	TCP_CLOSE_WAIT
	TCP_LAST_ACK
	TCP_LISTEN
	TCP_CLOSING /* Now a valid state */
	TCP_NEW_SYN_RECV
)

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/net/tcp_states.h

Variables

View Source
var ProcFS = "/proc"
View Source
var TargetPID = 0

Functions

This section is empty.

Types

type FDInfo

type FDInfo struct {
	FD     uint64
	Name   string
	INode  uint64
	Type   FDType
	Target string
	Info   string
}

type FDType

type FDType int
const (
	FDTypeFile FDType = iota
	FDTypeSocket
	FDTypeOther
)

type NetworkEntry

type NetworkEntry struct {
	Proto       string
	Type        uint
	TypeString  string
	Groups      string
	Path        string
	State       uint
	StateString string
	SrcIP       net.IP
	SrcPort     uint
	DstIP       net.IP
	DstPort     uint
	UserId      int
	INode       int
}

func (NetworkEntry) InfoString

func (e NetworkEntry) InfoString() string

func (NetworkEntry) String

func (e NetworkEntry) String() string

type NetworkINodes

type NetworkINodes map[int]NetworkEntry

type Process

type Process struct {
	PID int

	Parent     *procfs.Proc
	ParentStat procfs.ProcStat
	ParentComm string

	Process     procfs.Proc
	Users       []*user.User
	Groups      []*user.Group
	Stat        procfs.ProcStat
	StartTime   time.Time
	Executable  string
	CmdLine     []string
	RootDir     string
	Cwd         string
	WaitChan    string
	MemoryLimit uint64
	Status      procfs.ProcStatus
	Maps        []*procfs.ProcMap
	FDs         procfs.ProcFDInfos
	FDInfos     map[string]FDInfo
	IO          procfs.ProcIO
	Tasks       []Task
}

type Stack

type Stack []StackEntry

type StackEntry

type StackEntry struct {
	Address  uint
	Function string
	Offset   uint
	Size     uint
}

type State

type State struct {
	sync.Mutex
	Offline bool // whether or not this state comes from a recording or it's live

	ObservedAt    time.Time     // when this state has been parsed
	NetworkINodes NetworkINodes // network stuff
	PageSize      int           // generic stats + cpu times
	Stat          procfs.Stat
	Memory        procfs.Meminfo
	Process       Process // process specific stats
	CPUInfo       []procfs.CPUInfo
	// contains filtered or unexported fields
}

func Observe

func Observe(pid int) (*State, error)

type Task

type Task struct {
	ID      int
	IDStr   string
	Path    string
	Comm    string
	CmdLine []string
	Stack   Stack
}

func (Task) String

func (c Task) String() string

Jump to

Keyboard shortcuts

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