How olsr/oonf works
Project type and purpose
• This is a C-based network routing framework and toolset (“OONF”: OLSR.org Network Framework).
• It builds several CLI network daemons (olsrd2, dlep-radio, dlep-router, etc.) plus a core library and many protocol/plugin modules (NHDP, OLSRv2, DLEP, RFC5444, etc.).
• It is not a web-app but a modular, plugin-based network protocol engine.
File structure
• Top-level “apps” folder: each subfolder is one executable (dlep-radio, dlep-router, olsrd2, etc.) with its own CMakeLists.
• “src” tree: broken into directories per layer:
• base (network sockets, timers, HTTP, telnet, packet sockets)
• crypto (hash/signature providers)
• generic plugins (configuration loaders, DLEP, eth-listener, remotecontrol, systeminfo, etc.)
• libcommon, libconfig, libcore, librfc5444 (core libraries)
• protocol stacks: nhdp, olsrv2 (each with sub-modules)
• main (entry point)
• tests (CUnit tests)
• “include” mirrors “src” with public headers for each lib and module.
• build infrastructure: CMakeLists.txt at root, cmake/ folder, build/ folder.
• packaging: Debian under apps/olsrd2/debian, OpenWrt under openwrt/.
• configuration templates under “configuration/”.
README
• Confirms it is a network daemon framework, built with CMake and plugins, producing static binaries like olsrd2_static.
• Usage instructions show: selecting interfaces, logging subsystems, enabling protocols (NHDP, DLEP).
Main components
a. Executable layer (apps):
– olsrd2_static, dlep-radio, dlep-router, oonf (generic app)
b. Core Framework libraries:
– libcore (application lifecycle, subsystem registry)
– libconfig (configuration parsing/validation)
– libcommon (data structures, JSON, netaddr, lists)
– librfc5444 (message parser/writer)
c. Plugin Controller (loads runtime modules)
d. Protocol/feature modules (plugins):
– NHDP (neighborhood discovery)
– OLSRv2 (routing)
– DLEP (link-status exchange; radio/router roles)
– Generic services: cfg_compact, cfg_uciloader, eth_listener, remotecontrol, systeminfo, plugin_controller
– Crypto providers (hash, signature) used by some modules
e. OS integration layer (base):
– Packet sockets, Netlink (nl80211), timers, threading primitives, HTTP/telnet interfaces
f. External interfaces:
– Network interfaces (eth0, wlan0, lo)
– Telnet/HTTP management ports (viewer)
g. Configuration subsystem: reads configuration files, provides settings to modules
Relationships and interactions
• Apps link statically against core libs; they call main() in libcore.
• libcore registers a “plugin controller” which loads each enabled plugin module at startup.
• Plugin modules register themselves as subsystems (protocol handlers) with libcore.
• The framework’s I/O loop (in libcore) dispatches received raw packets (via packet sockets or netlink) into librfc5444 parser. Parsed messages are routed to appropriate protocol plugin (NHDP, DLEP, OLSRv2).
• Protocol modules may invoke crypto providers or generic services (eth_listener, link_config) as needed.
• Outgoing messages are composed via librfc5444 writer and sent back out the appropriate socket.
• libconfig provides the configuration data to each plugin during initialization.
• Generic modules (remotecontrol, viewer) provide management interfaces (HTTP, telnet).
• Test suites verify each library and module in isolation.
Architectural patterns & design principles
• Plugin-based modular architecture: core framework + dynamically linked (or statically registered) subsystems.
• Layered design:
• Transport/OS integration layer (base)
• Message framing layer (librfc5444)
• Protocol logic layer (NHDP, OLSRv2, DLEP)
• Management layer (remotecontrol, systeminfo)
• Separation of concerns: each library (libcommon, libconfig, etc.) focuses on one domain.
• Dependency inversion: core framework depends on abstract plugin interfaces; concrete modules implement those interfaces.