srv6

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

https://github.com/vishvananda/netlink/blob/master/nl/seg6_linux.go

https://github.com/vishvananda/netlink/blob/master/nl/seg6local_linux.go

Index

Constants

View Source
const (
	STR_TXPort         = "tx_port"
	STR_TransitTablev4 = "transit_table_v4"
	STR_TransitTablev6 = "transit_table_v6"
	STR_FunctionTable  = "function_table"
	STR_V6addrHeep     = "v6addr_heep"
)
View Source
const (
	SEG6_IPTUN_MODE_INLINE = iota
	SEG6_IPTUN_MODE_ENCAP
	SEG6_IPTUN_MODE_L2ENCAP
	SEG6_IPTUN_MODE_ENCAP_T_M_GTP6_D
	SEG6_IPTUN_MODE_ENCAP_T_M_GTP6_D_Di
	SEG6_IPTUN_MODE_ENCAP_H_M_GTP4_D
)

seg6 encap mode

View Source
const (
	SEG6_LOCAL_UNSPEC = iota
	SEG6_LOCAL_ACTION
	SEG6_LOCAL_SRH
	SEG6_LOCAL_TABLE
	SEG6_LOCAL_NH4
	SEG6_LOCAL_NH6
	SEG6_LOCAL_IIF
	SEG6_LOCAL_OIF
)

seg6local parameters

View Source
const (
	SEG6_LOCAL_FLAVER_NONE = iota + 1 // 1
	SEG6_LOCAL_FLAVER_PSP
	SEG6_LOCAL_FLAVER_USP
	SEG6_LOCAL_FLAVER_USD
)

seg6End Functions Flaver

View Source
const (
	SEG6_LOCAL_ACTION_END           = iota + 1 // 1
	SEG6_LOCAL_ACTION_END_X                    // 2
	SEG6_LOCAL_ACTION_END_T                    // 3
	SEG6_LOCAL_ACTION_END_DX2                  // 4
	SEG6_LOCAL_ACTION_END_DX6                  // 5
	SEG6_LOCAL_ACTION_END_DX4                  // 6
	SEG6_LOCAL_ACTION_END_DT6                  // 7
	SEG6_LOCAL_ACTION_END_DT4                  // 8
	SEG6_LOCAL_ACTION_END_B6                   // 9
	SEG6_LOCAL_ACTION_END_B6_ENCAPS            // 10
	SEG6_LOCAL_ACTION_END_BM                   // 11
	SEG6_LOCAL_ACTION_END_S                    // 12
	SEG6_LOCAL_ACTION_END_AS                   // 13
	SEG6_LOCAL_ACTION_END_AM                   // 14
	SEG6_LOCAL_ACTION_END_M_GTP6_E
	SEG6_LOCAL_ACTION_END_M_GTP4_E
)

seg6local actions

View Source
const MAX_SEGMENTS = 5
View Source
const MaxTxportDevice = 64
View Source
const (
	SEG6_GTPV1_LOC_FUNCTION_MAXSIZE = 56 // == 128 - v4addr(32) - args(40)
)
View Source
const (
	SEG6_IPTUN_MODE_MAX = __SEG6_IPTUN_MODE_MAX
)
View Source
const (
	SEG6_LOCAL_ACTION_MAX = __SEG6_LOCAL_ACTION_MAX - 1
)
View Source
const (
	SEG6_LOCAL_FLAVER_MAX = __SEG6_LOCAL_FLAVER_MAX
)
View Source
const (
	SEG6_LOCAL_MAX = __SEG6_LOCAL_MAX
)

Variables

Functions

func Seg6EncapModeInt

func Seg6EncapModeInt(name string) (uint32, error)

func Seg6EncapModeString

func Seg6EncapModeString(mode int) (string, error)

Helper functions

func Seg6LocalActionInt

func Seg6LocalActionInt(name string) (uint32, error)

Helper functions

func Seg6LocalActionString

func Seg6LocalActionString(action int) (string, error)

Helper functions

func Seg6LocalFlaverInt

func Seg6LocalFlaverInt(name string) (uint32, error)

Helper functions

func Seg6LocalFlaverString

func Seg6LocalFlaverString(action int) (string, error)

Helper functions

Types

type FunctionTable

type FunctionTable struct {
	StartSaddr [16]uint8
	Nexthop    [16]uint8
	Function   uint32
	Flaver     uint32
	V4AddrSPos uint32
	V4AddrDPos uint32
}

type FunctionTableKey

type FunctionTableKey struct {
	Prefixlen uint32
	Daddr     [16]uint8
}

type FunctionTablesMap

type FunctionTablesMap struct {
	FD  int
	Map *ebpf.Map
}

func LoadFunctionTables

func LoadFunctionTables() (*FunctionTablesMap, error)

func MappingFunctionTable

func MappingFunctionTable(m *ebpf.Map) *FunctionTablesMap

func NewFunctionTable

func NewFunctionTable(coll *ebpf.Collection) (*FunctionTablesMap, error)

func (*FunctionTablesMap) Delete

func (m *FunctionTablesMap) Delete(ip [16]byte, prefix uint32) error

func (*FunctionTablesMap) Get

func (m *FunctionTablesMap) Get(ip [16]byte, prefix uint32) (*FunctionTable, error)

func (*FunctionTablesMap) List

func (m *FunctionTablesMap) List() ([]*FunctionTable, error)

func (*FunctionTablesMap) Pin

func (m *FunctionTablesMap) Pin() error

func (*FunctionTablesMap) Unpin

func (m *FunctionTablesMap) Unpin() error

func (*FunctionTablesMap) Update

func (m *FunctionTablesMap) Update(fn FunctionTable, ip [16]byte, prefix uint32) error

type IPv6SrHdr

type IPv6SrHdr struct {
	Segments []net.IP
	// contains filtered or unexported fields
}

type TransitTablev4

type TransitTablev4 struct {
	Saddr         [16]byte
	Daddr         [16]byte
	SPrefixlen    uint32
	DPrefixlen    uint32
	SegmentLength uint32
	Action        uint32
	Segments      [MAX_SEGMENTS][16]byte
}

type TransitTablev4Key

type TransitTablev4Key struct {
	Prefixlen uint32
	Daddr     [4]byte
}

type TransitTablev4sMap

type TransitTablev4sMap struct {
	FD  int
	Map *ebpf.Map
}

func LoadTransitTablev4

func LoadTransitTablev4() (*TransitTablev4sMap, error)

func MappingTransitTablev4

func MappingTransitTablev4(m *ebpf.Map) *TransitTablev4sMap

func NewTransitTablev4

func NewTransitTablev4(coll *ebpf.Collection) (*TransitTablev4sMap, error)

func (*TransitTablev4sMap) Pin

func (m *TransitTablev4sMap) Pin() error

func (*TransitTablev4sMap) Unpin

func (m *TransitTablev4sMap) Unpin() error

func (*TransitTablev4sMap) Update

func (m *TransitTablev4sMap) Update(v4table TransitTablev4, ip [4]byte, prefix uint32) error

type TransitTablev6

type TransitTablev6 struct {
	Saddr         [16]byte
	Daddr         [16]byte
	SPrefixlen    uint32
	DPrefixlen    uint32
	SegmentLength uint32
	Action        uint32
	Segments      [MAX_SEGMENTS][16]byte
}

type TransitTablev6Key

type TransitTablev6Key struct {
	Prefixlen uint32
	Daddr     [16]byte
}

type TransitTablev6sMap

type TransitTablev6sMap struct {
	FD  int
	Map *ebpf.Map
}

func LoadTransitTablev6

func LoadTransitTablev6() (*TransitTablev6sMap, error)

func MappingTransitTablev6

func MappingTransitTablev6(m *ebpf.Map) *TransitTablev6sMap

func NewTransitTablev6

func NewTransitTablev6(coll *ebpf.Collection) (*TransitTablev6sMap, error)

func (*TransitTablev6sMap) Pin

func (m *TransitTablev6sMap) Pin() error

func (*TransitTablev6sMap) Unpin

func (m *TransitTablev6sMap) Unpin() error

func (*TransitTablev6sMap) Update

func (m *TransitTablev6sMap) Update(v4table TransitTablev6, ip [16]byte, prefix uint32) error

type TxPort

type TxPort struct {
	Iface uint32
}

type TxPortKey

type TxPortKey struct {
	Iface uint32
}

type TxPortsMap

type TxPortsMap struct {
	FD  int
	Map *ebpf.Map
}

func LoadTxPort

func LoadTxPort() (*TxPortsMap, error)

func MappingTxPort

func MappingTxPort(m *ebpf.Map) *TxPortsMap

func NewTxPort

func NewTxPort(coll *ebpf.Collection) (*TxPortsMap, error)

func (*TxPortsMap) Get

func (m *TxPortsMap) Get(iface int) (*TxPort, error)

func (*TxPortsMap) Pin

func (m *TxPortsMap) Pin() error

func (*TxPortsMap) Unpin

func (m *TxPortsMap) Unpin() error

func (*TxPortsMap) Update

func (m *TxPortsMap) Update(txp TxPort, iface int) error

type V6addrHeep

type V6addrHeep struct {
	Saddr [16]byte
	Daddr [16]byte
}

type V6addrHeepMap

type V6addrHeepMap struct {
	FD  int
	Map *ebpf.Map
}

func MappingV6addrHeep

func MappingV6addrHeep(m *ebpf.Map) *V6addrHeepMap

func NewV6addrHeep

func NewV6addrHeep(coll *ebpf.Collection) (*V6addrHeepMap, error)

func (*V6addrHeepMap) Pin

func (m *V6addrHeepMap) Pin() error

func (*V6addrHeepMap) Unpin

func (m *V6addrHeepMap) Unpin() error

func (*V6addrHeepMap) Update

func (m *V6addrHeepMap) Update(heep []*V6addrHeep, vkey int) error

Jump to

Keyboard shortcuts

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