Introduction
WebUI is a graphical user interface that is available to the connected devices. It acts as an application running on the RDK-B stack and performs the functions of a device management interface similar to TR69 & SNMP. A user can monitor and modify RDK-B feature settings/rules using WebUI. It is a client–server application, client runs in a web browser (as part of devices connected over LAN) and Lighttpd on the RDK-B stack acts as server. The functions in WebUI are defined in C and are called from PHP using ZEND_API. PHP and the Zend Engine manage [exchange] variables internally over the D-Bus.
Architecture
This is the architecture of WebUI component.
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTQ5MiIsImRpYWdyYW1OYW1lIjoid2VidWkgYXJjaGl0ZWN0dXJlLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJXZWJ1aSIsInRic3R5bGUiOiJ0b3AiLCJjYW5Db21tZW50IjpmYWxzZSwiZGlhZ3JhbVVybCI6IiIsImNzdkZpbGVVcmwiOiIiLCJib3JkZXIiOnRydWUsIm1heFNjYWxlIjoiMSIsIm93bmluZ1BhZ2VJZCI6MjEzNjU2OTAsImVkaXRhYmxlIjpmYWxzZSwiY2VvSWQiOjM2MzA3MDQxOSwicGFnZUlkIjoiIiwibGJveCI6dHJ1ZSwic2VydmVyQ29uZmlnIjp7ImVtYWlscHJldmlldyI6IjEifSwib2RyaXZlSWQiOiIiLCJyZXZpc2lvbiI6MSwibWFjcm9JZCI6IjZiMmRlYmE3LTViZWQtNDAzNy04ZjA2LThmMDNlYWNiYzc3ZCIsInByZXZpZXdOYW1lIjoid2VidWkgYXJjaGl0ZWN0dXJlLmRyYXdpby5wbmciLCJsaWNlbnNlU3RhdHVzIjoiT0siLCJzZXJ2aWNlIjoiIiwiaXNUZW1wbGF0ZSI6IiIsIndpZHRoIjoibnVsbCIsInNpbXBsZVZpZXdlciI6ZmFsc2UsImxhc3RNb2RpZmllZCI6MTYxNDY5NDU1MTAwMCwiZXhjZWVkUGFnZVdpZHRoIjpmYWxzZSwib0NsaWVudElkIjoiIn0=
Figure 1. WebUI Architecture
WebUI component uses HTML and JavaScript on Client side [ browser ] and PHP on Server side [ Lighttpd ]. Zend Engine (ZE) analyses the input code, translates it, and executes it. PHP is functionality of the language (its functions, classes, etc.) and interface is the part that talks to the Web server. "cosa.so" [ ZEND library ] is loaded at runtime using the extension tag in php.ini. In case of Dual core architecture, separate Lighttpd instances run on each core and one will act as a proxy.
Core functions that interact with RDK-B’s components are:
getStr(Obj)
setStr(Obj, Value, Flag)
getInstanceIDs(Obj)
DmExtGetInstanceIds(Obj)
addTblObj(RootObj)
delTblObj(RootObjIndex)
DmExtGetStrsWithRootObj(RootObj, ObjArray)
DmExtSetStrsWithRootObj(RootObj, Flag, 2D-Array)
Flow diagram for getStr(Obj):
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTQ4OCIsImRpYWdyYW1OYW1lIjoiRmxvdyBkaWFncmFtIGZvciBnZXRTdHIoT2JqKS5kcmF3aW8iLCJhc3BlY3QiOiIiLCJsaW5rcyI6ImF1dG8iLCJjZW9OYW1lIjoiV2VidWki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WYWx1ZSwgRmxhZykuZHJhd2lvIiwiYXNwZWN0IjoiIiwibGlua3MiOiJhdXRvIiwiY2VvTmFtZSI6IldlYnVpIiwidGJzdHlsZSI6InRvcCIsImNhbkNvbW1lbnQiOmZhbHNlLCJkaWFncmFtVXJsIjoiIiwiY3N2RmlsZVVybCI6IiIsImJvcmRlciI6dHJ1ZSwibWF4U2NhbGUiOiIxIiwib3duaW5nUGFnZUlkIjoyMTM2NTY5MCwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MzYzMDcwNDE5LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiZDc4OTJhY2ItYzY4ZC00YTg2LWE0NGEtNTU5MmVlZjI1MTlmIiwicHJldmlld05hbWUiOiJGbG93IGRpYWdyYW0gZm9yIGdldFN0cihPYmosIFZhbHVlLCBGbGFnKS5kcmF3aW8ucG5nIiwibGljZW5zZVN0YXR1cyI6Ik9LIiwic2VydmljZSI6IiIsImlzVGVtcGxhdGUiOiIiLCJ3aWR0aCI6Im51bGwiLCJzaW1wbGVWaWV3ZXIiOmZhbHNlLCJsYXN0TW9kaWZpZWQiOjE2MTQ2OTQ1NTEwMDAsImV4Y2VlZFBhZ2VXaWR0aCI6ZmFsc2UsIm9DbGllbnRJZCI6IiJ9
Note: The name Zend refers to the language engine [ PHP's core ]
Features
Gateway
At a Glance, Connection Status, Local IP Network, Wi-Fi, MTA, MoCA, Firewall IPv4 / IPv6, Software, Hardware, etc.
Connected Devices
Connected Devices and Range Extenders
Parental Control
Managed Sites, Managed Services, Managed Devices and Reports
Advanced
Port Forwarding, Port Triggering, Remote Management, DMZ, Device Discovery.
Troubleshooting
Troubleshooting Logs, Diagnostic Tools, Wi-Fi Spectrum Analyzer, MoCA Diagnostics, Reset/Restore Gateway, Change Password, etc.
Note: Only MSO has access to monitor / modify Email Notification (Gateway -> At a Glance, Wi-Fi Home Security and Community Wi-Fi
Code Flow
WebUI on the Device:
- “/etc/webgui.sh” will modify “/etc/lighttpd.conf” on runtime and create “/tmp/lighttpd.conf”
- Command to run lighttpd is “lighttpd –f /tmp/lighttpd.conf”
- “cosa.so” is linked as an extension to “php” in “/etc/php.ini”
- document-root = “/usr/www/”
- Inside “/usr/www/” we have,
- actionHandler folderhandles PHP SET actions
- cmn folder has css, fonts, img and js [Styling & JS Lib]
- includes folder has header.php, footer.php. nav.php, userbar.php and utility.php
WebUI on RDK-B Yocto Repo
- On RDK-B, Web UI source code resides in the path –
code.rdkcentral.com/rdkb/components/opensource/ccsp/webui/generic/source/Styles/xb3/code
- During build time “code” folder is moved to “/usr/www/”
- On yocto for build we can have specific target and what to build
$ repo init -u https://code.rdkcentral.com/r/manifests -b rdk-next -m rdkb-extsrc.xml
$ repo sync -j4 --no-clone-bundle
$ source meta-cmf-raspberrypi/setup-environment (Select option raspberrypi-rdk-broadband.conf)
$ bitbake rdk-generic-broadband-image
$ bitbake –c compile –f lighttpd
$ bitbake –c compile –f ccsp-webui
For details on WebUI Migration to jst, go to WebUI Migration to jst