pcep

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MT_RESERVED     uint8 = 0x00 // RFC5440
	MT_OPEN         uint8 = 0x01 // RFC5440
	MT_KEEPALIVE    uint8 = 0x02 // RFC5440
	MT_PCREQ        uint8 = 0x03 // RFC5440
	MT_PCREP        uint8 = 0x04 // RFC5440
	MT_NOTIFICATION uint8 = 0x05 // RFC5440
	MT_ERROR        uint8 = 0x06 // RFC5440
	MT_CLOSE        uint8 = 0x07 // RFC5440
	MT_PCMONREQ     uint8 = 0x08 // RFC5886
	MT_PCMONREP     uint8 = 0x09 // RFC5886
	MT_REPORT       uint8 = 0x0a // RFC8231
	MT_UPDATE       uint8 = 0x0b // RFC8281
	MT_LSPINITREQ   uint8 = 0x0c // RFC8281
	MT_STARTTLS     uint8 = 0x0d // RFC8253
)
View Source
const (
	OC_RESERVED       uint8 = 0x00 // RFC5440
	OC_OPEN           uint8 = 0x01 // RFC5440
	OC_RP             uint8 = 0x02 // RFC5440
	OC_NO_PATH        uint8 = 0x03 // RFC5440
	OC_END_POINTS     uint8 = 0x04 // RFC5440
	OC_BANDWIDTH      uint8 = 0x05 // RFC5440
	OC_METRIC         uint8 = 0x06 // RFC5440
	OC_ERO            uint8 = 0x07 // RFC5440
	OC_RRO            uint8 = 0x08 // RFC5440
	OC_LSPA           uint8 = 0x09 // RFC5440
	OC_IRO            uint8 = 0x0a // RFC5440
	OC_SVRC           uint8 = 0x0b // RFC5440
	OC_NOTIFICATION   uint8 = 0x0c // RFC5440
	OC_PCEP_ERROR     uint8 = 0x0d // RFC5440
	OC_LOAD_BALANCING uint8 = 0x0e // RFC5440
	OC_CLOSE          uint8 = 0x0f // RFC5440
	OC_PATH_KEY       uint8 = 0x10 // RFC5520
	OC_XRO            uint8 = 0x11 // RFC5521
	// 0x12 is Unassigned
	OC_MONITORING uint8 = 0x13 // RFC5886
	OC_PCC_REQ_ID uint8 = 0x14 // RFC5886
	OC_OF         uint8 = 0x15 // RFC5541
	OC_CLASSTYPE  uint8 = 0x16 // RFC5455
	// 0x17 is Unassigned
	OC_GLOBAL_CONSTRAINTS  uint8 = 0x18 // RFC5557
	OC_PCE_ID              uint8 = 0x19 // RFC5886
	OC_PROC_TIME           uint8 = 0x1a // RFC5886
	OC_OVERLOAD            uint8 = 0x1b // RFC5886
	OC_UNREACH_DESTINATION uint8 = 0x1c // RFC8306
	OC_SERO                uint8 = 0x1d // RFC8306
	OC_SRRO                uint8 = 0x1e // RFC8306
	OC_BNC                 uint8 = 0x1f // RFC8306
	OC_LSP                 uint8 = 0x20 // RFC8231
	OC_SRP                 uint8 = 0x21 // RFC8231
	OC_VENDOR_INFORMATION  uint8 = 0x22 // RFC7470
	OC_BU                  uint8 = 0x23 // RFC8233
	OC_INTER_LAYER         uint8 = 0x24 // RFC8282
	OC_SWITCH_LAYER        uint8 = 0x25 // RFC8282
	OC_REQ_ADAP_CAP        uint8 = 0x26 // RFC8282
	OC_SERVER_INDICATION   uint8 = 0x27 // RFC8282
	OC_ASSOCIATION         uint8 = 0x28 // RFC8697
	OC_S2LS                uint8 = 0x29 // RFC8623
	OC_WA                  uint8 = 0x2a // RFC8780
	OC_FLOWSPEC            uint8 = 0x2b // RFC9168
	OC_CCI_OBJECT_TYPE     uint8 = 0x2c // RFC9050
	OC_PATH_ATTRIB         uint8 = 0x2d // draft-ietf-pce-multipath-07
)
View Source
const (
	R_NO_EXPLANATION_PROVIDED               uint8 = 0x01
	R_DEADTIMER_EXPIRED                     uint8 = 0x02
	R_RECEPTION_OF_A_MALFORMED_PCEP_MESSAGE uint8 = 0x03
)
View Source
const (
	NT_ABSENT                   uint8 = 0x00 // RFC 8664 4.3.1
	NT_IPV4_NODE                uint8 = 0x01 // RFC 8664 4.3.1
	NT_IPV6_NODE                uint8 = 0x02 // RFC 8664 4.3.1
	NT_IPV4_ADJACENCY           uint8 = 0x03 // RFC 8664 4.3.1
	NT_IPV6_ADJACENCY_GLOBAL    uint8 = 0x04 // RFC 8664 4.3.1
	NT_UNNUMBERED_ADJACENCY     uint8 = 0x05 // RFC 8664 4.3.1
	NT_IPV6_ADJACENCY_LINKLOCAL uint8 = 0x06 // RFC 8664 4.3.1
)
View Source
const (
	NT_MUST_NOT_BE_INCLUDED     uint8 = 0x00 // draft-ietf-pce-segment-routing-ipv6 4.3.1
	NT_SRV6_NODE                uint8 = 0x02 // draft-ietf-pce-segment-routing-ipv6 4.3.1
	NT_SRV6_ADJACENCY_GLOBAL    uint8 = 0x04 // draft-ietf-pce-segment-routing-ipv6 4.3.1
	NT_SRV6_ADJACENCY_LINKLOCAL uint8 = 0x06 // draft-ietf-pce-segment-routing-ipv6 4.3.1
)
View Source
const (
	OT_EP_IPV4 uint8 = 1
	OT_EP_IPV6 uint8 = 2
)

END-POINTS Object (RFC5440 7.6)

View Source
const (
	OT_ASSOC_IPV4 uint8 = 1
	OT_ASSOC_IPV6 uint8 = 2
)

ASSOCIATION Object (RFC8697 6.)

View Source
const (
	JUNIPER_SPEC_TLV_EXTENDED_ASSOCIATION_ID   uint16 = 65507
	JUNIPER_SPEC_TLV_SRPOLICY_CPATH_ID         uint16 = 65508
	JUNIPER_SPEC_TLV_SRPOLICY_CPATH_PREFERENCE uint16 = 65509

	JUNIPER_SPEC_ASSOC_TYPE_SR_POLICY_ASSOCIATION uint16 = 65505
)

Juniper specific TLV (deprecated)

View Source
const (
	EN_CISCO uint32 = 9

	CISCO_SPEC_TLV_COLOR      uint16 = 1
	CISCO_SPEC_TLV_PREFERENCE uint16 = 3

	CISCO_SPEC_TLV_COLOR_LENGTH      uint16 = 4
	CISCO_SPEC_TLV_PREFERENCE_LENGTH uint16 = 4
)
View Source
const (
	TLV_RESERVED                              uint16 = 0x00 // RFC5440
	TLV_NO_PATH_VECTOR                        uint16 = 0x01 // RFC5440
	TLV_OVERLOAD_DURATION                     uint16 = 0x02 // RFC5440
	TLV_REQ_MISSING                           uint16 = 0x03 // RFC5440
	TLV_OF_LIST                               uint16 = 0x04 // RFC5541
	TLV_ORDER                                 uint16 = 0x05 // RFC5557
	TLV_P2MP_CAPABLE                          uint16 = 0x06 // RFC8306
	TLV_VENDOR_INFORMATION                    uint16 = 0x07 // RFC7470
	TLV_WAVELENGTH_SELECTION                  uint16 = 0x08 // RFC8780
	TLV_WAVELENGTH_RESTRICTION                uint16 = 0x09 // RFC8780
	TLV_WAVELENGTH_ALLOCATION                 uint16 = 0x0a // RFC8780
	TLV_OPTICAL_INTERFACE_CLASS_LIST          uint16 = 0x0b // RFC8780
	TLV_CLIENT_SIGNAL_INFORMATION             uint16 = 0x0c // RFC8780
	TLV_H_PCE_CAPABILITY                      uint16 = 0x0d // RFC8685
	TLV_DOMAIN_ID                             uint16 = 0x0e // RFC8685
	TLV_H_PCE_FLAG                            uint16 = 0x0f // RFC8685
	TLV_STATEFUL_PCE_CAPABILITY               uint16 = 0x10 // RFC8231
	TLV_SYMBOLIC_PATH_NAME                    uint16 = 0x11 // RFC8231
	TLV_IPV4_LSP_IDENTIFIERS                  uint16 = 0x12 // RFC8231
	TLV_IPV6_LSP_IDENTIFIERS                  uint16 = 0x13 // RFC8231
	TLV_LSP_ERROR_CODE                        uint16 = 0x14 // RFC8231
	TLV_RSVP_ERROR_SPEC                       uint16 = 0x15 // RFC8231
	TLV_LSP_DB_VERSION                        uint16 = 0x17 // RFC8232
	TLV_SPEAKER_ENTITY_ID                     uint16 = 0x18 // RFC8232
	TLV_SR_PCE_CAPABILITY                     uint16 = 0x1a // RFC8664
	TLV_PATH_SETUP_TYPE                       uint16 = 0x1c // RFC8408
	TLV_OPERATOR_CONFIGURED_ASSOCIATION_RANGE uint16 = 0x1d // RFC8697
	TLV_GLOBAL_ASSOCIATION_SOURCE             uint16 = 0x1e // RFC8697
	TLV_EXTENDED_ASSOCIATION_ID               uint16 = 0x1f // RFC8697
	TLV_P2MP_IPV4_LSP_IDENTIFIERS             uint16 = 0x20 // RFC8623
	TLV_P2MP_IPV6_LSP_IDENTIFIERS             uint16 = 0x21 // RFC8623
	TLV_PATH_SETUP_TYPE_CAPABILITY            uint16 = 0x22 // RFC8409
	TLV_ASSOC_TYPE_LIST                       uint16 = 0x23 // RFC8697
	TLV_AUTO_BANDWIDTH_CAPABILITY             uint16 = 0x24 // RFC8733
	TLV_AUTO_BANDWIDTH_ATTRIBUTES             uint16 = 0x25 // RFC8733
	TLV_PATH_PROTECTION_ASSOCIATION_GROUP_TLV uint16 = 0x26 // RFC8745
	TLV_IPV4_ADDRESS                          uint16 = 0x27 // RFC8779
	TLV_IPV6_ADDRESS                          uint16 = 0x28 // RFC8779
	TLV_UNNUMBERED_ENDPOINT                   uint16 = 0x29 // RFC8779
	TLV_LABEL_REQUEST                         uint16 = 0x2a // RFC8779
	TLV_LABEL_SET                             uint16 = 0x2b // RFC8779
	TLV_PROTECTION_ATTRIBUTE                  uint16 = 0x2c // RFC8779
	TLV_GMPLS_CAPABILITY                      uint16 = 0x2d // RFC8779
	TLV_DISJOINTNESS_CONFIGURATION            uint16 = 0x2e // RFC8800
	TLV_DISJOINTNESS_STATUS                   uint16 = 0x2f // RFC8800
	TLV_POLICY_PARAMETERSjTLV                 uint16 = 0x30 // RFC9005
	TLV_SCHED_LSP_ATTRIBUTE                   uint16 = 0x31 // RFC8934
	TLV_SCHED_PD_LSP_ATTRIBUTE                uint16 = 0x32 // RFC8934
	TLV_PCE_FLOWSPEC_CAPABILITY               uint16 = 0x33 // ietf-pce-pcep-flowspec-12
	TLV_FLOW_FILTER                           uint16 = 0x34 // ietf-pce-pcep-flowspec-12
	TLV_L2_FLOW_FILTER                        uint16 = 0x35 // ietf-pce-pcep-flowspec-12
	TLV_BIDIRECTIONAL_LSP_ASSOCIATION_GROUP   uint16 = 0x36 // RFC9059
	TLV_SRPOLICY_POL_NAME                     uint16 = 0x38 // ietf-pce-segment-routing-policy-cp-07
	TLV_SRPOLICY_CPATH_ID                     uint16 = 0x39 // ietf-pce-segment-routing-policy-cp-07
	TLV_SRPOLICY_CPATH_NAME                   uint16 = 0x3a // ietf-pce-segment-routing-policy-cp-07
	TLV_SRPOLICY_CPATH_PREFERENCE             uint16 = 0x3b // ietf-pce-segment-routing-policy-cp-07
)
View Source
const (
	TLV_STATEFUL_PCE_CAPABILITY_LENGTH      uint16 = 4
	TLV_SR_PCE_CAPABILITY_LENGTH            uint16 = 4
	TLV_PATH_SETUP_TYPE_LENGTH              uint16 = 4
	TLV_EXTENDED_ASSOCIATION_ID_IPV4_LENGTH uint16 = 8
	TLV_EXTENDED_ASSOCIATION_ID_IPV6_LENGTH uint16 = 20
	TLV_IPV4_LSP_IDENTIFIERS_LENGTH         uint16 = 16
	TLV_IPV6_LSP_IDENTIFIERS_LENGTH         uint16 = 52
	TLV_SRPOLICY_CPATH_ID_LENGTH            uint16 = 28
	TLV_SRPOLICY_CPATH_PREFERENCE_LENGTH    uint16 = 4
)
View Source
const (
	ASSOC_TYPE_SR_POLICY_ASSOCIATION uint16 = 0x06
)
View Source
const COMMON_HEADER_LENGTH uint16 = 4
View Source
const COMMON_OBJECT_HEADER_LENGTH uint16 = 4
View Source
const ERO_SUBOBJECT_SR uint8 = 0x24

SR-ERO Subobject (RFC8664 4.3.1)

View Source
const ERO_SUBOBJECT_SRV6 uint8 = 0x28

SRv6-ERO Subobject (draft-ietf-pce-segment-routing-ipv6 4.3.1)

View Source
const (
	OT_CLOSE_CLOSE uint8 = 0x01
)

Close Object (RFC5440 7.17)

View Source
const (
	OT_ERO_EXPLICIT_ROUTE uint8 = 0x01
)

ERO Object (RFC5440 7.9)

View Source
const (
	OT_ERROR_ERROR uint8 = 0x01
)

PCEP Error Object (RFC5440 7.15)

View Source
const (
	OT_LSP_LSP uint8 = 0x01
)

LSP Object (RFC8281 5.3.1)

View Source
const (
	OT_OPEN_OPEN uint8 = 0x01
)

OPEN Object (RFC5440 7.3)

View Source
const (
	OT_SRP_SRP uint8 = 0x01
)

SRP Object (RFC8231 7.2)

View Source
const (
	OT_VENDOR_SPECIFIC_CONSTRAINTS uint8 = 1
)

VENDOR-INFORMATION Object (RFC7470 4)

View Source
const TL_LENGTH = 4

Variables

This section is empty.

Functions

func AppendByteSlices

func AppendByteSlices(byteSlices ...[]byte) []byte

AppendByteSlices concatenates byte slices into a single slice.

func Uint16ToByteSlice added in v1.2.1

func Uint16ToByteSlice(input uint16) []byte

Uint16ToByteSlice converts a uint16 value to a big-endian byte slice.

func Uint32ToByteSlice added in v1.2.1

func Uint32ToByteSlice(input uint32) []byte

Uint32ToByteSlice converts a uint32 value to a big-endian byte slice.

Types

type AssocType added in v1.2.0

type AssocType uint16
const (
	AT_RESERVED                                   AssocType = 0x00
	AT_PATH_PROTECTION_ASSOCIATION                AssocType = 0x01
	AT_DISCOINT_ASSOCIATION                       AssocType = 0x02
	AT_POLICY_ASSOCIATION                         AssocType = 0x03
	AT_SINGLE_SIDED_BIDIRECTIONAL_LSP_ASSOCIATION AssocType = 0x04
	AT_DOUBLE_SIDED_BIDIRECTIONAL_LSP_ASSOCIATION AssocType = 0x05
	AT_SR_POLICY_ASSOCIATION                      AssocType = 0x06
	AT_VN_ASSOCIATION_TYPE                        AssocType = 0x07
)

type AssocTypeList added in v1.2.0

type AssocTypeList struct {
	AssocTypes []AssocType
}

func (*AssocTypeList) DecodeFromBytes added in v1.2.0

func (tlv *AssocTypeList) DecodeFromBytes(data []uint8) error

func (*AssocTypeList) Len added in v1.2.0

func (tlv *AssocTypeList) Len() uint16

func (*AssocTypeList) MarshalLogObject added in v1.2.0

func (tlv *AssocTypeList) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*AssocTypeList) Serialize added in v1.2.0

func (tlv *AssocTypeList) Serialize() []uint8

func (*AssocTypeList) Type added in v1.2.0

func (tlv *AssocTypeList) Type() uint16

type AssociationObject added in v1.1.1

type AssociationObject struct {
	ObjectType uint8
	RFlag      bool
	AssocType  uint16
	AssocID    uint16
	AssocSrc   netip.Addr
	TLVs       []TLVInterface
}

func NewAssociationObject added in v1.1.1

func NewAssociationObject(srcAddr netip.Addr, dstAddr netip.Addr, color uint32, preference uint32, opt ...Opt) (*AssociationObject, error)

func (*AssociationObject) Color added in v1.1.1

func (o *AssociationObject) Color() uint32

(I.D. pce-segment-routing-policy-cp-08 5.1)

func (*AssociationObject) DecodeFromBytes added in v1.1.1

func (o *AssociationObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (AssociationObject) Len added in v1.2.1

func (o AssociationObject) Len() (uint16, error)

func (*AssociationObject) Preference added in v1.1.1

func (o *AssociationObject) Preference() uint32

(I.D. pce-segment-routing-policy-cp-08 5.1)

func (*AssociationObject) Serialize added in v1.1.1

func (o *AssociationObject) Serialize() ([]uint8, error)

type BandwidthObject

type BandwidthObject struct {
	ObjectType uint8
	Bandwidth  uint32
}

BANDWIDTH Object (RFC5440 7.7)

func (*BandwidthObject) DecodeFromBytes

func (o *BandwidthObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

type CapabilityInterface added in v1.2.0

type CapabilityInterface interface {
	TLVInterface
}

func PolaCapability added in v1.2.0

func PolaCapability() []CapabilityInterface

type CloseMessage added in v1.2.1

type CloseMessage struct {
	CloseObject *CloseObject
}

Close Message

func NewCloseMessage added in v1.2.1

func NewCloseMessage(reason uint8) (*CloseMessage, error)

func (*CloseMessage) DecodeFromBytes added in v1.2.1

func (m *CloseMessage) DecodeFromBytes(messageBody []uint8) error

func (*CloseMessage) Serialize added in v1.2.1

func (m *CloseMessage) Serialize() []uint8

type CloseObject added in v1.2.1

type CloseObject struct {
	ObjectType uint8
	Reason     uint8
}

func NewCloseObject added in v1.2.1

func NewCloseObject(reason uint8) (*CloseObject, error)

func (*CloseObject) DecodeFromBytes added in v1.2.1

func (o *CloseObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*CloseObject) Len added in v1.2.1

func (o *CloseObject) Len() uint16

func (*CloseObject) Serialize added in v1.2.1

func (o *CloseObject) Serialize() []uint8

type CommonHeader

type CommonHeader struct {
	Version       uint8 // Current version is 1
	Flag          uint8
	MessageType   uint8
	MessageLength uint16
}

Common header of PCEP Message

func NewCommonHeader

func NewCommonHeader(messageType uint8, messageLength uint16) *CommonHeader

func (*CommonHeader) DecodeFromBytes

func (h *CommonHeader) DecodeFromBytes(header []uint8) error

func (*CommonHeader) Serialize

func (h *CommonHeader) Serialize() []uint8

type CommonObjectHeader

type CommonObjectHeader struct {
	ObjectClass  uint8
	ObjectType   uint8
	ResFlags     uint8 // MUST be set to zero
	PFlag        bool  // 0: optional, 1: MUST
	IFlag        bool  // 0: processed, 1: ignored
	ObjectLength uint16
}

func NewCommonObjectHeader

func NewCommonObjectHeader(objectClass uint8, objectType uint8, messageLength uint16) *CommonObjectHeader

func (*CommonObjectHeader) DecodeFromBytes

func (h *CommonObjectHeader) DecodeFromBytes(objectHeader []uint8) error

func (*CommonObjectHeader) Serialize

func (h *CommonObjectHeader) Serialize() []uint8

type EndpointsObject

type EndpointsObject struct {
	ObjectType uint8
	SrcAddr    netip.Addr
	DstAddr    netip.Addr
}

func NewEndpointsObject

func NewEndpointsObject(dstAddr netip.Addr, srcAddr netip.Addr) (*EndpointsObject, error)

func (EndpointsObject) Len added in v1.2.1

func (o EndpointsObject) Len() (uint16, error)

func (*EndpointsObject) Serialize

func (o *EndpointsObject) Serialize() ([]uint8, error)

type EroObject

type EroObject struct {
	ObjectType    uint8
	EroSubobjects []EroSubobject
}

func NewEroObject

func NewEroObject(segmentList []table.Segment) (*EroObject, error)

func (*EroObject) AddEroSubobjects added in v1.2.0

func (o *EroObject) AddEroSubobjects(SegmentList []table.Segment) error

func (*EroObject) DecodeFromBytes

func (o *EroObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (EroObject) Len added in v1.2.1

func (o EroObject) Len() (uint16, error)

func (EroObject) Serialize

func (o EroObject) Serialize() ([]uint8, error)

func (*EroObject) ToSegmentList added in v1.2.0

func (o *EroObject) ToSegmentList() []table.Segment

type EroSubobject added in v1.2.0

type EroSubobject interface {
	DecodeFromBytes([]uint8) error
	Len() (uint16, error)
	Serialize() []uint8
	ToSegment() table.Segment
}

func NewEroSubobject added in v1.2.0

func NewEroSubobject(seg table.Segment) (EroSubobject, error)

type IPv4LspIdentifiers added in v1.2.0

type IPv4LspIdentifiers struct {
	IPv4TunnelSenderAddress   netip.Addr
	IPv4TunnelEndpointAddress netip.Addr
}

func (*IPv4LspIdentifiers) DecodeFromBytes added in v1.2.0

func (tlv *IPv4LspIdentifiers) DecodeFromBytes(data []uint8) error

func (*IPv4LspIdentifiers) Len added in v1.2.0

func (tlv *IPv4LspIdentifiers) Len() uint16

func (*IPv4LspIdentifiers) MarshalLogObject added in v1.2.0

func (tlv *IPv4LspIdentifiers) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*IPv4LspIdentifiers) Serialize added in v1.2.0

func (tlv *IPv4LspIdentifiers) Serialize() []uint8

func (*IPv4LspIdentifiers) Type added in v1.2.0

func (tlv *IPv4LspIdentifiers) Type() uint16

type IPv6LspIdentifiers added in v1.2.0

type IPv6LspIdentifiers struct {
	IPv6TunnelSenderAddress   netip.Addr
	IPv6TunnelEndpointAddress netip.Addr
}

func (*IPv6LspIdentifiers) DecodeFromBytes added in v1.2.0

func (tlv *IPv6LspIdentifiers) DecodeFromBytes(data []uint8) error

func (*IPv6LspIdentifiers) Len added in v1.2.0

func (tlv *IPv6LspIdentifiers) Len() uint16

func (*IPv6LspIdentifiers) MarshalLogObject added in v1.2.0

func (tlv *IPv6LspIdentifiers) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*IPv6LspIdentifiers) Serialize added in v1.2.0

func (tlv *IPv6LspIdentifiers) Serialize() []uint8

func (*IPv6LspIdentifiers) Type added in v1.2.0

func (tlv *IPv6LspIdentifiers) Type() uint16

type KeepaliveMessage

type KeepaliveMessage struct {
}

Keepalive Message

func NewKeepaliveMessage

func NewKeepaliveMessage() (*KeepaliveMessage, error)

func (*KeepaliveMessage) Serialize

func (m *KeepaliveMessage) Serialize() ([]uint8, error)

type LspObject

type LspObject struct {
	ObjectType uint8
	Name       string
	SrcAddr    netip.Addr
	DstAddr    netip.Addr
	PlspID     uint32
	OFlag      uint8
	AFlag      bool
	RFlag      bool
	SFlag      bool
	DFlag      bool
	TLVs       []TLVInterface
}

func NewLspObject

func NewLspObject(lspName string, plspID uint32) (*LspObject, error)

func (*LspObject) DecodeFromBytes

func (o *LspObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*LspObject) Len added in v1.2.1

func (o *LspObject) Len() uint16

func (*LspObject) Serialize

func (o *LspObject) Serialize() []uint8

type LspaObject

type LspaObject struct {
	ObjectType      uint8
	ExcludeAny      uint32
	IncludeAny      uint32
	IncludeAll      uint32
	SetupPriority   uint8
	HoldingPriority uint8
	LFlag           bool
}

LSPA Object (RFC5440 7.11)

func (*LspaObject) DecodeFromBytes

func (o *LspaObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*LspaObject) Serialize

func (o *LspaObject) Serialize() []uint8

type Message added in v1.2.1

type Message interface {
	Serialize() ([]uint8, error)
}

type MetricObject

type MetricObject struct {
	ObjectType  uint8
	CFlag       bool
	BFlag       bool
	MetricType  uint8
	MetricValue uint32
}

METRIC Object (RFC5440 7.8)

func (*MetricObject) DecodeFromBytes

func (o *MetricObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*MetricObject) Serialize

func (o *MetricObject) Serialize() []uint8

type OpenMessage

type OpenMessage struct {
	OpenObject *OpenObject
}

Open Message

func NewOpenMessage

func NewOpenMessage(sessionID uint8, keepalive uint8, capabilities []CapabilityInterface) (*OpenMessage, error)

func (*OpenMessage) DecodeFromBytes added in v1.1.1

func (m *OpenMessage) DecodeFromBytes(messageBody []uint8) error

func (*OpenMessage) Serialize

func (m *OpenMessage) Serialize() ([]uint8, error)

type OpenObject

type OpenObject struct {
	ObjectType uint8
	Version    uint8
	Flag       uint8
	Keepalive  uint8
	Deadtime   uint8
	Sid        uint8
	Caps       []CapabilityInterface
}

func NewOpenObject

func NewOpenObject(sessionID uint8, keepalive uint8, capabilities []CapabilityInterface) (*OpenObject, error)

func (*OpenObject) DecodeFromBytes

func (o *OpenObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*OpenObject) Len added in v1.2.1

func (o *OpenObject) Len() uint16

func (*OpenObject) Serialize

func (o *OpenObject) Serialize() []uint8

type Opt added in v1.1.1

type Opt func(*optParams)

func VendorSpecific added in v1.1.1

func VendorSpecific(pt PccType) Opt

type PCErrMessage added in v1.2.1

type PCErrMessage struct {
	PcepErrorObject *PcepErrorObject
}

PCErr Message

func NewPCErrMessage added in v1.2.1

func NewPCErrMessage(errorType uint8, errorValue uint8, tlvs []TLVInterface) (*PCErrMessage, error)

func (*PCErrMessage) DecodeFromBytes added in v1.2.1

func (m *PCErrMessage) DecodeFromBytes(messageBody []uint8) error

func (*PCErrMessage) Serialize added in v1.2.1

func (m *PCErrMessage) Serialize() []uint8

type PCInitiateMessage

type PCInitiateMessage struct {
	SrpObject               *SrpObject
	LspObject               *LspObject
	EndpointsObject         *EndpointsObject
	EroObject               *EroObject
	AssociationObject       *AssociationObject
	VendorInformationObject *VendorInformationObject
}

PCInitiate Message

func NewPCInitiateMessage

func NewPCInitiateMessage(srpID uint32, lspName string, segmentList []table.Segment, color uint32, preference uint32, srcAddr netip.Addr, dstAddr netip.Addr, opt ...Opt) (*PCInitiateMessage, error)

func (*PCInitiateMessage) Serialize

func (m *PCInitiateMessage) Serialize() ([]uint8, error)

type PCRptMessage

type PCRptMessage struct {
	StateReports []*StateReport
}

PCRpt Message

func NewPCRptMessage added in v1.1.1

func NewPCRptMessage() *PCRptMessage

func (*PCRptMessage) DecodeFromBytes

func (m *PCRptMessage) DecodeFromBytes(messageBody []uint8) error

type PCUpdMessage

type PCUpdMessage struct {
	SrpObject *SrpObject
	LspObject *LspObject
	EroObject *EroObject
}

PCUpdate Message

func NewPCUpdMessage

func NewPCUpdMessage(srpID uint32, lspName string, plspID uint32, segmentList []table.Segment) (*PCUpdMessage, error)

func (*PCUpdMessage) Serialize

func (m *PCUpdMessage) Serialize() ([]uint8, error)

type PathSetupType added in v1.2.0

type PathSetupType struct {
	PathSetupType Pst
}

func (*PathSetupType) DecodeFromBytes added in v1.2.0

func (tlv *PathSetupType) DecodeFromBytes(data []uint8) error

func (*PathSetupType) Len added in v1.2.0

func (tlv *PathSetupType) Len() uint16

func (*PathSetupType) MarshalLogObject added in v1.2.0

func (tlv *PathSetupType) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*PathSetupType) Serialize added in v1.2.0

func (tlv *PathSetupType) Serialize() []uint8

func (*PathSetupType) Type added in v1.2.0

func (tlv *PathSetupType) Type() uint16

type PathSetupTypeCapability added in v1.2.0

type PathSetupTypeCapability struct {
	PathSetupTypes Psts
	SubTLVs        []TLVInterface
}

func (*PathSetupTypeCapability) DecodeFromBytes added in v1.2.0

func (tlv *PathSetupTypeCapability) DecodeFromBytes(data []uint8) error

func (*PathSetupTypeCapability) Len added in v1.2.0

func (tlv *PathSetupTypeCapability) Len() uint16

func (*PathSetupTypeCapability) MarshalLogObject added in v1.2.0

func (tlv *PathSetupTypeCapability) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*PathSetupTypeCapability) Serialize added in v1.2.0

func (tlv *PathSetupTypeCapability) Serialize() []uint8

func (*PathSetupTypeCapability) Type added in v1.2.0

func (tlv *PathSetupTypeCapability) Type() uint16

type PccType added in v1.1.1

type PccType int
const (
	CISCO_LEGACY PccType = iota
	JUNIPER_LEGACY
	RFC_COMPLIANT
)

func DeterminePccType added in v1.2.0

func DeterminePccType(caps []CapabilityInterface) (pccType PccType)

Determine PCC type from capability

type PcepErrorObject added in v1.2.1

type PcepErrorObject struct {
	ObjectType uint8
	ErrorType  uint8
	ErrorValue uint8
	Tlvs       []TLVInterface
}

func NewPcepErrorObject added in v1.2.1

func NewPcepErrorObject(errorType uint8, errorValue uint8, tlvs []TLVInterface) (*PcepErrorObject, error)

func (*PcepErrorObject) DecodeFromBytes added in v1.2.1

func (o *PcepErrorObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*PcepErrorObject) Len added in v1.2.1

func (o *PcepErrorObject) Len() uint16

func (*PcepErrorObject) Serialize added in v1.2.1

func (o *PcepErrorObject) Serialize() []uint8

type Pst added in v1.2.0

type Pst uint8
const (
	PST_RSVP_TE  Pst = 0x0
	PST_SR_TE    Pst = 0x1
	PST_PCECC_TE Pst = 0x2
	PST_SRV6_TE  Pst = 0x3
)

type Psts added in v1.2.0

type Psts []Pst

func (Psts) MarshalJSON added in v1.2.0

func (ts Psts) MarshalJSON() ([]byte, error)

type SREroSubobject added in v1.2.0

type SREroSubobject struct {
	LFlag         bool
	SubobjectType uint8
	Length        uint8
	NaiType       uint8
	FFlag         bool
	SFlag         bool
	CFlag         bool
	MFlag         bool
	Segment       table.SegmentSRMPLS
	Nai           netip.Addr
}

func NewSREroSubObject added in v1.2.0

func NewSREroSubObject(seg table.SegmentSRMPLS) (*SREroSubobject, error)

func (*SREroSubobject) DecodeFromBytes added in v1.2.0

func (o *SREroSubobject) DecodeFromBytes(subObj []uint8) error

func (*SREroSubobject) Len added in v1.2.1

func (o *SREroSubobject) Len() (uint16, error)

func (*SREroSubobject) Serialize added in v1.2.0

func (o *SREroSubobject) Serialize() []uint8

func (*SREroSubobject) ToSegment added in v1.2.0

func (o *SREroSubobject) ToSegment() table.Segment

type SRPceCapability added in v1.2.0

type SRPceCapability struct {
	UnlimitedMSD    bool
	SupportNAI      bool
	MaximumSidDepth uint8
}

func (*SRPceCapability) DecodeFromBytes added in v1.2.0

func (tlv *SRPceCapability) DecodeFromBytes(data []uint8) error

func (*SRPceCapability) Len added in v1.2.0

func (tlv *SRPceCapability) Len() uint16

func (*SRPceCapability) MarshalLogObject added in v1.2.0

func (tlv *SRPceCapability) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*SRPceCapability) Serialize added in v1.2.0

func (tlv *SRPceCapability) Serialize() []uint8

func (*SRPceCapability) Type added in v1.2.0

func (tlv *SRPceCapability) Type() uint16

type SRv6EroSubobject added in v1.2.0

type SRv6EroSubobject struct {
	LFlag         bool
	SubobjectType uint8
	Length        uint8
	NaiType       uint8
	VFlag         bool
	TFlag         bool
	FFlag         bool
	SFlag         bool
	Behavior      uint16
	Segment       table.SegmentSRv6
	Nai           netip.Addr
}

func NewSRv6EroSubObject added in v1.2.0

func NewSRv6EroSubObject(seg table.SegmentSRv6) (*SRv6EroSubobject, error)

func (*SRv6EroSubobject) DecodeFromBytes added in v1.2.0

func (o *SRv6EroSubobject) DecodeFromBytes(subObj []uint8) error

func (*SRv6EroSubobject) Len added in v1.2.1

func (o *SRv6EroSubobject) Len() (uint16, error)

func (*SRv6EroSubobject) Serialize added in v1.2.0

func (o *SRv6EroSubobject) Serialize() []uint8

func (*SRv6EroSubobject) ToSegment added in v1.2.0

func (o *SRv6EroSubobject) ToSegment() table.Segment

type SrpObject

type SrpObject struct {
	ObjectType uint8
	RFlag      bool
	SrpID      uint32 // 0x00000000 and 0xFFFFFFFF are reserved.
	TLVs       []TLVInterface
}

func NewSrpObject

func NewSrpObject(segs []table.Segment, srpID uint32, isRemove bool) (*SrpObject, error)

func (*SrpObject) DecodeFromBytes

func (o *SrpObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (*SrpObject) Len added in v1.2.1

func (o *SrpObject) Len() uint16

func (*SrpObject) Serialize

func (o *SrpObject) Serialize() []uint8

type StateReport added in v1.2.0

type StateReport struct {
	SrpObject               *SrpObject
	LspObject               *LspObject
	EroObject               *EroObject
	LspaObject              *LspaObject
	MetricObjects           []*MetricObject
	BandwidthObjects        []*BandwidthObject
	AssociationObject       *AssociationObject
	VendorInformationObject *VendorInformationObject
}

func NewStateReport added in v1.2.0

func NewStateReport() (*StateReport, error)

func (*StateReport) ToSRPolicy added in v1.2.0

func (r *StateReport) ToSRPolicy(pcc PccType) table.SRPolicy

type StatefulPceCapability added in v1.2.0

type StatefulPceCapability struct {
	LspUpdateCapability        bool
	IncludeDBVersion           bool
	LspInstantiationCapability bool
	TriggeredResync            bool
	DeltaLspSyncCapability     bool
	TriggeredInitialSync       bool
}

func (*StatefulPceCapability) DecodeFromBytes added in v1.2.0

func (tlv *StatefulPceCapability) DecodeFromBytes(data []uint8) error

func (*StatefulPceCapability) Len added in v1.2.0

func (tlv *StatefulPceCapability) Len() uint16

func (*StatefulPceCapability) MarshalLogObject added in v1.2.0

func (tlv *StatefulPceCapability) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*StatefulPceCapability) Serialize added in v1.2.0

func (tlv *StatefulPceCapability) Serialize() []uint8

func (*StatefulPceCapability) Type added in v1.2.0

func (tlv *StatefulPceCapability) Type() uint16

type SymbolicPathName added in v1.2.0

type SymbolicPathName struct {
	Name string
}

func (*SymbolicPathName) DecodeFromBytes added in v1.2.0

func (tlv *SymbolicPathName) DecodeFromBytes(data []uint8) error

func (*SymbolicPathName) Len added in v1.2.0

func (tlv *SymbolicPathName) Len() uint16

func (*SymbolicPathName) MarshalLogObject added in v1.2.0

func (tlv *SymbolicPathName) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*SymbolicPathName) Serialize added in v1.2.0

func (tlv *SymbolicPathName) Serialize() []uint8

func (*SymbolicPathName) Type added in v1.2.0

func (tlv *SymbolicPathName) Type() uint16

type TLVInterface added in v1.2.1

type TLVInterface interface {
	DecodeFromBytes(data []uint8) error
	Serialize() []uint8
	MarshalLogObject(enc zapcore.ObjectEncoder) error
	Type() uint16
	Len() uint16 // Total length of Type, Length, and Value
}

func DecodeTLV added in v1.2.0

func DecodeTLV(data []uint8) (TLVInterface, error)

func DecodeTLVs added in v1.2.0

func DecodeTLVs(data []uint8) ([]TLVInterface, error)

type UndefinedTLV added in v1.2.1

type UndefinedTLV struct {
	Typ    uint16
	Length uint16
	Value  []uint8
}

func (*UndefinedTLV) DecodeFromBytes added in v1.2.1

func (tlv *UndefinedTLV) DecodeFromBytes(data []uint8) error

func (*UndefinedTLV) Len added in v1.2.1

func (tlv *UndefinedTLV) Len() uint16

func (*UndefinedTLV) MarshalLogObject added in v1.2.1

func (tlv *UndefinedTLV) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*UndefinedTLV) Serialize added in v1.2.1

func (tlv *UndefinedTLV) Serialize() []uint8

func (*UndefinedTLV) SetLength added in v1.2.1

func (tlv *UndefinedTLV) SetLength()

func (*UndefinedTLV) Type added in v1.2.1

func (tlv *UndefinedTLV) Type() uint16

type VendorInformationObject

type VendorInformationObject struct {
	ObjectType       uint8 // vendor specific constraints: 1
	EnterpriseNumber uint32
	TLVs             []TLVInterface
}

func NewVendorInformationObject

func NewVendorInformationObject(vendor PccType, color uint32, preference uint32) (*VendorInformationObject, error)

func (*VendorInformationObject) Color

func (o *VendorInformationObject) Color() uint32

func (*VendorInformationObject) DecodeFromBytes

func (o *VendorInformationObject) DecodeFromBytes(typ uint8, objectBody []uint8) error

func (VendorInformationObject) Len added in v1.2.1

func (*VendorInformationObject) Preference

func (o *VendorInformationObject) Preference() uint32

func (*VendorInformationObject) Serialize

func (o *VendorInformationObject) Serialize() []uint8

Jump to

Keyboard shortcuts

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