bpf

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AND  Operator = "and"
	OR            = "or"
	NOOP          = ""
)

Supported operators

View Source
const (
	SRC   Dir = "src"
	DST       = "dst"
	NODIR     = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir added in v0.4.0

type Dir string

type Expr

type Expr string

Expr represents a BPF expression. It's zero value is ready to use.

func FromAddr added in v0.4.0

func FromAddr(d Dir, addr net.Addr) Expr

FromAddr returns a BPF from a network address, plus direction information. Use NODIR to make a filter that matches both src and dst packets.

func (Expr) And added in v0.4.0

func (l Expr) And(r string) Expr

And works as `Join`, but uses "and" to join the two expressions.

func (Expr) Join added in v0.4.0

func (l Expr) Join(r string) Expr

Join returns a new expression, made of the conjunction of the caller with `r`, wrapped in an Expr. Callers have to ensure that operator precedence is preserved.

func (Expr) NewReader

func (e Expr) NewReader() *strings.Reader

NewReader returns an io.Reader implementation, which will read the BPF expression from `e`. Later modifications of `e` will not affect the content of the reader.

func (Expr) Or added in v0.4.0

func (l Expr) Or(r string) Expr

Or is the same as `And`, but with "or".

func (Expr) Wrap added in v0.4.0

func (e Expr) Wrap() Expr

Wrap surrounds `e` with ().

type Operator added in v0.4.0

type Operator string

Jump to

Keyboard shortcuts

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