补充部分lsdb函数

This commit is contained in:
free will committed 2022-04-01 23:47:19 +08:00
1 parent 58c7de6ba1
commit 88beb51aaf
2 files changed
+39 -9

No files matched your search

+16
View File
@@ -8,5 +8,21 @@
package lsa
import (
"minlib/component"
"minlib/encoding"
)
type ILsa interface {
GetSeqNo() uint64
SetSeqNo(seq uint64)
GetOriginRouter() *component.Identifier
SetOriginRouter(routerIdentifier *component.Identifier)
GetExpirationTime() uint64
SetExpirationTime(time uint64)
WireEncode(encoder *encoding.Encoder) (int,error)
WireDecode(block *encoding.Block) error
}
+23 -9
View File
@@ -114,17 +114,17 @@ func (l *Lsdb) ProcessGPPkt(pkt *packet.GPPkt) {
// @return bool
//
func (l *Lsdb) GetIsBuildAdjLsaScheduled() bool {
panic("")
return l.isBuildAdjLsaScheduled
}
//
// GetSync
// @Description: 获取Sync协议类型
// @Description: 获取Sync协议逻辑处理器
// @receiver l
// @return communication.SyncLogicHandler
//
func (l *Lsdb) GetSync() communication.SyncLogicHandler {
panic("")
func (l *Lsdb) GetSync() *communication.SyncLogicHandler {
return l.sync
}
//
@@ -133,15 +133,29 @@ func (l *Lsdb) GetSync() communication.SyncLogicHandler {
// @receiver l*
// @param routerIdentifier
// @param lsaType
// @return []*lsa.ILsa
// @return *lsa.ILsa
//
func (l* Lsdb) FindLsa(routerIdentifier *component.Identifier,
lsaType lsa.LsaType) []*lsa.ILsa {
func (l *Lsdb) FindLsa(routerIdentifier *component.Identifier,
lsaType lsa.LsaType) lsa.ILsa {
panic("")
}
func (l *Lsdb) IsLsaNew() bool {
return false
//
// IsLsaNew
// @Description: 返回来自某个路由器的seq是否表示新的LSA。
// @receiver l
// @param routerIdentifier
// @param lsaType
// @param seqNo
// @return bool
//
func (l *Lsdb) IsLsaNew(routerIdentifier *component.Identifier,
lsaType lsa.LsaType,seqNo uint64) bool {
lsa := l.FindLsa(routerIdentifier,lsaType)
if lsa.GetSeqNo() >= seqNo{
return false
}
return true
}
func (l *Lsdb) InstallLsa(lsa *lsa.ILsa) {