MCPcopy Create free account

hub / github.com/cloudflare/xdpcap / functions

Functions93 in github.com/cloudflare/xdpcap

↓ 19 callersFunctioncheckOffsets
(tb testing.TB, filter []bpf.Instruction, offsets []uint32, expected bool, packet ...gopacket.SerializableLaye
cmd/bpfoff/main_test.go:213
↓ 17 callersFunctionparseFlags
parseFlags creates the flags, and attempts to parse args. On error, the returned flags is fully setup, but will not hold values for all the arguments.
cmd/xdpcap/flags.go:188
↓ 16 callersMethodClose
Close releases any resources held It does not Rm()
hook.go:39
↓ 10 callersFunctiondefaultFlags
(mapPath string)
cmd/xdpcap/flags_test.go:254
↓ 10 callersFunctionrequireFlags
(tb testing.TB, output string, expected, actual flags)
cmd/xdpcap/flags_test.go:270
↓ 9 callersMethodclose
()
cmd/xdpcap/filter.go:152
↓ 8 callersFunctiontempOutput
(t *testing.T)
cmd/xdpcap/flags_test.go:240
↓ 8 callersFunctionwithOffsets
withOffsets generates a new filter from filter, using a fixed set of offsets into the packet
cmd/bpfoff/main.go:107
↓ 7 callersFunctiontestOpts
(filter ...bpf.Instruction)
cmd/xdpcap/filter_test.go:16
↓ 6 callersMethodString
()
cmd/xdpcap/flags.go:37
↓ 5 callersFunctionaddOffsets
(offsets []uint32, expr string)
cmd/bpfoff/main.go:92
↓ 5 callersFunctionnewFilterWithMap
newFilterWithMap creates a filter from a tcpdump / libpcap filter expression
cmd/xdpcap/filter.go:57
↓ 5 callersFunctionparseAction
(action string)
cmd/xdpcap/xdpaction.go:47
↓ 4 callersMethodUsage
()
cmd/xdpcap/flags.go:241
↓ 4 callersFunctioncheckActions
checkActions checks that all programs return their expected action, and the packet isn't modified Packet is 0 padded to min ethernet length actions sh
cmd/xdpcap/filter_test.go:233
↓ 4 callersMethodmetrics
()
cmd/xdpcap/filter.go:205
↓ 4 callersFunctionmustNew
(t *testing.T, opts filterOpts)
cmd/xdpcap/filter_test.go:298
↓ 3 callersFunctionCheckHookMap
CheckHookMap checks the given map against HookMapABI to have appropriate values Only checks Type, KeySize, ValueSize
internal/abi.go:18
↓ 3 callersFunctionTcpdumpExprToBPF
tcpdumpExprToBPF converts a tcpdump / libpcap filter expression to cBPF using libpcap
internal/tcpdump.go:12
↓ 3 callersFunctionaddOffset
addOffset adds an offset, checking for overflow
cmd/bpfoff/main.go:191
↓ 3 callersFunctionhookMap
(t *testing.T, entries int)
cmd/xdpcap/filter_test.go:284
↓ 3 callersFunctionmatchByte
(offset, val uint32)
cmd/xdpcap/filter_test.go:24
↓ 3 callersFunctionparsecBPF
parsecBPF parses a string of cBPF 4 tuple instructions, formatted as: <length>,<opcode> <jt> <jf> <k>,...
cmd/xdpcap/flags.go:103
↓ 3 callersMethodread
Returns errFilterClosed if the filter has been closed
cmd/xdpcap/filter.go:170
↓ 2 callersFunctionNewHook
NewHook creates a new Hook, that can be Pin()'d to fileName. fileName must be inside a bpffs
hook.go:22
↓ 2 callersFunctionattachProg
no good way to check if a program is already attached, as Create() doesn't work on prog array maps We could check if values are present for keys, but
cmd/xdpcap/filter.go:143
↓ 2 callersFunctioncheckAction
(t *testing.T, action xdpAction, filter *filter, in []byte)
cmd/xdpcap/filter_test.go:246
↓ 2 callersFunctionlinkTypes
All valid LinkTypes
cmd/xdpcap/flags.go:74
↓ 2 callersFunctionmustPatchSpec
(tb testing.TB, hook *Hook)
hook_test.go:78
↓ 2 callersFunctionnewProgram
newProgram builds an eBPF program that copies packets matching a cBPF program to userspace via perf
cmd/xdpcap/program.go:46
↓ 2 callersFunctionunlimitLockedMemory
unlimitLockedMemory removes any locked memory limits
cmd/xdpcap/memory.go:9
↓ 1 callersMethodPatch
Patch edits all programs in the spec that refer to hookMapSymbol to use this hook. This function is a no-op if called on a nil Hook.
hook.go:58
↓ 1 callersMethodRm
Rm deletes files created by Pin()
hook.go:51
↓ 1 callersMethodString
()
cmd/xdpcap/xdpaction.go:30
↓ 1 callersFunctionallActions
allActions returns every action exposed by the map
cmd/xdpcap/filter.go:131
↓ 1 callersFunctioncapture
(flags flags)
cmd/xdpcap/main.go:56
↓ 1 callersFunctionisBigEndian
()
cmd/xdpcap/endian.go:18
↓ 1 callersFunctionnewFilter
newFilter creates a filter from a tcpdump / libpcap filter expression
cmd/xdpcap/filter.go:47
↓ 1 callersFunctionnewPcapWriter
newPcapWriter creates a pcapWriter with an pcap interface (metadata) per xdp action
cmd/xdpcap/main.go:145
↓ 1 callersFunctionparseFilter
(expr string, linkType layers.LinkType)
cmd/xdpcap/flags.go:90
↓ 1 callersFunctionparseInstruction
parseInstruction parses a cBPF instruction, formatted as: <opcode> <jt> <jf> <k>
cmd/xdpcap/flags.go:134
↓ 1 callersFunctionparseOffsets
(offsets string)
cmd/bpfoff/main.go:60
↓ 1 callersFunctionpcapInsnToX
(insns []pcap.BPFInstruction)
internal/tcpdump.go:22
↓ 1 callersFunctionprintFilter
printFilter prints a filter in the standard / linux form to stdout
cmd/bpfoff/main.go:76
↓ 1 callersFunctionwithOffset
withOffset rewrites filter to use a fixed offset into the packet new filter will return on match, fall through on no match
cmd/bpfoff/main.go:132
↓ 1 callersFunctionxdpcap_exit
* Return action, exposing the action and input packet to xdpcap hook. * * return xdpcap_exit(ctx, &hook, XDP_PASS) * * is equivalent to: * *
hook.h:28
MethodPin
Pin persists the underlying map to a file, overwriting it if it already exists
hook.go:44
MethodSet
(val string)
cmd/xdpcap/flags.go:21
MethodSet
(val string)
cmd/xdpcap/flags.go:48
MethodString
()
cmd/xdpcap/flags.go:69
FunctionTestActionParsing
(t *testing.T)
cmd/xdpcap/xdpaction_test.go:7
FunctionTestActionsFlagBad
(t *testing.T)
cmd/xdpcap/flags_test.go:194
FunctionTestActionsFlagUnknown
(t *testing.T)
cmd/xdpcap/flags_test.go:155
FunctionTestActionsFlagWhitespace
(t *testing.T)
cmd/xdpcap/flags_test.go:180
FunctionTestAllActions
(t *testing.T)
cmd/xdpcap/filter_test.go:114
FunctionTestCheckHookMap
Test CheckHookMap with valid and invalid HookMap ABI
internal/abi_test.go:10
FunctionTestClose
(t *testing.T)
cmd/xdpcap/filter_test.go:216
FunctionTestFilterLibpcap
(t *testing.T)
cmd/xdpcap/flags_test.go:64
FunctionTestFilterProgramForAllModes
(t *testing.T)
cmd/xdpcap/filter_test.go:49
FunctionTestFilterRaw
(t *testing.T)
cmd/xdpcap/flags_test.go:86
FunctionTestFilterRawInvalid
(t *testing.T)
cmd/xdpcap/flags_test.go:124
FunctionTestHookLoadAndReplace
Test loading an elf with a hook map using ebpf.CollectionSpec.LoadAndReplace(), which didn't always work: https://github.com/cilium/ebpf/commit/04b5c2
hook_test.go:33
FunctionTestHookNewCollection
Test loading an elf with a hook map using ebpf.NewCollection().
hook_test.go:15
FunctionTestLinkTypeUnknown
(t *testing.T)
cmd/xdpcap/flags_test.go:203
FunctionTestLoadAbsolute
(t *testing.T)
cmd/bpfoff/main_test.go:148
FunctionTestLoadIndirect
(t *testing.T)
cmd/bpfoff/main_test.go:168
FunctionTestLoadMemShift
(t *testing.T)
cmd/bpfoff/main_test.go:191
FunctionTestMain
(m *testing.M)
cmd/xdpcap/filter_test.go:33
FunctionTestMetrics
(t *testing.T)
cmd/xdpcap/filter_test.go:139
FunctionTestMissingFilter
(t *testing.T)
cmd/xdpcap/filter_test.go:42
FunctionTestNegativeAction
(t *testing.T)
cmd/xdpcap/xdpaction_test.go:21
FunctionTestNoHook
Test loading an elf that uses a hook without an explicit hook map
hook_test.go:65
FunctionTestOffsetOrder
(t *testing.T)
cmd/bpfoff/main_test.go:51
FunctionTestOffsetOverflow
(t *testing.T)
cmd/bpfoff/main_test.go:79
FunctionTestOffsets
(t *testing.T)
cmd/bpfoff/main_test.go:13
FunctionTestOptions
(t *testing.T)
cmd/xdpcap/flags_test.go:136
FunctionTestOutputInvalid
(t *testing.T)
cmd/xdpcap/flags_test.go:38
FunctionTestOutputStdout
(t *testing.T)
cmd/xdpcap/flags_test.go:45
FunctionTestPerf
(t *testing.T)
cmd/xdpcap/filter_test.go:187
FunctionTestRequiredArgs
(t *testing.T)
cmd/xdpcap/flags_test.go:17
FunctionTestRetA
(t *testing.T)
cmd/bpfoff/main_test.go:132
FunctionTestRetConstant
(t *testing.T)
cmd/bpfoff/main_test.go:114
FunctionTestUnknownAction
(t *testing.T)
cmd/xdpcap/filter_test.go:100
FunctionTestUnknownActionParsing
(t *testing.T)
cmd/xdpcap/xdpaction_test.go:28
FunctionTestUnsupportedInsn
(t *testing.T)
cmd/bpfoff/main_test.go:95
FunctionTestUsage
(t *testing.T)
cmd/xdpcap/flags_test.go:228
Methodclose
()
cmd/xdpcap/program.go:186
Functioninit
()
cmd/xdpcap/endian.go:10
Functionmain
()
cmd/bpfoff/main.go:21
Functionmain
()
cmd/xdpcap/main.go:36
Methodmetrics
()
cmd/xdpcap/program.go:191
Functionxdp_hook
testdata/xdp_hook.c:28
Functionxdp_nohook
testdata/xdp_hook.c:35