Documentation ¶
Index ¶
- Constants
- func CompileCbpf(expr string) (insts []bpf.Instruction, err error)
- func CompileEbpf(expr string, opts cbpfc.EBPFOpts) (insts asm.Instructions, err error)
- func InjectPcapFilter(program *ebpf.ProgramSpec, filterExpr string) (err error)
- func LoadBpf() (*ebpf.CollectionSpec, error)
- func LoadBpfObjects(obj interface{}, opts *ebpf.CollectionOptions) error
- type Bpf
- type BpfArgs
- type BpfContent
- type BpfDatum
- type BpfEvent
- type BpfMapSpecs
- type BpfMaps
- type BpfObjects
- type BpfProgramSpecs
- type BpfPrograms
- type BpfSpecs
- type Event
Constants ¶
const ( MaxBpfInstructions = 4096 MAXIMUM_SNAPLEN = 262144 )
Variables ¶
This section is empty.
Functions ¶
func CompileCbpf ¶
func CompileCbpf(expr string) (insts []bpf.Instruction, err error)
func CompileEbpf ¶
func InjectPcapFilter ¶
func InjectPcapFilter(program *ebpf.ProgramSpec, filterExpr string) (err error)
func LoadBpf ¶
func LoadBpf() (*ebpf.CollectionSpec, error)
LoadBpf returns the embedded CollectionSpec for Bpf.
func LoadBpfObjects ¶
func LoadBpfObjects(obj interface{}, opts *ebpf.CollectionOptions) error
LoadBpfObjects loads Bpf and converts it into a struct.
The following types are suitable as obj argument:
*BpfObjects *BpfPrograms *BpfMaps
See ebpf.CollectionSpec.LoadAndAssign documentation for details.
Types ¶
type Bpf ¶
type Bpf struct { TargetName string // contains filtered or unexported fields }
func (*Bpf) InjectPcapFilter ¶
type BpfContent ¶
type BpfMapSpecs ¶
type BpfMapSpecs struct { Argsbuf *ebpf.MapSpec `ebpf:"argsbuf"` Bp2skb *ebpf.MapSpec `ebpf:"bp2skb"` Contentbuf *ebpf.MapSpec `ebpf:"contentbuf"` Data *ebpf.MapSpec `ebpf:"data"` Events *ebpf.MapSpec `ebpf:"events"` Pc2param *ebpf.MapSpec `ebpf:"pc2param"` Skbmatched *ebpf.MapSpec `ebpf:"skbmatched"` }
BpfMapSpecs contains maps before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type BpfMaps ¶
type BpfMaps struct { Argsbuf *ebpf.Map `ebpf:"argsbuf"` Bp2skb *ebpf.Map `ebpf:"bp2skb"` Contentbuf *ebpf.Map `ebpf:"contentbuf"` Data *ebpf.Map `ebpf:"data"` Events *ebpf.Map `ebpf:"events"` Pc2param *ebpf.Map `ebpf:"pc2param"` Skbmatched *ebpf.Map `ebpf:"skbmatched"` }
BpfMaps contains all maps after they have been loaded into the kernel.
It can be passed to LoadBpfObjects or ebpf.CollectionSpec.LoadAndAssign.
type BpfObjects ¶
type BpfObjects struct { BpfPrograms BpfMaps }
BpfObjects contains all objects after they have been loaded into the kernel.
It can be passed to LoadBpfObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*BpfObjects) Close ¶
func (o *BpfObjects) Close() error
type BpfProgramSpecs ¶
type BpfProgramSpecs struct { OffBpfHelper *ebpf.ProgramSpec `ebpf:"off_bpf_helper"` OffTcfClassify *ebpf.ProgramSpec `ebpf:"off_tcf_classify"` OnBpfHelper *ebpf.ProgramSpec `ebpf:"on_bpf_helper"` OnEntry *ebpf.ProgramSpec `ebpf:"on_entry"` OnExit *ebpf.ProgramSpec `ebpf:"on_exit"` OnTcfClassify *ebpf.ProgramSpec `ebpf:"on_tcf_classify"` }
BpfSpecs contains programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type BpfPrograms ¶
type BpfPrograms struct { OffBpfHelper *ebpf.Program `ebpf:"off_bpf_helper"` OffTcfClassify *ebpf.Program `ebpf:"off_tcf_classify"` OnBpfHelper *ebpf.Program `ebpf:"on_bpf_helper"` OnEntry *ebpf.Program `ebpf:"on_entry"` OnExit *ebpf.Program `ebpf:"on_exit"` OnTcfClassify *ebpf.Program `ebpf:"on_tcf_classify"` }
BpfPrograms contains all programs after they have been loaded into the kernel.
It can be passed to LoadBpfObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*BpfPrograms) Close ¶
func (p *BpfPrograms) Close() error
type BpfSpecs ¶
type BpfSpecs struct { BpfProgramSpecs BpfMapSpecs }
BpfSpecs contains maps and programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.