Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeDatabaseDescriptionData(data []byte, dbd_data *ospfDatabaseDescriptionData, pktlen uint16)
- func NewOspfDatabaseDescriptionData() *ospfDatabaseDescriptionData
- func NewospfNeighborLSDBMsg() *ospfNeighborLSDBMsg
- func OSPFNewLogger(name string, tag string, listenToConfig bool) (*logging.Writer, error)
- type ASExtTOSDetail
- type ASExternalLsa
- type AdjOKEvtMsg
- type AreaConf
- type AreaConfKey
- type AreaIdKey
- type AreaRoutingTbl
- type AreaState
- type AsicdClient
- type BackupSeenMsg
- type ClientJson
- type DbEventMsg
- type DbLsdbMsg
- type DbRouteMsg
- type DestType
- type DrChangeMsg
- type DstIPType
- type EthHdrMetadata
- type GlobalConf
- type GlobalRoutingTblEntry
- type IPIntfProperty
- type IPv4IntfNotifyMsg
- type IfData
- type IntfConf
- type IntfConfKey
- type IntfRxHandle
- type IntfToNeighMsg
- type IntfTxHandle
- type IpHdrMetadata
- type IpProperty
- type LSAChangeMsg
- type LSDatabase
- type LinkDetail
- type LogicalIntfProperty
- type LsaHeader
- type LsaKey
- type LsaMetadata
- type LsaOp
- type LsdbKey
- type LsdbSliceEnt
- type LsdbUpdateMsg
- type NbrFullStateMsg
- type NbrIP
- type NbrMsgType
- type NbrStateChangeMsg
- type NeighChangeMsg
- type NeighCreateMsg
- type NeighborConfKey
- type NeighborData
- type NetworkLSAChangeMsg
- type NetworkLsa
- type NextHop
- type OSPFHeader
- type OSPFHelloData
- type OSPFServer
- func (server *OSPFServer) AddIPv4RoutesState(entry RoutingTblEntryKey) error
- func (server *OSPFServer) AddLsdbEntry(entry LsdbSliceEnt) error
- func (server *OSPFServer) AddOspfEventState(eventType string, eventInfo string) error
- func (server *OSPFServer) BuildAndSendLSAReq(nbrId NeighborConfKey, nbrConf OspfNeighborEntry) (curr_index uint8)
- func (server *OSPFServer) BuildDBDPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, ...) (data []byte)
- func (server *OSPFServer) BuildHelloPkt(ent IntfConf) []byte
- func (server *OSPFServer) BuildLSAAckPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, ...) (data []byte)
- func (server *OSPFServer) BuildLsaUpdPkt(intfKey IntfConfKey, ent IntfConf, dstMAC net.HardwareAddr, dstIp net.IP, ...) (data []byte)
- func (server *OSPFServer) BuildOspfInfra()
- func (server *OSPFServer) CalcASBorderRoutes(areaId uint32)
- func (server *OSPFServer) CalcInterAreaRoutes(areaId uint32)
- func (server *OSPFServer) CheckNeighborFullEvent(nbrKey NeighborConfKey)
- func (server *OSPFServer) CompareRoutes(rKey RoutingTblEntryKey) bool
- func (server *OSPFServer) ConnectToClients(paramsFile string)
- func (server *OSPFServer) ConsolidatingRoutingTbl()
- func (server *OSPFServer) ConstructAndSendDbdPacket(nbrKey NeighborConfKey, ibit bool, mbit bool, msbit bool, options uint8, ...) (dbd_mdata ospfDatabaseDescriptionData, last_exchange bool)
- func (server *OSPFServer) CreateAndSendHelloRecvdMsg(routerId uint32, ipHdrMd *IpHdrMetadata, ospfHdrMd *OspfHdrMetadata, ...)
- func (server *OSPFServer) CreateAreaGraph(areaId uint32) (VertexKey, error)
- func (server *OSPFServer) DecodeLSAAck(msg ospfNeighborLSAAckMsg)
- func (server *OSPFServer) DecodeLSAReq(msg ospfNeighborLSAreqMsg)
- func (server *OSPFServer) DecodeLSAUpd(msg ospfNeighborLSAUpdMsg)
- func (server *OSPFServer) DelIPv4RoutesState(entry RoutingTblEntryKey) error
- func (server *OSPFServer) DelLsdbEntry(entry LsdbSliceEnt) error
- func (server *OSPFServer) DelOspfEventState(entry config.OspfEventState) error
- func (server *OSPFServer) DeleteRoute(rKey RoutingTblEntryKey)
- func (server *OSPFServer) ElectBDR(key IntfConfKey) ([]byte, uint32)
- func (server *OSPFServer) ElectBDRAndDR(key IntfConfKey)
- func (server *OSPFServer) ElectDR(key IntfConfKey, electedBDR []byte, electedBDRtrId uint32) ([]byte, uint32)
- func (server *OSPFServer) EncodeLSAReqPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, ...) (data []byte)
- func (server *OSPFServer) ExecuteDijkstra(vKey VertexKey, areaId uint32) error
- func (server *OSPFServer) GenerateDefaultSummary3LSA(lsDbKey LsdbKey) (LsaKey, SummaryLsa)
- func (server *OSPFServer) GenerateSummaryLsa()
- func (server *OSPFServer) GenerateType3SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)
- func (server *OSPFServer) GenerateType4SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)
- func (server *OSPFServer) GetBulkOspfAreaEntryState(idx int, cnt int) (int, int, []config.AreaState)
- func (server *OSPFServer) GetBulkOspfIfEntryState(idx int, cnt int) (int, int, []config.InterfaceState)
- func (server *OSPFServer) GetBulkOspfLsdbEntryState(idx int, cnt int) (int, int, []config.LsdbState)
- func (server *OSPFServer) GetBulkOspfNbrEntryState(idx int, cnt int) (int, int, []config.NeighborState)
- func (server *OSPFServer) GetOspfGlobalState() *config.GlobalState
- func (server *OSPFServer) HandleASExternalLsa(areaId uint32)
- func (server *OSPFServer) HandleStubs(vKey VertexKey, areaId uint32)
- func (server *OSPFServer) HandleSummaryLsa(areaId uint32)
- func (server *OSPFServer) HandleSummaryType3Lsa(areaId uint32)
- func (server *OSPFServer) HandleSummaryType4Lsa(areaId uint32)
- func (server *OSPFServer) HandleTransitAreaSummaryLsa()
- func (server *OSPFServer) InitDBChannels()
- func (server *OSPFServer) InitNeighborStateMachine()
- func (server *OSPFServer) InitServer(paramFile string)
- func (server *OSPFServer) InitializeDB() error
- func (server *OSPFServer) InstallRoute(rKey RoutingTblEntryKey)
- func (server *OSPFServer) InstallRoutingTbl()
- func (server *OSPFServer) ProcessNbrStateMachine()
- func (server *OSPFServer) ProcessOspfRecvPkt(key IntfConfKey, pkt gopacket.Packet)
- func (server *OSPFServer) ProcessRibdRoutes(route ribdInt.Routes, msgType uint16)
- func (server *OSPFServer) ProcessRxDbdPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, ...) error
- func (server *OSPFServer) ProcessRxLSAAckPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, ...) error
- func (server *OSPFServer) ProcessRxLSAReqPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, ...) error
- func (server *OSPFServer) ProcessRxLsaUpdPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, ...) error
- func (server *OSPFServer) ProcessRxNbrPkt()
- func (server *OSPFServer) ProcessTxNbrPkt()
- func (server *OSPFServer) ReadOspfCfgFromDB()
- func (server *OSPFServer) SendOspfPkt(key IntfConfKey, ospfPkt []byte) error
- func (server *OSPFServer) SendRouterLsa(areaId uint32, intfKey IntfConfKey, lsaKey LsaKey) []byte
- func (server *OSPFServer) SendSelfOrigLSA(areaId uint32, intfKey IntfConfKey) []byte
- func (server *OSPFServer) StartDBListener()
- func (server *OSPFServer) StartLSDatabase()
- func (server *OSPFServer) StartOspfBroadcastIntfFSM(key IntfConfKey)
- func (server *OSPFServer) StartOspfIntfFSM(key IntfConfKey)
- func (server *OSPFServer) StartOspfP2PIntfFSM(key IntfConfKey)
- func (server *OSPFServer) StartOspfRecvPkts(key IntfConfKey)
- func (server *OSPFServer) StartSendHelloPkt(key IntfConfKey)
- func (server *OSPFServer) StartSendRecvPkts(intfConfKey IntfConfKey)
- func (server *OSPFServer) StartServer(paramFile string)
- func (server *OSPFServer) StopLSDatabase()
- func (server *OSPFServer) StopOspfIntfFSM(key IntfConfKey)
- func (server *OSPFServer) StopOspfRecvPkts(key IntfConfKey)
- func (server *OSPFServer) StopSendHelloPkt(key IntfConfKey)
- func (server *OSPFServer) StopSendRecvPkts(intfConfKey IntfConfKey)
- func (server *OSPFServer) UpdateAreaGraphNetworkLsa(lsaEnt NetworkLsa, lsaKey LsaKey, areaId uint32) error
- func (server *OSPFServer) UpdateAreaGraphRouterLsa(lsaEnt RouterLsa, lsaKey LsaKey, areaId uint32) error
- func (server *OSPFServer) UpdateIPv4Infra(msg asicdCommonDefs.IPv4IntfNotifyMsg, msgType uint8)
- func (server *OSPFServer) UpdateLogicalIntfInfra(msg asicdCommonDefs.LogicalIntfNotifyMsg, msgType uint8)
- func (server *OSPFServer) UpdateMtu(ifIndex int32, mtu int32)
- func (server *OSPFServer) UpdateNeighborConf()
- func (server *OSPFServer) UpdateNeighborList(nbrKey NeighborConfKey)
- func (server *OSPFServer) UpdateRoute(rKey RoutingTblEntryKey)
- func (server *OSPFServer) UpdateRoutingTbl(vKey VertexKey, areaId uint32)
- func (server *OSPFServer) UpdateRoutingTblForRouter(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)
- func (server *OSPFServer) UpdateRoutingTblForTNetwork(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)
- func (server *OSPFServer) UpdateRoutingTblWithStub(areaId uint32, vKey VertexKey, tVertex TreeVertex, parent TreeVertex, ...)
- func (server *OSPFServer) UpdateVlanInfra(msg asicdCommonDefs.VlanNotifyMsg, msgType uint8)
- type OspfClientBase
- type OspfHdrMetadata
- type OspfNeighborEntry
- type OspfType
- type Path
- type PathType
- type PortProperty
- type RibdClient
- type RouteMdata
- type RouterLsa
- type RoutingTblEntry
- type RoutingTblEntryKey
- type RoutingTblKey
- type SelfOrigLsa
- type StubVertex
- type SummaryLsa
- type SummaryLsaMap
- type SummaryTOSDetail
- type TOSDetail
- type TreeVertex
- type Vertex
- type VertexData
- type VertexDataArr
- type VertexKey
- type VlanProperty
Constants ¶
const ( OSPF_HELLO_MIN_SIZE = 20 OSPF_DBD_MIN_SIZE = 8 OSPF_LSA_HEADER_SIZE = 20 OSPF_LSA_REQ_SIZE = 12 OSPF_LSA_ACK_SIZE = 20 OSPF_HEADER_SIZE = 24 IP_HEADER_MIN_LEN = 20 OSPF_PROTO_ID = 89 OSPF_VERSION_2 = 2 OSPF_NO_OF_LSA_FIELD = 4 )
const ( EOption = 0x02 MCOption = 0x04 NPOption = 0x08 EAOption = 0x20 DCOption = 0x40 )
const ( LsdbEntryFound = 0 LsdbEntryNotFound = 1 )
const ( RouterLSA uint8 = 1 NetworkLSA uint8 = 2 Summary3LSA uint8 = 3 Summary4LSA uint8 = 4 ASExternalLSA uint8 = 5 )
const ( LsdbAdd uint8 = 0 LsdbDel uint8 = 1 LsdbUpdate uint8 = 2 LsdbNoAction uint8 = 3 )
const ( P2PLink uint8 = 1 TransitLink uint8 = 2 StubLink uint8 = 3 VirtualLink uint8 = 4 )
const ( NBRADD = 0 NBRUPD = 1 NBRDEL = 2 )
const ( LSAFLOOD = 0 // flood when FULL state reached LSASELFLOOD = 1 // flood for received LSA LSAINTF = 2 // Send LSA on the interface in reply to LSAREQ LSAAGE = 3 // flood aged LSAs. LSASUMMARYFLOOD = 4 //flood summary LSAs in different areas. LSAEXTFLOOD = 5 //flood AS External summary LSA LSAROUTERFLOOD = 6 //flood only router LSA )
const ( RouterVertex uint8 = 0 SNetworkVertex uint8 = 1 // Stub TNetworkVertex uint8 = 2 // Transit )
const ( SUCCESS = 0 FAIL = 1 )
const ( MODX int = 4102 FLETCHER_CHECKSUM_VALIDATE uint16 = 0xffff )
const (
DEFAULT_VLAN_COST uint32 = 10
)
const (
FloodLsa uint8 = LsdbNoAction + 1
)
const INTF_MTU_MIN = 1500
TODO
remote hardcoding and get it while config.
const INTF_OPTIONS = 66
const LSA_MAX_AGE uint16 = 0x7fff
const LSA_MAX_AGE_DIFF uint16 = 0x7fff
const (
RxDBDInterval = 5
)
Variables ¶
var ALLDROUTER string = "224.0.0.6"
var ALLDROUTERMAC string = "01:00:5e:00:00:06"
var ALLSPFROUTER string = "224.0.0.5"
var ALLSPFROUTERMAC string = "01:00:5e:00:00:05"
var DBEventSeq int32
var INVALID_NEIGHBOR_CONF_KEY uint32
var InitialSequenceNumber int = 0x80000001
var LSInfinity uint32 = 0x00ffffff
var LSSequenceNumber int = InitialSequenceNumber
var MASKMAC string = "ff:ff:ff:ff:ff:ff"
var MaxSequenceNumber int = 0x7fffffff
var OspfNeighborLastDbd map[NeighborConfKey]ospfDatabaseDescriptionData
Global structures for Neighbor
Functions ¶
func NewOspfDatabaseDescriptionData ¶
func NewOspfDatabaseDescriptionData() *ospfDatabaseDescriptionData
func NewospfNeighborLSDBMsg ¶
func NewospfNeighborLSDBMsg() *ospfNeighborLSDBMsg
Types ¶
type ASExtTOSDetail ¶
type ASExternalLsa ¶
type ASExternalLsa struct { LsaMd LsaMetadata Netmask uint32 /* Network Mask */ BitE bool Metric uint32 /* But only max value 2^24-1 */ FwdAddr uint32 ExtRouteTag uint32 ASExtTOSDetails []ASExtTOSDetail }
LS Type 5
func NewASExternalLsa ¶
func NewASExternalLsa() *ASExternalLsa
type AdjOKEvtMsg ¶
type AreaConf ¶
type AreaConf struct { AuthType config.AuthType ImportAsExtern config.ImportAsExtern AreaSummary config.AreaSummary StubDefaultCost int32 AreaNssaTranslatorRole config.NssaTranslatorRole TransitCapability bool IntfListMap map[IntfConfKey]bool }
TODO - Add list of interfaces for this Area
type AreaConfKey ¶
type AreaRoutingTbl ¶
type AreaRoutingTbl struct {
RoutingTblMap map[RoutingTblEntryKey]RoutingTblEntry
}
type AsicdClient ¶
type AsicdClient struct { OspfClientBase ClientHdl *asicdServices.ASICDServicesClient }
type BackupSeenMsg ¶
type ClientJson ¶
type DbEventMsg ¶
type DbEventMsg struct {
// contains filtered or unexported fields
}
type DbRouteMsg ¶
type DbRouteMsg struct {
// contains filtered or unexported fields
}
type DrChangeMsg ¶
type DrChangeMsg struct {
// contains filtered or unexported fields
}
type EthHdrMetadata ¶
type EthHdrMetadata struct {
// contains filtered or unexported fields
}
func NewEthHdrMetadata ¶
func NewEthHdrMetadata() *EthHdrMetadata
type GlobalConf ¶
type GlobalConf struct { RouterId []byte AdminStat config.Status ASBdrRtrStatus bool TOSSupport bool ExtLsdbLimit int32 MulticastExtensions int32 ExitOverflowInterval config.PositiveInteger DemandExtensions bool RFC1583Compatibility bool ReferenceBandwidth uint32 RestartSupport config.RestartSupport RestartInterval int32 RestartStrictLsaChecking bool StubRouterAdvertisement config.AdvertiseAction Version uint8 AreaBdrRtrStatus bool ExternLsaCount int32 ExternLsaChecksum int32 OriginateNewLsas int32 RxNewLsas int32 OpaqueLsaSupport bool RestartStatus config.RestartStatus RestartAge int32 RestartExitReason config.RestartExitReason AsLsaCount int32 AsLsaCksumSum int32 StubRouterSupport bool //DiscontinuityTime string DiscontinuityTime int32 // This should be string // contains filtered or unexported fields }
type GlobalRoutingTblEntry ¶
type GlobalRoutingTblEntry struct { AreaId uint32 // Area RoutingTblEnt RoutingTblEntry }
type IPIntfProperty ¶
type IPv4IntfNotifyMsg ¶
type IntfConf ¶
type IntfConf struct { IfAreaId []byte IfType config.IfType IfAdminStat config.Status IfRtrPriority uint8 IfTransitDelay config.UpToMaxAge IfRetransInterval config.UpToMaxAge IfHelloInterval uint16 IfRtrDeadInterval uint32 IfPollInterval config.PositiveInteger IfAuthKey []byte IfMulticastForwarding config.MulticastForwarding IfDemand bool IfAuthType uint16 FSMCtrlCh chan bool FSMCtrlStatusCh chan bool HelloIntervalTicker *time.Ticker BackupSeenCh chan BackupSeenMsg NeighborMap map[NeighborConfKey]NeighborData NeighCreateCh chan NeighCreateMsg NeighChangeCh chan NeighChangeMsg NbrStateChangeCh chan NbrStateChangeMsg NbrFullStateCh chan NbrFullStateMsg WaitTimer *time.Timer /* IntefaceState: Start */ IfDRIp []byte IfBDRIp []byte IfFSMState config.IfState IfEvents int32 IfLsaCount int32 IfLsaCksumSum int32 IfDRtrId uint32 IfBDRtrId uint32 /* IntefaceState: End */ IfName string IfIpAddr net.IP IfMacAddr net.HardwareAddr IfNetmask []byte IfMtu int32 IfCost uint32 IfMetricTOSMap map[uint8]uint32 // Key: TOS Value, Value: TOS Metric }
type IntfConfKey ¶
type IntfConfKey struct { IPAddr config.IpAddress IntfIdx config.InterfaceIndexOrZero }
type IntfRxHandle ¶
type IntfToNeighMsg ¶
type IpHdrMetadata ¶
type IpHdrMetadata struct {
// contains filtered or unexported fields
}
func NewIpHdrMetadata ¶
func NewIpHdrMetadata() *IpHdrMetadata
type IpProperty ¶
type LSAChangeMsg ¶
type LSAChangeMsg struct {
// contains filtered or unexported fields
}
type LSDatabase ¶
type LSDatabase struct { RouterLsaMap map[LsaKey]RouterLsa NetworkLsaMap map[LsaKey]NetworkLsa Summary3LsaMap map[LsaKey]SummaryLsa Summary4LsaMap map[LsaKey]SummaryLsa ASExternalLsaMap map[LsaKey]ASExternalLsa }
type LinkDetail ¶
type LogicalIntfProperty ¶
type LogicalIntfProperty struct { Name string MacAddr net.HardwareAddr }
type LsaHeader ¶
type LsaHeader struct { LSAge uint16 Options uint8 LSType uint8 LinkId uint32 Adv_router uint32 LSSequenceNum uint32 LSChecksum uint16 // contains filtered or unexported fields }
func NewLsaHeader ¶
func NewLsaHeader() *LsaHeader
type LsaKey ¶
type LsaMetadata ¶
type LsdbSliceEnt ¶
type LsdbUpdateMsg ¶
func NewLsdbUpdateMsg ¶
func NewLsdbUpdateMsg() *LsdbUpdateMsg
type NbrFullStateMsg ¶
type NbrMsgType ¶
type NbrMsgType uint32
type NbrStateChangeMsg ¶
type NbrStateChangeMsg struct {
// contains filtered or unexported fields
}
type NeighChangeMsg ¶
type NeighCreateMsg ¶
type NeighborConfKey ¶
type NeighborConfKey struct { IPAddr config.IpAddress IntfIdx config.InterfaceIndexOrZero }
type NeighborData ¶
type NetworkLSAChangeMsg ¶
type NetworkLSAChangeMsg struct {
// contains filtered or unexported fields
}
type NetworkLsa ¶
type NetworkLsa struct { LsaMd LsaMetadata Netmask uint32 /* Network Mask */ AttachedRtr []uint32 }
LS Type 2
func NewNetworkLsa ¶
func NewNetworkLsa() *NetworkLsa
type OSPFHeader ¶
type OSPFHeader struct {
// contains filtered or unexported fields
}
func NewOSPFHeader ¶
func NewOSPFHeader() *OSPFHeader
type OSPFHelloData ¶
type OSPFHelloData struct {
// contains filtered or unexported fields
}
func NewOSPFHelloData ¶
func NewOSPFHelloData() *OSPFHelloData
type OSPFServer ¶
type OSPFServer struct { GlobalConfigCh chan config.GlobalConf AreaConfigCh chan config.AreaConf IntfConfigCh chan config.InterfaceConf IfMetricConfCh chan config.IfMetricConf GlobalConfigRetCh chan error AreaConfigRetCh chan error IntfConfigRetCh chan error AreaLsdb map[LsdbKey]LSDatabase LsdbSlice []LsdbSliceEnt LsdbStateTimer *time.Timer AreaSelfOrigLsa map[LsdbKey]SelfOrigLsa LsdbUpdateCh chan LsdbUpdateMsg LsaUpdateRetCodeCh chan bool IntfStateChangeCh chan NetworkLSAChangeMsg NetworkDRChangeCh chan DrChangeMsg FlushNetworkLSACh chan NetworkLSAChangeMsg CreateNetworkLSACh chan ospfNbrMdata AdjOKEvtCh chan AdjOKEvtMsg ExternalRouteNotif chan RouteMdata AreaConfMap map[AreaConfKey]AreaConf IntfConfMap map[IntfConfKey]IntfConf IntfTxMap map[IntfConfKey]IntfTxHandle IntfRxMap map[IntfConfKey]IntfRxHandle NeighborConfigMap map[NeighborConfKey]OspfNeighborEntry NeighborListMap map[IntfConfKey]list.List AreaStateTimer *time.Timer AreaStateMutex sync.RWMutex AreaStateMap map[AreaConfKey]AreaState AreaStateSlice []AreaConfKey AreaConfKeyToSliceIdxMap map[AreaConfKey]int IntfKeySlice []IntfConfKey IntfKeyToSliceIdxMap map[IntfConfKey]bool IntfStateTimer *time.Timer IntfSliceRefreshCh chan bool IntfSliceRefreshDoneCh chan bool RefreshDuration time.Duration TempAreaRoutingTbl map[AreaIdKey]AreaRoutingTbl GlobalRoutingTbl map[RoutingTblEntryKey]GlobalRoutingTblEntry OldGlobalRoutingTbl map[RoutingTblEntryKey]GlobalRoutingTblEntry TempGlobalRoutingTbl map[RoutingTblEntryKey]GlobalRoutingTblEntry SummaryLsDb map[LsdbKey]SummaryLsaMap StartCalcSPFCh chan bool DoneCalcSPFCh chan bool AreaGraph map[VertexKey]Vertex SPFTree map[VertexKey]TreeVertex AreaStubs map[VertexKey]StubVertex DbReadConfig chan bool DbRouteOp chan DbRouteMsg DbLsdbOp chan DbLsdbMsg DbEventOp chan DbEventMsg // contains filtered or unexported fields }
func NewOSPFServer ¶
func NewOSPFServer(logger *logging.Writer) *OSPFServer
func (*OSPFServer) AddIPv4RoutesState ¶
func (server *OSPFServer) AddIPv4RoutesState(entry RoutingTblEntryKey) error
func (*OSPFServer) AddLsdbEntry ¶
func (server *OSPFServer) AddLsdbEntry(entry LsdbSliceEnt) error
func (*OSPFServer) AddOspfEventState ¶
func (server *OSPFServer) AddOspfEventState(eventType string, eventInfo string) error
func (*OSPFServer) BuildAndSendLSAReq ¶
func (server *OSPFServer) BuildAndSendLSAReq(nbrId NeighborConfKey, nbrConf OspfNeighborEntry) (curr_index uint8)
func (*OSPFServer) BuildDBDPkt ¶
func (server *OSPFServer) BuildDBDPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, dbdData ospfDatabaseDescriptionData, dstMAC net.HardwareAddr) (data []byte)
func (*OSPFServer) BuildHelloPkt ¶
func (server *OSPFServer) BuildHelloPkt(ent IntfConf) []byte
func (*OSPFServer) BuildLSAAckPkt ¶
func (server *OSPFServer) BuildLSAAckPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, dstMAC net.HardwareAddr, dstIp net.IP, lsa_pkt_size int, lsaAckEnc []byte) (data []byte)
func (server *OSPFServer) encodeLSAAck
func (*OSPFServer) BuildLsaUpdPkt ¶
func (server *OSPFServer) BuildLsaUpdPkt(intfKey IntfConfKey, ent IntfConf, dstMAC net.HardwareAddr, dstIp net.IP, lsa_pkt_size int, lsaUpdEnc []byte) (data []byte)
func (*OSPFServer) BuildOspfInfra ¶
func (server *OSPFServer) BuildOspfInfra()
func (*OSPFServer) CalcASBorderRoutes ¶
func (server *OSPFServer) CalcASBorderRoutes(areaId uint32)
func (*OSPFServer) CalcInterAreaRoutes ¶
func (server *OSPFServer) CalcInterAreaRoutes(areaId uint32)
Handling Summary LSA in case of FS is internal router
func (*OSPFServer) CheckNeighborFullEvent ¶
func (server *OSPFServer) CheckNeighborFullEvent(nbrKey NeighborConfKey)
func (*OSPFServer) CompareRoutes ¶
func (server *OSPFServer) CompareRoutes(rKey RoutingTblEntryKey) bool
Compare Old and New Route
func (*OSPFServer) ConnectToClients ¶
func (server *OSPFServer) ConnectToClients(paramsFile string)
func (*OSPFServer) ConsolidatingRoutingTbl ¶
func (server *OSPFServer) ConsolidatingRoutingTbl()
func (*OSPFServer) ConstructAndSendDbdPacket ¶
func (*OSPFServer) CreateAndSendHelloRecvdMsg ¶
func (server *OSPFServer) CreateAndSendHelloRecvdMsg(routerId uint32, ipHdrMd *IpHdrMetadata, ospfHdrMd *OspfHdrMetadata, nbrDeadInterval time.Duration, ifType config.IfType, TwoWayStatus bool, rtrPrio uint8, key IntfConfKey)
func (*OSPFServer) CreateAreaGraph ¶
func (server *OSPFServer) CreateAreaGraph(areaId uint32) (VertexKey, error)
func (*OSPFServer) DecodeLSAAck ¶
func (server *OSPFServer) DecodeLSAAck(msg ospfNeighborLSAAckMsg)
func (*OSPFServer) DecodeLSAReq ¶
func (server *OSPFServer) DecodeLSAReq(msg ospfNeighborLSAreqMsg)
func (*OSPFServer) DecodeLSAUpd ¶
func (server *OSPFServer) DecodeLSAUpd(msg ospfNeighborLSAUpdMsg)
func (*OSPFServer) DelIPv4RoutesState ¶
func (server *OSPFServer) DelIPv4RoutesState(entry RoutingTblEntryKey) error
func (*OSPFServer) DelLsdbEntry ¶
func (server *OSPFServer) DelLsdbEntry(entry LsdbSliceEnt) error
func (*OSPFServer) DelOspfEventState ¶
func (server *OSPFServer) DelOspfEventState(entry config.OspfEventState) error
func (*OSPFServer) DeleteRoute ¶
func (server *OSPFServer) DeleteRoute(rKey RoutingTblEntryKey)
func (*OSPFServer) ElectBDR ¶
func (server *OSPFServer) ElectBDR(key IntfConfKey) ([]byte, uint32)
func (*OSPFServer) ElectBDRAndDR ¶
func (server *OSPFServer) ElectBDRAndDR(key IntfConfKey)
func (*OSPFServer) ElectDR ¶
func (server *OSPFServer) ElectDR(key IntfConfKey, electedBDR []byte, electedBDRtrId uint32) ([]byte, uint32)
func (*OSPFServer) EncodeLSAReqPkt ¶
func (server *OSPFServer) EncodeLSAReqPkt(intfKey IntfConfKey, ent IntfConf, nbrConf OspfNeighborEntry, lsa_req_pkt []ospfLSAReq, dstMAC net.HardwareAddr) (data []byte)
func (*OSPFServer) ExecuteDijkstra ¶
func (server *OSPFServer) ExecuteDijkstra(vKey VertexKey, areaId uint32) error
func (*OSPFServer) GenerateDefaultSummary3LSA ¶
func (server *OSPFServer) GenerateDefaultSummary3LSA(lsDbKey LsdbKey) (LsaKey, SummaryLsa)
@fn GenerateDefaultSummary3LSA
RFC 2328 A 4.4 For stub areas, Type 3 summary-LSAs can also be used to describe a (per-area) default route. Default summary routes are used in stub areas instead of flooding a complete set of external routes. When describing a default summary route, the summary-LSA's Link State ID is always set to DefaultDestination (0.0.0.0) and the Network Mask is set to 0.0.0.0.
func (*OSPFServer) GenerateSummaryLsa ¶
func (server *OSPFServer) GenerateSummaryLsa()
func (*OSPFServer) GenerateType3SummaryLSA ¶
func (server *OSPFServer) GenerateType3SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)
func (*OSPFServer) GenerateType4SummaryLSA ¶
func (server *OSPFServer) GenerateType4SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)
func (*OSPFServer) GetBulkOspfAreaEntryState ¶
func (*OSPFServer) GetBulkOspfIfEntryState ¶
func (server *OSPFServer) GetBulkOspfIfEntryState(idx int, cnt int) (int, int, []config.InterfaceState)
func (*OSPFServer) GetBulkOspfLsdbEntryState ¶
func (*OSPFServer) GetBulkOspfNbrEntryState ¶
func (server *OSPFServer) GetBulkOspfNbrEntryState(idx int, cnt int) (int, int, []config.NeighborState)
func (*OSPFServer) GetOspfGlobalState ¶
func (server *OSPFServer) GetOspfGlobalState() *config.GlobalState
func (*OSPFServer) HandleASExternalLsa ¶
func (server *OSPFServer) HandleASExternalLsa(areaId uint32)
func (*OSPFServer) HandleStubs ¶
func (server *OSPFServer) HandleStubs(vKey VertexKey, areaId uint32)
func (*OSPFServer) HandleSummaryLsa ¶
func (server *OSPFServer) HandleSummaryLsa(areaId uint32)
func (*OSPFServer) HandleSummaryType3Lsa ¶
func (server *OSPFServer) HandleSummaryType3Lsa(areaId uint32)
func (*OSPFServer) HandleSummaryType4Lsa ¶
func (server *OSPFServer) HandleSummaryType4Lsa(areaId uint32)
func (*OSPFServer) HandleTransitAreaSummaryLsa ¶
func (server *OSPFServer) HandleTransitAreaSummaryLsa()
func (*OSPFServer) InitDBChannels ¶
func (server *OSPFServer) InitDBChannels()
func (*OSPFServer) InitNeighborStateMachine ¶
func (server *OSPFServer) InitNeighborStateMachine()
func (*OSPFServer) InitServer ¶
func (server *OSPFServer) InitServer(paramFile string)
func (*OSPFServer) InitializeDB ¶
func (server *OSPFServer) InitializeDB() error
func (*OSPFServer) InstallRoute ¶
func (server *OSPFServer) InstallRoute(rKey RoutingTblEntryKey)
func (*OSPFServer) InstallRoutingTbl ¶
func (server *OSPFServer) InstallRoutingTbl()
func (*OSPFServer) ProcessNbrStateMachine ¶
func (server *OSPFServer) ProcessNbrStateMachine()
func (*OSPFServer) ProcessOspfRecvPkt ¶
func (server *OSPFServer) ProcessOspfRecvPkt(key IntfConfKey, pkt gopacket.Packet)
func (*OSPFServer) ProcessRibdRoutes ¶
func (server *OSPFServer) ProcessRibdRoutes(route ribdInt.Routes, msgType uint16)
@fn ProcessRibdRoutes Send notif to LSDB to generate/delete AS external LSA
func (*OSPFServer) ProcessRxDbdPkt ¶
func (server *OSPFServer) ProcessRxDbdPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, key IntfConfKey, srcMAC net.HardwareAddr) error
func (*OSPFServer) ProcessRxLSAAckPkt ¶
func (server *OSPFServer) ProcessRxLSAAckPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, key IntfConfKey) error
func (*OSPFServer) ProcessRxLSAReqPkt ¶
func (server *OSPFServer) ProcessRxLSAReqPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, key IntfConfKey) error
@fn ProcessRxLSAReqPkt Send Lsa req packet meta data to Rx packet thread
func (*OSPFServer) ProcessRxLsaUpdPkt ¶
func (server *OSPFServer) ProcessRxLsaUpdPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, key IntfConfKey) error
func (*OSPFServer) ProcessRxNbrPkt ¶
func (server *OSPFServer) ProcessRxNbrPkt()
@fn ProcessRxNbrPkt
Nbr packet Rx thread. It handles LSA REQ/UPD/ACK in.
func (*OSPFServer) ProcessTxNbrPkt ¶
func (server *OSPFServer) ProcessTxNbrPkt()
@fn ProcessTxNbrPkt
Nbr packet out thread. It handles LSA REQ/UPD/ACK out , DBD packets out signalling the LSA generation
func (*OSPFServer) ReadOspfCfgFromDB ¶
func (server *OSPFServer) ReadOspfCfgFromDB()
func (*OSPFServer) SendOspfPkt ¶
func (server *OSPFServer) SendOspfPkt(key IntfConfKey, ospfPkt []byte) error
func (*OSPFServer) SendRouterLsa ¶
func (server *OSPFServer) SendRouterLsa(areaId uint32, intfKey IntfConfKey, lsaKey LsaKey) []byte
@fn sendRouterLsa At the event of interface down need to flood updated router LSA.
func (*OSPFServer) SendSelfOrigLSA ¶
func (server *OSPFServer) SendSelfOrigLSA(areaId uint32, intfKey IntfConfKey) []byte
@fn SendSelfOrigLSA Api is called When adjacency is established DR/BDR change
func (*OSPFServer) StartDBListener ¶
func (server *OSPFServer) StartDBListener()
func (*OSPFServer) StartLSDatabase ¶
func (server *OSPFServer) StartLSDatabase()
func (*OSPFServer) StartOspfBroadcastIntfFSM ¶
func (server *OSPFServer) StartOspfBroadcastIntfFSM(key IntfConfKey)
func (*OSPFServer) StartOspfIntfFSM ¶
func (server *OSPFServer) StartOspfIntfFSM(key IntfConfKey)
func (*OSPFServer) StartOspfP2PIntfFSM ¶
func (server *OSPFServer) StartOspfP2PIntfFSM(key IntfConfKey)
func (*OSPFServer) StartOspfRecvPkts ¶
func (server *OSPFServer) StartOspfRecvPkts(key IntfConfKey)
func (*OSPFServer) StartSendHelloPkt ¶
func (server *OSPFServer) StartSendHelloPkt(key IntfConfKey)
func (*OSPFServer) StartSendRecvPkts ¶
func (server *OSPFServer) StartSendRecvPkts(intfConfKey IntfConfKey)
func (*OSPFServer) StartServer ¶
func (server *OSPFServer) StartServer(paramFile string)
func (*OSPFServer) StopLSDatabase ¶
func (server *OSPFServer) StopLSDatabase()
func (*OSPFServer) StopOspfIntfFSM ¶
func (server *OSPFServer) StopOspfIntfFSM(key IntfConfKey)
func (*OSPFServer) StopOspfRecvPkts ¶
func (server *OSPFServer) StopOspfRecvPkts(key IntfConfKey)
func (*OSPFServer) StopSendHelloPkt ¶
func (server *OSPFServer) StopSendHelloPkt(key IntfConfKey)
func (*OSPFServer) StopSendRecvPkts ¶
func (server *OSPFServer) StopSendRecvPkts(intfConfKey IntfConfKey)
func (*OSPFServer) UpdateAreaGraphNetworkLsa ¶
func (server *OSPFServer) UpdateAreaGraphNetworkLsa(lsaEnt NetworkLsa, lsaKey LsaKey, areaId uint32) error
func (*OSPFServer) UpdateAreaGraphRouterLsa ¶
func (server *OSPFServer) UpdateAreaGraphRouterLsa(lsaEnt RouterLsa, lsaKey LsaKey, areaId uint32) error
func (*OSPFServer) UpdateIPv4Infra ¶
func (server *OSPFServer) UpdateIPv4Infra(msg asicdCommonDefs.IPv4IntfNotifyMsg, msgType uint8)
func (*OSPFServer) UpdateLogicalIntfInfra ¶
func (server *OSPFServer) UpdateLogicalIntfInfra(msg asicdCommonDefs.LogicalIntfNotifyMsg, msgType uint8)
func (*OSPFServer) UpdateMtu ¶
func (server *OSPFServer) UpdateMtu(ifIndex int32, mtu int32)
func (*OSPFServer) UpdateNeighborConf ¶
func (server *OSPFServer) UpdateNeighborConf()
@fn UpdateNeighborConf Thread to update/add/delete neighbor global struct.
func (*OSPFServer) UpdateNeighborList ¶
func (server *OSPFServer) UpdateNeighborList(nbrKey NeighborConfKey)
func (*OSPFServer) UpdateRoute ¶
func (server *OSPFServer) UpdateRoute(rKey RoutingTblEntryKey)
func (*OSPFServer) UpdateRoutingTbl ¶
func (server *OSPFServer) UpdateRoutingTbl(vKey VertexKey, areaId uint32)
func (*OSPFServer) UpdateRoutingTblForRouter ¶
func (server *OSPFServer) UpdateRoutingTblForRouter(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)
func (*OSPFServer) UpdateRoutingTblForTNetwork ¶
func (server *OSPFServer) UpdateRoutingTblForTNetwork(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)
func (*OSPFServer) UpdateRoutingTblWithStub ¶
func (server *OSPFServer) UpdateRoutingTblWithStub(areaId uint32, vKey VertexKey, tVertex TreeVertex, parent TreeVertex, parentKey VertexKey, rootVKey VertexKey)
func (*OSPFServer) UpdateVlanInfra ¶
func (server *OSPFServer) UpdateVlanInfra(msg asicdCommonDefs.VlanNotifyMsg, msgType uint8)
type OspfClientBase ¶
type OspfClientBase struct { Address string Transport thrift.TTransport PtrProtocolFactory *thrift.TBinaryProtocolFactory IsConnected bool }
type OspfHdrMetadata ¶
type OspfHdrMetadata struct {
// contains filtered or unexported fields
}
func NewOspfHdrMetadata ¶
func NewOspfHdrMetadata() *OspfHdrMetadata
type OspfNeighborEntry ¶
type PortProperty ¶
type RibdClient ¶
type RibdClient struct { OspfClientBase ClientHdl *ribd.RIBDServicesClient }
type RouteMdata ¶
type RouteMdata struct {
// contains filtered or unexported fields
}
type RouterLsa ¶
type RouterLsa struct { LsaMd LsaMetadata BitV bool /* V Bit */ BitE bool /* Bit E */ BitB bool /* Bit B */ NumOfLinks uint16 /* NumOfLinks */ LinkDetails []LinkDetail /* List of LinkDetails */ }
LS Type 1
func NewRouterLsa ¶
func NewRouterLsa() *RouterLsa
type RoutingTblEntry ¶
type RoutingTblEntryKey ¶
type RoutingTblKey ¶
type RoutingTblKey struct {
AreaId uint32
}
type SelfOrigLsa ¶
type StubVertex ¶
type SummaryLsa ¶
type SummaryLsa struct { LsaMd LsaMetadata Netmask uint32 /* Network Mask */ Metric uint32 SummaryTOSDetails []SummaryTOSDetail /* TOS */ }
LS Type 3 or 4
func NewSummaryLsa ¶
func NewSummaryLsa() *SummaryLsa
type SummaryLsaMap ¶
type SummaryLsaMap map[LsaKey]SummaryLsa
type SummaryTOSDetail ¶
type TreeVertex ¶
type VertexData ¶
type VertexData struct {
// contains filtered or unexported fields
}
type VertexDataArr ¶
type VertexDataArr []VertexData
func (VertexDataArr) Len ¶
func (v VertexDataArr) Len() int
func (VertexDataArr) Less ¶
func (v VertexDataArr) Less(i, j int) bool
func (VertexDataArr) Swap ¶
func (v VertexDataArr) Swap(i, j int)
type VlanProperty ¶
Source Files ¶
- ospfASExternal.go
- ospfAreaConf.go
- ospfAsicd.go
- ospfBulkGet.go
- ospfCommon.go
- ospfDB.go
- ospfDD.go
- ospfFlooding.go
- ospfGlobalConf.go
- ospfHeader.go
- ospfHello.go
- ospfIfMetricConf.go
- ospfInfra.go
- ospfIntfConf.go
- ospfIntfFSM.go
- ospfLSAPkt.go
- ospfLsa.go
- ospfLsdb.go
- ospfLsdbTimer.go
- ospfMultiArea.go
- ospfNeighbor.go
- ospfNeighborStruct.go
- ospfRibd.go
- ospfRoutingTbl.go
- ospfRxPkt.go
- ospfSPF.go
- ospfTestUtils.go
- ospfTxPkt.go
- server.go
- serverUtil.go