Documentation ¶
Index ¶
Constants ¶
const ( MessageTypeUnspec = iota MessageTypeDrop MessageTypeDebug MessageTypeCapture )
Must be synchronized with <bpf/lib/common.h>
const ( DbgCaptureUnspec = iota DbgCaptureFromLxc DbgCaptureFromNetdev DbgCaptureFromOverlay DbgCaptureDelivery DbgCaptureFromLb DbgCaptureAfterV46 DbgCaptureAfterV64 DbgCaptureProxyPre DbgCaptureProxyPost )
must be in sync with <bpf/lib/dbg.h>
const ( DbgUnspec = iota DbgGeneric DbgLocalDelivery DbgEncap DbgLxcFound DbgPolicyDenied DbgCtLookup DbgCtLookupRev DbgCtMatch DbgCtCreated DbgCtCreated2 DbgIcmp6Handle DbgIcmp6Request DbgIcmp6Ns DbgIcmp6TimeExceeded DbgCtVerdict DbgDecap DbgPortMap DbgErrorRet DbgToHost DbgToStack DbgPktHash DbgLb6LookupMaster DbgLb6LookupMasterFail DbgLb6LookupSlave DbgLb6LookupSlaveSuccess DbgLb6ReverseNatLookup DbgLb6ReverseNat DbgLb4LookupMaster DbgLb4LookupMasterFail DbgLb4LookupSlave DbgLb4LookupSlaveSuccess DbgLb4ReverseNatLookup DbgLb4ReverseNat DbgLb4LoopbackSnat DbgLb4LoopbackSnatRev DbgCtLookup4 DbgRRSlaveSel DbgRevProxyLookup DbgRevProxyFound DbgRevProxyUpdate DbgL4Policy DbgNetdevInCluster DbgNetdevEncap4 )
must be in sync with <bpf/lib/dbg.h>
const ( CtNew uint32 = iota CtEstablished CtReply CtRelated )
must be in sync with <bpf/lib/conntrack.h>
const (
// DebugCaptureLen is the amount of packet data in a packet capture message
DebugCaptureLen = 24
)
const (
// DropNotifyLen is the amount of packet data provided in a drop notification
DropNotifyLen = 32
)
Variables ¶
This section is empty.
Functions ¶
func Dissect ¶
Dissect parses and prints the provided data if dissect is set to true, otherwise the data is printed as HEX output
func GetConnectionSummary ¶ added in v0.10.0
GetConnectionSummary decodes the data into layers and returns a connection summary in the format:
- sIP:sPort -> dIP:dPort, e.g. 1.1.1.1:2000 -> 2.2.2.2:80 - sIP -> dIP icmpCode, 1.1.1.1 -> 2.2.2.2 echo-request
Types ¶
type DebugCapture ¶
type DebugCapture struct { Type uint8 SubType uint8 // Source, if populated, is the ID of the source endpoint. Source uint16 Hash uint32 Len uint32 OrigLen uint32 Arg1 uint32 Arg2 uint32 }
DebugCapture is the metadata sent along with a captured packet frame
func (*DebugCapture) DumpInfo ¶ added in v0.10.0
func (n *DebugCapture) DumpInfo(data []byte)
DumpInfo prints a summary of the capture messages.
func (*DebugCapture) DumpVerbose ¶ added in v0.10.0
func (n *DebugCapture) DumpVerbose(dissect bool, data []byte, prefix string)
Dump prints the captured packet in human readable format
type DebugMsg ¶
type DebugMsg struct { Type uint8 SubType uint8 Source uint16 Hash uint32 Arg1 uint32 Arg2 uint32 Arg3 uint32 }
DebugMsg is the message format of the debug message found in the BPF ring buffer
type DropNotify ¶
type DropNotify struct { Type uint8 SubType uint8 Source uint16 Hash uint32 OrigLen uint32 CapLen uint32 SrcLabel uint32 DstLabel uint32 DstID uint32 Ifindex uint32 }
DropNotify is the message format of a drop notification in the BPF ring buffer
func (*DropNotify) DumpInfo ¶ added in v0.10.0
func (n *DropNotify) DumpInfo(data []byte)
DumpInfo prints a summary of the drop messages.
func (*DropNotify) DumpVerbose ¶ added in v0.10.0
func (n *DropNotify) DumpVerbose(dissect bool, data []byte, prefix string)
Dump prints the drop notification in human readable form