l7_req

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BPF_L7_PROTOCOL_UNKNOWN = iota
	BPF_L7_PROTOCOL_HTTP
	BPF_L7_PROTOCOL_AMQP
	BPF_L7_PROTOCOL_POSTGRES
	BPF_L7_PROTOCOL_HTTP2
)

match with values in l7_req.c

View Source
const (
	L7_PROTOCOL_HTTP     = "HTTP"
	L7_PROTOCOL_HTTP2    = "HTTP2"
	L7_PROTOCOL_AMQP     = "AMQP"
	L7_PROTOCOL_POSTGRES = "POSTGRES"
	L7_PROTOCOL_UNKNOWN  = "UNKNOWN"
)

for user space

View Source
const (
	BPF_METHOD_UNKNOWN = iota
	BPF_METHOD_GET
	BPF_METHOD_POST
	BPF_METHOD_PUT
	BPF_METHOD_PATCH
	BPF_METHOD_DELETE
	BPF_METHOD_HEAD
	BPF_METHOD_CONNECT
	BPF_METHOD_OPTIONS
	BPF_METHOD_TRACE
)

match with values in l7_req.c, order is important

View Source
const (
	BPF_HTTP2_METHOD_UNKNOWN = iota
	BPF_HTTP2_METHOD_CLIENT
	BPF_HTTP2_METHOD_SERVER
)
View Source
const (
	BPF_AMQP_METHOD_UNKNOWN = iota
	BPF_AMQP_METHOD_PUBLISH
	BPF_AMQP_METHOD_DELIVER
)

match with values in l7_req.c, order is important

View Source
const (
	BPF_POSTGRES_METHOD_UNKNOWN = iota
	BPF_POSTGRES_METHOD_STATEMENT_CLOSE_OR_CONN_TERMINATE
	BPF_POSTGRES_METHOD_SIMPLE_QUERY
	BPF_POSTGRES_METHOD_EXTENDED_QUERY // for prepared statements

)

match with values in l7_req.c, order is important

View Source
const (
	GET     = "GET"
	POST    = "POST"
	PUT     = "PUT"
	PATCH   = "PATCH"
	DELETE  = "DELETE"
	HEAD    = "HEAD"
	CONNECT = "CONNECT"
	OPTIONS = "OPTIONS"
	TRACE   = "TRACE"
)

for http, user space

View Source
const (
	PUBLISH = "PUBLISH"
	DELIVER = "DELIVER"
)

for rabbitmq, user space

View Source
const (
	CLOSE_OR_TERMINATE = "CLOSE_OR_TERMINATE"
	SIMPLE_QUERY       = "SIMPLE_QUERY"
	EXTENDED_QUERY     = "EXTENDED_QUERY"
)

for postgres, user space

View Source
const (
	CLIENT_FRAME = "CLIENT_FRAME"
	SERVER_FRAME = "SERVER_FRAME"
)

for http2, user space

View Source
const L7_EVENT = "l7_event"
View Source
const TRACE_EVENT = "trace_event"

Variables

View Source
var DIST_TRACING_ENABLED bool
View Source
var L7BpfProgsAndMaps bpfObjects

Functions

This section is empty.

Types

type HTTPMethodConversion

type HTTPMethodConversion uint32

Custom type for the enumeration

func (HTTPMethodConversion) String

func (e HTTPMethodConversion) String() string

String representation of the enumeration values

type Http2MethodConversion added in v0.3.0

type Http2MethodConversion uint32

Custom type for the enumeration

func (Http2MethodConversion) String added in v0.3.0

func (e Http2MethodConversion) String() string

String representation of the enumeration values

type L7Event

type L7Event struct {
	Fd                  uint64
	Pid                 uint32
	Status              uint32
	Duration            uint64
	Protocol            string // L7_PROTOCOL_HTTP
	Tls                 bool   // Whether request was encrypted
	Method              string
	Payload             [1024]uint8
	PayloadSize         uint32 // How much of the payload was copied
	PayloadReadComplete bool   // Whether the payload was copied completely
	Failed              bool   // Request failed
	WriteTimeNs         uint64 // start time of write syscall
	Tid                 uint32
	Seq                 uint32 // tcp seq num
	EventReadTime       int64
}

for user space

func (*L7Event) Type

func (e *L7Event) Type() string

type L7Prog added in v0.5.1

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

func InitL7Prog added in v0.5.1

func InitL7Prog(conf *L7ProgConfig) *L7Prog

func (*L7Prog) Attach added in v0.5.1

func (l7p *L7Prog) Attach()

func (*L7Prog) Close added in v0.5.1

func (l7p *L7Prog) Close()

func (*L7Prog) Consume added in v0.5.1

func (l7p *L7Prog) Consume(ctx context.Context, ch chan interface{})

returns when program is detached

func (*L7Prog) InitMaps added in v0.5.1

func (l7p *L7Prog) InitMaps()

func (*L7Prog) Load added in v0.5.1

func (l7p *L7Prog) Load()

Loads bpf programs into kernel

type L7ProgConfig added in v0.5.1

type L7ProgConfig struct {
	TrafficBpfMapSize  uint32 // specified in terms of os page size
	L7EventsBpfMapSize uint32 // specified in terms of os page size
	LogsBpfMapSize     uint32
}

type L7ProtocolConversion

type L7ProtocolConversion uint32

Custom type for the enumeration

func (L7ProtocolConversion) String

func (e L7ProtocolConversion) String() string

String representation of the enumeration values

type PostgresMethodConversion

type PostgresMethodConversion uint32

Custom type for the enumeration

func (PostgresMethodConversion) String

func (e PostgresMethodConversion) String() string

String representation of the enumeration values

type RabbitMQMethodConversion

type RabbitMQMethodConversion uint32

Custom type for the enumeration

func (RabbitMQMethodConversion) String

func (e RabbitMQMethodConversion) String() string

String representation of the enumeration values

type TraceEvent added in v0.4.0

type TraceEvent struct {
	Pid   uint32
	Tid   uint32
	Tx    int64
	Type_ uint8
	Seq   uint32
}

func (TraceEvent) Type added in v0.4.0

func (e TraceEvent) Type() string

Jump to

Keyboard shortcuts

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