ebpf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBPFCode

func GetBPFCode(conf *config.Config) (string, error)

GetBPFCode returns BPF program

func ValidateField

func ValidateField(f string) (string, error)

ValidateField validates a field

func ValidateTCPStatus

func ValidateTCPStatus(status string) (string, error)

ValidateTCPStatus validates a TCP status

func ValidateTracepoint

func ValidateTracepoint(tp string) error

ValidateTracepoint validates a tracepoint

Types

type BPF

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

BPF represents eBPF procedures.

func New

func New(conf *config.Config) *BPF

New generates and loads the bpf program.

func (*BPF) Close

func (b *BPF) Close()

Close cleans up BPF attachments

func (*BPF) Start

func (b *BPF) Start(ctx context.Context, tp TP)

Start loads and attaches tracepoint and approperiate channel

type CGen

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

CGen represents code generator

type CType

type CType uint8

CType represents clang type

func (CType) String

func (c CType) String() string

type DType

type DType uint8

DType represents data type

const (
	// IP represents IP data type
	IP DType = 1
)

type FieldAttrs

type FieldAttrs struct {
	CType     CType
	DType     DType
	CField    string
	DS        string
	UMath     string
	Math      string
	Func      string
	Filter    string
	Desc      string
	DSNP      bool
	BigEndian bool
}

FieldAttrs represents

type TP

type TP struct {
	Name    string
	BufPool *sync.Pool
	OutChan chan *bytes.Buffer
	Index   int
	Workers int
	INet    []int
	Fields  []string
}

TP represents a tracepoint

type TracepointTemplate

type TracepointTemplate struct {
	Fields4    []FieldAttrs
	Fields6    []FieldAttrs
	Tracepoint string
	TCPState   string
	Suffix     int
	Sample     int
	TCPInfo    bool
	ICSK       bool
}

TracepointTemplate represents template's data object

func (*TracepointTemplate) Init

func (t *TracepointTemplate) Init()

Init intializes tracepointTemplate

Jump to

Keyboard shortcuts

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