srv6map

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

+groupName=maps

Index

Constants

View Source
const (
	PolicyMapName4   = "cilium_srv6_policy_v4"
	PolicyMapName6   = "cilium_srv6_policy_v6"
	MaxPolicyEntries = 16384
)
View Source
const (
	SIDMapName    = "cilium_srv6_sid"
	MaxSIDEntries = 16384
)
View Source
const (
	StateMapName4   = "cilium_srv6_state_v4"
	StateMapName6   = "cilium_srv6_state_v6"
	MaxStateEntries = 16384
)
View Source
const (
	VRFMapName4   = "cilium_srv6_vrf_v4"
	VRFMapName6   = "cilium_srv6_vrf_v6"
	MaxVRFEntries = 16384
)

Variables

View Source
var (
	SRv6PolicyMap4 *srv6PolicyMap
	SRv6PolicyMap6 *srv6PolicyMap
)
View Source
var (
	SRv6StateMap4 *srv6StateMap
	SRv6StateMap6 *srv6StateMap
)
View Source
var (
	SRv6VRFMap4 *srv6VRFMap
	SRv6VRFMap6 *srv6VRFMap
)
View Source
var (
	SRv6SIDMap *srv6SIDMap
)

Functions

func CreateMaps

func CreateMaps()

func CreatePolicyMaps

func CreatePolicyMaps() error

func CreateSIDMap

func CreateSIDMap() error

func CreateVRFMaps

func CreateVRFMaps() error

func OpenPolicyMaps

func OpenPolicyMaps() error

func OpenSIDMap

func OpenSIDMap() error

func OpenStateMaps

func OpenStateMaps() error

func OpenVRFMaps

func OpenVRFMaps() error

Types

type PolicyKey

type PolicyKey struct {
	VRFID    uint32
	DestCIDR *net.IPNet
}

Generic policy key for IPv4 and IPv6.

func (*PolicyKey) Match

func (k *PolicyKey) Match(vrfID uint32, cidr *net.IPNet) bool

Match returns true if the vrfID and destCIDR parameters match the SRv6 policy key.

func (*PolicyKey) String

func (k *PolicyKey) String() string

type PolicyKey4

type PolicyKey4 struct {
	// PrefixLen is full 32 bits of VRF ID + DestCIDR's mask bits
	PrefixLen uint32 `align:"lpm"`

	VRFID    uint32     `align:"vrf_id"`
	DestCIDR types.IPv4 `align:"dst_cidr"`
}

type PolicyKey6

type PolicyKey6 struct {
	// PrefixLen is full 32 bits of VRF ID + DestCIDR's mask bits
	PrefixLen uint32 `align:"lpm"`

	VRFID    uint32     `align:"vrf_id"`
	DestCIDR types.IPv6 `align:"dst_cidr"`
}

type PolicyValue

type PolicyValue struct {
	SID types.IPv6
}

func (*PolicyValue) String

func (v *PolicyValue) String() string

String pretty print the SID.

type SIDKey

type SIDKey struct {
	SID types.IPv6
}

func NewSIDKey

func NewSIDKey(sid types.IPv6) SIDKey

func NewSIDKeyFromIP

func NewSIDKeyFromIP(ip *net.IP) (*SIDKey, error)

func (*SIDKey) String

func (k *SIDKey) String() string

type SIDValue

type SIDValue struct {
	VRFID uint32
}

type SRv6PolicyIterateCallback

type SRv6PolicyIterateCallback func(*PolicyKey, *PolicyValue)

SRv6PolicyIterateCallback represents the signature of the callback function expected by the IterateWithCallback method, which in turn is used to iterate all the keys/values of an SRv6 policy map.

type SRv6SIDIterateCallback

type SRv6SIDIterateCallback func(*SIDKey, *SIDValue)

SRv6SIDIterateCallback represents the signature of the callback function expected by the IterateWithCallback method, which in turn is used to iterate all the keys/values of an SRv6 SID map.

type SRv6StateIterateCallback

type SRv6StateIterateCallback func(*StateKey, *StateValue)

SRv6StateIterateCallback represents the signature of the callback function expected by the IterateWithCallback method, which in turn is used to iterate all the keys/values of an SRv6 state map.

type SRv6VRFIterateCallback

type SRv6VRFIterateCallback func(*VRFKey, *VRFValue)

SRv6VRFIterateCallback represents the signature of the callback function expected by the IterateWithCallback method, which in turn is used to iterate all the keys/values of an SRv6 policy map.

type StateKey

type StateKey struct {
	InnerSrc *net.IP
	InnerDst *net.IP
}

Generic SRv6 state key for IPv4 and IPv6.

func (*StateKey) String

func (k *StateKey) String() string

type StateKey4

type StateKey4 struct {
	InnerSrc types.IPv4
	InnerDst types.IPv4
}

type StateKey6

type StateKey6 struct {
	InnerSrc types.IPv6
	InnerDst types.IPv6
}

type StateValue

type StateValue struct {
	OuterSrc *net.IP
	OuterDst *net.IP
}

StateValue implements the bpf.MapValue interface. It contains the SRv6 outer IPs for the state maps.

func (*StateValue) String

func (v *StateValue) String() string

String pretty prints the state outer IPs.

type VRFKey

type VRFKey struct {
	SourceIP *net.IP
	DestCIDR *net.IPNet
}

Generic VRF mapping key for IPv4 and IPv6.

func (*VRFKey) Match

func (k *VRFKey) Match(srcIP net.IP, cidr *net.IPNet) bool

Match returns true if the sourceIP and destCIDR parameters match the SRv6 policy key.

func (*VRFKey) String

func (k *VRFKey) String() string

type VRFKey4

type VRFKey4 struct {
	// PrefixLen is full 32 bits of VRF ID + DestCIDR's mask bits
	PrefixLen uint32 `align:"lpm"`

	SourceIP types.IPv4 `align:"src_ip"`
	DestCIDR types.IPv4 `align:"dst_cidr"`
}

type VRFKey6

type VRFKey6 struct {
	// PrefixLen is full 32 bits of VRF ID + DestCIDR's mask bits
	PrefixLen uint32 `align:"lpm"`

	SourceIP types.IPv6 `align:"src_ip"`
	DestCIDR types.IPv6 `align:"dst_cidr"`
}

type VRFValue

type VRFValue struct {
	ID uint32
}

VRFValue implements the bpf.MapValue interface. It contains the VRF ID for SRv6 lookups.

func (*VRFValue) String

func (v *VRFValue) String() string

String pretty prints the VRF ID.

Jump to

Keyboard shortcuts

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