From 0f52089e8219b5bef85bab8724fe8642055148c4 Mon Sep 17 00:00:00 2001 From: Oliver Geiselhardt-Herms Date: Sun, 21 Jul 2024 20:04:32 +0200 Subject: [PATCH] ISIS: Generate L2 LSP on startup --- protocols/isis/server/server.go | 6 +++--- protocols/isis/types/isis.go | 2 +- tests/isis_integration_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protocols/isis/server/server.go b/protocols/isis/server/server.go index fd152521..d9825752 100644 --- a/protocols/isis/server/server.go +++ b/protocols/isis/server/server.go @@ -64,13 +64,13 @@ func (s *Server) Start() { s.running = true } + s.lsdbL2.updateL2LSP() + decrementTicker := clock.Ticker(time.Second) minLSPTransTicker := clock.Ticker(minimumLSPTransmissionInterval) psnpTransTicker := clock.Ticker(time.Second * 5) csnpTransTicker := clock.Ticker(csnpTransmissionInterval) s.lsdbL2.start(decrementTicker, minLSPTransTicker, psnpTransTicker, csnpTransTicker) - - return } type Adjacency struct { @@ -188,7 +188,7 @@ func (s *Server) GetInterfaceNames() []string { } // updateL2LSP updates the systems L2 LSP. This is triggered when: -// 1. Router starts up (todo) +// 1. Router starts up (done) // 2. Periodic refresh timer expired (done) // 3. A new adjacency is formed (done) // 4. An adjacency goes down (done) diff --git a/protocols/isis/types/isis.go b/protocols/isis/types/isis.go index ebf39c90..6c88758c 100644 --- a/protocols/isis/types/isis.go +++ b/protocols/isis/types/isis.go @@ -15,7 +15,7 @@ type SourceID struct { CircuitID uint8 } -func (sysID *SystemID) String() string { +func (sysID SystemID) String() string { return fmt.Sprintf("%x%x.%x%x.%x%x", sysID[0], sysID[1], sysID[2], sysID[3], sysID[4], sysID[5]) } diff --git a/tests/isis_integration_test.go b/tests/isis_integration_test.go index 4ef4c270..867bc983 100644 --- a/tests/isis_integration_test.go +++ b/tests/isis_integration_test.go @@ -232,8 +232,8 @@ var ( 0, 0x5f, // Length 7, 6, // Remaining Lifetime 12, 12, 12, 13, 13, 13, 0, 0, // LSP ID - 0, 0, 0, 2, // Sequence number - 0x54, 0xc9, // Checksum + 0, 0, 0, 3, // Sequence number + 0x52, 0xca, // Checksum 0, // Type block // TLVs 1, // Area