Documentation
¶
Index ¶
- Constants
- Variables
- func AttachKprobeMulti(ctx context.Context, bar *pb.ProgressBar, kprobes []Kprobe, a2n Addr2Name) (links []link.Link, ignored int)
- func AttachKprobes(ctx context.Context, bar *pb.ProgressBar, kps []Kprobe, batch uint) (links []link.Link, ignored int)
- func DetectKfreeSkbReason(spec *btf.Spec) bool
- func GetFuncsByPos(funcs Funcs) map[int][]string
- func HaveAvailableFilterFunctions() bool
- func HaveBPFLinkKprobeMulti() bool
- func HaveBPFLinkTracing() bool
- func HaveBpfSkbOutput() bool
- func HaveBpfXdpOutput() bool
- func InjectPcapFilter(spec *ebpf.CollectionSpec, f *Flags)
- func KprobeIptables(coll *ebpf.Collection) *iptablesKprober
- func KprobeSkb(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n Addr2Name, ...) *skbKprober
- func KprobeSock(ctx context.Context, funcs Funcs, coll *ebpf.Collection, a2n Addr2Name, ...) *sockKprober
- func KprobeTCP(coll *ebpf.Collection) *tcpKprober
- func ParseKallsyms(funcsSkb, funcsSk Funcs, all bool) (Addr2Name, BpfProgName2Addr, error)
- func TraceTC(options TracingOptions) *tracing
- func TraceXDP(options TracingOptions) *tracing
- func TrackSkb(coll *ebpf.Collection, haveFexit bool) *skbTracker
- func TrimBpfSpec(spec *ebpf.CollectionSpec, f *Flags, haveFexit bool)
- type Addr2Name
- type BpfProgName2Addr
- type Bytes
- type Event
- type FilterCfg
- type Flags
- type Funcs
- type ICMPInfo
- type IptablesMeta
- type Kprobe
- type Meta
- type Output
- type OutputCounter
- type OutputEvent
- type PcapMeta
- type PortInfo
- type Reset
- type SockMeta
- type StackData
- type TCPMeta
- type TracingOptions
- type Tuple
Constants ¶
View Source
const ( SOCK_STREAM sockType = 1 SOCK_DGRAM sockType = 2 SOCK_RAW sockType = 3 SOCK_RDM sockType = 4 SOCK_SEQPACKET sockType = 5 SOCK_DCCP sockType = 6 SOCK_PACKET sockType = 10 )
View Source
const ( TCP_ESTABLISHED sockState = 1 + iota TCP_SYN_SENT TCP_SYN_RECV TCP_FIN_WAIT1 TCP_FIN_WAIT2 TCP_TIME_WAIT TCP_CLOSE TCP_CLOSE_WAIT TCP_LAST_ACK TCP_LISTEN TCP_CLOSING /* Now a valid state */ TCP_NEW_SYN_RECV TCP_BOUND_INACTIVE /* Pseudo-state for inet_diag */ )
View Source
const ( ProgNameFentryTC = "fentry_tc" ProgNameFexitTC = "fexit_tc" ProgNameFentryTCPcap = "fentry_tc_pcap" ProgNameFexitTCPcap = "fexit_tc_pcap" ProgNameFentryXDP = "fentry_xdp" ProgNameFexitXDP = "fexit_xdp" ProgNameFentryXDPPcap = "fentry_xdp_pcap" ProgNameFexitXDPPcap = "fexit_xdp_pcap" )
View Source
const ( MaxStackDepth = 50 BackendKprobe = "kprobe" BackendKprobeMulti = "kprobe-multi" )
Variables ¶
View Source
var Version string = "version unknown"
Version is the vista version and is set at compile time via LDFLAGS-
Functions ¶
func AttachKprobeMulti ¶
func AttachKprobeMulti(ctx context.Context, bar *pb.ProgressBar, kprobes []Kprobe, a2n Addr2Name) (links []link.Link, ignored int)
AttachKprobeMulti attaches kprobe-multi serially.
func AttachKprobes ¶
func AttachKprobes(ctx context.Context, bar *pb.ProgressBar, kps []Kprobe, batch uint) (links []link.Link, ignored int)
AttachKprobes attaches kprobes concurrently.
func DetectKfreeSkbReason ¶
func GetFuncsByPos ¶
func HaveAvailableFilterFunctions ¶
func HaveAvailableFilterFunctions() bool
func HaveBPFLinkKprobeMulti ¶
func HaveBPFLinkKprobeMulti() bool
Very hacky way to check whether multi-link kprobe is supported.
func HaveBPFLinkTracing ¶
func HaveBPFLinkTracing() bool
Very hacky way to check whether tracing link is supported.
func HaveBpfSkbOutput ¶
func HaveBpfSkbOutput() bool
func HaveBpfXdpOutput ¶
func HaveBpfXdpOutput() bool
func InjectPcapFilter ¶
func InjectPcapFilter(spec *ebpf.CollectionSpec, f *Flags)
func KprobeIptables ¶
func KprobeIptables(coll *ebpf.Collection) *iptablesKprober
func KprobeSock ¶
func KprobeTCP ¶
func KprobeTCP(coll *ebpf.Collection) *tcpKprober
func ParseKallsyms ¶
func ParseKallsyms(funcsSkb, funcsSk Funcs, all bool) (Addr2Name, BpfProgName2Addr, error)
func TraceTC ¶
func TraceTC(options TracingOptions) *tracing
func TraceXDP ¶
func TraceXDP(options TracingOptions) *tracing
func TrackSkb ¶
func TrackSkb(coll *ebpf.Collection, haveFexit bool) *skbTracker
func TrimBpfSpec ¶
func TrimBpfSpec(spec *ebpf.CollectionSpec, f *Flags, haveFexit bool)
Types ¶
type BpfProgName2Addr ¶
type Event ¶
type Event struct {
PID uint32
Type uint8
Source uint8
Pad uint16
Addr uint64
SAddr uint64
Timestamp uint64
PrintSkbId uint64
PrintStackId int64
Tuple Tuple
Meta Meta
CPU uint32
Data [72]byte
}
func (*Event) Iptables ¶
func (e *Event) Iptables() *IptablesMeta
type FilterCfg ¶
type Flags ¶
type Flags struct {
ShowVersion bool
ShowHelp bool
KernelBTF string
FilterTraceSkb bool
FilterTraceSk bool
FilterTraceIptables bool
FilterTraceTCP bool
FilterTrackSkb bool
FilterTraceTc bool
FilterTraceXdp bool
FilterNetns string
FilterSkbMark uint32
FilterSkMark uint32
FilterSkbFunc string
FilterSkFunc string
FilterIfname string
FilterPcap string
FilterKprobeBatch uint
FilterProto string
FilterAddr string
FilterPort uint16
FilterTCPLifetime time.Duration
OutputTS string
OutputMeta bool
OutputTuple bool
OutputSkb bool
OutputStack bool
OutputIptables bool
OutputTCP bool
OutputSk bool
OutputLimitLines int64
OutputFile string
PcapFile string
PcapSnaplen uint16
PcapMode []string
FilterSkbDropStack bool
KMods []string
AllKMods bool
ReadyFile string
KprobeBackend string
PerCPUBuffer uint
// contains filtered or unexported fields
}
type Funcs ¶
func GetSkFuncs ¶
type IptablesMeta ¶
type Output ¶ added in v0.1.1
type Output struct {
// contains filtered or unexported fields
}
func (*Output) Pcap ¶ added in v0.1.1
func (o *Output) Pcap(ev OutputEvent) error
func (*Output) Print ¶ added in v0.1.1
func (o *Output) Print(ev OutputEvent)
func (*Output) PrintHeader ¶ added in v0.1.1
func (o *Output) PrintHeader()
type OutputCounter ¶
type OutputCounter struct {
// contains filtered or unexported fields
}
func NewOutputCounter ¶
func NewOutputCounter(limit int64) *OutputCounter
func (*OutputCounter) Next ¶
func (c *OutputCounter) Next() bool
type OutputEvent ¶
func NewOutputEvent ¶
func NewOutputEvent(raw []byte) (OutputEvent, error)
type SockMeta ¶
type SockMeta struct {
SkcBoundIfindex uint32
// SkRxDstIfindex uint32
SkBacklog uint32
SkRcvBuff uint32
SkSndBuff uint32
SkPriority uint32
SkMark uint32
SkType sockType
SocketState socketState
SkcState sockState
SkcReusePort uint8
WithSocket uint8
SocketPad uint8
SocketFileInode uint64
SocketFlags uint64
}
type StackData ¶
type StackData struct {
IPs [MaxStackDepth]uint64
}
type TracingOptions ¶
type TracingOptions struct {
Coll *ebpf.Collection
Spec *ebpf.CollectionSpec
Opts *ebpf.CollectionOptions
OutputSkb bool
Pcap bool
PcapModes []string
N2A BpfProgName2Addr
// contains filtered or unexported fields
}
Source Files
¶
- bpf_prog.go
- bpf_spec.go
- config.go
- features.go
- flags.go
- funcs.go
- kprobe.go
- kprobe_iptables.go
- kprobe_skb.go
- kprobe_sock.go
- kprobe_tcp.go
- ksym.go
- output.go
- output_counter.go
- output_event.go
- output_func.go
- output_iface.go
- output_iptables.go
- output_pcap.go
- output_pkttype.go
- output_process.go
- output_sock.go
- output_tcp.go
- output_tuple.go
- pcap_action.go
- pcap_filter.go
- skb_tracker.go
- tracing.go
- types.go
Click to show internal directories.
Click to hide internal directories.