tcp_state

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BPF_EVENT_TCP_ESTABLISHED = iota + 1
	BPF_EVENT_TCP_CONNECT_FAILED
	BPF_EVENT_TCP_LISTEN
	BPF_EVENT_TCP_LISTEN_CLOSED
	BPF_EVENT_TCP_CLOSED
)

match with values in tcp_state.c

View Source
const (
	EVENT_TCP_ESTABLISHED    = "EVENT_TCP_ESTABLISHED"
	EVENT_TCP_CONNECT_FAILED = "EVENT_TCP_CONNECT_FAILED"
	EVENT_TCP_LISTEN         = "EVENT_TCP_LISTEN"
	EVENT_TCP_LISTEN_CLOSED  = "EVENT_TCP_LISTEN_CLOSED"
	EVENT_TCP_CLOSED         = "EVENT_TCP_CLOSED"
)

for user space

View Source
const TCP_CONNECT_EVENT = "tcp_connect_event"

Variables

This section is empty.

Functions

This section is empty.

Types

type BpfTcpEvent added in v0.5.1

type BpfTcpEvent struct {
	Fd        uint64
	Timestamp uint64
	Type      uint32
	Pid       uint32
	SPort     uint16
	DPort     uint16
	SAddr     [16]byte
	DAddr     [16]byte
}

padding to match the kernel struct

type TcpConnectEvent

type TcpConnectEvent struct {
	Fd        uint64
	Timestamp uint64
	Type_     string
	Pid       uint32
	SPort     uint16
	DPort     uint16
	SAddr     string
	DAddr     string
}

for user space

func (TcpConnectEvent) Type

func (e TcpConnectEvent) Type() string

type TcpStateConfig added in v0.5.1

type TcpStateConfig struct {
	BpfMapSize uint32 // specified in terms of os page size
}

type TcpStateConversion

type TcpStateConversion uint32

Custom type for the enumeration

func (TcpStateConversion) String

func (e TcpStateConversion) String() string

String representation of the enumeration values

type TcpStateProg added in v0.5.1

type TcpStateProg struct {
	ContainerPidMap *ebpf.Map // for filtering non-container pids on the node
	// contains filtered or unexported fields
}
var TcpState *TcpStateProg

func InitTcpStateProg added in v0.5.1

func InitTcpStateProg(conf *TcpStateConfig) *TcpStateProg

func (*TcpStateProg) Attach added in v0.5.1

func (tsp *TcpStateProg) Attach()

func (*TcpStateProg) Close added in v0.5.1

func (tsp *TcpStateProg) Close()

func (*TcpStateProg) Consume added in v0.5.1

func (tsp *TcpStateProg) Consume(ctx context.Context, ch chan interface{})

returns when program is detached

func (*TcpStateProg) InitMaps added in v0.5.1

func (tsp *TcpStateProg) InitMaps()

func (*TcpStateProg) PopulateContainerPidsMap added in v0.8.0

func (tsp *TcpStateProg) PopulateContainerPidsMap(newKeys, deletedKeys []uint32) error

Jump to

Keyboard shortcuts

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