ebpfless

package
v0.0.0-...-8dae9f9 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ebpfless contains supporting code for the ebpfless tracer

Package ebpfless contains supporting code for the ebpfless tracer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TCPPayloadLen

func TCPPayloadLen(family network.ConnectionFamily, ip4 *layers.IPv4, ip6 *layers.IPv6, tcp *layers.TCP) (uint16, error)

TCPPayloadLen returns the TCP payload length from a layers.TCP object

func UDPPayloadLen

func UDPPayloadLen(udp *layers.UDP) (uint16, error)

UDPPayloadLen returns the UDP payload length from a layers.UDP object

func WriteMapWithSizeLimit

func WriteMapWithSizeLimit[Key comparable, Val any](m map[Key]Val, key Key, val Val, sizeLimit int) bool

WriteMapWithSizeLimit updates a map via m[key] = val. However, if the map would overflow sizeLimit, it returns false instead.

Types

type BoundPorts

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

BoundPorts is a collection of bound ports on the host that is periodically updated from procfs

func NewBoundPorts

func NewBoundPorts(cfg *config.Config) *BoundPorts

NewBoundPorts returns a new BoundPorts instance

func (*BoundPorts) Find

func (b *BoundPorts) Find(proto network.ConnectionType, port uint16) bool

Find returns `true` if the given `(proto, port)` exists in the BoundPorts collection

func (*BoundPorts) Start

func (b *BoundPorts) Start() error

Start starts a BoundPorts instance

func (*BoundPorts) Stop

func (b *BoundPorts) Stop()

Stop stops a BoundPorts instance

Jump to

Keyboard shortcuts

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