# rdkcentral/epon-manager architecture

> Architecture diagram of the GitHub repository rdkcentral/epon-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rdkcentral/epon-manager
- Repository: https://github.com/rdkcentral/epon-manager
- Video tour (about a minute): https://gitdiagram.com/rdkcentral/epon-manager/video

## Overview

epon-manager is RDK middleware that configures and controls EPON lower layers through the HAL, while exposing device state to other RDK components. Its main workflow is: initialize the manager and persistent settings, accept HAL events and TR-181 requests, update shared ONU/interface state or invoke HAL operations, then report link changes and telemetry. The graph preserves the documented LLID, CPE/DPoE, VEIP, polling, and persistence capabilities. Some subsystem wiring is documented rather than visible in the sampled excerpts, so uncertain call edges are omitted.

Main entry points: [`src/core/controller/eponMgr_controller.c`](https://github.com/rdkcentral/epon-manager/blob/main/src/core/controller/eponMgr_controller.c) (Event controller), [`src/core/data_structures/eponMgr_data.c`](https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_data.c) (Shared data context), [`src/core/epon_manager_main.c`](https://github.com/rdkcentral/epon-manager/blob/main/src/core/epon_manager_main.c) (Process entry), [`src/rbus/eponMgr_rbus.c`](https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/eponMgr_rbus.c) (RBUS connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Manager runtime"]
  node_main["Process entry"]
  node_controller["Event controller"]
  node_queue["Event queue<br/>[eponMgr_queue.c]"]
  node_poller["Statistics poller"]
end

subgraph group_state["EPON state and HAL"]
  node_data["Shared data context<br/>[eponMgr_data.c]"]
  node_onu["ONU and LLID state"]
  node_stats["Statistics data"]
end

subgraph group_rbus["RBUS interfaces"]
  node_rbuscore["RBUS connection<br/>[eponMgr_rbus.c]"]
  node_tr181["TR-181 model<br/>[eponMgr_tr181.c]"]
  node_wan["WanManager updates"]
end

subgraph group_operations["Persistence and telemetry"]
  node_persistence["Configuration persistence"]
  node_psm["PSM adapter<br/>[eponMgr_psm.c]"]
  node_telemetry["Telemetry reporting"]
end

node_rdk(("RDK components"))
node_hal["EPON HAL"]
node_rbusservice["RDK RBUS services"]
node_psmstore[("CCSP PSM")]
node_telemetryservice["RDK telemetry"]

node_rdk -->|"starts"| node_main
node_main -->|"initializes"| node_telemetry
node_main -->|"initializes and runs"| node_controller
node_controller -->|"initializes"| node_rbuscore
node_controller -->|"loads settings"| node_persistence
node_persistence -->|"reads and writes"| node_psm
node_psm -->|"gets handle"| node_rbuscore
node_psm -->|"invokes PSM methods"| node_psmstore
node_rbuscore -->|"opens connection"| node_rbusservice
node_rbuscore -->|"registers model"| node_tr181
node_tr181 -->|"reads and updates"| node_data
node_tr181 -->|"invokes operations"| node_hal
node_controller -->|"initializes HAL"| node_hal
node_hal -->|"delivers events"| node_controller
node_controller -->|"enqueues events"| node_queue
node_controller -->|"updates state"| node_data
node_data -->|"maintains state"| node_onu
node_controller -->|"syncs dynamic tables"| node_tr181
node_controller -->|"notifies link changes"| node_wan
node_wan -->|"updates status"| node_rbusservice
node_controller -->|"starts and stops"| node_poller
node_poller -->|"queries statistics"| node_data
node_data -->|"caches counters"| node_stats
node_controller -->|"raises events"| node_telemetry
node_main -->|"reports startup and shutdown"| node_telemetry
node_telemetry -->|"reports events"| node_telemetryservice

click node_main "https://github.com/rdkcentral/epon-manager/blob/main/src/core/epon_manager_main.c"
click node_controller "https://github.com/rdkcentral/epon-manager/blob/main/src/core/controller/eponMgr_controller.c"
click node_queue "https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_queue.c"
click node_poller "https://github.com/rdkcentral/epon-manager/blob/main/src/core/stats_poller/eponMgr_stats_poller.c"
click node_data "https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_data.c"
click node_onu "https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_onu_state.c"
click node_stats "https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_statsData.c"
click node_rbuscore "https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/eponMgr_rbus.c"
click node_tr181 "https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/tr181/eponMgr_tr181.c"
click node_wan "https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/wanmanager_update/eponMgr_wanmanager_update.c"
click node_persistence "https://github.com/rdkcentral/epon-manager/blob/main/src/core/config/eponMgr_persistence.c"
click node_psm "https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/eponMgr_psm.c"
click node_telemetry "https://github.com/rdkcentral/epon-manager/blob/main/src/telemetry/eponMgr_telemetry.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_controller,node_queue,node_poller toneBlue
class node_data,node_onu,node_stats,node_psmstore toneAmber
class node_rbuscore,node_tr181,node_wan toneMint
class node_persistence,node_psm,node_telemetry toneRose
class node_rdk,node_hal,node_rbusservice,node_telemetryservice toneIndigo
```

## Components

### Manager runtime

- [Process entry](https://github.com/rdkcentral/epon-manager/blob/main/src/core/epon_manager_main.c): `src/core/epon_manager_main.c`
- [Event controller](https://github.com/rdkcentral/epon-manager/blob/main/src/core/controller/eponMgr_controller.c): `src/core/controller/eponMgr_controller.c`
- [Event queue](https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_queue.c): `src/core/data_structures/eponMgr_queue.c`
- [Statistics poller](https://github.com/rdkcentral/epon-manager/blob/main/src/core/stats_poller/eponMgr_stats_poller.c): `src/core/stats_poller/eponMgr_stats_poller.c`

### EPON state and HAL

- [Shared data context](https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_data.c): `src/core/data_structures/eponMgr_data.c`
- [ONU and LLID state](https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_onu_state.c): `src/core/data_structures/eponMgr_onu_state.c`
- [Statistics data](https://github.com/rdkcentral/epon-manager/blob/main/src/core/data_structures/eponMgr_statsData.c): `src/core/data_structures/eponMgr_statsData.c`

### RBUS interfaces

- [RBUS connection](https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/eponMgr_rbus.c): `src/rbus/eponMgr_rbus.c`
- [TR-181 model](https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/tr181/eponMgr_tr181.c): `src/rbus/tr181/eponMgr_tr181.c`
- [WanManager updates](https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/wanmanager_update/eponMgr_wanmanager_update.c): `src/rbus/wanmanager_update/eponMgr_wanmanager_update.c`

### Persistence and telemetry

- [Configuration persistence](https://github.com/rdkcentral/epon-manager/blob/main/src/core/config/eponMgr_persistence.c): `src/core/config/eponMgr_persistence.c`
- [PSM adapter](https://github.com/rdkcentral/epon-manager/blob/main/src/rbus/eponMgr_psm.c): `src/rbus/eponMgr_psm.c`
- [Telemetry reporting](https://github.com/rdkcentral/epon-manager/blob/main/src/telemetry/eponMgr_telemetry.c): `src/telemetry/eponMgr_telemetry.c`

### Other components

- **RDK components**
- **EPON HAL**
- **RDK RBUS services**
- **CCSP PSM**
- **RDK telemetry**

## Connections

- RDK components → Process entry: starts
- Process entry → Telemetry reporting: initializes
- Process entry → Event controller: initializes and runs
- Event controller → RBUS connection: initializes
- Event controller → Configuration persistence: loads settings
- Configuration persistence → PSM adapter: reads and writes
- PSM adapter → RBUS connection: gets handle
- PSM adapter → CCSP PSM: invokes PSM methods
- RBUS connection → RDK RBUS services: opens connection
- RBUS connection → TR-181 model: registers model
- TR-181 model → Shared data context: reads and updates
- TR-181 model → EPON HAL: invokes operations
- Event controller → EPON HAL: initializes HAL
- EPON HAL → Event controller: delivers events
- Event controller → Event queue: enqueues events
- Event controller → Shared data context: updates state
- Shared data context → ONU and LLID state: maintains state
- Event controller → TR-181 model: syncs dynamic tables
- Event controller → WanManager updates: notifies link changes
- WanManager updates → RDK RBUS services: updates status
- Event controller → Statistics poller: starts and stops
- Statistics poller → Shared data context: queries statistics
- Shared data context → Statistics data: caches counters
- Event controller → Telemetry reporting: raises events
- Process entry → Telemetry reporting: reports startup and shutdown
- Telemetry reporting → RDK telemetry: reports events
