Documentation
¶
Overview ¶
Package tuple defines keys used for connection tuples in multiple BPF maps. +groupName=maps
Index ¶
- Constants
- type TupleKey
- type TupleKey4
- func (k TupleKey4) Dump(sb *strings.Builder, reverse bool) bool
- func (t *TupleKey4) GetDestAddr() netip.Addr
- func (t *TupleKey4) GetDestPort() uint16
- func (k *TupleKey4) GetFlags() uint8
- func (t *TupleKey4) GetNextHeader() u8proto.U8proto
- func (t *TupleKey4) GetSourceAddr() netip.Addr
- func (t *TupleKey4) GetSourcePort() uint16
- func (k *TupleKey4) New() bpf.MapKey
- func (k *TupleKey4) String() string
- func (t *TupleKey4) SwapAddresses()
- func (k *TupleKey4) ToHost() TupleKey
- func (k *TupleKey4) ToNetwork() TupleKey
- type TupleKey4Global
- type TupleKey6
- func (k TupleKey6) Dump(sb *strings.Builder, reverse bool) bool
- func (t *TupleKey6) GetDestAddr() netip.Addr
- func (t *TupleKey6) GetDestPort() uint16
- func (k *TupleKey6) GetFlags() uint8
- func (t *TupleKey6) GetNextHeader() u8proto.U8proto
- func (t *TupleKey6) GetSourceAddr() netip.Addr
- func (t *TupleKey6) GetSourcePort() uint16
- func (k *TupleKey6) New() bpf.MapKey
- func (k *TupleKey6) String() string
- func (t *TupleKey6) SwapAddresses()
- func (k *TupleKey6) ToHost() TupleKey
- func (k *TupleKey6) ToNetwork() TupleKey
- type TupleKey6Global
Constants ¶
const ( TUPLE_F_OUT = 0 TUPLE_F_IN = 1 TUPLE_F_RELATED = 2 TUPLE_F_SERVICE = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TupleKey ¶
type TupleKey interface { bpf.MapKey // ToNetwork converts fields to network byte order. ToNetwork() TupleKey // ToHost converts fields to host byte order. ToHost() TupleKey // Dumps contents of key to sb. Returns true if successful. Dump(sb *strings.Builder, reverse bool) bool // Returns flags containing the direction of the tuple key. GetFlags() uint8 }
TupleKey is the interface describing keys to the conntrack and NAT maps.
type TupleKey4 ¶
TupleKey4 represents the key for {IPv4,IPv6} entries in the local BPF conntrack map. Address field names are correct for return traffic, i.e., they are reversed compared to the original direction traffic.
func (TupleKey4) Dump ¶
Dump writes the contents of key to sb and returns true if the value for next header in the key is nonzero.
func (*TupleKey4) GetDestAddr ¶
func (*TupleKey4) GetDestPort ¶
func (*TupleKey4) GetNextHeader ¶
func (*TupleKey4) GetSourceAddr ¶
func (*TupleKey4) GetSourcePort ¶
func (*TupleKey4) SwapAddresses ¶
func (t *TupleKey4) SwapAddresses()
SwapAddresses swaps the tuple source and destination addresses.
type TupleKey4Global ¶
type TupleKey4Global struct {
TupleKey4
}
TupleKey4Global represents the key for IPv4 entries in the global BPF conntrack map.
func (TupleKey4Global) Dump ¶
func (k TupleKey4Global) Dump(sb *strings.Builder, reverse bool) bool
Dump writes the contents of key to sb and returns true if the value for next header in the key is nonzero.
func (*TupleKey4Global) GetFlags ¶
func (k *TupleKey4Global) GetFlags() uint8
GetFlags returns the tuple's flags.
func (*TupleKey4Global) String ¶
func (k *TupleKey4Global) String() string
String returns the tuple's string representation, doh.
func (*TupleKey4Global) ToHost ¶
func (k *TupleKey4Global) ToHost() TupleKey
ToHost converts ports to host byte order.
This is necessary to prevent callers from implicitly converting the TupleKey4Global type here into a local key type in the nested TupleKey4 field.
func (*TupleKey4Global) ToNetwork ¶
func (k *TupleKey4Global) ToNetwork() TupleKey
ToNetwork converts ports to network byte order.
This is necessary to prevent callers from implicitly converting the TupleKey4Global type here into a local key type in the nested TupleKey4 field.
type TupleKey6 ¶
TupleKey6 represents the key for IPv6 entries in the local BPF conntrack map. Address field names are correct for return traffic, i.e., they are reversed compared to the original direction traffic.
func (TupleKey6) Dump ¶
Dump writes the contents of key to sb and returns true if the value for next header in the key is nonzero.
func (*TupleKey6) GetDestAddr ¶
func (*TupleKey6) GetDestPort ¶
func (*TupleKey6) GetNextHeader ¶
func (*TupleKey6) GetSourceAddr ¶
func (*TupleKey6) GetSourcePort ¶
func (*TupleKey6) SwapAddresses ¶
func (t *TupleKey6) SwapAddresses()
SwapAddresses swaps the tuple source and destination addresses.
type TupleKey6Global ¶
type TupleKey6Global struct {
TupleKey6
}
TupleKey6Global represents the key for IPv6 entries in the global BPF conntrack map.
func (TupleKey6Global) Dump ¶
func (k TupleKey6Global) Dump(sb *strings.Builder, reverse bool) bool
Dump writes the contents of key to sb and returns true if the value for next header in the key is nonzero.
func (*TupleKey6Global) GetFlags ¶
func (k *TupleKey6Global) GetFlags() uint8
GetFlags returns the tuple's flags.
func (*TupleKey6Global) String ¶
func (k *TupleKey6Global) String() string
String returns the tuple's string representation, doh.
func (*TupleKey6Global) ToHost ¶
func (k *TupleKey6Global) ToHost() TupleKey
ToHost converts ports to host byte order.
This is necessary to prevent callers from implicitly converting the TupleKey6Global type here into a local key type in the nested TupleKey6 field.
func (*TupleKey6Global) ToNetwork ¶
func (k *TupleKey6Global) ToNetwork() TupleKey
ToNetwork converts ports to network byte order.
This is necessary to prevent callers from implicitly converting the TupleKey6Global type here into a local key type in the nested TupleKey6 field.