socket

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AF_UNSPEC     = 0
	AF_UNIX       = 1
	AF_INET       = 2
	AF_AX25       = 3
	AF_IPX        = 4
	AF_APPLETALK  = 5
	AF_NETROM     = 6
	AF_BRIDGE     = 7
	AF_ATMPVC     = 8
	AF_X25        = 9
	AF_INET6      = 10
	AF_ROSE       = 11
	AF_DECnet     = 12
	AF_NETBEUI    = 13
	AF_SECURITY   = 14
	AF_KEY        = 15
	AF_NETLINK    = 16
	AF_PACKET     = 17
	AF_ASH        = 18
	AF_ECONET     = 19
	AF_ATMSVC     = 20
	AF_RDS        = 21
	AF_SNA        = 22
	AF_IRDA       = 23
	AF_PPPOX      = 24
	AF_WANPIPE    = 25
	AF_LLC        = 26
	AF_IB         = 27
	AF_MPLS       = 28
	AF_CAN        = 29
	AF_TIPC       = 30
	AF_BLUETOOTH  = 31
	AF_IUCV       = 32
	AF_RXRPC      = 33
	AF_ISDN       = 34
	AF_PHONET     = 35
	AF_IEEE802154 = 36
	AF_CAIF       = 37
	AF_ALG        = 38
	AF_NFC        = 39
	AF_VSOCK      = 40
	AF_KCM        = 41
	AF_QIPCRTR    = 42
	AF_SMC        = 43
	AF_XDP        = 44
)

https://elixir.bootlin.com/linux/latest/source/include/linux/socket.h#L160

View Source
const (
	IPPROTO_IP      = 0
	IPPROTO_ICMP    = 1
	IPPROTO_IGMP    = 2
	IPPROTO_IPIP    = 4
	IPPROTO_TCP     = 6
	IPPROTO_EGP     = 8
	IPPROTO_PUP     = 12
	IPPROTO_UDP     = 17
	IPPROTO_IDP     = 22
	IPPROTO_TP      = 29
	IPPROTO_DCCP    = 33
	IPPROTO_IPV6    = 41
	IPPROTO_RSVP    = 46
	IPPROTO_GRE     = 47
	IPPROTO_ESP     = 50
	IPPROTO_AH      = 51
	IPPROTO_MTP     = 92
	IPPROTO_BEETPH  = 94
	IPPROTO_ENCAP   = 98
	IPPROTO_PIM     = 103
	IPPROTO_COMP    = 108
	IPPROTO_SCTP    = 132
	IPPROTO_UDPLITE = 136
	IPPROTO_MPLS    = 137
	IPPROTO_RAW     = 255
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressFamily

type AddressFamily uint16

func (AddressFamily) MarshalText

func (af AddressFamily) MarshalText() ([]byte, error)

func (AddressFamily) String

func (af AddressFamily) String() string

type IPProtocol

type IPProtocol uint8

func (IPProtocol) MarshalText

func (p IPProtocol) MarshalText() ([]byte, error)

func (IPProtocol) String

func (p IPProtocol) String() string

type IPState

type IPState struct {
	Timestamp     time.Time     `json:"timestamp"`
	ID            uint64        `json:"id"`
	PID           uint32        `json:"pid"`
	Comm          string        `json:"comm"`
	UID           uint32        `json:"uid"`
	GID           uint32        `json:"gid"`
	SrcAddr       net.IP        `json:"source_ip"`
	DstAddr       net.IP        `json:"destination_ip"`
	SrcPort       uint16        `json:"source_port,omitempty"`
	DstPort       uint16        `json:"destination_port,omitempty"`
	OldState      TCPState      `json:"state_old"`
	NewState      TCPState      `json:"state_new"`
	AddressFamily AddressFamily `json:"address_family"`
	Protocol      IPProtocol    `json:"network_protocol"`
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor() (*Monitor, error)

func (*Monitor) Start

func (m *Monitor) Start(done <-chan struct{}) (<-chan interface{}, error)

type TCPState

type TCPState uint32
const (
	TCP_ESTABLISHED TCPState = 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

	TCP_MAX_STATES /* Leave at the end! */
)

Linux TCP states. https://elixir.bootlin.com/linux/latest/source/include/net/tcp_states.h#L16

func (TCPState) MarshalText

func (s TCPState) MarshalText() ([]byte, error)

func (TCPState) String

func (s TCPState) String() string

Jump to

Keyboard shortcuts

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