Documentation ¶
Overview ¶
+groupName=maps
Index ¶
- Constants
- Variables
- func CreateSockRevNat4Map() error
- func CreateSockRevNat6Map() error
- func Init(params InitParams)
- func InitMaglevMaps(ipv4, ipv6 bool, tableSize uint32) error
- type Affinity4Key
- type Affinity6Key
- type AffinityMatchKey
- type AffinityMatchValue
- type AffinityValue
- type Backend
- type Backend4
- type Backend4Key
- type Backend4KeyV3
- type Backend4V2
- type Backend4V3
- type Backend4Value
- func (b *Backend4Value) GetAddress() net.IP
- func (b *Backend4Value) GetFlags() uint8
- func (b *Backend4Value) GetIPCluster() cmtypes.AddrCluster
- func (b *Backend4Value) GetPort() uint16
- func (b *Backend4Value) New() bpf.MapValue
- func (v *Backend4Value) String() string
- func (v *Backend4Value) ToHost() BackendValue
- func (v *Backend4Value) ToNetwork() BackendValue
- type Backend4ValueV3
- func (b *Backend4ValueV3) GetAddress() net.IP
- func (b *Backend4ValueV3) GetFlags() uint8
- func (b *Backend4ValueV3) GetIPCluster() cmtypes.AddrCluster
- func (b *Backend4ValueV3) GetPort() uint16
- func (b *Backend4ValueV3) New() bpf.MapValue
- func (v *Backend4ValueV3) String() string
- func (v *Backend4ValueV3) ToHost() BackendValue
- func (v *Backend4ValueV3) ToNetwork() BackendValue
- type Backend6
- type Backend6Key
- type Backend6KeyV3
- type Backend6V2
- type Backend6V3
- type Backend6Value
- func (b *Backend6Value) GetAddress() net.IP
- func (b *Backend6Value) GetFlags() uint8
- func (b *Backend6Value) GetIPCluster() cmtypes.AddrCluster
- func (b *Backend6Value) GetPort() uint16
- func (v *Backend6Value) New() bpf.MapValue
- func (v *Backend6Value) String() string
- func (v *Backend6Value) ToHost() BackendValue
- func (v *Backend6Value) ToNetwork() BackendValue
- type Backend6ValueV3
- func (b *Backend6ValueV3) GetAddress() net.IP
- func (b *Backend6ValueV3) GetFlags() uint8
- func (b *Backend6ValueV3) GetIPCluster() cmtypes.AddrCluster
- func (b *Backend6ValueV3) GetPort() uint16
- func (v *Backend6ValueV3) New() bpf.MapValue
- func (v *Backend6ValueV3) String() string
- func (v *Backend6ValueV3) ToHost() BackendValue
- func (v *Backend6ValueV3) ToNetwork() BackendValue
- type BackendKey
- type BackendValue
- type InitParams
- type LBBPFMap
- func (*LBBPFMap) AddAffinityMatch(revNATID uint16, backendID loadbalancer.BackendID) error
- func (*LBBPFMap) AddBackend(b *loadbalancer.Backend, ipv6 bool) error
- func (*LBBPFMap) DeleteAffinityMatch(revNATID uint16, backendID loadbalancer.BackendID) error
- func (*LBBPFMap) DeleteBackendByID(id loadbalancer.BackendID) error
- func (*LBBPFMap) DeleteService(svc loadbalancer.L3n4AddrID, backendCount int, useMaglev bool, ...) error
- func (*LBBPFMap) DumpAffinityMatches() (datapathTypes.BackendIDByServiceIDSet, error)
- func (*LBBPFMap) DumpBackendMaps() ([]*loadbalancer.Backend, error)
- func (*LBBPFMap) DumpServiceMaps() ([]*loadbalancer.SVC, []error)
- func (*LBBPFMap) DumpSourceRanges(ipv6 bool) (datapathTypes.SourceRangeSetByServiceID, error)
- func (*LBBPFMap) ExistsSockRevNat(cookie uint64, addr net.IP, port uint16) bool
- func (*LBBPFMap) IsMaglevLookupTableRecreated(ipv6 bool) bool
- func (*LBBPFMap) UpdateBackendWithState(b *loadbalancer.Backend) error
- func (*LBBPFMap) UpdateSourceRanges(revNATID uint16, prevSourceRanges []*cidr.CIDR, sourceRanges []*cidr.CIDR, ...) error
- func (lbmap *LBBPFMap) UpsertMaglevLookupTable(svcID uint16, backends map[string]*loadbalancer.Backend, ipv6 bool) error
- func (lbmap *LBBPFMap) UpsertService(p *datapathTypes.UpsertServiceParams) error
- type MaglevInnerKey
- type MaglevInnerMap
- type MaglevInnerVal
- type MaglevOuterKey
- type MaglevOuterMap
- type MaglevOuterVal
- type RevNat4Key
- type RevNat4Value
- type RevNat6Key
- type RevNat6Value
- type RevNatKey
- type RevNatValue
- type Service4Key
- func (k *Service4Key) GetAddress() net.IP
- func (k *Service4Key) GetBackendSlot() int
- func (k *Service4Key) GetPort() uint16
- func (k *Service4Key) GetScope() uint8
- func (k *Service4Key) IsIPv6() bool
- func (k *Service4Key) IsSurrogate() bool
- func (k *Service4Key) Map() *bpf.Map
- func (k *Service4Key) MapDelete() error
- func (k *Service4Key) New() bpf.MapKey
- func (k *Service4Key) RevNatValue() RevNatValue
- func (k *Service4Key) SetBackendSlot(slot int)
- func (k *Service4Key) SetScope(scope uint8)
- func (k *Service4Key) String() string
- func (k *Service4Key) ToHost() ServiceKey
- func (k *Service4Key) ToNetwork() ServiceKey
- type Service4Value
- func (s *Service4Value) GetBackendID() loadbalancer.BackendID
- func (s *Service4Value) GetCount() int
- func (s *Service4Value) GetFlags() uint16
- func (s *Service4Value) GetRevNat() int
- func (s *Service4Value) New() bpf.MapValue
- func (s *Service4Value) RevNatKey() RevNatKey
- func (s *Service4Value) SetBackendID(id loadbalancer.BackendID)
- func (s *Service4Value) SetCount(count int)
- func (s *Service4Value) SetFlags(flags uint16)
- func (s *Service4Value) SetL7LBProxyPort(port uint16)
- func (s *Service4Value) SetRevNat(id int)
- func (s *Service4Value) SetSessionAffinityTimeoutSec(t uint32)
- func (s *Service4Value) String() string
- func (s *Service4Value) ToHost() ServiceValue
- func (s *Service4Value) ToNetwork() ServiceValue
- type Service6Key
- func (k *Service6Key) GetAddress() net.IP
- func (k *Service6Key) GetBackendSlot() int
- func (k *Service6Key) GetPort() uint16
- func (k *Service6Key) GetScope() uint8
- func (k *Service6Key) IsIPv6() bool
- func (k *Service6Key) IsSurrogate() bool
- func (k *Service6Key) Map() *bpf.Map
- func (k *Service6Key) MapDelete() error
- func (k *Service6Key) New() bpf.MapKey
- func (k *Service6Key) RevNatValue() RevNatValue
- func (k *Service6Key) SetBackendSlot(slot int)
- func (k *Service6Key) SetScope(scope uint8)
- func (k *Service6Key) String() string
- func (k *Service6Key) ToHost() ServiceKey
- func (k *Service6Key) ToNetwork() ServiceKey
- type Service6Value
- func (s *Service6Value) GetBackendID() loadbalancer.BackendID
- func (s *Service6Value) GetCount() int
- func (s *Service6Value) GetFlags() uint16
- func (s *Service6Value) GetRevNat() int
- func (s *Service6Value) New() bpf.MapValue
- func (s *Service6Value) RevNatKey() RevNatKey
- func (s *Service6Value) SetBackendID(id loadbalancer.BackendID)
- func (s *Service6Value) SetCount(count int)
- func (s *Service6Value) SetFlags(flags uint16)
- func (s *Service6Value) SetL7LBProxyPort(port uint16)
- func (s *Service6Value) SetRevNat(id int)
- func (s *Service6Value) SetSessionAffinityTimeoutSec(t uint32)
- func (s *Service6Value) String() string
- func (s *Service6Value) ToHost() ServiceValue
- func (s *Service6Value) ToNetwork() ServiceValue
- type ServiceKey
- type ServiceValue
- type SockRevNat4Key
- type SockRevNat4Value
- type SockRevNat6Key
- type SockRevNat6Value
- type SourceRangeKey
- type SourceRangeKey4
- type SourceRangeKey6
- type SourceRangeValue
Constants ¶
const ( AffinityMatchMapName = "cilium_lb_affinity_match" Affinity4MapName = "cilium_lb4_affinity" Affinity6MapName = "cilium_lb6_affinity" )
const ( // HealthProbe4MapName is the health datapath map name HealthProbe4MapName = "cilium_lb4_health" // SockRevNat4MapName is the BPF map name. SockRevNat4MapName = "cilium_lb4_reverse_sk" // SockRevNat4MapSize is the maximum number of entries in the BPF map. SockRevNat4MapSize = 256 * 1024 // Service4MapV2Name is the name of the IPv4 LB Services v2 BPF map. Service4MapV2Name = "cilium_lb4_services_v2" // Backend4MapName is the name of the IPv4 LB backends BPF map. Backend4MapName = "cilium_lb4_backends" // Backend4MapV2Name is the name of the IPv4 LB backends v2 BPF map. Backend4MapV2Name = "cilium_lb4_backends_v2" // Backend4MapV3Name is the name of the IPv4 LB backends v3 BPF map. Backend4MapV3Name = "cilium_lb4_backends_v3" // RevNat4MapName is the name of the IPv4 LB reverse NAT BPF map. RevNat4MapName = "cilium_lb4_reverse_nat" )
const ( // HealthProbe6MapName is the health datapath map name HealthProbe6MapName = "cilium_lb6_health" // SockRevNat6MapName is the BPF map name. SockRevNat6MapName = "cilium_lb6_reverse_sk" // SockRevNat6MapSize is the maximum number of entries in the BPF map. SockRevNat6MapSize = 256 * 1024 // Service6MapV2Name is the name of the IPv6 LB Services v2 BPF map. Service6MapV2Name = "cilium_lb6_services_v2" // Backend6MapName is the name of the IPv6 LB backends BPF map. Backend6MapName = "cilium_lb6_backends" // Backend6MapV2Name is the name of the IPv6 LB backends v2 BPF map. Backend6MapV2Name = "cilium_lb6_backends_v2" // Backend6MapV3Name is the name of the IPv6 LB backends v3 BPF map. Backend6MapV3Name = "cilium_lb6_backends_v3" // RevNat6MapName is the name of the IPv6 LB reverse NAT BPF map. RevNat6MapName = "cilium_lb6_reverse_nat" )
const ( // Both outer maps are pinned though given we need to insert // inner maps into them. MaglevOuter4MapName = "cilium_lb4_maglev" MaglevOuter6MapName = "cilium_lb6_maglev" )
const ( SourceRange4MapName = "cilium_lb4_source_range" SourceRange6MapName = "cilium_lb6_source_range" )
const DefaultMaxEntries = 65536
const SizeofSockRevNat6Key = int(unsafe.Sizeof(SockRevNat6Key{}))
SizeofSockRevNat6Key is the size of type SockRevNat6Key.
const SizeofSockRevNat6Value = int(unsafe.Sizeof(SockRevNat6Value{}))
SizeofSockRevNat6Value is the size of type SockRevNat6Value.
Variables ¶
var ( // AffinityMatchMap is the BPF map to implement session affinity. AffinityMatchMap *bpf.Map Affinity4Map *bpf.Map Affinity6Map *bpf.Map )
var ( // MaxSockRevNat4MapEntries is the maximum number of entries in the BPF // map. It is set by Init(), but unit tests use the initial value below. MaxSockRevNat4MapEntries = SockRevNat4MapSize // Service4MapV2 is the IPv4 LB Services v2 BPF map. Service4MapV2 *bpf.Map // Backend4Map is the IPv4 LB backends BPF map. Backend4Map *bpf.Map // Backend4MapV2 is the IPv4 LB backends v2 BPF map. Backend4MapV2 *bpf.Map // Backend4MapV2 is the IPv4 LB backends v2 BPF map. Backend4MapV3 *bpf.Map // RevNat4Map is the IPv4 LB reverse NAT BPF map. RevNat4Map *bpf.Map // SockRevNat4Map is the IPv4 LB sock reverse NAT BPF map. SockRevNat4Map *bpf.Map )
var ( // MaxSockRevNat6MapEntries is the maximum number of entries in the BPF // map. It is set by Init(), but unit tests use the initial value below. MaxSockRevNat6MapEntries = SockRevNat6MapSize // Service6MapV2 is the IPv6 LB Services v2 BPF map. Service6MapV2 *bpf.Map // Backend6Map is the IPv6 LB backends BPF map. Backend6Map *bpf.Map // Backend6MapV2 is the IPv6 LB backends v2 BPF map. Backend6MapV2 *bpf.Map // Backend6MapV3 is the IPv6 LB backends v3 BPF map. Backend6MapV3 *bpf.Map // RevNat6Map is the IPv6 LB reverse NAT BPF map. RevNat6Map *bpf.Map // SockRevNat6Map is the IPv6 LB sock reverse NAT BPF map. SockRevNat6Map *bpf.Map )
var ( // MaxEntries contains the maximum number of entries that are allowed // in Cilium LB service, backend and affinity maps. ServiceMapMaxEntries = DefaultMaxEntries ServiceBackEndMapMaxEntries = DefaultMaxEntries RevNatMapMaxEntries = DefaultMaxEntries AffinityMapMaxEntries = DefaultMaxEntries SourceRangeMapMaxEntries = DefaultMaxEntries MaglevMapMaxEntries = DefaultMaxEntries )
var ( // SourceRange4Map is the BPF map for storing IPv4 service source ranges to // check if option.Config.EnableSVCSourceRangeCheck is enabled. SourceRange4Map *bpf.Map // SourceRange6Map is the BPF map for storing IPv6 service source ranges to // check if option.Config.EnableSVCSourceRangeCheck is enabled. SourceRange6Map *bpf.Map )
Functions ¶
func CreateSockRevNat4Map ¶ added in v0.15.7
func CreateSockRevNat4Map() error
CreateSockRevNat4Map creates the reverse NAT sock map.
func CreateSockRevNat6Map ¶ added in v0.15.7
func CreateSockRevNat6Map() error
CreateSockRevNat6Map creates the reverse NAT sock map.
func Init ¶ added in v0.15.7
func Init(params InitParams)
Init updates the map info defaults for sock rev nat {4,6} and LB maps and then initializes all LB-related maps.
func InitMaglevMaps ¶ added in v0.15.7
InitMaglevMaps inits the ipv4 and/or ipv6 maglev outer and inner maps.
Types ¶
type Affinity4Key ¶ added in v0.15.7
type Affinity4Key struct { ClientID uint64 `align:"client_id"` RevNATID uint16 `align:"rev_nat_id"` NetNSCookie uint8 `align:"netns_cookie"` Pad1 uint8 `align:"pad1"` Pad2 uint32 `align:"pad2"` }
Affinity4Key is the Go representation of lb4_affinity_key
func (*Affinity4Key) New ¶ added in v0.15.7
func (k *Affinity4Key) New() bpf.MapKey
func (*Affinity4Key) String ¶ added in v0.15.7
func (k *Affinity4Key) String() string
String converts the key into a human readable string format.
type Affinity6Key ¶ added in v0.15.7
type Affinity6Key struct { ClientID types.IPv6 `align:"client_id"` RevNATID uint16 `align:"rev_nat_id"` NetNSCookie uint8 `align:"netns_cookie"` Pad1 uint8 `align:"pad1"` Pad2 uint32 `align:"pad2"` }
Affinity6Key is the Go representation of lb6_affinity_key
func (*Affinity6Key) New ¶ added in v0.15.7
func (k *Affinity6Key) New() bpf.MapKey
func (*Affinity6Key) String ¶ added in v0.15.7
func (k *Affinity6Key) String() string
String converts the key into a human readable string format.
type AffinityMatchKey ¶ added in v0.15.7
type AffinityMatchKey struct { BackendID loadbalancer.BackendID `align:"backend_id"` RevNATID uint16 `align:"rev_nat_id"` Pad uint16 `align:"pad"` }
func NewAffinityMatchKey ¶ added in v0.15.7
func NewAffinityMatchKey(revNATID uint16, backendID loadbalancer.BackendID) *AffinityMatchKey
NewAffinityMatchKey creates the AffinityMatch key
func (*AffinityMatchKey) New ¶ added in v0.15.7
func (k *AffinityMatchKey) New() bpf.MapKey
func (*AffinityMatchKey) String ¶ added in v0.15.7
func (k *AffinityMatchKey) String() string
String converts the key into a human readable string format
func (*AffinityMatchKey) ToHost ¶ added in v0.15.7
func (k *AffinityMatchKey) ToHost() *AffinityMatchKey
ToHost returns the key in the host byte order
func (*AffinityMatchKey) ToNetwork ¶ added in v0.15.7
func (k *AffinityMatchKey) ToNetwork() *AffinityMatchKey
ToNetwork returns the key in the network byte order
type AffinityMatchValue ¶ added in v0.15.7
type AffinityMatchValue struct {
Pad uint8 `align:"pad"`
}
func (*AffinityMatchValue) New ¶ added in v0.15.7
func (v *AffinityMatchValue) New() bpf.MapValue
func (*AffinityMatchValue) String ¶ added in v0.15.7
func (v *AffinityMatchValue) String() string
String converts the value into a human readable string format
type AffinityValue ¶ added in v0.15.7
type AffinityValue struct { LastUsed uint64 `align:"last_used"` BackendID uint32 `align:"backend_id"` Pad uint32 `align:"pad"` }
AffinityValue is the Go representing of lb_affinity_value
func (*AffinityValue) New ¶ added in v0.15.7
func (v *AffinityValue) New() bpf.MapValue
func (*AffinityValue) String ¶ added in v0.15.7
func (v *AffinityValue) String() string
String converts the value into a human readable string format.
type Backend ¶ added in v0.15.7
type Backend interface { // Return the BPF map matching the type Map() *bpf.Map // Get key of the backend entry GetKey() BackendKey // Get value of the backend entry GetValue() BackendValue }
Backend is the interface describing protocol independent backend used by services v2.
type Backend4 ¶ added in v0.15.7
type Backend4 struct { Key *Backend4Key Value *Backend4Value }
func (*Backend4) GetKey ¶ added in v0.15.7
func (b *Backend4) GetKey() BackendKey
func (*Backend4) GetValue ¶ added in v0.15.7
func (b *Backend4) GetValue() BackendValue
type Backend4Key ¶ added in v0.15.7
type Backend4Key struct {
ID uint16
}
func (*Backend4Key) GetID ¶ added in v0.15.7
func (k *Backend4Key) GetID() loadbalancer.BackendID
func (*Backend4Key) Map ¶ added in v0.15.7
func (k *Backend4Key) Map() *bpf.Map
func (*Backend4Key) New ¶ added in v0.15.7
func (k *Backend4Key) New() bpf.MapKey
func (*Backend4Key) SetID ¶ added in v0.15.7
func (k *Backend4Key) SetID(id loadbalancer.BackendID)
func (*Backend4Key) String ¶ added in v0.15.7
func (k *Backend4Key) String() string
type Backend4KeyV3 ¶ added in v0.15.7
type Backend4KeyV3 struct {
ID loadbalancer.BackendID
}
func NewBackend4KeyV3 ¶ added in v0.15.7
func NewBackend4KeyV3(id loadbalancer.BackendID) *Backend4KeyV3
func (*Backend4KeyV3) GetID ¶ added in v0.15.7
func (k *Backend4KeyV3) GetID() loadbalancer.BackendID
func (*Backend4KeyV3) Map ¶ added in v0.15.7
func (k *Backend4KeyV3) Map() *bpf.Map
func (*Backend4KeyV3) New ¶ added in v0.15.7
func (k *Backend4KeyV3) New() bpf.MapKey
func (*Backend4KeyV3) SetID ¶ added in v0.15.7
func (k *Backend4KeyV3) SetID(id loadbalancer.BackendID)
func (*Backend4KeyV3) String ¶ added in v0.15.7
func (k *Backend4KeyV3) String() string
type Backend4V2 ¶ added in v0.15.7
type Backend4V2 struct { Key *Backend4KeyV3 Value *Backend4Value }
func NewBackend4V2 ¶ added in v0.15.7
func NewBackend4V2(id loadbalancer.BackendID, ip net.IP, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend4V2, error)
func (*Backend4V2) GetKey ¶ added in v0.15.7
func (b *Backend4V2) GetKey() BackendKey
func (*Backend4V2) GetValue ¶ added in v0.15.7
func (b *Backend4V2) GetValue() BackendValue
func (*Backend4V2) Map ¶ added in v0.15.7
func (b *Backend4V2) Map() *bpf.Map
type Backend4V3 ¶ added in v0.15.7
type Backend4V3 struct { Key *Backend4KeyV3 Value *Backend4ValueV3 }
func NewBackend4V3 ¶ added in v0.15.7
func NewBackend4V3(id loadbalancer.BackendID, addrCluster cmtypes.AddrCluster, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend4V3, error)
func (*Backend4V3) GetKey ¶ added in v0.15.7
func (b *Backend4V3) GetKey() BackendKey
func (*Backend4V3) GetValue ¶ added in v0.15.7
func (b *Backend4V3) GetValue() BackendValue
func (*Backend4V3) Map ¶ added in v0.15.7
func (b *Backend4V3) Map() *bpf.Map
type Backend4Value ¶ added in v0.15.7
type Backend4Value struct { Address types.IPv4 `align:"address"` Port uint16 `align:"port"` Proto u8proto.U8proto `align:"proto"` Flags uint8 `align:"flags"` }
Backend4Value must match 'struct lb4_backend' in "bpf/lib/common.h".
func NewBackend4Value ¶ added in v0.15.7
func NewBackend4Value(ip net.IP, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend4Value, error)
func (*Backend4Value) GetAddress ¶ added in v0.15.7
func (b *Backend4Value) GetAddress() net.IP
func (*Backend4Value) GetFlags ¶ added in v0.15.7
func (b *Backend4Value) GetFlags() uint8
func (*Backend4Value) GetIPCluster ¶ added in v0.15.7
func (b *Backend4Value) GetIPCluster() cmtypes.AddrCluster
func (*Backend4Value) GetPort ¶ added in v0.15.7
func (b *Backend4Value) GetPort() uint16
func (*Backend4Value) New ¶ added in v0.15.7
func (b *Backend4Value) New() bpf.MapValue
func (*Backend4Value) String ¶ added in v0.15.7
func (v *Backend4Value) String() string
func (*Backend4Value) ToHost ¶ added in v0.15.7
func (v *Backend4Value) ToHost() BackendValue
ToHost converts Backend4Value to host byte order.
func (*Backend4Value) ToNetwork ¶ added in v0.15.7
func (v *Backend4Value) ToNetwork() BackendValue
type Backend4ValueV3 ¶ added in v0.15.7
type Backend4ValueV3 struct { Address types.IPv4 `align:"address"` Port uint16 `align:"port"` Proto u8proto.U8proto `align:"proto"` Flags uint8 `align:"flags"` ClusterID uint8 `align:"cluster_id"` Pad pad3uint8 `align:"pad"` }
func NewBackend4ValueV3 ¶ added in v0.15.7
func NewBackend4ValueV3(addrCluster cmtypes.AddrCluster, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend4ValueV3, error)
func (*Backend4ValueV3) GetAddress ¶ added in v0.15.7
func (b *Backend4ValueV3) GetAddress() net.IP
func (*Backend4ValueV3) GetFlags ¶ added in v0.15.7
func (b *Backend4ValueV3) GetFlags() uint8
func (*Backend4ValueV3) GetIPCluster ¶ added in v0.15.7
func (b *Backend4ValueV3) GetIPCluster() cmtypes.AddrCluster
func (*Backend4ValueV3) GetPort ¶ added in v0.15.7
func (b *Backend4ValueV3) GetPort() uint16
func (*Backend4ValueV3) New ¶ added in v0.15.7
func (b *Backend4ValueV3) New() bpf.MapValue
func (*Backend4ValueV3) String ¶ added in v0.15.7
func (v *Backend4ValueV3) String() string
func (*Backend4ValueV3) ToHost ¶ added in v0.15.7
func (v *Backend4ValueV3) ToHost() BackendValue
ToHost converts Backend4Value to host byte order.
func (*Backend4ValueV3) ToNetwork ¶ added in v0.15.7
func (v *Backend4ValueV3) ToNetwork() BackendValue
type Backend6 ¶ added in v0.15.7
type Backend6 struct { Key *Backend6Key Value *Backend6Value }
func (*Backend6) GetKey ¶ added in v0.15.7
func (b *Backend6) GetKey() BackendKey
func (*Backend6) GetValue ¶ added in v0.15.7
func (b *Backend6) GetValue() BackendValue
type Backend6Key ¶ added in v0.15.7
type Backend6Key struct {
ID uint16
}
func (*Backend6Key) GetID ¶ added in v0.15.7
func (k *Backend6Key) GetID() loadbalancer.BackendID
func (*Backend6Key) Map ¶ added in v0.15.7
func (k *Backend6Key) Map() *bpf.Map
func (*Backend6Key) New ¶ added in v0.15.7
func (k *Backend6Key) New() bpf.MapKey
func (*Backend6Key) SetID ¶ added in v0.15.7
func (k *Backend6Key) SetID(id loadbalancer.BackendID)
func (*Backend6Key) String ¶ added in v0.15.7
func (k *Backend6Key) String() string
type Backend6KeyV3 ¶ added in v0.15.7
type Backend6KeyV3 struct {
ID loadbalancer.BackendID
}
func NewBackend6KeyV3 ¶ added in v0.15.7
func NewBackend6KeyV3(id loadbalancer.BackendID) *Backend6KeyV3
func (*Backend6KeyV3) GetID ¶ added in v0.15.7
func (k *Backend6KeyV3) GetID() loadbalancer.BackendID
func (*Backend6KeyV3) Map ¶ added in v0.15.7
func (k *Backend6KeyV3) Map() *bpf.Map
func (*Backend6KeyV3) New ¶ added in v0.15.7
func (k *Backend6KeyV3) New() bpf.MapKey
func (*Backend6KeyV3) SetID ¶ added in v0.15.7
func (k *Backend6KeyV3) SetID(id loadbalancer.BackendID)
func (*Backend6KeyV3) String ¶ added in v0.15.7
func (k *Backend6KeyV3) String() string
type Backend6V2 ¶ added in v0.15.7
type Backend6V2 struct { Key *Backend6KeyV3 Value *Backend6Value }
func NewBackend6V2 ¶ added in v0.15.7
func NewBackend6V2(id loadbalancer.BackendID, ip net.IP, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend6V2, error)
func (*Backend6V2) GetKey ¶ added in v0.15.7
func (b *Backend6V2) GetKey() BackendKey
func (*Backend6V2) GetValue ¶ added in v0.15.7
func (b *Backend6V2) GetValue() BackendValue
func (*Backend6V2) Map ¶ added in v0.15.7
func (b *Backend6V2) Map() *bpf.Map
type Backend6V3 ¶ added in v0.15.7
type Backend6V3 struct { Key *Backend6KeyV3 Value *Backend6ValueV3 }
func NewBackend6V3 ¶ added in v0.15.7
func NewBackend6V3(id loadbalancer.BackendID, addrCluster cmtypes.AddrCluster, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend6V3, error)
func (*Backend6V3) GetKey ¶ added in v0.15.7
func (b *Backend6V3) GetKey() BackendKey
func (*Backend6V3) GetValue ¶ added in v0.15.7
func (b *Backend6V3) GetValue() BackendValue
func (*Backend6V3) Map ¶ added in v0.15.7
func (b *Backend6V3) Map() *bpf.Map
type Backend6Value ¶ added in v0.15.7
type Backend6Value struct { Address types.IPv6 `align:"address"` Port uint16 `align:"port"` Proto u8proto.U8proto `align:"proto"` Flags uint8 `align:"flags"` }
Backend6Value must match 'struct lb6_backend' in "bpf/lib/common.h".
func NewBackend6Value ¶ added in v0.15.7
func NewBackend6Value(ip net.IP, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend6Value, error)
func (*Backend6Value) GetAddress ¶ added in v0.15.7
func (b *Backend6Value) GetAddress() net.IP
func (*Backend6Value) GetFlags ¶ added in v0.15.7
func (b *Backend6Value) GetFlags() uint8
func (*Backend6Value) GetIPCluster ¶ added in v0.15.7
func (b *Backend6Value) GetIPCluster() cmtypes.AddrCluster
func (*Backend6Value) GetPort ¶ added in v0.15.7
func (b *Backend6Value) GetPort() uint16
func (*Backend6Value) New ¶ added in v0.15.7
func (v *Backend6Value) New() bpf.MapValue
func (*Backend6Value) String ¶ added in v0.15.7
func (v *Backend6Value) String() string
func (*Backend6Value) ToHost ¶ added in v0.15.7
func (v *Backend6Value) ToHost() BackendValue
ToHost converts Backend6Value to host byte order.
func (*Backend6Value) ToNetwork ¶ added in v0.15.7
func (v *Backend6Value) ToNetwork() BackendValue
type Backend6ValueV3 ¶ added in v0.15.7
type Backend6ValueV3 struct { Address types.IPv6 `align:"address"` Port uint16 `align:"port"` Proto u8proto.U8proto `align:"proto"` Flags uint8 `align:"flags"` ClusterID uint8 `align:"cluster_id"` Pad pad3uint8 `align:"pad"` }
func NewBackend6ValueV3 ¶ added in v0.15.7
func NewBackend6ValueV3(addrCluster cmtypes.AddrCluster, port uint16, proto u8proto.U8proto, state loadbalancer.BackendState) (*Backend6ValueV3, error)
func (*Backend6ValueV3) GetAddress ¶ added in v0.15.7
func (b *Backend6ValueV3) GetAddress() net.IP
func (*Backend6ValueV3) GetFlags ¶ added in v0.15.7
func (b *Backend6ValueV3) GetFlags() uint8
func (*Backend6ValueV3) GetIPCluster ¶ added in v0.15.7
func (b *Backend6ValueV3) GetIPCluster() cmtypes.AddrCluster
func (*Backend6ValueV3) GetPort ¶ added in v0.15.7
func (b *Backend6ValueV3) GetPort() uint16
func (*Backend6ValueV3) New ¶ added in v0.15.7
func (v *Backend6ValueV3) New() bpf.MapValue
func (*Backend6ValueV3) String ¶ added in v0.15.7
func (v *Backend6ValueV3) String() string
func (*Backend6ValueV3) ToHost ¶ added in v0.15.7
func (v *Backend6ValueV3) ToHost() BackendValue
ToHost converts Backend6ValueV3 to host byte order.
func (*Backend6ValueV3) ToNetwork ¶ added in v0.15.7
func (v *Backend6ValueV3) ToNetwork() BackendValue
type BackendKey ¶ added in v0.15.7
type BackendKey interface { bpf.MapKey // Return the BPF map matching the type Map() *bpf.Map // Set backend identifier SetID(loadbalancer.BackendID) // Get backend identifier GetID() loadbalancer.BackendID }
BackendKey is the interface describing protocol independent backend key.
type BackendValue ¶ added in v0.15.7
type BackendValue interface { bpf.MapValue // Get backend address GetAddress() net.IP // Get backend IP + clusterID GetIPCluster() cmtypes.AddrCluster // Get backend port GetPort() uint16 // Get backend flags GetFlags() uint8 // Convert fields to network byte order. ToNetwork() BackendValue // ToHost converts fields to host byte order. ToHost() BackendValue }
BackendValue is the interface describing protocol independent backend value.
type InitParams ¶ added in v0.15.7
type InitParams struct {
IPv4, IPv6 bool
MaxSockRevNatMapEntries int
ServiceMapMaxEntries, BackEndMapMaxEntries, RevNatMapMaxEntries int
AffinityMapMaxEntries int
SourceRangeMapMaxEntries int
MaglevMapMaxEntries int
}
InitParams represents the parameters to be passed to Init().
type LBBPFMap ¶ added in v0.15.7
type LBBPFMap struct {
// contains filtered or unexported fields
}
LBBPFMap is an implementation of the LBMap interface.
func (*LBBPFMap) AddAffinityMatch ¶ added in v0.15.7
func (*LBBPFMap) AddAffinityMatch(revNATID uint16, backendID loadbalancer.BackendID) error
AddAffinityMatch adds the given affinity match to the BPF map.
func (*LBBPFMap) AddBackend ¶ added in v0.15.7
func (*LBBPFMap) AddBackend(b *loadbalancer.Backend, ipv6 bool) error
AddBackend adds a backend into a BPF map. ipv6 indicates if the backend needs to be added in the v4 or v6 backend map.
func (*LBBPFMap) DeleteAffinityMatch ¶ added in v0.15.7
func (*LBBPFMap) DeleteAffinityMatch(revNATID uint16, backendID loadbalancer.BackendID) error
DeleteAffinityMatch removes the affinity match for the given svc and backend ID tuple from the BPF map
func (*LBBPFMap) DeleteBackendByID ¶ added in v0.15.7
func (*LBBPFMap) DeleteBackendByID(id loadbalancer.BackendID) error
DeleteBackendByID removes a backend identified with the given ID from a BPF map.
func (*LBBPFMap) DeleteService ¶ added in v0.15.7
func (*LBBPFMap) DeleteService(svc loadbalancer.L3n4AddrID, backendCount int, useMaglev bool, natPolicy loadbalancer.SVCNatPolicy) error
DeleteService removes given service from a BPF map.
func (*LBBPFMap) DumpAffinityMatches ¶ added in v0.15.7
func (*LBBPFMap) DumpAffinityMatches() (datapathTypes.BackendIDByServiceIDSet, error)
DumpAffinityMatches returns the affinity match map represented as a nested map which first key is svc ID and the second - backend ID.
func (*LBBPFMap) DumpBackendMaps ¶ added in v0.15.7
func (*LBBPFMap) DumpBackendMaps() ([]*loadbalancer.Backend, error)
DumpBackendMaps dumps the backend entries from the BPF maps.
func (*LBBPFMap) DumpServiceMaps ¶ added in v0.15.7
func (*LBBPFMap) DumpServiceMaps() ([]*loadbalancer.SVC, []error)
DumpServiceMaps dumps the services from the BPF maps.
func (*LBBPFMap) DumpSourceRanges ¶ added in v0.15.7
func (*LBBPFMap) DumpSourceRanges(ipv6 bool) (datapathTypes.SourceRangeSetByServiceID, error)
func (*LBBPFMap) ExistsSockRevNat ¶ added in v1.15.0
ExistsSockRevNat checks if the passed entry exists in the sock rev nat map.
func (*LBBPFMap) IsMaglevLookupTableRecreated ¶ added in v0.15.7
IsMaglevLookupTableRecreated returns true if the maglev lookup BPF map was recreated due to the changed M param.
func (*LBBPFMap) UpdateBackendWithState ¶ added in v0.15.7
func (*LBBPFMap) UpdateBackendWithState(b *loadbalancer.Backend) error
UpdateBackendWithState updates the state for the given backend.
This function should only be called to update backend's state.
func (*LBBPFMap) UpdateSourceRanges ¶ added in v0.15.7
func (*LBBPFMap) UpsertMaglevLookupTable ¶ added in v0.15.7
func (lbmap *LBBPFMap) UpsertMaglevLookupTable(svcID uint16, backends map[string]*loadbalancer.Backend, ipv6 bool) error
UpsertMaglevLookupTable calculates Maglev lookup table for given backends, and inserts into the Maglev BPF map.
func (*LBBPFMap) UpsertService ¶ added in v0.15.7
func (lbmap *LBBPFMap) UpsertService(p *datapathTypes.UpsertServiceParams) error
UpsertService inserts or updates the given service in a BPF map.
The corresponding backend entries (identified with the given backendIDs) have to exist before calling the function.
The service's prevActiveBackendCount denotes the count of previously active backend entries that were added to the BPF map so that the function can remove obsolete ones.
The service's non-active backends are appended to the active backends list, and skipped from the service backends count set in the master key so that the non-active backends will not be considered for load-balancing traffic. The backends count is used in the datapath to determine if a service has any backends. The non-active backends are, however, populated in the service map so that they can be restored upon agent restart along with their state.
type MaglevInnerKey ¶ added in v0.15.7
type MaglevInnerKey struct {
Zero uint32
}
MaglevInnerKey is the key of a maglev inner map.
type MaglevInnerMap ¶ added in v0.15.7
MaglevInnerMap represents a maglev inner map.
func MaglevInnerMapFromID ¶ added in v0.15.7
func MaglevInnerMapFromID(id uint32) (*MaglevInnerMap, error)
MaglevInnerMapFromID returns a new object representing the maglev inner map identified by an ID.
func (*MaglevInnerMap) DumpBackends ¶ added in v0.15.7
func (m *MaglevInnerMap) DumpBackends() (string, error)
DumpBackends returns the first key of the map as stringified ints for dumping purposes.
func (*MaglevInnerMap) Lookup ¶ added in v0.15.7
func (m *MaglevInnerMap) Lookup(key *MaglevInnerKey) (*MaglevInnerVal, error)
Lookup returns the value associated with a given key for a maglev inner map.
func (*MaglevInnerMap) TableSize ¶ added in v0.15.7
func (m *MaglevInnerMap) TableSize() uint32
TableSize returns the amount of backends this map can hold as a value.
func (*MaglevInnerMap) UpdateBackends ¶ added in v0.15.7
func (m *MaglevInnerMap) UpdateBackends(backends []loadbalancer.BackendID) error
UpdateBackends updates the maglev inner map's list of backends.
type MaglevInnerVal ¶ added in v0.15.7
type MaglevInnerVal struct {
BackendIDs []loadbalancer.BackendID
}
MaglevInnerVal is the value of a maglev inner map.
type MaglevOuterKey ¶ added in v0.15.7
type MaglevOuterKey struct {
RevNatID uint16
}
MaglevOuterKey is the key of a maglev outer map.
type MaglevOuterMap ¶ added in v0.15.7
MaglevOuterMap represents a Maglev outer map.
func NewMaglevOuterMap ¶ added in v0.15.7
func NewMaglevOuterMap(name string, maxEntries int, tableSize uint32, innerMap *ebpf.MapSpec) (*MaglevOuterMap, error)
NewMaglevOuterMap returns a new object representing a maglev outer map.
func OpenMaglevOuterMap ¶ added in v0.15.7
func OpenMaglevOuterMap(name string) (*MaglevOuterMap, error)
OpenMaglevOuterMap opens an existing pinned maglev outer map and returns an object representing it.
func (*MaglevOuterMap) DumpBackends ¶ added in v0.15.7
func (m *MaglevOuterMap) DumpBackends(ipv6 bool) (map[string][]string, error)
DumpBackends iterates through all of the Maglev map's entries, opening each entry's inner map, and dumps their contents in a format expected by Cilium's table printer.
func (*MaglevOuterMap) GetService ¶ added in v0.15.7
func (m *MaglevOuterMap) GetService(id uint16) (*MaglevInnerMap, error)
GetService gets the maglev backend lookup table for the given service id.
func (*MaglevOuterMap) TableSize ¶ added in v0.15.7
func (m *MaglevOuterMap) TableSize() (uint32, error)
TableSize tries to determine the table size of the Maglev map. It does so by opening the first-available service's inner map and reading its size. For this to work, at least one service entry must be available.
func (*MaglevOuterMap) UpdateService ¶ added in v0.15.7
func (m *MaglevOuterMap) UpdateService(id uint16, inner *MaglevInnerMap) error
UpdateService sets the given inner map to be the Maglev lookup table for the service with the given id.
type MaglevOuterVal ¶ added in v0.15.7
type MaglevOuterVal struct {
FD uint32
}
MaglevOuterVal is the value of a maglev outer map.
type RevNat4Key ¶
type RevNat4Key struct {
Key uint16
}
func NewRevNat4Key ¶
func NewRevNat4Key(value uint16) *RevNat4Key
func (*RevNat4Key) GetKey ¶
func (k *RevNat4Key) GetKey() uint16
func (*RevNat4Key) Map ¶
func (k *RevNat4Key) Map() *bpf.Map
func (*RevNat4Key) New ¶ added in v0.15.7
func (k *RevNat4Key) New() bpf.MapKey
func (*RevNat4Key) String ¶
func (k *RevNat4Key) String() string
func (*RevNat4Key) ToHost ¶ added in v0.15.7
func (k *RevNat4Key) ToHost() RevNatKey
ToHost converts RevNat4Key to host byte order.
func (*RevNat4Key) ToNetwork ¶ added in v0.10.0
func (k *RevNat4Key) ToNetwork() RevNatKey
ToNetwork converts RevNat4Key to network byte order.
type RevNat4Value ¶
func (*RevNat4Value) New ¶ added in v0.15.7
func (v *RevNat4Value) New() bpf.MapValue
func (*RevNat4Value) String ¶
func (v *RevNat4Value) String() string
func (*RevNat4Value) ToHost ¶ added in v0.15.7
func (k *RevNat4Value) ToHost() RevNatValue
ToHost converts RevNat4Value to host byte order.
func (*RevNat4Value) ToNetwork ¶ added in v0.10.0
func (v *RevNat4Value) ToNetwork() RevNatValue
ToNetwork converts RevNat4Value to network byte order.
type RevNat6Key ¶
type RevNat6Key struct {
Key uint16
}
func NewRevNat6Key ¶
func NewRevNat6Key(value uint16) *RevNat6Key
func (*RevNat6Key) GetKey ¶
func (v *RevNat6Key) GetKey() uint16
func (*RevNat6Key) Map ¶
func (v *RevNat6Key) Map() *bpf.Map
func (*RevNat6Key) New ¶ added in v0.15.7
func (v *RevNat6Key) New() bpf.MapKey
func (*RevNat6Key) String ¶
func (v *RevNat6Key) String() string
func (*RevNat6Key) ToHost ¶ added in v0.15.7
func (v *RevNat6Key) ToHost() RevNatKey
ToNetwork converts RevNat6Key to host byte order.
func (*RevNat6Key) ToNetwork ¶ added in v0.10.0
func (v *RevNat6Key) ToNetwork() RevNatKey
ToNetwork converts RevNat6Key to network byte order.
type RevNat6Value ¶
func (*RevNat6Value) New ¶ added in v0.15.7
func (v *RevNat6Value) New() bpf.MapValue
func (*RevNat6Value) String ¶
func (v *RevNat6Value) String() string
func (*RevNat6Value) ToHost ¶ added in v0.15.7
func (v *RevNat6Value) ToHost() RevNatValue
ToNetwork converts RevNat6Value to Host byte order.
func (*RevNat6Value) ToNetwork ¶ added in v0.10.0
func (v *RevNat6Value) ToNetwork() RevNatValue
ToNetwork converts RevNat6Value to network byte order.
type RevNatValue ¶
type RevNatValue interface { bpf.MapValue // ToNetwork converts fields to network byte order. ToNetwork() RevNatValue // ToHost converts fields to host byte order. ToHost() RevNatValue }
type Service4Key ¶
type Service4Key struct { Address types.IPv4 `align:"address"` Port uint16 `align:"dport"` BackendSlot uint16 `align:"backend_slot"` Proto uint8 `align:"proto"` Scope uint8 `align:"scope"` Pad pad2uint8 `align:"pad"` }
Service4Key must match 'struct lb4_key' in "bpf/lib/common.h".
func NewService4Key ¶
func (*Service4Key) GetAddress ¶ added in v0.15.7
func (k *Service4Key) GetAddress() net.IP
func (*Service4Key) GetBackendSlot ¶ added in v0.15.7
func (k *Service4Key) GetBackendSlot() int
func (*Service4Key) GetPort ¶
func (k *Service4Key) GetPort() uint16
func (*Service4Key) GetScope ¶ added in v0.15.7
func (k *Service4Key) GetScope() uint8
func (*Service4Key) IsIPv6 ¶
func (k *Service4Key) IsIPv6() bool
func (*Service4Key) IsSurrogate ¶ added in v0.15.7
func (k *Service4Key) IsSurrogate() bool
func (*Service4Key) Map ¶
func (k *Service4Key) Map() *bpf.Map
func (*Service4Key) MapDelete ¶
func (k *Service4Key) MapDelete() error
func (*Service4Key) New ¶ added in v0.15.7
func (k *Service4Key) New() bpf.MapKey
func (*Service4Key) RevNatValue ¶
func (k *Service4Key) RevNatValue() RevNatValue
func (*Service4Key) SetBackendSlot ¶ added in v0.15.7
func (k *Service4Key) SetBackendSlot(slot int)
func (*Service4Key) SetScope ¶ added in v0.15.7
func (k *Service4Key) SetScope(scope uint8)
func (*Service4Key) String ¶
func (k *Service4Key) String() string
func (*Service4Key) ToHost ¶ added in v0.10.0
func (k *Service4Key) ToHost() ServiceKey
ToHost converts Service4Key to host byte order.
func (*Service4Key) ToNetwork ¶ added in v0.10.0
func (k *Service4Key) ToNetwork() ServiceKey
type Service4Value ¶
type Service4Value struct { BackendID uint32 `align:"$union0"` Count uint16 `align:"count"` RevNat uint16 `align:"rev_nat_index"` Flags uint8 `align:"flags"` Flags2 uint8 `align:"flags2"` Pad pad2uint8 `align:"pad"` }
Service4Value must match 'struct lb4_service' in "bpf/lib/common.h".
func (*Service4Value) GetBackendID ¶ added in v0.15.7
func (s *Service4Value) GetBackendID() loadbalancer.BackendID
func (*Service4Value) GetCount ¶
func (s *Service4Value) GetCount() int
func (*Service4Value) GetFlags ¶ added in v0.15.7
func (s *Service4Value) GetFlags() uint16
func (*Service4Value) GetRevNat ¶ added in v0.15.7
func (s *Service4Value) GetRevNat() int
func (*Service4Value) New ¶ added in v0.15.7
func (s *Service4Value) New() bpf.MapValue
func (*Service4Value) RevNatKey ¶
func (s *Service4Value) RevNatKey() RevNatKey
func (*Service4Value) SetBackendID ¶ added in v0.15.7
func (s *Service4Value) SetBackendID(id loadbalancer.BackendID)
func (*Service4Value) SetCount ¶
func (s *Service4Value) SetCount(count int)
func (*Service4Value) SetFlags ¶ added in v0.15.7
func (s *Service4Value) SetFlags(flags uint16)
func (*Service4Value) SetL7LBProxyPort ¶ added in v0.15.7
func (s *Service4Value) SetL7LBProxyPort(port uint16)
func (*Service4Value) SetRevNat ¶
func (s *Service4Value) SetRevNat(id int)
func (*Service4Value) SetSessionAffinityTimeoutSec ¶ added in v0.15.7
func (s *Service4Value) SetSessionAffinityTimeoutSec(t uint32)
func (*Service4Value) String ¶
func (s *Service4Value) String() string
func (*Service4Value) ToHost ¶ added in v0.10.0
func (s *Service4Value) ToHost() ServiceValue
ToHost converts Service4Value to host byte order.
func (*Service4Value) ToNetwork ¶ added in v0.10.0
func (s *Service4Value) ToNetwork() ServiceValue
type Service6Key ¶
type Service6Key struct { Address types.IPv6 `align:"address"` Port uint16 `align:"dport"` BackendSlot uint16 `align:"backend_slot"` Proto uint8 `align:"proto"` Scope uint8 `align:"scope"` Pad pad2uint8 `align:"pad"` }
Service6Key must match 'struct lb6_key' in "bpf/lib/common.h".
func NewService6Key ¶
func (*Service6Key) GetAddress ¶ added in v0.15.7
func (k *Service6Key) GetAddress() net.IP
func (*Service6Key) GetBackendSlot ¶ added in v0.15.7
func (k *Service6Key) GetBackendSlot() int
func (*Service6Key) GetPort ¶
func (k *Service6Key) GetPort() uint16
func (*Service6Key) GetScope ¶ added in v0.15.7
func (k *Service6Key) GetScope() uint8
func (*Service6Key) IsIPv6 ¶
func (k *Service6Key) IsIPv6() bool
func (*Service6Key) IsSurrogate ¶ added in v0.15.7
func (k *Service6Key) IsSurrogate() bool
func (*Service6Key) Map ¶
func (k *Service6Key) Map() *bpf.Map
func (*Service6Key) MapDelete ¶ added in v0.15.7
func (k *Service6Key) MapDelete() error
func (*Service6Key) New ¶ added in v0.15.7
func (k *Service6Key) New() bpf.MapKey
func (*Service6Key) RevNatValue ¶
func (k *Service6Key) RevNatValue() RevNatValue
func (*Service6Key) SetBackendSlot ¶ added in v0.15.7
func (k *Service6Key) SetBackendSlot(slot int)
func (*Service6Key) SetScope ¶ added in v0.15.7
func (k *Service6Key) SetScope(scope uint8)
func (*Service6Key) String ¶
func (k *Service6Key) String() string
func (*Service6Key) ToHost ¶ added in v0.10.0
func (k *Service6Key) ToHost() ServiceKey
ToHost converts Service6Key to host byte order.
func (*Service6Key) ToNetwork ¶ added in v0.10.0
func (k *Service6Key) ToNetwork() ServiceKey
type Service6Value ¶
type Service6Value struct { BackendID uint32 `align:"$union0"` Count uint16 `align:"count"` RevNat uint16 `align:"rev_nat_index"` Flags uint8 `align:"flags"` Flags2 uint8 `align:"flags2"` Pad pad2uint8 `align:"pad"` }
Service6Value must match 'struct lb6_service' in "bpf/lib/common.h".
func (*Service6Value) GetBackendID ¶ added in v0.15.7
func (s *Service6Value) GetBackendID() loadbalancer.BackendID
func (*Service6Value) GetCount ¶
func (s *Service6Value) GetCount() int
func (*Service6Value) GetFlags ¶ added in v0.15.7
func (s *Service6Value) GetFlags() uint16
func (*Service6Value) GetRevNat ¶ added in v0.15.7
func (s *Service6Value) GetRevNat() int
func (*Service6Value) New ¶ added in v0.15.7
func (s *Service6Value) New() bpf.MapValue
func (*Service6Value) RevNatKey ¶
func (s *Service6Value) RevNatKey() RevNatKey
func (*Service6Value) SetBackendID ¶ added in v0.15.7
func (s *Service6Value) SetBackendID(id loadbalancer.BackendID)
func (*Service6Value) SetCount ¶
func (s *Service6Value) SetCount(count int)
func (*Service6Value) SetFlags ¶ added in v0.15.7
func (s *Service6Value) SetFlags(flags uint16)
func (*Service6Value) SetL7LBProxyPort ¶ added in v0.15.7
func (s *Service6Value) SetL7LBProxyPort(port uint16)
func (*Service6Value) SetRevNat ¶
func (s *Service6Value) SetRevNat(id int)
func (*Service6Value) SetSessionAffinityTimeoutSec ¶ added in v0.15.7
func (s *Service6Value) SetSessionAffinityTimeoutSec(t uint32)
func (*Service6Value) String ¶
func (s *Service6Value) String() string
func (*Service6Value) ToHost ¶ added in v0.10.0
func (s *Service6Value) ToHost() ServiceValue
ToHost converts Service6Value to host byte order.
func (*Service6Value) ToNetwork ¶ added in v0.10.0
func (s *Service6Value) ToNetwork() ServiceValue
type ServiceKey ¶
type ServiceKey interface { bpf.MapKey // Return true if the key is of type IPv6 IsIPv6() bool // IsSurrogate returns true on zero-address IsSurrogate() bool // Return the BPF map matching the key type Map() *bpf.Map // Set backend slot for the key SetBackendSlot(slot int) // Get backend slot of the key GetBackendSlot() int // Set lookup scope for the key SetScope(scope uint8) // Get lookup scope for the key GetScope() uint8 // Get frontend IP address GetAddress() net.IP // Get frontend port GetPort() uint16 // Returns a RevNatValue matching a ServiceKey RevNatValue() RevNatValue // Delete entry identified with the key from the matching map MapDelete() error // ToNetwork converts fields to network byte order. ToNetwork() ServiceKey // ToHost converts fields to host byte order. ToHost() ServiceKey }
ServiceKey is the interface describing protocol independent key for services map v2.
type ServiceValue ¶
type ServiceValue interface { bpf.MapValue // Set the number of backends SetCount(int) // Get the number of backends GetCount() int // Set reverse NAT identifier SetRevNat(int) // Get reverse NAT identifier GetRevNat() int // Set flags SetFlags(uint16) // Get flags GetFlags() uint16 // Set timeout for sessionAffinity=clientIP SetSessionAffinityTimeoutSec(t uint32) // Set proxy port for l7 loadbalancer services SetL7LBProxyPort(port uint16) // Set backend identifier SetBackendID(id loadbalancer.BackendID) // Get backend identifier GetBackendID() loadbalancer.BackendID // Returns a RevNatKey matching a ServiceValue RevNatKey() RevNatKey // Convert fields to network byte order. ToNetwork() ServiceValue // ToHost converts fields to host byte order. ToHost() ServiceValue }
ServiceValue is the interface describing protocol independent value for services map v2.
type SockRevNat4Key ¶ added in v0.15.7
type SockRevNat4Key struct { Cookie uint64 `align:"cookie"` Address types.IPv4 `align:"address"` Port int16 `align:"port"` // contains filtered or unexported fields }
SockRevNat4Key is the tuple with address, port and cookie used as key in the reverse NAT sock map.
func NewSockRevNat4Key ¶ added in v1.15.0
func NewSockRevNat4Key(cookie uint64, addr net.IP, port uint16) *SockRevNat4Key
func (*SockRevNat4Key) Map ¶ added in v1.15.0
func (k *SockRevNat4Key) Map() *bpf.Map
func (*SockRevNat4Key) New ¶ added in v0.15.7
func (k *SockRevNat4Key) New() bpf.MapKey
func (*SockRevNat4Key) String ¶ added in v0.15.7
func (k *SockRevNat4Key) String() string
String converts the key into a human readable string format.
type SockRevNat4Value ¶ added in v0.15.7
type SockRevNat4Value struct { Address types.IPv4 `align:"address"` Port int16 `align:"port"` RevNatIndex uint16 `align:"rev_nat_index"` }
SockRevNat4Value is an entry in the reverse NAT sock map.
func (*SockRevNat4Value) New ¶ added in v0.15.7
func (v *SockRevNat4Value) New() bpf.MapValue
func (*SockRevNat4Value) String ¶ added in v0.15.7
func (v *SockRevNat4Value) String() string
String converts the value into a human readable string format.
type SockRevNat6Key ¶ added in v0.15.7
type SockRevNat6Key struct { Cookie uint64 `align:"cookie"` Address types.IPv6 `align:"address"` Port int16 `align:"port"` // contains filtered or unexported fields }
SockRevNat6Key is the tuple with address, port and cookie used as key in the reverse NAT sock map.
func NewSockRevNat6Key ¶ added in v1.15.0
func NewSockRevNat6Key(cookie uint64, addr net.IP, port uint16) *SockRevNat6Key
func (*SockRevNat6Key) Map ¶ added in v1.15.0
func (k *SockRevNat6Key) Map() *bpf.Map
func (*SockRevNat6Key) New ¶ added in v0.15.7
func (k *SockRevNat6Key) New() bpf.MapKey
func (*SockRevNat6Key) String ¶ added in v0.15.7
func (k *SockRevNat6Key) String() string
String converts the key into a human readable string format.
type SockRevNat6Value ¶ added in v0.15.7
type SockRevNat6Value struct {
// contains filtered or unexported fields
}
SockRevNat6Value is an entry in the reverse NAT sock map.
func (*SockRevNat6Value) New ¶ added in v0.15.7
func (v *SockRevNat6Value) New() bpf.MapValue
func (*SockRevNat6Value) String ¶ added in v0.15.7
func (v *SockRevNat6Value) String() string
String converts the value into a human readable string format.
type SourceRangeKey ¶ added in v0.15.7
type SourceRangeKey interface { GetCIDR() *cidr.CIDR GetRevNATID() uint16 // Convert fields to network byte order. ToNetwork() SourceRangeKey // ToHost converts fields to host byte order. ToHost() SourceRangeKey }
type SourceRangeKey4 ¶ added in v0.15.7
type SourceRangeKey4 struct { PrefixLen uint32 `align:"lpm_key"` RevNATID uint16 `align:"rev_nat_id"` Pad uint16 `align:"pad"` Address types.IPv4 `align:"addr"` }
func (*SourceRangeKey4) GetCIDR ¶ added in v0.15.7
func (k *SourceRangeKey4) GetCIDR() *cidr.CIDR
func (*SourceRangeKey4) GetRevNATID ¶ added in v0.15.7
func (k *SourceRangeKey4) GetRevNATID() uint16
func (*SourceRangeKey4) New ¶ added in v0.15.7
func (k *SourceRangeKey4) New() bpf.MapKey
func (*SourceRangeKey4) String ¶ added in v0.15.7
func (k *SourceRangeKey4) String() string
func (*SourceRangeKey4) ToHost ¶ added in v0.15.7
func (k *SourceRangeKey4) ToHost() SourceRangeKey
ToHost returns the key in the host byte order
func (*SourceRangeKey4) ToNetwork ¶ added in v0.15.7
func (k *SourceRangeKey4) ToNetwork() SourceRangeKey
type SourceRangeKey6 ¶ added in v0.15.7
type SourceRangeKey6 struct { PrefixLen uint32 `align:"lpm_key"` RevNATID uint16 `align:"rev_nat_id"` Pad uint16 `align:"pad"` Address types.IPv6 `align:"addr"` }
func (*SourceRangeKey6) GetCIDR ¶ added in v0.15.7
func (k *SourceRangeKey6) GetCIDR() *cidr.CIDR
func (*SourceRangeKey6) GetRevNATID ¶ added in v0.15.7
func (k *SourceRangeKey6) GetRevNATID() uint16
func (*SourceRangeKey6) New ¶ added in v0.15.7
func (k *SourceRangeKey6) New() bpf.MapKey
func (*SourceRangeKey6) String ¶ added in v0.15.7
func (k *SourceRangeKey6) String() string
func (*SourceRangeKey6) ToHost ¶ added in v0.15.7
func (k *SourceRangeKey6) ToHost() SourceRangeKey
ToHost returns the key in the host byte order
func (*SourceRangeKey6) ToNetwork ¶ added in v0.15.7
func (k *SourceRangeKey6) ToNetwork() SourceRangeKey
type SourceRangeValue ¶ added in v0.15.7
type SourceRangeValue struct {
Pad uint8 // not used
}
func (*SourceRangeValue) New ¶ added in v0.15.7
func (v *SourceRangeValue) New() bpf.MapValue
func (*SourceRangeValue) String ¶ added in v0.15.7
func (v *SourceRangeValue) String() string