
{"id":9690,"date":"2022-06-21T13:53:01","date_gmt":"2022-06-21T13:53:01","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/"},"modified":"2026-02-17T10:05:21","modified_gmt":"2026-02-17T10:05:21","slug":"gwprovapp","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/","title":{"rendered":"GwProvApp"},"content":{"rendered":"\n<p>The Gateway Provisioning Application (GwProvApp) is the RDK-B middleware component responsible for managing gateway device initialization, mode configuration, and provisioning state machine operations. It orchestrates the transition between different operational modes (router\/bridge) based on configuration file parsing, system events, and provisioning requirements. GwProvApp serves as the central coordinator for device startup sequence, handling DOCSIS initialization, WAN connectivity management, and system configuration establishment. GwProvApp provides essential services to the RDK-B ecosystem by managing device provisioning workflows, coordinating with DOCSIS subsystems for cable modem functionality, and maintaining operational state transitions. At the device level, it ensures proper initialization sequence coordination, enables dynamic WAN mode switching between DOCSIS and Ethernet WAN (AutoWAN), and provides configuration management through TLV parsing and system configuration integration.<\/p>\n\n\n\n<p>At the module level, GwProvApp implements a sophisticated state machine that handles provisioning events, manages eRouter operational modes, coordinates with HAL layers for hardware abstraction, and integrates with sysevent framework for inter-process communication across the RDK-B middleware stack.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">graph LR\n    subgraph \"External Systems\"\n\t\tHeadEnd[Cable Headend\/CMTS]\n    end\n\n    subgraph \"RDK-B Platform\"\n        WanMgr[\"WAN Manager\"]\n        GwProvApp[GwProvApp]\n        rdkbComponent[\"Other RDK-B Components\"]\n        subgraph \"Platform Layer\"\n            HAL[\"HAL(DOCSIS HAL, EthSwitch HAL, Platform HAL)\"]\n            Linux[Linux]\n        end\n    end\n\n    %% External connections\n    HeadEnd -->|DOCSIS Config File\/TLV| GwProvApp\n\n    %% WAN Manager to Interface Managers\n    GwProvApp -->|IPC| WanMgr\n    GwProvApp -->|IPC| rdkbComponent\n\n    %% Interface Managers to HAL\n    GwProvApp -->|HAL APIs| HAL\n\n    %% System integration\n    HAL -->|Drivers| Linux\n\n    classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:2px;\n    classDef GwProvApp fill:#e3f2fd,stroke:#1976d2,stroke-width:3px;\n    classDef rdkbComponent fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px;\n    classDef system fill:#fce4ec,stroke:#c2185b,stroke-width:2px;\n\n    class HeadEnd external;\n    class GwProvApp GwProvApp;\n    class WanMgr,rdkbComponent rdkbComponent;\n    class HAL,Linux,HW system;<\/pre><\/div>\n\n\n\n<p><strong>Key Features &amp; Responsibilities<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gateway Provisioning State Machine<\/strong>: Orchestrates device initialization sequence from DOCSIS registration through operational readiness, managing transitions between unprovisioned, provisioning, and fully operational states<\/li>\n\n\n\n<li><strong>Router\/Bridge Mode Management<\/strong>: Dynamically switches between router mode (IPv4\/IPv6\/dual-stack) and bridge modes (primary\/global bridge) based on configuration files, user preferences, and operational requirements<\/li>\n\n\n\n<li><strong>AutoWAN Technology Selection<\/strong>: Automatically detects and configures optimal WAN connectivity method between DOCSIS cable modem and Ethernet WAN interfaces based on link availability and configuration policies<\/li>\n\n\n\n<li><strong>DOCSIS Configuration File Processing<\/strong>: Parses and processes DOCSIS configuration files containing TLV (Type-Length-Value) encoded parameters for TR-069, eRouter modes, and operational parameters<\/li>\n\n\n\n<li><strong>System Event Coordination<\/strong>: Integrates with sysevent framework to coordinate startup sequences, network interface management, and inter-component communication across the RDK-B middleware stack<\/li>\n\n\n\n<li><strong>Hardware Abstraction Integration<\/strong>: Interfaces with multiple HAL layers including DOCSIS, Ethernet switch, platform HAL for hardware control and status monitoring<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"design\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#design\">Design<\/a><\/h2>\n\n\n\n<p>GwProvApp follows a sophisticated event-driven state machine architecture designed to handle the complex initialization and operational mode management requirements of RDK-B gateway devices. The design emphasizes reliability, configurability, and seamless integration with both legacy DOCSIS infrastructure and modern Ethernet WAN deployments. The component implements a multi-threaded architecture with dedicated event handling threads, configuration processing modules, and hardware interface management layers.<\/p>\n\n\n\n<p>The core design philosophy centers around maintaining system stability during mode transitions while providing flexibility for different deployment scenarios. The state machine handles asynchronous events from multiple sources including DOCSIS subsystem notifications, network interface status changes, user configuration updates, and external provisioning triggers. This design ensures that the gateway can adapt to changing network conditions and configuration requirements without requiring system restarts in most scenarios.<\/p>\n\n\n\n<p>The north-bound interfaces integrate seamlessly with RDK-B middleware components through IPC methods (RBus), providing configuration updates, operational status, and event notifications. South-bound integration leverages HAL APIs for hardware control, syscfg for persistent configuration management, and sysevent for real-time system coordination. The design incorporates robust error handling, recovery mechanisms, and comprehensive logging to support field deployment requirements and troubleshooting scenarios.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: {\n  \"themeVariables\": { \"fontSize\": \"60px\", \"lineHeight\": 1.7 },\n  \"flowchart\": { \"nodeSpacing\": 140, \"rankSpacing\": 180, \"diagramPadding\": 80, \"padding\": 28, \"useMaxWidth\": true, \"htmlLabels\": true, \"wrap\": true }\n}}%%\ngraph TD\n    subgraph \"GwProvApp\"\n\n        subgraph \"Main Module\"\n            MainSM[Gateway Provisioning State Machine]\n            EventHandler[System Event Handler]\n            ConfigMgr[Configuration Manager]\n        end\n        subgraph \"Network Management\"\n            RouterMgr[Router Mode Manager]\n            BridgeMgr[Bridge Mode Manager]\n            InterfaceMgr[Interface Manager]\n        end\n        subgraph \"AutoWAN Module\"\n            AutoWANSM[AutoWAN State Machine]\n            LinkMonitor[Link Status Monitor]\n            ModeSelector[WAN Mode Selector]\n        end\n        subgraph \"DOCSIS Integration\"\n            TLVParser[TLV Configuration Parser]\n            DOCSISEvents[DOCSIS Event Handler]\n            ProvisioningMgr[Provisioning Manager]\n        end\n    end\n\n    subgraph \"External systems\"\n        SysEvent[Sysevent Framework]\n        SysCfg[System Configuration]\n        HALLayer[HAL Interfaces]\n    end\n\n    EventHandler --> SysEvent\n    ConfigMgr --> SysCfg\n    DOCSISEvents --> HALLayer\n    InterfaceMgr --> HALLayer\n    \n    AutoWANSM --> LinkMonitor\n    AutoWANSM --> ModeSelector\n    LinkMonitor --> HALLayer\n\n    MainSM --> EventHandler\n    MainSM --> AutoWANSM\n    MainSM --> TLVParser\n    MainSM --> RouterMgr\n    MainSM --> BridgeMgr\n\n    TLVParser --> ProvisioningMgr<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequisites-and-dependencies\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#prerequisites-and-dependencies\">Prerequisites and Dependencies<\/a><\/h3>\n\n\n\n<p><strong>DISTRO_FEATURES-based Build Flags:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>dslite<\/code><\/td><td><code>-DDSLITE_FEATURE_SUPPORT<\/code><\/td><td>Enable DS-Lite (Dual-Stack Lite) IPv6 transition technology support<\/td><td>Disabled<\/td><td>Adds IPv6\/IPv4 tunneling capabilities<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>RDK-B Platform and Integration Requirements:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>RDK-B Components<\/strong>: CcspCommonLibrary for base CCSP functionality, Utopia for system service coordination, sysevent daemon for inter-process communication<\/li>\n\n\n\n<li><strong>HAL Dependencies<\/strong>: Cable Modem HAL, Ethernet Switch HAL, Platform HAL, DHCP v4 Client HAL, required for hardware abstraction<\/li>\n\n\n\n<li><strong>Systemd Services<\/strong>: sysevent service must be active, syscfg service for configuration persistence, platform-specific initialization services<\/li>\n\n\n\n<li><strong>IPC Methods<\/strong>: Sysevent framework registration, RBus framework integration for middleware communication<\/li>\n\n\n\n<li><strong>Configuration Files<\/strong>: \/nvram\/syscfg.db for persistent configuration, \/etc\/utopia\/ scripts for system integration, TLV configuration file support<\/li>\n\n\n\n<li><strong>Startup Order<\/strong>: Must initialize after sysevent, syscfg, and basic HAL services, before dependent middleware components like CcspPandM<\/li>\n<\/ul>\n\n\n\n<p><strong>Threading Model<\/strong><\/p>\n\n\n\n<p>GwProvApp implements a multi-threaded architecture optimized for event-driven operations and concurrent hardware interface management. The component uses dedicated threads for different operational aspects to ensure responsive system behavior and proper event handling isolation.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Threading Architecture<\/strong>: Multi-threaded with event-driven main loop and specialized worker threads for different functional domains<\/li>\n\n\n\n<li><strong>Main Thread<\/strong>: Handles primary state machine operations, configuration processing, and coordinated initialization sequence management<\/li>\n\n\n\n<li><strong>Main worker Threads<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Sysevent Thread<\/strong>: Dedicated thread for sysevent notification handling and system event coordination<\/li>\n\n\n\n<li><strong>AutoWAN Thread<\/strong>: Monitors WAN interface status and handles automatic WAN mode selection logic<\/li>\n\n\n\n<li><strong>Link State Thread<\/strong>: Platform-specific thread for physical link status monitoring (Raspberry Pi\/embedded platforms)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Synchronization<\/strong>: Uses pthread mutexes for shared state protection, sysevent framework for inter-process coordination, atomic operations for status flags<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"component-state-flow\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#component-state-flow\">Component State Flow<\/a><\/h3>\n\n\n\n<p><strong>Initialization to Active State<\/strong><\/p>\n\n\n\n<p>GwProvApp follows a carefully orchestrated initialization sequence that coordinates with multiple system components and hardware interfaces. The component progresses through distinct phases from system startup through operational readiness, with each phase having specific prerequisites and validation checkpoints.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: { \"config\": { \"useMaxWidth\": false } }}%%\nsequenceDiagram\n    autonumber\n    participant System\n    participant GwProvApp\n    participant Utopia\n    participant DOCSIS\n    participant HAL\n    participant ConfigMgr\n    participant NetworkSvcs\n\n    System->>System: Start [*] \u2192 SystemInit\n    Note right of System: Initialize logging framework&lt;br>Open sysevent connections&lt;br>Load persistent configuration&lt;br>Register signal handlers\n\n    System->>GwProvApp: Component Start \u2192 SystemInit\n    GwProvApp->>Utopia: Load System Configuration \u2192 UtopiaInit\n    Note right of Utopia: Load syscfg parameters&lt;br>Initialize system services&lt;br>Setup IPC connections\n\n    Utopia->>DOCSIS: Initialize System Services \u2192 DOCSISWait\n    Note right of DOCSIS: Wait for DOCSIS registration&lt;br>Hardware interface discovery&lt;br>Cable modem initialization\n\n    DOCSIS->>HAL: DOCSIS Initialization Complete \u2192 DOCSISReady\n    Note right of HAL: Cable modem registration&lt;br>Hardware interface discovery&lt;br>HAL initialization complete&lt;br>Network device creation\n\n    HAL->>ConfigMgr: Hardware Interfaces Available \u2192 ConfigParsing\n    Note right of ConfigMgr: Parse TLV configuration&lt;br>Process DOCSIS parameters&lt;br>Validate settings\n\n    ConfigMgr->>GwProvApp: TLV Configuration Processed \u2192 ModeSelection\n    Note right of GwProvApp: Determine operational mode&lt;br>Evaluate AutoWAN options&lt;br>Select router\/bridge mode\n\n    GwProvApp->>NetworkSvcs: Operational Mode Determined \u2192 NetworkSetup\n    Note right of NetworkSvcs: Configure network interfaces&lt;br>Apply mode settings&lt;br>Setup routing\/bridging\n\n    NetworkSvcs->>GwProvApp: Network Interfaces Configured \u2192 ServiceReady\n    Note right of GwProvApp: Start dependent services&lt;br>Initialize monitoring&lt;br>Enable management interfaces\n\n    GwProvApp->>System: All Services Active \u2192 OperationalReady\n    Note right of System: LAN\/WAN services active&lt;br>Web interface available&lt;br>TR-069 connectivity established&lt;br>Monitoring services running\n\n    System->>System: System Fully Operational \u2192 RuntimeOperation<\/pre><\/div>\n\n\n\n<p><strong>Runtime State Changes and Context Switching<\/strong><\/p>\n\n\n\n<p>GwProvApp handles dynamic operational mode changes and configuration updates during normal operation without requiring full system restart. The component supports seamless transitions between router and bridge modes, WAN technology switching, and configuration parameter updates.<\/p>\n\n\n\n<p><strong>State Change Triggers:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DOCSIS configuration file updates triggering TLV re-parsing and potential mode changes affecting eRouter operational parameters<\/li>\n\n\n\n<li>User-initiated mode changes through web interface or TR-069 management causing bridge\/router mode transitions<\/li>\n\n\n\n<li>AutoWAN events from link status changes requiring WAN technology switching between DOCSIS and Ethernet interfaces<\/li>\n\n\n\n<li>System restart events from configuration management triggering controlled service restart without full device reboot<\/li>\n\n\n\n<li>Network interface status changes necessitating service coordination and dependent component notification<\/li>\n<\/ul>\n\n\n\n<p><strong>Context Switching Scenarios:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Router to Bridge mode transition involving eRouter disable, interface reconfiguration, and service coordination with dependent middleware<\/li>\n\n\n\n<li>AutoWAN failover switching between DOCSIS cable modem and Ethernet WAN based on link availability and configuration priorities<\/li>\n\n\n\n<li>IPv4\/IPv6 operational mode changes based on ISP provisioning and configuration requirements affecting routing and firewall rules<\/li>\n\n\n\n<li>Factory reset scenarios requiring configuration restoration, mode validation, and coordinated service restart across middleware stack<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"call-flow\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#call-flow\">Call Flow<\/a><\/h3>\n\n\n\n<p><strong>Initialization Call Flow:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">sequenceDiagram\n    participant System as System Init\n    participant GwProvApp as GwProvApp\n    participant Sysevent as Sysevent Framework\n    participant HAL as HAL Layer\n    participant DOCSIS as DOCSIS Subsystem\n\n    System->>GwProvApp: Start GwProvApp Process\n    GwProvApp->>GwProvApp: Load Configuration &amp; Initialize Logging\n    GwProvApp->>Sysevent: Open Sysevent Connections\n    Sysevent-->>GwProvApp: Connection Established\n    GwProvApp->>GwProvApp: Create Event Handler Threads\n    GwProvApp->>HAL: Initialize HAL Interfaces\n    HAL-->>GwProvApp: HAL Ready\n    GwProvApp->>DOCSIS: Register for DOCSIS Events\n    DOCSIS-->>GwProvApp: DOCSIS Initialization Complete\n    GwProvApp->>GwProvApp: Process Initial Configuration\n    GwProvApp->>System: Signal Component Ready<\/pre><\/div>\n\n\n\n<p><strong>Configuration File Processing Call Flow:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">sequenceDiagram\n    participant DOCSIS as DOCSIS Subsystem\n    participant GwProvApp as GwProvApp\n    participant TLVParser as TLV Parser\n    participant ConfigMgr as Config Manager\n    participant TR069 as TR-069 Agent\n\n    DOCSIS->>GwProvApp: Configuration File Available\n    GwProvApp->>TLVParser: Parse TLV Configuration\n    TLVParser->>TLVParser: Validate TLV Structure\n    TLVParser-->>GwProvApp: TLV Parameters Extracted\n    GwProvApp->>ConfigMgr: Update System Configuration\n    ConfigMgr->>ConfigMgr: Validate Configuration Changes\n    ConfigMgr-->>GwProvApp: Configuration Updated\n    GwProvApp->>TR069: Update TR-069 Parameters\n    TR069-->>GwProvApp: Parameters Applied\n    GwProvApp->>GwProvApp: Trigger Mode Transition (if needed)<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"internal-modules\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#internal-modules\">Internal Modules<\/a><\/h2>\n\n\n\n<p>GwProvApp is organized into functionally distinct modules that handle specific aspects of gateway provisioning and operational management. Each module encapsulates related functionality while providing clear interfaces for integration with other components.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Gateway Provisioning State Machine<\/strong><\/td><td>Core state machine managing device initialization, mode transitions, and operational state coordination<\/td><td><code>gw_prov_sm.c<\/code>,&nbsp;<code><strong>gw_prov_sm<\/strong>.h<\/code><\/td><\/tr><tr><td><strong>AutoWAN Management<\/strong><\/td><td>Automatic WAN technology selection between DOCSIS and Ethernet interfaces based on availability and configuration<\/td><td><code>autowan.c<\/code>,&nbsp;<code><strong>autowan<\/strong>.h<\/code><\/td><\/tr><tr><td><strong>TLV Configuration Parser<\/strong><\/td><td>Processes DOCSIS configuration files containing Type-Length-Value encoded parameters for system configuration<\/td><td>TLV parsing functions in&nbsp;<code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><strong>System Event Integration<\/strong><\/td><td>Handles sysevent framework integration for inter-process communication and system coordination<\/td><td>Event handling functions in&nbsp;<code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><strong>HAL Interface Management<\/strong><\/td><td>Abstracts hardware interface control for DOCSIS, Ethernet switching, and platform-specific operations<\/td><td>HAL API calls throughout source files<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"component-interactions\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#component-interactions\">Component Interactions<\/a><\/h2>\n\n\n\n<p>GwProvApp serves as a central coordination point within the RDK-B middleware stack, interfacing with multiple components across different architectural layers. The component handles both north-bound integration with middleware services and south-bound integration with hardware abstraction and system services.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"interaction-matrix\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#interaction-matrix\">Interaction Matrix<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>RDK-B Middleware Components<\/strong><\/td><td><\/td><td><\/td><\/tr><tr><td>CcspTr069Pa<\/td><td>TR-069 parameter configuration from TLV parsing results<\/td><td><code><strong>dmcli<\/strong>&nbsp;eRT setvalues Device.ManagementServer.*<\/code><\/td><\/tr><tr><td>CcspPandM<\/td><td>Device operational status and configuration notifications<\/td><td><code><strong>Device<\/strong>.X_CISCO_COM_DeviceControl.*<\/code>&nbsp;parameters<\/td><\/tr><tr><td>OneWifi<\/td><td>Network readiness and operational mode notifications<\/td><td><code>lan-status<\/code>,&nbsp;<code>bridge-status<\/code>,&nbsp;<code>network-ready<\/code><\/td><\/tr><tr><td>WAN Manager<\/td><td>WAN interface selection and operational mode coordination<\/td><td><code>wan-<strong>start<\/strong><\/code>,&nbsp;<code>wan-<strong>stop<\/strong><\/code>,&nbsp;<code>wan-status<\/code>&nbsp;events<\/td><\/tr><tr><td><strong>System &amp; HAL Layers<\/strong><\/td><td><\/td><td><\/td><\/tr><tr><td>Sysevent Framework<\/td><td>Inter-process communication and system coordination<\/td><td><code><strong>sysevent_set<\/strong>()<\/code>,&nbsp;<code><strong>sysevent_get<\/strong>()<\/code>,&nbsp;<code><strong>sysevent_setnotification<\/strong>()<\/code><\/td><\/tr><tr><td>System Configuration<\/td><td>Persistent configuration management and storage<\/td><td><code><strong>syscfg_get<\/strong>()<\/code>,&nbsp;<code><strong>syscfg_set<\/strong>()<\/code>,&nbsp;<code><strong>syscfg_commit<\/strong>()<\/code><\/td><\/tr><tr><td>DOCSIS HAL<\/td><td>Cable modem control and status monitoring<\/td><td><code>eSafeDevice_*()<\/code>,&nbsp;<code><strong>getDocsisDbFactoryMode<\/strong>()<\/code><\/td><\/tr><tr><td>Ethernet Switch HAL<\/td><td>Port control and link status management<\/td><td><code>CcspHalEthSwGetPortStatus()<\/code>,&nbsp;<code>CcspHalEthSwSetPortCfg()<\/code><\/td><\/tr><tr><td><strong>External Systems<\/strong><\/td><td><\/td><td><\/td><\/tr><tr><td>Cable Headend\/CMTS<\/td><td>DOCSIS configuration file delivery and provisioning<\/td><td>Configuration file parsing via DOCSIS subsystem<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Main events Published by GwProvApp:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>gw_prov-status<\/code><\/td><td><code>gw_prov-status<\/code><\/td><td>Component initialization complete<\/td><td>System monitoring, dependent services<\/td><\/tr><tr><td><code>docsis-initialized<\/code><\/td><td><code>docsis-initialized<\/code><\/td><td>DOCSIS subsystem ready<\/td><td>Network services, middleware components<\/td><\/tr><tr><td><code>bridge_mode<\/code><\/td><td><code>bridge_mode<\/code><\/td><td>Operational mode change<\/td><td>Network stack, firewall, routing services<\/td><\/tr><tr><td><code>erouter_mode-updated<\/code><\/td><td><code>erouter_mode-updated<\/code><\/td><td>eRouter mode change completed<\/td><td>TR-069 agent, network services<\/td><\/tr><tr><td><code>phylink_wan_state<\/code><\/td><td><code>phylink_wan_state<\/code><\/td><td>WAN physical link status change<\/td><td>WAN services, monitoring systems<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ipc-flow-patterns\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#ipc-flow-patterns\">IPC Flow Patterns<\/a><\/h3>\n\n\n\n<p><strong>Primary IPC Flow &#8211; Mode Change Processing:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">sequenceDiagram\n    participant WebUI as Web Interface\/User\n    participant Sysevent as Sysevent Framework\n    participant GwProvApp as GwProvApp\n    participant HAL as HAL Layer\n    participant Services as Network Services\n\n    WebUI->>Sysevent: Set bridge_mode configuration\n    Sysevent->>GwProvApp: system-restart event\n    Note over GwProvApp: Validate configuration &amp; determine mode\n    GwProvApp->>HAL: Update hardware configuration\n    HAL-->>GwProvApp: Hardware configuration complete\n    GwProvApp->>Sysevent: Publish bridge_mode event\n    Sysevent->>Services: Notify network services\n    GwProvApp->>Sysevent: Publish operational status<\/pre><\/div>\n\n\n\n<p><strong>Event Notification Flow &#8211; Network Status Updates:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">sequenceDiagram\n    participant HAL as HAL Layer\n    participant GwProvApp as GwProvApp\n    participant Sysevent as Sysevent Framework\n    participant NetworkSvcs as Network Services\n    participant Middleware as RDK-B Components\n\n    HAL->>GwProvApp: Link status change notification\n    Note over GwProvApp: Process link state change\n    GwProvApp->>Sysevent: Publish phylink_wan_state\n    Sysevent->>NetworkSvcs: Notify WAN services\n    Sysevent->>Middleware: Notify dependent components\n    NetworkSvcs-->>Sysevent: Service status update\n    Sysevent->>GwProvApp: Service ready notification<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"implementation-details\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#implementation-details\">mplementation Details<\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"major-hal-apis-integration\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#major-hal-apis-integration\">Major HAL APIs Integration<\/a><\/h3>\n\n\n\n<p>GwProvApp integrates with multiple HAL interfaces to provide hardware abstraction and platform-specific functionality. The component leverages these APIs for cable modem control, Ethernet switching, and platform-specific operations.<\/p>\n\n\n\n<p><strong>Core HAL APIs:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code><strong>eSafeDevice_Initialize<\/strong>()<\/code><\/td><td>Initialize DOCSIS eSafe device with MAC address<\/td><td><code>macaddr_t&nbsp;*macAddr<\/code><\/td><td>void<\/td><td><code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><code><strong>eSafeDevice_SetProvisioningStatusProgress<\/strong>()<\/code><\/td><td>Update provisioning state in DOCSIS database<\/td><td><code>esafeProvStatusProgressExtIf_e&nbsp;status<\/code><\/td><td>void<\/td><td><code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><code><strong>eSafeDevice_SetErouterOperationMode<\/strong>()<\/code><\/td><td>Configure eRouter operational mode<\/td><td><code>esafeErouterOperModeExtIf_e&nbsp;mode<\/code><\/td><td>void<\/td><td><code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><code>CcspHalEthSwGetPortStatus()<\/code><\/td><td>Get Ethernet port link status<\/td><td><code><strong>port<\/strong>, *status, *linkRate, *duplexMode<\/code><\/td><td><code>CCSP_HAL_ETHSW_LINK_STATUS<\/code><\/td><td><code>autowan.c<\/code><\/td><\/tr><tr><td><code><strong>getNetworkDeviceMacAddress<\/strong>()<\/code><\/td><td>Retrieve device MAC address for interface configuration<\/td><td><code>macaddr_t&nbsp;*macAddr<\/code><\/td><td>void<\/td><td><code>gw_prov_sm.c<\/code><\/td><\/tr><tr><td><code><strong>parseTlv<\/strong>()<\/code><\/td><td>Parse DOCSIS TLV configuration data<\/td><td><code><strong>unsigned<\/strong>&nbsp;<strong>char<\/strong>&nbsp;*buffer,&nbsp;<strong>unsigned<\/strong>&nbsp;<strong>int<\/strong>&nbsp;length<\/code><\/td><td><code>TlvParsingStatusExtIf_e<\/code><\/td><td><code>gw_prov_sm.c<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"key-implementation-logic\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#key-implementation-logic\">Key Implementation Logic<\/a><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gateway Provisioning State Machine Engine<\/strong>: Core state management implemented through event-driven callbacks and state transition functions with comprehensive error handling and recovery mechanisms. Main state machine logic in&nbsp;<code><strong>gw_prov_sm_main<\/strong>()<\/code>&nbsp;function with initialization sequence coordination. State transition handlers in callback functions like&nbsp;<code>GWP_act_DocsisInited_callback()<\/code>,&nbsp;<code>GWP_act_ProvEntry_callback()<\/code>.<\/li>\n\n\n\n<li><strong>AutoWAN Decision Engine<\/strong>: Intelligent WAN technology selection based on link availability, configuration priorities, and operational requirements. AutoWAN main logic in&nbsp;<code>AutoWAN_main()<\/code>&nbsp;function with thread-based monitoring. Link status monitoring through&nbsp;<code>CheckEthWanLinkStatus()<\/code>&nbsp;and&nbsp;<code>CheckWanConnection()<\/code>&nbsp;functions. WAN mode selection algorithms in&nbsp;<code>TryAltWan()<\/code>&nbsp;and&nbsp;<code>ManageWanModes()<\/code>&nbsp;functions.<\/li>\n\n\n\n<li><strong>TLV Configuration Processing<\/strong>: DOCSIS configuration file parsing with validation, parameter extraction, and system configuration updates. TLV parsing initiated in&nbsp;<code>GWP_act_DocsisCfgfile_callback()<\/code>&nbsp;with comprehensive error handling. Configuration parameter extraction through&nbsp;<code>GW_Tr069PaSubTLVParse()<\/code>&nbsp;callback function. TR-069 parameter updates handled in dedicated&nbsp;<code>GWP_UpdateTr069CfgThread()<\/code>&nbsp;thread.<\/li>\n\n\n\n<li><strong>System Event Coordination<\/strong>: Multi-threaded event handling with dedicated threads for different event categories and comprehensive synchronization. Primary event handling in&nbsp;<code>GWP_sysevent_threadfunc()<\/code>&nbsp;with event registration and processing. Event type classification through&nbsp;<code>Get_GwpThreadType()<\/code>&nbsp;function mapping events to handlers. Thread synchronization using pthread mechanisms and sysevent framework coordination.<\/li>\n\n\n\n<li><strong>Error Handling Strategy<\/strong>: Comprehensive error detection, logging, and recovery mechanisms for hardware failures, configuration errors, and system resource issues. Hardware error handling with automatic retry mechanisms and fallback configurations. Configuration validation with default value restoration and corruption detection. System resource monitoring with graceful degradation and error reporting through telemetry.<\/li>\n\n\n\n<li><strong>Logging &amp; Debugging<\/strong>: Multi-level logging with RDK Logger integration, telemetry event generation, and debug configuration support. Conditional logging through&nbsp;<code>GWPROV_PRINT<\/code>&nbsp;macro with RDK Logger integration when available. Telemetry event generation using&nbsp;<code><strong>t2_event_d<\/strong>()<\/code>&nbsp;for operational metrics and error conditions. Debug configuration support through&nbsp;<code>\/etc\/debug.ini<\/code>&nbsp;file parsing and runtime log level control.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"key-configuration-files\"><a href=\"https:\/\/wiki.rdkcentral.com\/spaces\/RDK\/pages\/460988735\/GwProvApp#key-configuration-files\">Key Configuration Files<\/a><\/h3>\n\n\n\n<p>GwProvApp relies on several configuration files and persistent storage mechanisms for operational parameters, system configuration, and runtime state management.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>\/nvram\/TLVData.bin<\/code><\/td><td>Processed TLV configuration data from DOCSIS config file<\/td><td>DOCSIS configuration file updates, headend provisioning<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The Gateway Provisioning Application (GwProvApp) is the RDK-B middleware component responsible for managing gateway device [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"parent":9575,"menu_order":18,"comment_status":"open","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-9690","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GwProvApp - RDK Documentation Portal | Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GwProvApp - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"The Gateway Provisioning Application (GwProvApp) is the RDK-B middleware component responsible for managing gateway device [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-17T10:05:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/\",\"name\":\"GwProvApp - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"datePublished\":\"2022-06-21T13:53:01+00:00\",\"dateModified\":\"2026-02-17T10:05:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RDK Broadband\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Components\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"GwProvApp\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/\",\"name\":\"RDK Documentation Portal | Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GwProvApp - RDK Documentation Portal | Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/","og_locale":"en_US","og_type":"article","og_title":"GwProvApp - RDK Documentation Portal | Documentation","og_description":"The Gateway Provisioning Application (GwProvApp) is the RDK-B middleware component responsible for managing gateway device [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2026-02-17T10:05:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/","name":"GwProvApp - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"datePublished":"2022-06-21T13:53:01+00:00","dateModified":"2026-02-17T10:05:21+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/gwprovapp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"RDK Broadband","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/"},{"@type":"ListItem","position":4,"name":"Components","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/"},{"@type":"ListItem","position":5,"name":"GwProvApp"}]},{"@type":"WebSite","@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website","url":"https:\/\/developer.rdkcentral.com\/documentation\/","name":"RDK Documentation Portal | Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=9690"}],"version-history":[{"count":2,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9690\/revisions"}],"predecessor-version":[{"id":12718,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9690\/revisions\/12718"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9575"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=9690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}