⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module ospf

Module ospf 

Source
Expand description

OSPF routing daemon (RFC 2328)

Link-state routing protocol implementation (single area, Area 0):

  • Hello protocol for neighbor discovery
  • Database description exchange
  • Link-state database with LSA flooding
  • SPF (Dijkstra) shortest path calculation
  • DR/BDR election

Structs§

HelloPacket
OSPF Hello packet
LsDatabase
Link-State Database
LsaHeader
LSA header (20 bytes)
LsaKey
Key for LSA database lookup: (type, link_state_id, advertising_router)
NetworkLsa
Network LSA (type 2)
OspfHeader
OSPF packet header (24 bytes)
OspfNeighbor
OSPF neighbor entry
OspfRouter
OSPF Router
RouterLink
A single link in a Router LSA
RouterLsa
Router LSA (type 1)
SpfEntry
SPF result entry

Enums§

AuthType
OSPF authentication type
Lsa
Stored LSA in the database
LsaType
LSA types
NeighborState
OSPF neighbor states (RFC 2328 Section 10.1)
OspfPacketType
OSPF packet types
RouterLinkType
Router LSA link types

Constants§

DEAD_INTERVAL
Default dead interval in ticks (4x hello)
HELLO_INTERVAL
Default Hello interval in ticks
MAX_LSA_AGE
Maximum LSA age in ticks
OSPF_ALL_DR
OSPF all-DR multicast (224.0.0.6)
OSPF_ALL_ROUTERS
OSPF all-routers multicast (224.0.0.5)
OSPF_INFINITY
Cost representing infinity (unreachable)
OSPF_PROTOCOL
OSPF protocol number (IP protocol 89)
OSPF_VERSION
OSPF version 2

Functions§

deserialize_header
Deserialize an OSPF header from bytes
serialize_header
Serialize an OSPF header to bytes