
{"id":12809,"date":"2026-03-13T07:38:49","date_gmt":"2026-03-13T07:38:49","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/?page_id=12809"},"modified":"2026-03-13T07:39:23","modified_gmt":"2026-03-13T07:39:23","slug":"dhcp-manager-main-controller","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/","title":{"rendered":"DHCP Manager Main Controller"},"content":{"rendered":"\n<p>The Main Controller (<code>dhcpmgr_controller.c\/h<\/code>) serves as the central coordination hub for the DHCP Client Manager. It orchestrates DHCP client lifecycle management, monitors interface status changes, coordinates lease processing, and manages the interaction between various components of the system.<br><br><img decoding=\"async\" height=\"250\" src=\"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2\" alt=\"\"><\/p>\n\n\n\n<p><em>Figure 1: Main Controller Flow Chart &#8211; Shows the decision flow and operational logic of the main controller thread<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"DHCPManagerMainController-Architecture\">Architecture<\/h2>\n\n\n\n<p>The controller implements a state-driven architecture that continuously monitors system conditions and responds to changes:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502   TR-181 Events     \u2502\u2500\u2500\u2500\u2500\u25ba\u2502  Main Controller    \u2502\u2500\u2500\u2500\u2500\u25ba\u2502  DHCP Clients       \u2502\n\u2502                     \u2502     \u2502                     \u2502     \u2502                     \u2502\n\u2502 \u2022 Config Changes    \u2502     \u2502 \u2022 State Machine     \u2502     \u2502 \u2022 udhcpc            \u2502\n\u2502 \u2022 Enable\/Disable    \u2502     \u2502 \u2022 Interface Monitor \u2502     \u2502 \u2022 dibbler           \u2502\n\u2502 \u2022 Option Updates    \u2502     \u2502 \u2022 Lease Coordinator \u2502     \u2502 \u2022 Config Generation \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                      \u2502\n                                      \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502   Lease Handlers    \u2502\u25c4\u2500\u2500\u2500\u2500\u2502  Lease Processing   \u2502\u2500\u2500\u2500\u2500\u25ba\u2502  System Events      \u2502\n\u2502                     \u2502     \u2502                     \u2502     \u2502                     \u2502\n\u2502 \u2022 DHCPv4 Handler    \u2502     \u2502 \u2022 Lease Validation  \u2502     \u2502 \u2022 Network Config    \u2502\n\u2502 \u2022 DHCPv6 Handler    \u2502     \u2502 \u2022 Status Updates    \u2502     \u2502 \u2022 WAN Manager       \u2502\n\u2502 \u2022 Data Model Update \u2502     \u2502 \u2022 Event Generation  \u2502     \u2502 \u2022 Interface Events  \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/pre>\n\n\n\n<p><br>Key Components<\/p>\n\n\n\n<p><strong>Files<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Source<\/strong>:\u00a0<code>source\/DHCPMgrUtils\/dhcpmgr_controller.c<\/code><\/li>\n\n\n\n<li><strong>Header<\/strong>:\u00a0<code>source\/DHCPMgrUtils\/dhcpmgr_controller.h<br><\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Core Functions<\/strong><\/p>\n\n\n\n<p>DhcpMgr_StartMainController()<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose<\/strong>: Initializes and starts the main controller thread<\/li>\n\n\n\n<li><strong>Returns<\/strong>: 0 on success, negative error code on failure<\/li>\n\n\n\n<li><strong>Threading<\/strong>: Creates main controller thread with proper error handling<\/li>\n<\/ul>\n\n\n\n<p>DhcpMgr_MainController(void *args)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose<\/strong>: Main control loop managing DHCP client lifecycle<\/li>\n\n\n\n<li><strong>Behavior<\/strong>: Continuous monitoring and state management<\/li>\n\n\n\n<li><strong>Responsibilities<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Interface status monitoring<\/li>\n\n\n\n<li>DHCP client startup\/shutdown<\/li>\n\n\n\n<li>Lease processing coordination<\/li>\n\n\n\n<li>Error recovery handling<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>DHCP Client Management<\/p>\n\n\n\n<p><strong>DHCPv4 Client Control<\/strong><\/p>\n\n\n\n<p>The controller manages udhcpc clients with comprehensive lifecycle management:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ConfigurationBuilding\">Configuration Building<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static int DhcpMgr_build_dhcpv4_opt_list(\n    PCOSA_CONTEXT_DHCPC_LINK_OBJECT hInsContext,\n    dhcp_opt_list **req_opt_list,\n    dhcp_opt_list **send_opt_list\n)\n<\/pre>\n\n\n\n<p><strong>Function Details<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Constructs DHCP option lists from TR-181 DML entries<\/li>\n\n\n\n<li>Processes requested options (options to request from server)<\/li>\n\n\n\n<li>Processes sent options (options to send to server)<\/li>\n\n\n\n<li>Handles custom vendor-specific options<\/li>\n\n\n\n<li>Validates option formats and values<\/li>\n<\/ul>\n\n\n\n<p><strong>Option Processing<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Requested Options<\/strong>: Options the client wants from server\n<ul class=\"wp-block-list\">\n<li>Standard options (subnet mask, router, DNS, etc.)<\/li>\n\n\n\n<li>Vendor-specific options<\/li>\n\n\n\n<li>Custom application options<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Sent Options<\/strong>: Options the client sends to server\n<ul class=\"wp-block-list\">\n<li>Client identifier<\/li>\n\n\n\n<li>Vendor class identifier<\/li>\n\n\n\n<li>Custom client information<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-InterfaceStatusMonitoring\">Interface Status Monitoring<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static bool DhcpMgr_checkInterfaceStatus(const char *ifName)\n<\/pre>\n\n\n\n<p><strong>Functionality<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verifies interface operational status<\/li>\n\n\n\n<li>Checks link state (up\/down)<\/li>\n\n\n\n<li>Validates interface configuration<\/li>\n\n\n\n<li>Returns interface readiness for DHCP operations<\/li>\n<\/ul>\n\n\n\n<p><strong><br>DHCPv6 Client Control<\/strong><\/p>\n\n\n\n<p>The controller manages dibbler clients with specialized IPv6 handling:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ConfigurationBuilding.1\">Configuration Building<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static int DhcpMgr_build_dhcpv6_opt_list(\n    PCOSA_CONTEXT_DHCPCV6_LINK_OBJECT hInsContext,\n    dhcp_opt_list **req_opt_list,\n    dhcp_opt_list **send_opt_list\n)\n<\/pre>\n\n\n\n<p><strong>Function Details<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Constructs DHCPv6 option lists from TR-181 DML entries<\/li>\n\n\n\n<li>Handles IANA (non-temporary addresses) options<\/li>\n\n\n\n<li>Handles IAPD (prefix delegation) options<\/li>\n\n\n\n<li>Processes vendor-specific options<\/li>\n\n\n\n<li>Validates IPv6-specific option formats<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-Link-LocalAddressVerification\">Link-Local Address Verification<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static bool DhcpMgr_checkLinkLocalAddress(const char *interfaceName)\n<\/pre>\n\n\n\n<p><strong>IPv6 Requirements<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verifies link-local address presence<\/li>\n\n\n\n<li>Required for DHCPv6 client operation<\/li>\n\n\n\n<li>Checks address scope and validity<\/li>\n\n\n\n<li>Ensures proper IPv6 stack initialization<br><\/li>\n<\/ul>\n\n\n\n<p>Lease Processing Coordination<\/p>\n\n\n\n<p><strong>DHCPv4 Lease Handling<\/strong><\/p>\n\n\n\n<p>DHCPMgr_AddDhcpv4Lease(char *ifName, DHCPv4_PLUGIN_MSG *newLease)<\/p>\n\n\n\n<p><strong>Process Flow<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Interface Lookup<\/strong>: Locate DHCP client by interface name<\/li>\n\n\n\n<li><strong>Validation<\/strong>: Verify lease data integrity<\/li>\n\n\n\n<li><strong>Queue Management<\/strong>: Add lease to processing queue<\/li>\n\n\n\n<li><strong>Memory Management<\/strong>: Allocate lease structure<\/li>\n\n\n\n<li><strong>Error Handling<\/strong>: Cleanup on failure<\/li>\n<\/ol>\n\n\n\n<p><strong>Lease Structure Management<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">typedef struct {\n    DHCPv4_PLUGIN_MSG *NewLeases;     \/\/ Pending lease queue\n    DHCPv4_PLUGIN_MSG *currentLease;  \/\/ Active lease\n    \/\/ ... other DHCP client data\n} COSA_DML_DHCPC_FULL;\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-DhcpMgr_ProcessV4Lease(PCOSA_DML_DHCPC_FULLpDhcpc)\"><code>DhcpMgr_ProcessV4Lease(PCOSA_DML_DHCPC_FULL pDhcpc)<\/code><\/h4>\n\n\n\n<p><strong>Processing Steps<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Lease Retrieval<\/strong>: Get next lease from queue<\/li>\n\n\n\n<li><strong>Comparison<\/strong>: Compare with current lease<\/li>\n\n\n\n<li><strong>Validation<\/strong>: Verify lease parameters<\/li>\n\n\n\n<li><strong>TR-181 Update<\/strong>: Update data model<\/li>\n\n\n\n<li><strong>Network Configuration<\/strong>: Configure interface<\/li>\n\n\n\n<li><strong>Event Generation<\/strong>: Notify other components<\/li>\n\n\n\n<li><strong>Persistence<\/strong>: Store lease for recovery<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-DHCPv6LeaseHandling\">DHCPv6 Lease Handling<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-DHCPMgr_AddDhcpv6Lease(char*ifName,DHCPv6_PLUGIN_MSG*newLease)\"><code>DHCPMgr_AddDhcpv6Lease(char *ifName, DHCPv6_PLUGIN_MSG *newLease)<\/code><\/h4>\n\n\n\n<p><strong>IPv6-Specific Processing<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Dual Stack Management<\/strong>: Handle IANA and IAPD separately<\/li>\n\n\n\n<li><strong>Prefix Delegation<\/strong>: Process IPv6 prefix assignments<\/li>\n\n\n\n<li><strong>Address Assignment<\/strong>: Handle individual IPv6 addresses<\/li>\n\n\n\n<li><strong>Option Processing<\/strong>: Handle IPv6-specific options<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-DhcpMgr_ProcessV6Lease(PCOSA_DML_DHCPCV6_FULLpDhcp6c)\"><code>DhcpMgr_ProcessV6Lease(PCOSA_DML_DHCPCV6_FULL pDhcp6c)<\/code><\/h4>\n\n\n\n<p><strong>IPv6 Lease Processing<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>IANA Processing<\/strong>: Non-temporary address handling<\/li>\n\n\n\n<li><strong>IAPD Processing<\/strong>: Prefix delegation handling<\/li>\n\n\n\n<li><strong>Lease Comparison<\/strong>: Detect changes in assignments<\/li>\n\n\n\n<li><strong>Route Configuration<\/strong>: Set up IPv6 routing<\/li>\n\n\n\n<li><strong>Event Notification<\/strong>: Generate IPv6-specific events<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"DHCPManagerMainController-StateManagement\">State Management<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ClientStateMachine\">Client State Machine<\/h3>\n\n\n\n<p>Each DHCP client maintains state through the controller:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    Enable    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    Interface    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502  DISABLED   \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba\u2502   STARTING  \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba\u2502   RUNNING   \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518       Up        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n       \u25b2                            \u2502                                \u2502\n       \u2502                            \u2502 Timeout                       \u2502\n       \u2502         Disable            \u2502                               \u2502\n       \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                    \u25bc                     Interface Down\n                              \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510                       \u2502\n                              \u2502   ERROR     \u2502\u25c4\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-InterfaceMonitoring\">Interface Monitoring<\/h3>\n\n\n\n<p>The controller continuously monitors interface conditions:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-StatusChecks\">Status Checks<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Link State<\/strong>: Physical link up\/down status<\/li>\n\n\n\n<li><strong>Configuration<\/strong>: IP configuration readiness<\/li>\n\n\n\n<li><strong>Driver Status<\/strong>: Network driver operational state<\/li>\n\n\n\n<li><strong>Administrative State<\/strong>: Interface enabled\/disabled<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-EventResponses\">Event Responses<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Interface Up<\/strong>: Start appropriate DHCP clients<\/li>\n\n\n\n<li><strong>Interface Down<\/strong>: Stop clients and cleanup resources<\/li>\n\n\n\n<li><strong>Configuration Change<\/strong>: Restart clients with new configuration<\/li>\n\n\n\n<li><strong>Error Conditions<\/strong>: Implement recovery procedures<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"DHCPManagerMainController-IntegrationPoints\">Integration Points<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-TR-181DataModelIntegration\">TR-181 Data Model Integration<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ConfigurationSource\">Configuration Source<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Device.DHCPv4.Client.{i}.*<\/code>\u00a0&#8211; DHCPv4 client parameters<\/li>\n\n\n\n<li><code>Device.DHCPv6.Client.{i}.*<\/code>\u00a0&#8211; DHCPv6 client parameters<\/li>\n\n\n\n<li>Dynamic updates trigger client reconfiguration<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-StatusUpdates\">Status Updates<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lease information published to TR-181<\/li>\n\n\n\n<li>Client operational status<\/li>\n\n\n\n<li>Error conditions and diagnostics<\/li>\n\n\n\n<li>Performance metrics<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-SystemEventIntegration\">System Event Integration<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-EventGeneration\">Event Generation<\/h4>\n\n\n\n<p>The controller generates system events for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lease acquisition\/renewal\/release<\/li>\n\n\n\n<li>IP address changes<\/li>\n\n\n\n<li>Client state transitions<\/li>\n\n\n\n<li>Error conditions<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-EventConsumption\">Event Consumption<\/h4>\n\n\n\n<p>The controller responds to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interface state changes<\/li>\n\n\n\n<li>Network configuration updates<\/li>\n\n\n\n<li>Administrative commands<\/li>\n\n\n\n<li>Recovery triggers<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ErrorHandlingandRecovery\">Error Handling and Recovery<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ClientProcessManagement\">Client Process Management<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ProcessMonitoring\">Process Monitoring<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void processKilled(pid_t pid)\n<\/pre>\n\n\n\n<p><strong>Functionality<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Monitors DHCP client process health<\/li>\n\n\n\n<li>Detects abnormal process termination<\/li>\n\n\n\n<li>Initiates recovery procedures<\/li>\n\n\n\n<li>Updates client state appropriately<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-RecoveryProcedures\">Recovery Procedures<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Process Restart<\/strong>: Automatic client restart on failure<\/li>\n\n\n\n<li><strong>State Recovery<\/strong>: Restore previous lease information<\/li>\n\n\n\n<li><strong>Configuration Rebuild<\/strong>: Regenerate client configuration<\/li>\n\n\n\n<li><strong>Interface Reset<\/strong>: Reset interface if necessary<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"DHCPManagerMainController-LeaseValidation\">Lease Validation<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-DataIntegrityChecks\">Data Integrity Checks<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify lease parameter validity<\/li>\n\n\n\n<li>Validate IP address formats<\/li>\n\n\n\n<li>Check lease timing parameters<\/li>\n\n\n\n<li>Ensure option consistency<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"DHCPManagerMainController-ConflictResolution\">Conflict Resolution<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Handle duplicate lease information<\/li>\n\n\n\n<li>Resolve timing conflicts<\/li>\n\n\n\n<li>Manage option precedence<\/li>\n\n\n\n<li>Coordinate multiple interfaces<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Main Controller (dhcpmgr_controller.c\/h) serves as the central coordination hub for the DHCP Client Manager. [&hellip;]<\/p>\n","protected":false},"author":659,"featured_media":0,"parent":12785,"menu_order":0,"comment_status":"closed","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-12809","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>DHCP Manager Main Controller - 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\/dhcp-client-manager\/dhcp-manager-main-controller\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DHCP Manager Main Controller - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"The Main Controller (dhcpmgr_controller.c\/h) serves as the central coordination hub for the DHCP Client Manager. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-13T07:39:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2\" \/>\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=\"4 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\/dhcp-client-manager\/dhcp-manager-main-controller\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/\",\"name\":\"DHCP Manager Main Controller - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2\",\"datePublished\":\"2026-03-13T07:38:49+00:00\",\"dateModified\":\"2026-03-13T07:39:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage\",\"url\":\"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2\",\"contentUrl\":\"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#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\":\"DHCP Client Manager\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"DHCP Manager Main Controller\"}]},{\"@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":"DHCP Manager Main Controller - 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\/dhcp-client-manager\/dhcp-manager-main-controller\/","og_locale":"en_US","og_type":"article","og_title":"DHCP Manager Main Controller - RDK Documentation Portal | Documentation","og_description":"The Main Controller (dhcpmgr_controller.c\/h) serves as the central coordination hub for the DHCP Client Manager. [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2026-03-13T07:39:23+00:00","og_image":[{"url":"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/","name":"DHCP Manager Main Controller - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"primaryImageOfPage":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage"},"image":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage"},"thumbnailUrl":"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2","datePublished":"2026-03-13T07:38:49+00:00","dateModified":"2026-03-13T07:39:23+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#primaryimage","url":"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2","contentUrl":"https:\/\/wiki.rdkcentral.com\/download\/thumbnails\/466452782\/Main_controller_flow_chart.png?version=1&amp;modificationDate=1772794841000&amp;api=v2"},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/dhcp-manager-main-controller\/#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":"DHCP Client Manager","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/dhcp-client-manager\/"},{"@type":"ListItem","position":6,"name":"DHCP Manager Main Controller"}]},{"@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\/12809","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\/659"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=12809"}],"version-history":[{"count":1,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12809\/revisions"}],"predecessor-version":[{"id":12810,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12809\/revisions\/12810"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12785"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=12809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}