Documentation
¶
Index ¶
- Constants
- func AccumulateBase(p *ebpf.BpfFlowMetrics, other *ebpf.BpfFlowMetrics) *ebpf.BpfFlowMetrics
- func AllZeroIP(ip net.IP) bool
- func AllZerosMac(s [6]uint8) bool
- func AllZerosMetaData(s [NetworkEventsMaxEventsMD]uint8) bool
- func IP(ia IPAddr) net.IP
- func IntEncodeV4(ia [net.IPv6len]uint8) uint32
- func SetGlobalIP(ip net.IP)
- func SetInterfaceNamer(ifaceNamer InterfaceNamer)
- type BpfFlowContent
- type Direction
- type HumanBytes
- type IPAddr
- type InterfaceNamer
- type IntfDirUdn
- type MacAddr
- type PacketRecord
- type RawByte
- type RawRecord
- type Record
Constants ¶
const ( DirectionIngress = 0 DirectionEgress = 1 MacLen = 6 // IPv4Type / IPv6Type value as defined in IEEE 802: https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml IPv6Type = 0x86DD NetworkEventsMaxEventsMD = 8 MaxNetworkEvents = 4 MaxObservedInterfaces = 6 )
Values according to field 61 in https://www.iana.org/assignments/ipfix/ipfix.xhtml
Variables ¶
This section is empty.
Functions ¶
func AccumulateBase ¶
func AccumulateBase(p *ebpf.BpfFlowMetrics, other *ebpf.BpfFlowMetrics) *ebpf.BpfFlowMetrics
func AllZerosMac ¶
func AllZerosMetaData ¶
func AllZerosMetaData(s [NetworkEventsMaxEventsMD]uint8) bool
func IntEncodeV4 ¶
IntEncodeV4 encodes an IPv4 address as an integer (in network encoding, big endian). It assumes that the passed IP is already IPv4. Otherwise, it would just encode the last 4 bytes of an IPv6 address
func SetGlobalIP ¶
func SetInterfaceNamer ¶
func SetInterfaceNamer(ifaceNamer InterfaceNamer)
Types ¶
type BpfFlowContent ¶
type BpfFlowContent struct {
*ebpf.BpfFlowMetrics
AdditionalMetrics *ebpf.BpfAdditionalMetrics
}
func NewBpfFlowContent ¶
func NewBpfFlowContent(metrics ebpf.BpfFlowMetrics) BpfFlowContent
nolint:gocritic // hugeParam: metric is reported as heavy; but it needs to be copied anyway, we don't want a pointer here
func (*BpfFlowContent) AccumulateAdditional ¶
func (p *BpfFlowContent) AccumulateAdditional(other *ebpf.BpfAdditionalMetrics)
func (*BpfFlowContent) AccumulateBase ¶
func (p *BpfFlowContent) AccumulateBase(other *ebpf.BpfFlowMetrics)
type HumanBytes ¶
type HumanBytes uint64
type IPAddr ¶
IPAddr encodes v4 and v6 IPs with a fixed length. IPv4 addresses are encoded as IPv6 addresses with prefix ::ffff/96 as described in https://datatracker.ietf.org/doc/html/rfc4038#section-4.2 (same behavior as Go's net.IP type)
func IPAddrFromNetIP ¶
IPAddrFromNetIP returns IPAddr from net.IP
func (*IPAddr) MarshalJSON ¶
type InterfaceNamer ¶
type IntfDirUdn ¶
func NewIntfDirUdn ¶
func NewIntfDirUdn(intf string, dir int, cache map[string]string) IntfDirUdn
type MacAddr ¶
func (*MacAddr) MarshalJSON ¶
type PacketRecord ¶
func NewPacketRecord ¶
func NewPacketRecord( stream []byte, length uint32, ts time.Time, ) *PacketRecord
NewPacketRecord contains packet bytes
func ReadRawPacket ¶
func ReadRawPacket(reader io.Reader) (*PacketRecord, error)
ReadRawPacket reads a PacketRecord from a binary source, in NativeEndian order
type Record ¶
type Record struct {
ID ebpf.BpfFlowId
Metrics BpfFlowContent
// TODO: redundant field from RecordMetrics. Reorganize structs
TimeFlowStart time.Time
TimeFlowEnd time.Time
DNSLatency time.Duration
Interfaces []IntfDirUdn
// AgentIP provides information about the source of the flow (the Agent that traced it)
AgentIP net.IP
// Calculated RTT which is set when record is created by calling NewRecord
TimeFlowRtt time.Duration
NetworkMonitorEventsMD []map[string]string
}
Record contains accumulated metrics from a flow