Documentation ¶
Overview ¶
package common contains common functions and types used by all Retina plugins.
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
Constants ¶
const ( // MapPath is the path to pinned BPF maps MapPath = "/sys/fs/bpf" // FilterMapName is the name of the BPF filter map FilterMapName = "retina_filter" // ConntrackMapName is the name of the BPF conntrack map ConntrackMapName = "retina_conntrack" )
Variables ¶
This section is empty.
Functions ¶
func NewPerfReader ¶
NewPerfReader creates a new perf reader with a buffer size that is a power of 2. It starts with the maximum buffer size and tries with smaller buffer sizes if it fails with ENOMEM. Returns an error if it fails to create a perf reader or encounters any other error. Not enforced, but max and min should be a power of 2. The allocated size will be a multiple of pagesize determined at runtime.
func ProtocolToFlow ¶
Interface for IG event handlers. Maps to cilum Flow.
func RCodeToFlow ¶
Refer: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 Inspektor gadget uses Gopacket pkg for DNS response codes. Ref: https://github.com/google/gopacket/blob/32ee38206866f44a74a6033ec26aeeb474506804/layers/dns.go#L129