Skip to content

Commit

Permalink
Merge pull request #41 from nttcom/feature/PCEP_capability
Browse files Browse the repository at this point in the history
Add struct of TLVs and interface of Capabilities
  • Loading branch information
watal committed Feb 12, 2023
2 parents 4dbbf8a + 2416129 commit e08c6c3
Show file tree
Hide file tree
Showing 6 changed files with 794 additions and 310 deletions.
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

0 comments on commit e08c6c3

Please sign in to comment.