tracer

package
v0.2.146 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_TYPE_CONNECT = iota
	EVENT_TYPE_ACCEPT
	EVENT_TYPE_REQUEST
	EVENT_TYPE_RESPONSE
	EVENT_TYPE_CLOSE
)

Variables

This section is empty.

Functions

func AttachTracepoint

func AttachTracepoint(tracepoint TracepointInfo) (link.Link, error)

func ExtractConsistentHeaders

func ExtractConsistentHeaders(headers http.Header) map[string][]string

func FromCString

func FromCString(in []byte) []byte

func GetHttpData

func GetHttpData(bpfEvent *http_snifferHttpevent) (tracerhttptype.HTTPData, error)

Types

type Config

type Config struct {
	MountnsMap *ebpf.Map
}

type GadgetDesc

type GadgetDesc struct{}

func (*GadgetDesc) NewInstance

func (g *GadgetDesc) NewInstance() (gadgets.Gadget, error)

type TracepointInfo

type TracepointInfo struct {
	Syscall string
	ObjFunc interface{}
}

func GetTracepointDefinitions

func GetTracepointDefinitions(objs *http_snifferPrograms) []TracepointInfo

type Tracer

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

func NewTracer

func NewTracer(config *Config, enricher gadgets.DataEnricherByMntNs,
	eventCallback func(*types.Event),
) (*Tracer, error)

func (*Tracer) Close

func (t *Tracer) Close()

func (*Tracer) ParseHTTP

func (t *Tracer) ParseHTTP(rawSample []byte) (*tracerhttptype.Event, error)

func (*Tracer) Run

func (t *Tracer) Run(gadgetCtx gadgets.GadgetContext) error

func (*Tracer) SetEventHandler

func (t *Tracer) SetEventHandler(handler any)

func (*Tracer) SetMountNsMap

func (t *Tracer) SetMountNsMap(mountnsMap *ebpf.Map)

Jump to

Keyboard shortcuts

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