lbmap

package
v1.6.0-rc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

+groupName=maps

Index

Constants

View Source
const (
	// Maximum number of entries in each hashtable
	MaxEntries = 65536

	// MaxSeq is used by daemon for generating bpf define LB_RR_MAX_SEQ.
	MaxSeq = 31
)

Variables

View Source
var (
	Service4Map = bpf.NewMap("cilium_lb4_services",
		bpf.MapTypeHash,
		&Service4Key{},
		int(unsafe.Sizeof(Service4Key{})),
		&Service4Value{},
		int(unsafe.Sizeof(Service4Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey, svcVal := mapKey.(*Service4Key), mapValue.(*Service4Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, svcVal); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), svcVal.ToNetwork(), nil
		}).WithCache()
	Service4MapV2 = bpf.NewMap("cilium_lb4_services_v2",
		bpf.MapTypeHash,
		&Service4KeyV2{},
		int(unsafe.Sizeof(Service4KeyV2{})),
		&Service4ValueV2{},
		int(unsafe.Sizeof(Service4ValueV2{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey, svcVal := mapKey.(*Service4KeyV2), mapValue.(*Service4ValueV2)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, svcVal); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), svcVal.ToNetwork(), nil
		}).WithCache()
	Backend4Map = bpf.NewMap("cilium_lb4_backends",
		bpf.MapTypeHash,
		&Backend4Key{},
		int(unsafe.Sizeof(Backend4Key{})),
		&Backend4Value{},
		int(unsafe.Sizeof(Backend4Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			backendVal := mapValue.(*Backend4Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, mapKey, backendVal); err != nil {
				return nil, nil, err
			}

			return mapKey, backendVal.ToNetwork(), nil
		}).WithCache()
	RevNat4Map = bpf.NewMap("cilium_lb4_reverse_nat",
		bpf.MapTypeHash,
		&RevNat4Key{},
		int(unsafe.Sizeof(RevNat4Key{})),
		&RevNat4Value{},
		int(unsafe.Sizeof(RevNat4Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			revKey, revNat := mapKey.(*RevNat4Key), mapValue.(*RevNat4Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, revKey, revNat); err != nil {
				return nil, nil, err
			}

			return revKey.ToNetwork(), revNat.ToNetwork(), nil
		}).WithCache()
	RRSeq4Map = bpf.NewMap("cilium_lb4_rr_seq",
		bpf.MapTypeHash,
		&Service4Key{},
		int(unsafe.Sizeof(Service4Key{})),
		&RRSeqValue{},
		int(unsafe.Sizeof(RRSeqValue{})),
		maxFrontEnds,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey := mapKey.(*Service4Key)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, mapValue); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), mapValue, nil
		}).WithCache()
	RRSeq4MapV2 = bpf.NewMap("cilium_lb4_rr_seq_v2",
		bpf.MapTypeHash,
		&Service4KeyV2{},
		int(unsafe.Sizeof(Service4KeyV2{})),
		&RRSeqValue{},
		int(unsafe.Sizeof(RRSeqValue{})),
		maxFrontEnds,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey := mapKey.(*Service4KeyV2)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, mapValue); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), mapValue, nil
		}).WithCache()
)
View Source
var (
	// Service6Map represents the BPF map for services in IPv6 load balancer
	Service6Map = bpf.NewMap("cilium_lb6_services",
		bpf.MapTypeHash,
		&Service6Key{},
		int(unsafe.Sizeof(Service6Key{})),
		&Service6Value{},
		int(unsafe.Sizeof(Service6Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey, svcVal := mapKey.(*Service6Key), mapValue.(*Service6Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, svcVal); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), svcVal.ToNetwork(), nil
		}).WithCache()
	Service6MapV2 = bpf.NewMap("cilium_lb6_services_v2",
		bpf.MapTypeHash,
		&Service6KeyV2{},
		int(unsafe.Sizeof(Service6KeyV2{})),
		&Service6ValueV2{},
		int(unsafe.Sizeof(Service6ValueV2{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey, svcVal := mapKey.(*Service6KeyV2), mapValue.(*Service6ValueV2)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, svcVal); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), svcVal.ToNetwork(), nil
		}).WithCache()
	Backend6Map = bpf.NewMap("cilium_lb6_backends",
		bpf.MapTypeHash,
		&Backend6Key{},
		int(unsafe.Sizeof(Backend6Key{})),
		&Backend6Value{},
		int(unsafe.Sizeof(Backend6Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			backendVal := mapValue.(*Backend6Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, mapKey, backendVal); err != nil {
				return nil, nil, err
			}

			return mapKey, backendVal.ToNetwork(), nil
		}).WithCache()
	// RevNat6Map represents the BPF map for reverse NAT in IPv6 load balancer
	RevNat6Map = bpf.NewMap("cilium_lb6_reverse_nat",
		bpf.MapTypeHash,
		&RevNat6Key{},
		int(unsafe.Sizeof(RevNat6Key{})),
		&RevNat6Value{},
		int(unsafe.Sizeof(RevNat6Value{})),
		MaxEntries,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			revKey, revNat := mapKey.(*RevNat6Key), mapValue.(*RevNat6Value)

			if _, _, err := bpf.ConvertKeyValue(key, value, revKey, revNat); err != nil {
				return nil, nil, err
			}

			return revKey.ToNetwork(), revNat.ToNetwork(), nil
		}).WithCache()
	// RRSeq6Map represents the BPF map for wrr sequences in IPv6 load balancer
	RRSeq6Map = bpf.NewMap("cilium_lb6_rr_seq",
		bpf.MapTypeHash,
		&Service6Key{},
		int(unsafe.Sizeof(Service6Key{})),
		&RRSeqValue{},
		int(unsafe.Sizeof(RRSeqValue{})),
		maxFrontEnds,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey := mapKey.(*Service6Key)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, mapValue); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), mapValue, nil
		}).WithCache()
	// RRSeq6MapV2 represents the BPF map for wrr sequences in IPv6 load balancer
	RRSeq6MapV2 = bpf.NewMap("cilium_lb6_rr_seq_v2",
		bpf.MapTypeHash,
		&Service6KeyV2{},
		int(unsafe.Sizeof(Service6KeyV2{})),
		&RRSeqValue{},
		int(unsafe.Sizeof(RRSeqValue{})),
		maxFrontEnds,
		0, 0,
		func(key []byte, value []byte, mapKey bpf.MapKey, mapValue bpf.MapValue) (bpf.MapKey, bpf.MapValue, error) {
			svcKey := mapKey.(*Service6KeyV2)

			if _, _, err := bpf.ConvertKeyValue(key, value, svcKey, mapValue); err != nil {
				return nil, nil, err
			}

			return svcKey.ToNetwork(), mapValue, nil
		}).WithCache()
)

Functions

func AddBackendIDsToCache added in v1.5.0

func AddBackendIDsToCache(backendIDs map[BackendAddrID]BackendKey)

AddBackendIDsToCache populates the given backend IDs to the lbmap local cache.

func DeleteOrphanBackends added in v1.5.0

func DeleteOrphanBackends(releaseBackendID func(loadbalancer.BackendID)) []error

func DeleteRevNATBPF added in v1.5.0

func DeleteRevNATBPF(id loadbalancer.ServiceID, isIPv6 bool) error

DeleteRevNATBPF deletes the revNAT entry from its corresponding BPF map (IPv4 or IPv6) with ID id. Returns an error if the deletion operation failed.

func DeleteRevNat

func DeleteRevNat(key RevNatKey) error

func DeleteServiceCache added in v1.5.0

func DeleteServiceCache(svc loadbalancer.L3n4AddrID)

DeleteServiceCache deletes the service cache.

func DeleteServiceV2 added in v1.5.0

func DeleteServiceV2(svc loadbalancer.L3n4AddrID, releaseBackendID func(loadbalancer.BackendID)) error

DeleteServiceV2 deletes a service from the lbmap and deletes backends of it if they are not used by any other service.

The given key has to be of the master service.

func DumpBackendMapsToUserspace added in v1.5.0

func DumpBackendMapsToUserspace() (map[BackendAddrID]*loadbalancer.LBBackEnd, error)

DumpBackendMapsToUserspace dumps the backend entries from the BPF maps.

func DumpRevNATMapsToUserspace added in v1.5.0

func DumpRevNATMapsToUserspace() (loadbalancer.RevNATMap, []error)

DumpRevNATMapsToUserspace dumps the contents of both the IPv6 and IPv4 revNAT BPF maps, and stores the contents of said dumps in a RevNATMap. Returns the errors that occurred while dumping the maps.

func DumpServiceMapsToUserspaceV2 added in v1.5.0

func DumpServiceMapsToUserspaceV2() (loadbalancer.SVCMap, []*loadbalancer.LBSVC, []error)

DumpServiceMapsToUserspaceV2 dumps the services in the same way as DumpServiceMapsToUserspace.

func L3n4Addr2RevNatKeynValue

func L3n4Addr2RevNatKeynValue(svcID loadbalancer.ServiceID, feL3n4Addr loadbalancer.L3n4Addr) (RevNatKey, RevNatValue)

L3n4Addr2RevNatKeynValue converts the given L3n4Addr to a RevNatKey and RevNatValue.

func LBSVC2ServiceKeynValue

func LBSVC2ServiceKeynValue(svc loadbalancer.LBSVC) (ServiceKey, []ServiceValue, error)

LBSVC2ServiceKeynValue transforms the SVC Cilium type into a bpf SVC type.

func LBSVC2ServiceKeynValuenBackendV2 added in v1.5.0

func LBSVC2ServiceKeynValuenBackendV2(svc *loadbalancer.LBSVC) (ServiceKeyV2, []ServiceValueV2, []Backend, error)

LBSVC2ServiceKeynValuenBackendValueV2 transforms the SVC Cilium type into a bpf SVC v2 type.

func RemoveDeprecatedMaps added in v1.6.0

func RemoveDeprecatedMaps() error

RemoveDeprecatedMaps removes the maps for legacy services, left over from previous installations.

Safe to remove in Cilium 1.7.

func RestoreService added in v1.5.0

func RestoreService(svc loadbalancer.LBSVC) error

RestoreService restores a single service in the cache. This is required to guarantee consistent backend ordering, slave slot and backend by backend address ID lookups.

func UpdateRevNat

func UpdateRevNat(key RevNatKey, value RevNatValue) error

func UpdateService

func UpdateService(fe ServiceKey, backends []ServiceValue,
	addRevNAT bool, revNATID int,
	acquireBackendID func(loadbalancer.L3n4Addr) (loadbalancer.BackendID, error),
	releaseBackendID func(loadbalancer.BackendID)) error

UpdateService adds or updates the given service in the bpf maps.

Types

type Backend added in v1.5.0

type Backend interface {
	// Return true if the value is of type IPv6
	IsIPv6() bool

	// Return the BPF map matching the type
	Map() *bpf.Map

	// Get backend identifier
	GetID() loadbalancer.BackendID

	// 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.

func LBBackEnd2Backend added in v1.6.0

func LBBackEnd2Backend(be loadbalancer.LBBackEnd) (Backend, error)

LBBackEnd2Backend converts the loadbalancer backend type into a backend with a BPF key backing.

type Backend4 added in v1.5.0

type Backend4 struct {
	Key   *Backend4Key
	Value *Backend4Value
}

func NewBackend4 added in v1.5.0

func NewBackend4(id loadbalancer.BackendID, ip net.IP, port uint16, proto u8proto.U8proto) (*Backend4, error)

func (*Backend4) GetID added in v1.5.0

func (b *Backend4) GetID() loadbalancer.BackendID

func (*Backend4) GetKey added in v1.5.0

func (b *Backend4) GetKey() BackendKey

func (*Backend4) GetValue added in v1.5.0

func (b *Backend4) GetValue() BackendValue

func (*Backend4) IsIPv6 added in v1.5.0

func (b *Backend4) IsIPv6() bool

func (*Backend4) Map added in v1.5.0

func (b *Backend4) Map() *bpf.Map

type Backend4Key added in v1.5.0

type Backend4Key struct {
	ID loadbalancer.BackendID
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewBackend4Key added in v1.5.0

func NewBackend4Key(id loadbalancer.BackendID) *Backend4Key

func (*Backend4Key) DeepCopy added in v1.5.1

func (in *Backend4Key) DeepCopy() *Backend4Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend4Key.

func (*Backend4Key) DeepCopyInto added in v1.5.1

func (in *Backend4Key) DeepCopyInto(out *Backend4Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backend4Key) DeepCopyMapKey added in v1.5.1

func (in *Backend4Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Backend4Key) GetID added in v1.5.0

func (k *Backend4Key) GetID() loadbalancer.BackendID

func (*Backend4Key) GetKeyPtr added in v1.5.0

func (k *Backend4Key) GetKeyPtr() unsafe.Pointer

func (*Backend4Key) Map added in v1.5.0

func (k *Backend4Key) Map() *bpf.Map

func (*Backend4Key) NewValue added in v1.5.0

func (k *Backend4Key) NewValue() bpf.MapValue

func (*Backend4Key) SetID added in v1.5.0

func (k *Backend4Key) SetID(id loadbalancer.BackendID)

func (*Backend4Key) String added in v1.5.0

func (k *Backend4Key) String() string

type Backend4Value added in v1.5.0

type Backend4Value struct {
	Address types.IPv4      `align:"address"`
	Port    uint16          `align:"port"`
	Proto   u8proto.U8proto `align:"proto"`
	Pad     uint8
}

Backend4Value must match 'struct lb4_backend' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewBackend4Value added in v1.5.0

func NewBackend4Value(ip net.IP, port uint16, proto u8proto.U8proto) (*Backend4Value, error)

func (*Backend4Value) BackendAddrID added in v1.5.0

func (b *Backend4Value) BackendAddrID() BackendAddrID

func (*Backend4Value) DeepCopy added in v1.5.1

func (in *Backend4Value) DeepCopy() *Backend4Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend4Value.

func (*Backend4Value) DeepCopyInto added in v1.5.1

func (in *Backend4Value) DeepCopyInto(out *Backend4Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backend4Value) DeepCopyMapValue added in v1.5.1

func (in *Backend4Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Backend4Value) GetAddress added in v1.5.0

func (b *Backend4Value) GetAddress() net.IP

func (*Backend4Value) GetPort added in v1.5.0

func (b *Backend4Value) GetPort() uint16

func (*Backend4Value) GetValuePtr added in v1.5.0

func (v *Backend4Value) GetValuePtr() unsafe.Pointer

func (*Backend4Value) String added in v1.5.0

func (v *Backend4Value) String() string

func (*Backend4Value) ToNetwork added in v1.5.0

func (v *Backend4Value) ToNetwork() BackendValue

type Backend6 added in v1.5.0

type Backend6 struct {
	Key   *Backend6Key
	Value *Backend6Value
}

func NewBackend6 added in v1.5.0

func NewBackend6(id loadbalancer.BackendID, ip net.IP, port uint16, proto u8proto.U8proto) (*Backend6, error)

func (*Backend6) GetID added in v1.5.0

func (b *Backend6) GetID() loadbalancer.BackendID

func (*Backend6) GetKey added in v1.5.0

func (b *Backend6) GetKey() BackendKey

func (*Backend6) GetValue added in v1.5.0

func (b *Backend6) GetValue() BackendValue

func (*Backend6) IsIPv6 added in v1.5.0

func (b *Backend6) IsIPv6() bool

func (*Backend6) Map added in v1.5.0

func (b *Backend6) Map() *bpf.Map

type Backend6Key added in v1.5.0

type Backend6Key struct {
	ID loadbalancer.BackendID
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewBackend6Key added in v1.5.0

func NewBackend6Key(id loadbalancer.BackendID) *Backend6Key

func (*Backend6Key) DeepCopy added in v1.5.1

func (in *Backend6Key) DeepCopy() *Backend6Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend6Key.

func (*Backend6Key) DeepCopyInto added in v1.5.1

func (in *Backend6Key) DeepCopyInto(out *Backend6Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backend6Key) DeepCopyMapKey added in v1.5.1

func (in *Backend6Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Backend6Key) GetID added in v1.5.0

func (k *Backend6Key) GetID() loadbalancer.BackendID

func (*Backend6Key) GetKeyPtr added in v1.5.0

func (k *Backend6Key) GetKeyPtr() unsafe.Pointer

func (*Backend6Key) Map added in v1.5.0

func (k *Backend6Key) Map() *bpf.Map

func (*Backend6Key) NewValue added in v1.5.0

func (k *Backend6Key) NewValue() bpf.MapValue

func (*Backend6Key) SetID added in v1.5.0

func (k *Backend6Key) SetID(id loadbalancer.BackendID)

func (*Backend6Key) String added in v1.5.0

func (k *Backend6Key) String() string

type Backend6Value added in v1.5.0

type Backend6Value struct {
	Address types.IPv6      `align:"address"`
	Port    uint16          `align:"port"`
	Proto   u8proto.U8proto `align:"proto"`
	Pad     uint8
}

Backend6Value must match 'struct lb6_backend' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewBackend6Value added in v1.5.0

func NewBackend6Value(ip net.IP, port uint16, proto u8proto.U8proto) (*Backend6Value, error)

func (*Backend6Value) BackendAddrID added in v1.5.0

func (b *Backend6Value) BackendAddrID() BackendAddrID

func (*Backend6Value) DeepCopy added in v1.5.1

func (in *Backend6Value) DeepCopy() *Backend6Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend6Value.

func (*Backend6Value) DeepCopyInto added in v1.5.1

func (in *Backend6Value) DeepCopyInto(out *Backend6Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backend6Value) DeepCopyMapValue added in v1.5.1

func (in *Backend6Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Backend6Value) GetAddress added in v1.5.0

func (b *Backend6Value) GetAddress() net.IP

func (*Backend6Value) GetPort added in v1.5.0

func (b *Backend6Value) GetPort() uint16

func (*Backend6Value) GetValuePtr added in v1.5.0

func (v *Backend6Value) GetValuePtr() unsafe.Pointer

func (*Backend6Value) String added in v1.5.0

func (v *Backend6Value) String() string

func (*Backend6Value) ToNetwork added in v1.5.0

func (v *Backend6Value) ToNetwork() BackendValue

type BackendAddrID added in v1.5.0

type BackendAddrID string

BackendAddrID is the type of a service endpoint's unique identifier which consists of "IP:PORT"

type BackendKey added in v1.5.0

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 v1.5.0

type BackendValue interface {
	bpf.MapValue

	// Get backend address
	GetAddress() net.IP

	// Get backend port
	GetPort() uint16

	// Get backend address identifier (string of IP:Port)
	BackendAddrID() BackendAddrID

	// Convert fields to network byte order.
	ToNetwork() BackendValue
}

BackendValue is the interface describing protocol independent backend value.

type RRSeqValue

type RRSeqValue struct {
	// Length of Generated sequence
	Count uint16

	// Generated Sequence
	Idx idx
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func (*RRSeqValue) DeepCopy added in v1.5.1

func (in *RRSeqValue) DeepCopy() *RRSeqValue

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RRSeqValue.

func (*RRSeqValue) DeepCopyInto added in v1.5.1

func (in *RRSeqValue) DeepCopyInto(out *RRSeqValue)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RRSeqValue) DeepCopyMapValue added in v1.5.1

func (in *RRSeqValue) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*RRSeqValue) GetValuePtr

func (s *RRSeqValue) GetValuePtr() unsafe.Pointer

func (*RRSeqValue) String added in v1.5.0

func (s *RRSeqValue) String() string

type RevNat4Key

type RevNat4Key struct {
	Key uint16
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewRevNat4Key

func NewRevNat4Key(value uint16) *RevNat4Key

func (*RevNat4Key) DeepCopy added in v1.5.1

func (in *RevNat4Key) DeepCopy() *RevNat4Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevNat4Key.

func (*RevNat4Key) DeepCopyInto added in v1.5.1

func (in *RevNat4Key) DeepCopyInto(out *RevNat4Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevNat4Key) DeepCopyMapKey added in v1.5.1

func (in *RevNat4Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*RevNat4Key) GetKey

func (k *RevNat4Key) GetKey() uint16

func (*RevNat4Key) GetKeyPtr

func (k *RevNat4Key) GetKeyPtr() unsafe.Pointer

func (*RevNat4Key) IsIPv6

func (k *RevNat4Key) IsIPv6() bool

func (*RevNat4Key) Map

func (k *RevNat4Key) Map() *bpf.Map

func (*RevNat4Key) NewValue

func (k *RevNat4Key) NewValue() bpf.MapValue

func (*RevNat4Key) String

func (k *RevNat4Key) String() string

func (*RevNat4Key) ToNetwork added in v0.10.0

func (k *RevNat4Key) ToNetwork() RevNatKey

ToNetwork converts RevNat4Key to network byte order.

type RevNat4Value

type RevNat4Value struct {
	Address types.IPv4
	Port    uint16
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewRevNat4Value

func NewRevNat4Value(ip net.IP, port uint16) *RevNat4Value

func (*RevNat4Value) DeepCopy added in v1.5.1

func (in *RevNat4Value) DeepCopy() *RevNat4Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevNat4Value.

func (*RevNat4Value) DeepCopyInto added in v1.5.1

func (in *RevNat4Value) DeepCopyInto(out *RevNat4Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevNat4Value) DeepCopyMapValue added in v1.5.1

func (in *RevNat4Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*RevNat4Value) GetValuePtr

func (v *RevNat4Value) GetValuePtr() unsafe.Pointer

func (*RevNat4Value) String

func (v *RevNat4Value) String() string

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
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewRevNat6Key

func NewRevNat6Key(value uint16) *RevNat6Key

func (*RevNat6Key) DeepCopy added in v1.5.1

func (in *RevNat6Key) DeepCopy() *RevNat6Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevNat6Key.

func (*RevNat6Key) DeepCopyInto added in v1.5.1

func (in *RevNat6Key) DeepCopyInto(out *RevNat6Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevNat6Key) DeepCopyMapKey added in v1.5.1

func (in *RevNat6Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*RevNat6Key) GetKey

func (v *RevNat6Key) GetKey() uint16

func (*RevNat6Key) GetKeyPtr

func (v *RevNat6Key) GetKeyPtr() unsafe.Pointer

func (*RevNat6Key) IsIPv6

func (v *RevNat6Key) IsIPv6() bool

func (*RevNat6Key) Map

func (v *RevNat6Key) Map() *bpf.Map

func (*RevNat6Key) NewValue

func (v *RevNat6Key) NewValue() bpf.MapValue

func (*RevNat6Key) String

func (v *RevNat6Key) String() string

func (*RevNat6Key) ToNetwork added in v0.10.0

func (v *RevNat6Key) ToNetwork() RevNatKey

ToNetwork converts RevNat6Key to network byte order.

type RevNat6Value

type RevNat6Value struct {
	Address types.IPv6
	Port    uint16
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewRevNat6Value

func NewRevNat6Value(ip net.IP, port uint16) *RevNat6Value

func (*RevNat6Value) DeepCopy added in v1.5.1

func (in *RevNat6Value) DeepCopy() *RevNat6Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevNat6Value.

func (*RevNat6Value) DeepCopyInto added in v1.5.1

func (in *RevNat6Value) DeepCopyInto(out *RevNat6Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevNat6Value) DeepCopyMapValue added in v1.5.1

func (in *RevNat6Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*RevNat6Value) GetValuePtr

func (v *RevNat6Value) GetValuePtr() unsafe.Pointer

func (*RevNat6Value) String

func (v *RevNat6Value) String() string

func (*RevNat6Value) ToNetwork added in v0.10.0

func (v *RevNat6Value) ToNetwork() RevNatValue

ToNetwork converts RevNat6Value to network byte order.

type RevNatKey

type RevNatKey interface {
	bpf.MapKey

	// Returns true if the key is of type IPv6
	IsIPv6() bool

	// Returns the BPF map matching the key type
	Map() *bpf.Map

	// ToNetwork converts fields to network byte order.
	ToNetwork() RevNatKey

	// Returns the key value
	GetKey() uint16
}

type RevNatValue

type RevNatValue interface {
	bpf.MapValue

	// ToNetwork converts fields to network byte order.
	ToNetwork() RevNatValue
}

type Service4Key

type Service4Key struct {
	Address types.IPv4 `align:"address"`
	Port    uint16     `align:"dport"`
	Slave   uint16     `align:"slave"`
}

Service4Key must match 'struct lb4_key' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewService4Key

func NewService4Key(ip net.IP, port uint16, slave uint16) *Service4Key

func (*Service4Key) DeepCopy added in v1.5.1

func (in *Service4Key) DeepCopy() *Service4Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service4Key.

func (*Service4Key) DeepCopyInto added in v1.5.1

func (in *Service4Key) DeepCopyInto(out *Service4Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service4Key) DeepCopyMapKey added in v1.5.1

func (in *Service4Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Service4Key) GetBackend

func (k *Service4Key) GetBackend() int

func (*Service4Key) GetKeyPtr

func (k *Service4Key) GetKeyPtr() unsafe.Pointer

func (*Service4Key) GetPort

func (k *Service4Key) GetPort() uint16

func (Service4Key) IsIPv6

func (k Service4Key) IsIPv6() bool

func (Service4Key) Map

func (k Service4Key) Map() *bpf.Map

func (*Service4Key) MapDelete

func (k *Service4Key) MapDelete() error

func (Service4Key) NewValue

func (k Service4Key) NewValue() bpf.MapValue

func (Service4Key) RRMap

func (k Service4Key) RRMap() *bpf.Map

func (*Service4Key) RevNatValue

func (k *Service4Key) RevNatValue() RevNatValue

func (*Service4Key) SetBackend

func (k *Service4Key) SetBackend(backend int)

func (*Service4Key) SetPort

func (k *Service4Key) SetPort(port uint16)

func (*Service4Key) String

func (k *Service4Key) String() string

func (*Service4Key) ToHost added in v0.10.0

func (k *Service4Key) ToHost() ServiceKey

ToHost converts Service4Key port to network byte order.

func (*Service4Key) ToNetwork added in v0.10.0

func (k *Service4Key) ToNetwork() ServiceKey

ToNetwork converts Service4Key port to network byte order.

type Service4KeyV2 added in v1.5.0

type Service4KeyV2 struct {
	Address types.IPv4 `align:"address"`
	Port    uint16     `align:"dport"`
	Slave   uint16     `align:"slave"`
	Proto   uint8      `align:"proto"`
	Pad     pad3uint8
}

Service4KeyV2 must match 'struct lb4_key_v2' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewService4KeyV2 added in v1.5.0

func NewService4KeyV2(ip net.IP, port uint16, proto u8proto.U8proto, slave uint16) *Service4KeyV2

func (*Service4KeyV2) DeepCopy added in v1.5.1

func (in *Service4KeyV2) DeepCopy() *Service4KeyV2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service4KeyV2.

func (*Service4KeyV2) DeepCopyInto added in v1.5.1

func (in *Service4KeyV2) DeepCopyInto(out *Service4KeyV2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service4KeyV2) DeepCopyMapKey added in v1.5.1

func (in *Service4KeyV2) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Service4KeyV2) GetAddress added in v1.5.0

func (k *Service4KeyV2) GetAddress() net.IP

func (*Service4KeyV2) GetKeyPtr added in v1.5.0

func (k *Service4KeyV2) GetKeyPtr() unsafe.Pointer

func (*Service4KeyV2) GetPort added in v1.5.0

func (k *Service4KeyV2) GetPort() uint16

func (*Service4KeyV2) GetSlave added in v1.5.0

func (k *Service4KeyV2) GetSlave() int

func (*Service4KeyV2) IsIPv6 added in v1.5.0

func (k *Service4KeyV2) IsIPv6() bool

func (*Service4KeyV2) Map added in v1.5.0

func (k *Service4KeyV2) Map() *bpf.Map

func (*Service4KeyV2) MapDelete added in v1.5.0

func (k *Service4KeyV2) MapDelete() error

func (*Service4KeyV2) NewValue added in v1.5.0

func (k *Service4KeyV2) NewValue() bpf.MapValue

func (*Service4KeyV2) RRMap added in v1.5.0

func (k *Service4KeyV2) RRMap() *bpf.Map

func (*Service4KeyV2) SetSlave added in v1.5.0

func (k *Service4KeyV2) SetSlave(slave int)

func (*Service4KeyV2) String added in v1.5.0

func (k *Service4KeyV2) String() string

func (*Service4KeyV2) ToNetwork added in v1.5.0

func (k *Service4KeyV2) ToNetwork() ServiceKeyV2

type Service4Value

type Service4Value struct {
	Address types.IPv4 `align:"target"`
	Port    uint16     `align:"port"`
	Count   uint16     `align:"count"`
	RevNat  uint16     `align:"rev_nat_index"`
	Weight  uint16     `align:"weight"`
}

Service4Value must match 'struct lb4_service' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewService4Value

func NewService4Value(count uint16, target net.IP, port uint16, revNat uint16, weight uint16) *Service4Value

func (*Service4Value) BackendAddrID added in v1.5.0

func (s *Service4Value) BackendAddrID() BackendAddrID

func (*Service4Value) DeepCopy added in v1.5.1

func (in *Service4Value) DeepCopy() *Service4Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service4Value.

func (*Service4Value) DeepCopyInto added in v1.5.1

func (in *Service4Value) DeepCopyInto(out *Service4Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service4Value) DeepCopyMapValue added in v1.5.1

func (in *Service4Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Service4Value) GetAddress added in v1.6.0

func (s *Service4Value) GetAddress() net.IP

func (*Service4Value) GetCount

func (s *Service4Value) GetCount() int

func (*Service4Value) GetPort added in v1.5.0

func (s *Service4Value) GetPort() uint16

func (*Service4Value) GetValuePtr

func (s *Service4Value) GetValuePtr() unsafe.Pointer

func (*Service4Value) GetWeight

func (s *Service4Value) GetWeight() uint16

func (*Service4Value) IsIPv6 added in v1.5.0

func (s *Service4Value) IsIPv6() bool

func (*Service4Value) RevNatKey

func (s *Service4Value) RevNatKey() RevNatKey

func (*Service4Value) SetAddress

func (s *Service4Value) SetAddress(ip net.IP) error

func (*Service4Value) SetCount

func (s *Service4Value) SetCount(count int)

func (*Service4Value) SetPort

func (s *Service4Value) SetPort(port uint16)

func (*Service4Value) SetRevNat

func (s *Service4Value) SetRevNat(id int)

func (*Service4Value) SetWeight

func (s *Service4Value) SetWeight(weight uint16)

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

ToNetwork converts Service4Value to network byte order.

type Service4ValueV2 added in v1.5.0

type Service4ValueV2 struct {
	BackendID uint32 `align:"backend_id"`
	Count     uint16 `align:"count"`
	RevNat    uint16 `align:"rev_nat_index"`
	Weight    uint16 `align:"weight"`
	Pad       uint16
}

Service4ValueV2 must match 'struct lb4_service_v2' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewService4ValueV2 added in v1.5.0

func NewService4ValueV2(count uint16, backendID loadbalancer.BackendID, revNat uint16, weight uint16) *Service4ValueV2

func (*Service4ValueV2) DeepCopy added in v1.5.1

func (in *Service4ValueV2) DeepCopy() *Service4ValueV2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service4ValueV2.

func (*Service4ValueV2) DeepCopyInto added in v1.5.1

func (in *Service4ValueV2) DeepCopyInto(out *Service4ValueV2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service4ValueV2) DeepCopyMapValue added in v1.5.1

func (in *Service4ValueV2) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Service4ValueV2) GetBackendID added in v1.5.0

func (s *Service4ValueV2) GetBackendID() loadbalancer.BackendID

func (*Service4ValueV2) GetCount added in v1.5.0

func (s *Service4ValueV2) GetCount() int

func (*Service4ValueV2) GetRevNat added in v1.5.0

func (s *Service4ValueV2) GetRevNat() int

func (*Service4ValueV2) GetValuePtr added in v1.5.0

func (s *Service4ValueV2) GetValuePtr() unsafe.Pointer

func (*Service4ValueV2) GetWeight added in v1.5.0

func (s *Service4ValueV2) GetWeight() uint16

func (*Service4ValueV2) RevNatKey added in v1.5.0

func (s *Service4ValueV2) RevNatKey() RevNatKey

func (*Service4ValueV2) SetBackendID added in v1.5.0

func (s *Service4ValueV2) SetBackendID(id loadbalancer.BackendID)

func (*Service4ValueV2) SetCount added in v1.5.0

func (s *Service4ValueV2) SetCount(count int)

func (*Service4ValueV2) SetRevNat added in v1.5.0

func (s *Service4ValueV2) SetRevNat(id int)

func (*Service4ValueV2) SetWeight added in v1.5.0

func (s *Service4ValueV2) SetWeight(weight uint16)

func (*Service4ValueV2) String added in v1.5.0

func (s *Service4ValueV2) String() string

func (*Service4ValueV2) ToNetwork added in v1.5.0

func (s *Service4ValueV2) ToNetwork() ServiceValueV2

type Service6Key

type Service6Key struct {
	Address types.IPv6 `align:"address"`
	Port    uint16     `align:"dport"`
	Slave   uint16     `align:"slave"`
}

Service6Key must match 'struct lb6_key' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewService6Key

func NewService6Key(ip net.IP, port uint16, slave uint16) *Service6Key

func (*Service6Key) DeepCopy added in v1.5.1

func (in *Service6Key) DeepCopy() *Service6Key

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service6Key.

func (*Service6Key) DeepCopyInto added in v1.5.1

func (in *Service6Key) DeepCopyInto(out *Service6Key)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service6Key) DeepCopyMapKey added in v1.5.1

func (in *Service6Key) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Service6Key) GetBackend

func (k *Service6Key) GetBackend() int

func (*Service6Key) GetKeyPtr

func (k *Service6Key) GetKeyPtr() unsafe.Pointer

func (*Service6Key) GetPort

func (k *Service6Key) GetPort() uint16

func (Service6Key) IsIPv6

func (k Service6Key) IsIPv6() bool

func (Service6Key) Map

func (k Service6Key) Map() *bpf.Map

func (Service6Key) NewValue

func (k Service6Key) NewValue() bpf.MapValue

func (Service6Key) RRMap

func (k Service6Key) RRMap() *bpf.Map

func (*Service6Key) RevNatValue

func (k *Service6Key) RevNatValue() RevNatValue

func (*Service6Key) SetBackend

func (k *Service6Key) SetBackend(backend int)

func (*Service6Key) SetPort

func (k *Service6Key) SetPort(port uint16)

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

ToNetwork converts Service6Key to network byte order.

type Service6KeyV2 added in v1.5.0

type Service6KeyV2 struct {
	Address types.IPv6 `align:"address"`
	Port    uint16     `align:"dport"`
	Slave   uint16     `align:"slave"`
	Proto   uint8      `align:"proto"`
	Pad     pad3uint8
}

Service6KeyV2 must match 'struct lb6_key_v2' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey

func NewService6KeyV2 added in v1.5.0

func NewService6KeyV2(ip net.IP, port uint16, proto u8proto.U8proto, slave uint16) *Service6KeyV2

func (*Service6KeyV2) DeepCopy added in v1.5.1

func (in *Service6KeyV2) DeepCopy() *Service6KeyV2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service6KeyV2.

func (*Service6KeyV2) DeepCopyInto added in v1.5.1

func (in *Service6KeyV2) DeepCopyInto(out *Service6KeyV2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service6KeyV2) DeepCopyMapKey added in v1.5.1

func (in *Service6KeyV2) DeepCopyMapKey() bpf.MapKey

DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.

func (*Service6KeyV2) GetAddress added in v1.5.0

func (k *Service6KeyV2) GetAddress() net.IP

func (*Service6KeyV2) GetKeyPtr added in v1.5.0

func (k *Service6KeyV2) GetKeyPtr() unsafe.Pointer

func (*Service6KeyV2) GetPort added in v1.5.0

func (k *Service6KeyV2) GetPort() uint16

func (*Service6KeyV2) GetSlave added in v1.5.0

func (k *Service6KeyV2) GetSlave() int

func (*Service6KeyV2) IsIPv6 added in v1.5.0

func (k *Service6KeyV2) IsIPv6() bool

func (*Service6KeyV2) Map added in v1.5.0

func (k *Service6KeyV2) Map() *bpf.Map

func (*Service6KeyV2) MapDelete added in v1.5.0

func (k *Service6KeyV2) MapDelete() error

func (*Service6KeyV2) NewValue added in v1.5.0

func (k *Service6KeyV2) NewValue() bpf.MapValue

func (*Service6KeyV2) RRMap added in v1.5.0

func (k *Service6KeyV2) RRMap() *bpf.Map

func (*Service6KeyV2) SetSlave added in v1.5.0

func (k *Service6KeyV2) SetSlave(slave int)

func (*Service6KeyV2) String added in v1.5.0

func (k *Service6KeyV2) String() string

func (*Service6KeyV2) ToNetwork added in v1.5.0

func (k *Service6KeyV2) ToNetwork() ServiceKeyV2

type Service6Value

type Service6Value struct {
	Address types.IPv6 `align:"target"`
	Port    uint16     `align:"port"`
	Count   uint16     `align:"count"`
	RevNat  uint16     `align:"rev_nat_index"`
	Weight  uint16     `align:"weight"`
}

Service6Value must match 'struct lb6_service' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewService6Value

func NewService6Value(count uint16, target net.IP, port uint16, revNat uint16, weight uint16) *Service6Value

func (*Service6Value) BackendAddrID added in v1.5.0

func (s *Service6Value) BackendAddrID() BackendAddrID

func (*Service6Value) DeepCopy added in v1.5.1

func (in *Service6Value) DeepCopy() *Service6Value

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service6Value.

func (*Service6Value) DeepCopyInto added in v1.5.1

func (in *Service6Value) DeepCopyInto(out *Service6Value)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service6Value) DeepCopyMapValue added in v1.5.1

func (in *Service6Value) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Service6Value) GetAddress added in v1.6.0

func (s *Service6Value) GetAddress() net.IP

func (*Service6Value) GetCount

func (s *Service6Value) GetCount() int

func (*Service6Value) GetPort added in v1.5.0

func (s *Service6Value) GetPort() uint16

func (*Service6Value) GetValuePtr

func (s *Service6Value) GetValuePtr() unsafe.Pointer

func (*Service6Value) GetWeight

func (s *Service6Value) GetWeight() uint16

func (*Service6Value) IsIPv6 added in v1.5.0

func (s *Service6Value) IsIPv6() bool

func (*Service6Value) RevNatKey

func (s *Service6Value) RevNatKey() RevNatKey

func (*Service6Value) SetAddress

func (s *Service6Value) SetAddress(ip net.IP) error

func (*Service6Value) SetCount

func (s *Service6Value) SetCount(count int)

func (*Service6Value) SetPort

func (s *Service6Value) SetPort(port uint16)

func (*Service6Value) SetRevNat

func (s *Service6Value) SetRevNat(id int)

func (*Service6Value) SetWeight

func (s *Service6Value) SetWeight(weight uint16)

func (*Service6Value) String

func (s *Service6Value) String() string

func (*Service6Value) ToHost added in v0.10.0

func (s *Service6Value) ToHost() ServiceValue

ToHost converts Service6Value ports to host byte order.

func (*Service6Value) ToNetwork added in v0.10.0

func (s *Service6Value) ToNetwork() ServiceValue

ToNetwork converts Service6Value ports to network byte order.

type Service6ValueV2 added in v1.5.0

type Service6ValueV2 struct {
	BackendID uint32 `align:"backend_id"`
	Count     uint16 `align:"count"`
	RevNat    uint16 `align:"rev_nat_index"`
	Weight    uint16 `align:"weight"`
	Pad       uint16
}

Service6ValueV2 must match 'struct lb6_service_v2' in "bpf/lib/common.h". +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue

func NewService6ValueV2 added in v1.5.0

func NewService6ValueV2(count uint16, backendID loadbalancer.BackendID, revNat uint16, weight uint16) *Service6ValueV2

func (*Service6ValueV2) DeepCopy added in v1.5.1

func (in *Service6ValueV2) DeepCopy() *Service6ValueV2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service6ValueV2.

func (*Service6ValueV2) DeepCopyInto added in v1.5.1

func (in *Service6ValueV2) DeepCopyInto(out *Service6ValueV2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service6ValueV2) DeepCopyMapValue added in v1.5.1

func (in *Service6ValueV2) DeepCopyMapValue() bpf.MapValue

DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.

func (*Service6ValueV2) GetBackendID added in v1.5.0

func (s *Service6ValueV2) GetBackendID() loadbalancer.BackendID

func (*Service6ValueV2) GetCount added in v1.5.0

func (s *Service6ValueV2) GetCount() int

func (*Service6ValueV2) GetRevNat added in v1.5.0

func (s *Service6ValueV2) GetRevNat() int

func (*Service6ValueV2) GetValuePtr added in v1.5.0

func (s *Service6ValueV2) GetValuePtr() unsafe.Pointer

func (*Service6ValueV2) GetWeight added in v1.5.0

func (s *Service6ValueV2) GetWeight() uint16

func (*Service6ValueV2) RevNatKey added in v1.5.0

func (s *Service6ValueV2) RevNatKey() RevNatKey

func (*Service6ValueV2) SetBackendID added in v1.5.0

func (s *Service6ValueV2) SetBackendID(id loadbalancer.BackendID)

func (*Service6ValueV2) SetCount added in v1.5.0

func (s *Service6ValueV2) SetCount(count int)

func (*Service6ValueV2) SetRevNat added in v1.5.0

func (s *Service6ValueV2) SetRevNat(id int)

func (*Service6ValueV2) SetWeight added in v1.5.0

func (s *Service6ValueV2) SetWeight(weight uint16)

func (*Service6ValueV2) String added in v1.5.0

func (s *Service6ValueV2) String() string

func (*Service6ValueV2) ToNetwork added in v1.5.0

func (s *Service6ValueV2) ToNetwork() ServiceValueV2

type ServiceKey

type ServiceKey interface {
	bpf.MapKey

	// Returns true if the key is of type IPv6
	IsIPv6() bool

	// Returns the BPF map matching the key type
	Map() *bpf.Map

	// Returns the BPF Weighted Round Robin map matching the key type
	RRMap() *bpf.Map

	// Returns a RevNatValue matching a ServiceKey
	RevNatValue() RevNatValue

	// Returns the port set in the key or 0
	GetPort() uint16

	// Set the backend index (master: 0, backend: nth backend)
	SetBackend(int)

	// Return backend index
	GetBackend() int

	// 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.

type ServiceKeyV2 added in v1.5.0

type ServiceKeyV2 interface {
	bpf.MapKey

	// Return true if the key is of type IPv6
	IsIPv6() bool

	// Return the BPF map matching the key type
	Map() *bpf.Map

	// Return the BPF Weighted Round Robin map matching the key type
	RRMap() *bpf.Map

	// Set slave slot for the key
	SetSlave(slave int)

	// Get slave slot of the key
	GetSlave() int

	// Get frontend IP address
	GetAddress() net.IP

	// Get frontend port
	GetPort() uint16

	// Delete entry identified with the key from the matching map
	MapDelete() error

	// ToNetwork converts fields to network byte order.
	ToNetwork() ServiceKeyV2
}

ServiceKey is the interface describing protocol independent key for services map v2.

NOTE: ServiceKeyV2.String() output should match output of corresponding ServiceKey.String()!

type ServiceValue

type ServiceValue interface {
	bpf.MapValue

	// Returns a RevNatKey matching a ServiceValue
	RevNatKey() RevNatKey

	// Set the number of backends
	SetCount(int)

	// Get the number of backends
	GetCount() int

	// Set address to map to (left blank for master)
	SetAddress(net.IP) error

	// Get address to map to (left blank for master)
	GetAddress() net.IP

	// Set port to map to (left blank for master)
	SetPort(uint16)

	// Get the port number
	GetPort() uint16

	// Set reverse NAT identifier
	SetRevNat(int)

	// Set Weight
	SetWeight(uint16)

	// Get Weight
	GetWeight() uint16

	// ToNetwork converts fields to network byte order.
	ToNetwork() ServiceValue

	// ToHost converts fields to host byte order.
	ToHost() ServiceValue

	// Get BackendAddrID of the service value
	BackendAddrID() BackendAddrID

	// Returns true if the value is of type IPv6
	IsIPv6() bool
}

ServiceValue is the interface describing protocol independent value for services map.

type ServiceValueV2 added in v1.5.0

type ServiceValueV2 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 weight
	SetWeight(uint16)

	// Get weight
	GetWeight() 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() ServiceValueV2
}

ServiceValue is the interface describing protocol independent value for services map v2.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL