sockstate

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Established skState = 0x01
	SynSent     skState = 0x02
	SynRecv     skState = 0x03
	FinWait1    skState = 0x04
	FinWait2    skState = 0x05
	TimeWait    skState = 0x06
	Close       skState = 0x07
	CloseWait   skState = 0x08
	LastAck     skState = 0x09
	Listen      skState = 0x0a
	Closing     skState = 0x0b
)

Socket states

View Source
const (
	Broken = iota
	Other
	Error
)

Variables

View Source
var ErrMultipleSocketsForInode = errors.NewKind("more than one socket found for inode")

ErrMultipleSocketsForInode is returned when more than one socket is found for an inode

View Source
var ErrNoSocketLink = errors.NewKind("couldn't resolve file descriptor link to socket")
View Source
var ErrSocketCheckNotImplemented = errors.NewKind("socket checking not implemented for this OS")

ErrSocketCheckNotImplemented will be returned for OS where the socket checks is not implemented yet

Functions

func GetConnInode

func GetConnInode(c *net.TCPConn) (n uint64, err error)

GetConnInode returns the Linux inode number of a TCP connection

Types

type AcceptFn

type AcceptFn func(*sockTabEntry) bool

AcceptFn is used to filter socket entries. The value returned indicates whether the element is to be appended to the socket list.

type SockState

type SockState uint8

func GetInodeSockState

func GetInodeSockState(port int, inode uint64) (SockState, error)

Jump to

Keyboard shortcuts

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