Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add struct of TLVs and interface of Capabilities #41

Merged
merged 1 commit into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions pkg/packet/pcep/capability.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2022 NTT Communications Corporation
//
// This software is released under the MIT License.
// see https://github.com/nttcom/pola/blob/main/LICENSE

package pcep

type CapabilityInterface interface {
TlvInterface
}

func PolaCapability() []CapabilityInterface {
return []CapabilityInterface{
&StatefulPceCapability{
LspUpdateCapability: true,
IncludeDBVersion: false,
LspInstantiationCapability: true,
TriggeredResync: false,
DeltaLspSyncCapability: false,
TriggeredInitialSync: false,
},
&PathSetupTypeCapability{
Length: uint16(10),
PathSetupTypes: Psts{PST_RSVP_TE, PST_SR_TE},
SubTlvs: []TlvInterface{
&SrPceCapability{
UnlimitedMSD: false,
SupportNAI: false,
MaximumSidDepth: uint8(16),
},
},
},
&SrPceCapability{
UnlimitedMSD: false,
SupportNAI: false,
MaximumSidDepth: uint8(16),
},
&AssocTypeList{
AssocTypes: []AssocType{AT_PATH_PROTECTION_ASSOCIATION, AT_SR_POLICY_ASSOCIATION},
},
}
}
4 changes: 2 additions & 2 deletions pkg/packet/pcep/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (m *OpenMessage) Serialize() []uint8 {
return byteOpenMessage
}

func NewOpenMessage(sessionID uint8, keepalive uint8) (*OpenMessage, error) {
oo, err := NewOpenObject(sessionID, keepalive)
func NewOpenMessage(sessionID uint8, keepalive uint8, capabilities []CapabilityInterface) (*OpenMessage, error) {
oo, err := NewOpenObject(sessionID, keepalive, capabilities)
if err != nil {
return nil, err
}
Expand Down
Loading