Documentation ¶
Index ¶
- Constants
- Variables
- func Map() maps.Map
- func MapV6() maps.Map
- func SetMapSize(size int)
- type Flags
- type Key
- type KeyInterface
- type KeyV6
- type LPM
- type MapMem
- type MapMemV6
- type Value
- type ValueInterface
- func NewValueIntf(flags Flags) ValueInterface
- func NewValueIntfWithIfIndex(flags Flags, ifIndex int) ValueInterface
- func NewValueIntfWithNextHop(flags Flags, nextHop ip.Addr) ValueInterface
- func NewValueV6Intf(flags Flags) ValueInterface
- func NewValueV6IntfWithIfIndex(flags Flags, ifIndex int) ValueInterface
- func NewValueV6IntfWithNextHop(flags Flags, nextHop ip.Addr) ValueInterface
- func ValueInftFromBytes(b []byte) ValueInterface
- func ValueV6InftFromBytes(b []byte) ValueInterface
- type ValueV6
Constants ¶
View Source
const ( FlagInIPAMPool Flags = 0x01 FlagNATOutgoing Flags = 0x02 FlagWorkload Flags = 0x04 FlagLocal Flags = 0x08 FlagHost Flags = 0x10 FlagSameSubnet Flags = 0x20 FlagTunneled Flags = 0x40 FlagNoDSR Flags = 0x80 FlagBlackHoleDrop Flags = 0x100 FlagBlackHoleReject Flags = 0x200 FlagsUnknown Flags = 0 FlagsRemoteWorkload = FlagWorkload FlagsRemoteHost = FlagHost FlagsLocalHost = FlagLocal | FlagHost FlagsLocalWorkload = FlagLocal | FlagWorkload FlagsRemoteTunneledHost = FlagsRemoteHost | FlagTunneled FlagsLocalTunneledHost = FlagsLocalHost | FlagTunneled )
View Source
const KeySize = 8
struct cali_rt_key { __u32 mask; __be32 addr; // NBO };
View Source
const KeyV6Size = 20
View Source
const ValueSize = 8
struct cali_rt_value { __u32 flags; union { __u32 next_hop; __u32 ifIndex; }; };
View Source
const ValueV6Size = 20
Variables ¶
View Source
var MapParameters = maps.MapParameters{ Type: "lpm_trie", KeySize: KeySize, ValueSize: ValueSize, MaxEntries: 256 * 1024, Name: "cali_v4_routes", Flags: unix.BPF_F_NO_PREALLOC, }
View Source
var MapV6Parameters = maps.MapParameters{ Type: "lpm_trie", KeySize: KeyV6Size, ValueSize: ValueV6Size, MaxEntries: 256 * 1024, Name: "cali_v6_routes", Flags: unix.BPF_F_NO_PREALLOC, }
Functions ¶
func SetMapSize ¶
func SetMapSize(size int)
Types ¶
type KeyInterface ¶
func KeyInftFromBytes ¶
func KeyInftFromBytes(b []byte) KeyInterface
func KeyV6InftFromBytes ¶
func KeyV6InftFromBytes(b []byte) KeyInterface
func NewKeyIntf ¶
func NewKeyIntf(cidr ip.CIDR) KeyInterface
func NewKeyV6Intf ¶
func NewKeyV6Intf(cidr ip.CIDR) KeyInterface
type LPM ¶
func (*LPM) Delete ¶
func (lpm *LPM) Delete(k KeyInterface)
func (*LPM) Update ¶
func (lpm *LPM) Update(k KeyInterface, v ValueInterface)
type Value ¶
func NewValueWithIfIndex ¶
func (Value) Equal ¶
func (v Value) Equal(x ValueInterface) bool
func (Value) IfaceIndex ¶
type ValueInterface ¶
type ValueInterface interface { Flags() Flags NextHop() ip.Addr IfaceIndex() uint32 AsBytes() []byte Equal(ValueInterface) bool }
func NewValueIntf ¶
func NewValueIntf(flags Flags) ValueInterface
func NewValueIntfWithIfIndex ¶
func NewValueIntfWithIfIndex(flags Flags, ifIndex int) ValueInterface
func NewValueIntfWithNextHop ¶
func NewValueIntfWithNextHop(flags Flags, nextHop ip.Addr) ValueInterface
func NewValueV6Intf ¶
func NewValueV6Intf(flags Flags) ValueInterface
func NewValueV6IntfWithIfIndex ¶
func NewValueV6IntfWithIfIndex(flags Flags, ifIndex int) ValueInterface
func NewValueV6IntfWithNextHop ¶
func NewValueV6IntfWithNextHop(flags Flags, nextHop ip.Addr) ValueInterface
func ValueInftFromBytes ¶
func ValueInftFromBytes(b []byte) ValueInterface
func ValueV6InftFromBytes ¶
func ValueV6InftFromBytes(b []byte) ValueInterface
type ValueV6 ¶
type ValueV6 [ValueV6Size]byte
func NewValueV6 ¶
func NewValueV6WithIfIndex ¶
func (ValueV6) Equal ¶
func (v ValueV6) Equal(x ValueInterface) bool
func (ValueV6) IfaceIndex ¶
Click to show internal directories.
Click to hide internal directories.