af

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package af implements AFI, SAFI, and combinations

Index

Constants

This section is empty.

Variables

View Source
var (
	// generic errors
	ErrTODO        = errors.New("not implemented")
	ErrUnsupported = errors.New("unsupported")
	ErrType        = errors.New("invalid type")
	ErrValue       = errors.New("invalid value")
	ErrLength      = errors.New("invalid length")
	ErrShort       = errors.New("too short")
	ErrLong        = errors.New("too long")
	ErrDupe        = errors.New("duplicate")

	ErrMarker    = errors.New("marker not found")
	ErrVersion   = errors.New("invalid version")
	ErrParams    = errors.New("invalid parameters")
	ErrCaps      = errors.New("invalid capabilities")
	ErrAttrCode  = errors.New("invalid attribute code")
	ErrAttrFlags = errors.New("invalid attribute flags")
	ErrAttrs     = errors.New("invalid attributes")
	ErrSegType   = errors.New("invalid segment type")
	ErrSegLen    = errors.New("invalid segment length")
)

Functions

func AFIStrings

func AFIStrings() []string

AFIStrings returns a slice of all String values of the enum

func SAFIStrings

func SAFIStrings() []string

SAFIStrings returns a slice of all String values of the enum

Types

type AFI

type AFI uint16
const (
	AFI_IPV4            AFI = 1
	AFI_IPV6            AFI = 2
	AFI_L2VPN           AFI = 25
	AFI_MPLS_SECTION    AFI = 26
	AFI_MPLS_LSP        AFI = 27
	AFI_MPLS_PSEUDOWIRE AFI = 28
	AFI_MT_IPV4         AFI = 29
	AFI_MT_IPV6         AFI = 30
	AFI_SFC             AFI = 31
	AFI_LS              AFI = 16388
	AFI_ROUTING_POLICY  AFI = 16398
	AFI_MPLS_NAMESPACES AFI = 16399
)

func AFIString

func AFIString(s string) (AFI, error)

AFIString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func AFIValues

func AFIValues() []AFI

AFIValues returns all values of the enum

func NewAFIBytes

func NewAFIBytes(buf []byte) AFI

NewAFIBytes reads AFI from wire representation in buf

func (AFI) IsAAFI

func (i AFI) IsAAFI() bool

IsAAFI returns "true" if the value is listed in the enum definition. "false" otherwise

func (AFI) String

func (i AFI) String() string

type AS

type AS uint32

AS represents AFI+SAFI as afi(16) + 0(8) + safi(8)

func NewAS

func NewAS(afi AFI, safi SAFI) AS

NewAS returns AS for given Afi and Safi

func NewASBytes

func NewASBytes(buf []byte) AS

NewASBytes reads AS from wire representation in buf

func (AS) Afi

func (as AS) Afi() AFI

func (*AS) FromJSON

func (as *AS) FromJSON(src []byte) error

func (AS) Marshal3

func (as AS) Marshal3(dst []byte) []byte

Marshal3 marshals AS as 3 bytes

func (AS) Safi

func (as AS) Safi() SAFI

func (AS) ToJSON

func (as AS) ToJSON(dst []byte) []byte

func (AS) ToJSONKey

func (as AS) ToJSONKey(dst []byte, key string) []byte

type ASV

type ASV uint64

ASV represents AFI+SAFI+VAL as afi(16) + 0(8) + safi(8) + val(32)

func NewASV

func NewASV(afi AFI, safi SAFI, val uint32) ASV

func (ASV) Afi

func (asv ASV) Afi() AFI

func (*ASV) FromJSONAfi

func (asv *ASV) FromJSONAfi(src []byte) error

FromJSONAfi interprets Val as an AFI

func (ASV) Safi

func (asv ASV) Safi() SAFI

func (ASV) ToJSONAfi

func (asv ASV) ToJSONAfi(dst []byte) []byte

ToJSONAfi interprets Val as an AFI

func (ASV) Val

func (asv ASV) Val() uint32

type SAFI

type SAFI uint8
const (
	SAFI_UNICAST             SAFI = 1
	SAFI_MULTICAST           SAFI = 2
	SAFI_MPLS                SAFI = 4
	SAFI_MCAST_VPN           SAFI = 5
	SAFI_PLACEMENT_MSPW      SAFI = 6
	SAFI_MCAST_VPLS          SAFI = 8
	SAFI_SFC                 SAFI = 9
	SAFI_TUNNEL              SAFI = 64
	SAFI_VPLS                SAFI = 65
	SAFI_MDT                 SAFI = 66
	SAFI_4OVER6              SAFI = 67
	SAFI_6OVER4              SAFI = 68
	SAFI_L1VPN_DISCOVERY     SAFI = 69
	SAFI_EVPNS               SAFI = 70
	SAFI_LS                  SAFI = 71
	SAFI_LS_VPN              SAFI = 72
	SAFI_SR_TE_POLICY        SAFI = 73
	SAFI_SD_WAN_CAPABILITIES SAFI = 74
	SAFI_ROUTING_POLICY      SAFI = 75
	SAFI_CLASSFUL_TRANSPORT  SAFI = 76
	SAFI_TUNNELED_FLOWSPEC   SAFI = 77
	SAFI_MCAST_TREE          SAFI = 78
	SAFI_DPS                 SAFI = 79
	SAFI_LS_SPF              SAFI = 80
	SAFI_CAR                 SAFI = 83
	SAFI_VPN_CAR             SAFI = 84
	SAFI_MUP                 SAFI = 85
	SAFI_MPLS_VPN            SAFI = 128
	SAFI_MULTICAST_VPNS      SAFI = 129
	SAFI_ROUTE_TARGET        SAFI = 132
	SAFI_FLOWSPEC            SAFI = 133
	SAFI_L3VPN_FLOWSPEC      SAFI = 134
	SAFI_VPN_DISCOVERY       SAFI = 140
)

func SAFIString

func SAFIString(s string) (SAFI, error)

SAFIString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func SAFIValues

func SAFIValues() []SAFI

SAFIValues returns all values of the enum

func (SAFI) IsASAFI

func (i SAFI) IsASAFI() bool

IsASAFI returns "true" if the value is listed in the enum definition. "false" otherwise

func (SAFI) String

func (i SAFI) String() string

Jump to

Keyboard shortcuts

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