RDK Documentation (Open Sourced RDK Components)
Network Service Manager APIs

Description

Functions

bool netSrvMgrUtiles::getMacAddress_IfName (const char *ifName_in, char macAddress_out[18])
 This function is used to get the MAC address for the provided interface. More...
 
void netSrvMgrUtiles::triggerDhcpLease (const char *operation, const char *interface)
 This function trigger the process by which the DHCP client renews or updates its IP address configuration data with the DHCP server. More...
 
void netSrvMgrUtiles::triggerDhcpRenew (const char *interface=NULL)
 
void netSrvMgrUtiles::triggerDhcpReleaseAndRenew (const char *interface)
 
bool netSrvMgrUtiles::getRouteInterface (char *devname)
 This function retrieves information about the active routing interface. More...
 
bool netSrvMgrUtiles::readDevFile (char *deviceName)
 This function gets the device interface type(Ethernet/MOCA/WIFI) of the input device name. This function reads the device interface type from device properties file. More...
 
char netSrvMgrUtiles::getAllNetworkInterface (char *devAllInterface)
 This function parse all the device interface details and gives all the network interface device name in the output buffer. This function also returns the total network interface count. More...
 
bool netSrvMgrUtiles::getCurrentTime (char *currTime, const char *timeFormat)
 This function retrieves the current time using the requested format specifier. More...
 
bool netSrvMgrUtiles::checkInterfaceActive (char *interfaceName)
 This function returns the Ethernet active status of the interface, if finds the status from interface status file. More...
 
bool netSrvMgrUtiles::getSTBip (char *stbip, bool *isIpv6)
 This function is used to get STB IP address and its IP version. More...
 
bool netSrvMgrUtiles::getInterfaceConfig (const char *ifName, const unsigned int family, char *interfaceIp, char *netMask)
 This function is used to get Interface IP address and on which interface. More...
 
bool netSrvMgrUtiles::getDNSip (const unsigned int family, char *primaryDNS, char *secondaryDNS)
 This function is used to get Interface IP address and on which interface. More...
 
bool netSrvMgrUtiles::getSTBip_family (char *stbip, const char *family)
 
bool netSrvMgrUtiles::getRouteInterfaceType (char *devname)
 This function gets the active interface device type(Ethernet/MOCA/WIFI). More...
 
bool netSrvMgrUtiles::chk_ipaddr_linklocal (const char *stbip, unsigned int family)
 This function checks whether IP string(IPv4 and IPv6) is link local address or not. More...
 
bool netSrvMgrUtiles::currentActiveInterface (char *currentInterface)
 This function is used to get the current active interface(WIFI/MOCA). More...
 
bool netSrvMgrUtiles::check_global_v6_based_macaddress (std::string ipv6Addr, std::string macAddr)
 This function checks whether the input ipv6 address is based on specified mac address. More...
 
bool netSrvMgrUtiles::check_global_v6_ula_address (std::string ipv6Addr)
 This function checks whether the input ipv6 address is Unique Local Address. More...
 
bool netSrvMgrUtiles::getCommandOutput (const char *command, char *output_buffer, size_t output_buffer_size)
 This function is used to get the output of running the specified command. More...
 
bool netSrvMgrUtiles::getNetMask_IfName (const char *ifName_in, const unsigned int, char *netMask_out)
 This function is used to get the NetMask address for the provided interface. More...
 
bool netSrvMgrUtiles::isIPv4AddressScopeDocumentation (const std::string &ipv4_address)
 This function checks if the input ipv4 address is a unicast address reserved for documentation. More...
 
void startMocaTelemetry ()
 Initializes a thread to retrieve and send MoCA related telemetry data.
 
void * mocaTelemetryThread (void *arg)
 This Thread function prints the statistics information on MOCA interface if the MOCA link is up.
 
static void _mocaEventHandler (const char *owner, IARM_EventId_t eventId, void *data, size_t len)
 
static void eventCallback (const enum RMH_Event event, const struct RMH_EventData *eventData, void *userContext)
 
void sendDefaultGatewayRoute ()
 This function is used to init thread attributes and create thread to send route data event.
 
void * sendDefaultGatewayRouteThrd (void *arg)
 Thread function handles the current route data by identifying appropriate IP mode to send route data event. This functions sends event to IARM client, so that listeners are notified by this event.
 
void getGatewayRouteData ()
 This function is used to init thread attributes and create thread to get route data.
 
static void _evtHandler (const char *owner, IARM_EventId_t eventId, void *data, size_t len)
 
void * getGatewayRouteDataThrd (void *arg)
 When there is a new gateway data, this thread function used IARM Bus call to get XUPNP device information. Received gateway results would be parsed and append the gateway route data to the route list.
 
gboolean checkvalidip (char *ipAddress)
 This will check whether the input IP Address is a valid IPv4 or IPv6 address. More...
 
gboolean checkvalidhostname (char *hostname)
 This function will check whether a Host name is valid by validating all the associated IP addresses. More...
 
bool checkIpMode (char *v6Prefix)
 This function is used to check whether the input IP Address belongs to IPv4 or IPv6 address. More...
 
WiFiStatusCode_t get_WifiRadioStatus ()
 This function is used to get WIFI connectivity status. More...
 
WiFiConnectionTypeCode_t get_WifiConnectionType ()
 This function is used to get WIFI connection type. More...
 
bool ethernet_on ()
 This function is used to get the ethernet connection ON/OFF status in order to proceed with IARM bus calls. More...
 
bool updateWiFiList ()
 This function gets the host interface parameters through IARM TR69 calls and update BSS identifier list data. More...
 
bool shutdownWifi ()
 This function is used to cancel all the WIFI related threads and un initialize the WIFI module. More...
 
bool isWiFiCapable ()
 This function is used to check whether the device supports wireless communication or not. More...
 
void get_CurrentSsidInfo (WiFiConnectionStatus *currSsidConnInfo)
 This function is used to get current SSID and connection status from persistent memory. More...
 
void put_boolean (char *ptr, bool val)
 This function converts the input data to Boolean type. More...
 
void put_int (char *ptr, int val)
 This function converts the input data to integer type. More...
 
bool storeMfrWifiCredentials (void)
 This function retrieve and store the WIFI credentials(SSID, password). More...
 
bool eraseMfrWifiCredentials (void)
 This function erase the stored MFR WIFI credentials. More...
 
bool getRadioStats (WiFi_Radio_Stats_Diag_Params *params)
 This function is used to get detail radio traffic statistics information. More...
 
void getConnectedSSIDInfo (WiFiConnectedSSIDInfo_t *)
 This function is used to get the connected SSID informations such as SSID, BSSID, signal strength etc,. More...
 
void getEndPointInfo (WiFi_EndPoint_Diag_Params *)
 This function checks for WIFI connection enable status, If connection enabled, then it provide WIFI statistics information such as enable status, SSID, signal strength, data transmission rate etc.,. More...
 
bool cancelWPSPairingOperation ()
 
int WiFiNetworkMgr::create_wpa_supplicant_conf_from_netapp_db (const char *wpa_supplicant_conf_file, const char *netapp_db_file)
 This function 1. Extract "SSID", "BSSID", "Password", "Security" from specified netapp_db_file. More...
 

Variables

ssidList gSsidList
 

Function Documentation

◆ getMacAddress_IfName()

bool netSrvMgrUtiles::getMacAddress_IfName ( const char *  ifName_in,
char  macAddress_out[18] 
)

This function is used to get the MAC address for the provided interface.

Parameters
[in]ifName_inIndicates the interface name which the mac address is required.
[out]macAddress_outIndicates the mac address of ifname_in interface name.
Returns
Returns true if successfully gets the mac address of interface provided or else false.

◆ triggerDhcpLease()

void netSrvMgrUtiles::triggerDhcpLease ( const char *  operation,
const char *  interface 
)

This function trigger the process by which the DHCP client renews or updates its IP address configuration data with the DHCP server.

Triggers a "renew" or "release and renew" of DHCP lease on specified interface. If DHCP lease renew is requested, the specified interface may be NULL in which case a DHCP lease renew will be triggered for all interfaces running the DHCPv4 client. If DHCP lease release and renew is requested, the specified interface must not be NULL.

Parameters
[in]operationDHCP lease renew / DHCP lease release and renew.
[in]interfaceinterface to operate on.
[in]operationDHCP lease operation to perform ("renew" or "release and renew")
[in]interfaceinterface (wlan0, eth0, etc.) to perform DHCP lease operation on

Definition at line 171 of file netsrvmgrUtiles.cpp.

◆ getRouteInterface()

bool netSrvMgrUtiles::getRouteInterface ( char *  devname)

This function retrieves information about the active routing interface.

Parameters
[out]devnameDevice name buffer to be filled.
Returns
Returns true if successfully found the route interface or else false.

Definition at line 263 of file netsrvmgrUtiles.cpp.

◆ readDevFile()

bool netSrvMgrUtiles::readDevFile ( char *  deviceName)

This function gets the device interface type(Ethernet/MOCA/WIFI) of the input device name. This function reads the device interface type from device properties file.

Parameters
[in/out]Interface deviceName as input and Device type buffer to be filled as output.
Returns
Returns true if successfully gets the route interface type or else false.

Definition at line 289 of file netsrvmgrUtiles.cpp.

◆ getAllNetworkInterface()

char netSrvMgrUtiles::getAllNetworkInterface ( char *  devAllInterface)

This function parse all the device interface details and gives all the network interface device name in the output buffer. This function also returns the total network interface count.

Parameters
[out]devAllInterfaceEvery interface device names.
Returns
Returns total network interface count.

Definition at line 349 of file netsrvmgrUtiles.cpp.

◆ getCurrentTime()

bool netSrvMgrUtiles::getCurrentTime ( char *  currTime,
const char *  timeFormat 
)

This function retrieves the current time using the requested format specifier.

Parameters
[out]currTimeCurrent time to be filled.
[in]timeFormatRequested time format to give the current time.
Returns
Returns true if successfully gets the current time and converted to specified format or else false.

Definition at line 389 of file netsrvmgrUtiles.cpp.

◆ checkInterfaceActive()

bool netSrvMgrUtiles::checkInterfaceActive ( char *  interfaceName)

This function returns the Ethernet active status of the interface, if finds the status from interface status file.

Parameters
[out]interfaceNameInterface name for which network status required.
Returns
Returns true if Ethernet mode is "Up" or else false.

Definition at line 409 of file netsrvmgrUtiles.cpp.

◆ getSTBip()

bool netSrvMgrUtiles::getSTBip ( char *  stbip,
bool *  isIpv6 
)

This function is used to get STB IP address and its IP version.

Parameters
[out]stbipSTB IP.
[out]isIpv6Internet Protocol Version.
Returns
Returns true if successfully gets the IP details, Otherwise returns false.

Definition at line 535 of file netsrvmgrUtiles.cpp.

◆ getInterfaceConfig()

bool netSrvMgrUtiles::getInterfaceConfig ( const char *  ifName,
const unsigned int  family,
char *  interfaceIp,
char *  netMask 
)

This function is used to get Interface IP address and on which interface.

Parameters
[in]ifName` Interface in string format. Valid values are "ETHERNET" or "WIFI"
[in]familyIP Address family in string format. Valid values are "ipv6" or "ipv4"
[out]InterfaceIPIP of the Interface .
[out]netmaskNetmask of the interface
Returns
Returns true if successfully gets the IP details, Otherwise returns false.

Definition at line 481 of file netsrvmgrUtiles.cpp.

◆ getDNSip()

bool netSrvMgrUtiles::getDNSip ( const unsigned int  family,
char *  primaryDNS,
char *  secondaryDNS 
)

This function is used to get Interface IP address and on which interface.

Parameters
[out]InterfaceIP IP of the Interface .
[out]interfaceInternet Protocol Version.
Returns
Returns true if successfully gets the IP details, Otherwise returns false.

Definition at line 1472 of file netSrvMgrMain.cpp.

◆ getRouteInterfaceType()

bool netSrvMgrUtiles::getRouteInterfaceType ( char *  devname)

This function gets the active interface device type(Ethernet/MOCA/WIFI).

Parameters
[out]devnameDevice type buffer to be filled.
Returns
Returns true if successfully gets the route interface type or else false.

Definition at line 272 of file netsrvmgrUtiles.cpp.

◆ chk_ipaddr_linklocal()

bool netSrvMgrUtiles::chk_ipaddr_linklocal ( const char *  stbip,
unsigned int  family 
)

This function checks whether IP string(IPv4 and IPv6) is link local address or not.

Parameters
[in]stbipSTB IP.
[in]familyInterface family.
Returns
Returns false in case of not supported interface family data passed.

Definition at line 636 of file netsrvmgrUtiles.cpp.

◆ currentActiveInterface()

bool netSrvMgrUtiles::currentActiveInterface ( char *  currentInterface)

This function is used to get the current active interface(WIFI/MOCA).

Parameters
[out]currentInterfaceCurrent active Interface.
Returns
Returns true is successfully gets the current active interface details.

Definition at line 656 of file netsrvmgrUtiles.cpp.

◆ check_global_v6_based_macaddress()

bool netSrvMgrUtiles::check_global_v6_based_macaddress ( std::string  ipv6Addr,
std::string  macAddr 
)

This function checks whether the input ipv6 address is based on specified mac address.

Parameters
[in]ipv6AddrIP address.
[in]macAddrMAC address.
Returns
Returns true if global ipv6 address is on mac based, Otherwise false.

Definition at line 688 of file netsrvmgrUtiles.cpp.

◆ check_global_v6_ula_address()

bool netSrvMgrUtiles::check_global_v6_ula_address ( std::string  ipv6Addr)

This function checks whether the input ipv6 address is Unique Local Address.

Parameters
[in]ipv6AddrIP address.
Returns
Returns true if global ipv6 address is ULA, Otherwise false.

Definition at line 719 of file netsrvmgrUtiles.cpp.

◆ getCommandOutput()

bool netSrvMgrUtiles::getCommandOutput ( const char *  command,
char *  output_buffer,
size_t  output_buffer_size 
)

This function is used to get the output of running the specified command.

Parameters
[in]commandcommand to run.
[out]output_bufferoutput buffer into which to put command's output
[in]output_buffer_sizeoutput buffer size
Returns
Returns true if it gets the command's output successfully, Otherwise false.

Definition at line 737 of file netsrvmgrUtiles.cpp.

◆ getNetMask_IfName()

bool netSrvMgrUtiles::getNetMask_IfName ( const char *  ifName_in,
const unsigned int  family,
char *  netMask_out 
)

This function is used to get the NetMask address for the provided interface.

Parameters
[in]ifName_inIndicates the interface name which the netMask is required.
[out]netMask_outIndicates the netMask address of ifname_in interface name.
Returns
Returns true if successfully gets the NetMask address of interface provided or else false.

Definition at line 757 of file netsrvmgrUtiles.cpp.

◆ isIPv4AddressScopeDocumentation()

bool netSrvMgrUtiles::isIPv4AddressScopeDocumentation ( const std::string &  ipv4_address)

This function checks if the input ipv4 address is a unicast address reserved for documentation.

Parameters
[in]ipv4_addressIPv4 address.
Returns
Returns true if input ipv4 address is a unicast address reserved for documentation.

Definition at line 803 of file netsrvmgrUtiles.cpp.

◆ checkvalidip()

gboolean checkvalidip ( char *  ipAddress)

This will check whether the input IP Address is a valid IPv4 or IPv6 address.

Parameters
[in]ipAddressIP Address in string format.
Returns
Returns TRUE if IP address is valid else returns FALSE.

Definition at line 4153 of file xdiscovery.c.

◆ checkvalidhostname()

gboolean checkvalidhostname ( char *  hostname)

This function will check whether a Host name is valid by validating all the associated IP addresses.

Parameters
[in]hostnameHost name represented as a string.
Returns
Returns TRUE if host name is valid else returns FALSE.

Definition at line 4184 of file xdiscovery.c.

◆ checkIpMode()

bool checkIpMode ( char *  v6Prefix)

This function is used to check whether the input IP Address belongs to IPv4 or IPv6 address.

Parameters
[in]v6PrefixIP prefix string.
Returns
Returns TRUE if version 6 prefix is valid, Otherwise it belongs to IPV4 so returns FALSE.

Definition at line 1009 of file routeSrvMgr.cpp.

◆ get_WifiRadioStatus()

WiFiStatusCode_t get_WifiRadioStatus ( )

This function is used to get WIFI connectivity status.

Returns
Returns WIFI connectivity status(whether uninstalled/disabled/disconnected/pairing/connecting/connected/failed).

Definition at line 518 of file wifiHalUtiles.cpp.

◆ get_WifiConnectionType()

WiFiConnectionTypeCode_t get_WifiConnectionType ( )

This function is used to get WIFI connection type.

Returns
Returns WIFI connection type(whether WPS/mannual/LNF/private).

Definition at line 541 of file wifiHalUtiles.cpp.

◆ ethernet_on()

bool ethernet_on ( )

This function is used to get the ethernet connection ON/OFF status in order to proceed with IARM bus calls.

Returns
Returns true if connection status OK, Otherwise false.

Definition at line 387 of file wifiHalUtiles.cpp.

◆ updateWiFiList()

bool updateWiFiList ( )

This function gets the host interface parameters through IARM TR69 calls and update BSS identifier list data.

Returns
Returns false in case of WIFI disabled or any other error, Otherwise true in success case.

◆ shutdownWifi()

bool shutdownWifi ( )

This function is used to cancel all the WIFI related threads and un initialize the WIFI module.

Returns
Returns true if successfully terminated all operations, Otherwise false.

Definition at line 3955 of file wifiHalUtiles.cpp.

◆ isWiFiCapable()

bool isWiFiCapable ( )

This function is used to check whether the device supports wireless communication or not.

Returns
Returns true if the device supports wireless connections,Otherwise false.

Definition at line 1922 of file wifiHalUtiles.cpp.

◆ get_CurrentSsidInfo()

void get_CurrentSsidInfo ( WiFiConnectionStatus currSsidConnInfo)

This function is used to get current SSID and connection status from persistent memory.

Parameters
[out]currSsidConnInfoSSID connection details structure.

Definition at line 512 of file wifiHalUtiles.cpp.

◆ put_boolean()

void put_boolean ( char *  ptr,
bool  val 
)

This function converts the input data to Boolean type.

Parameters
[in]ptrAddress to store the boolean value.
[in]valBoolean value.

Definition at line 191 of file hostIf_utils.cpp.

◆ put_int()

void put_int ( char *  ptr,
int  val 
)

This function converts the input data to integer type.

Parameters
[in]ptrAddress to store the integer value.
[in]valInteger value.

Definition at line 152 of file hostIf_utils.cpp.

◆ storeMfrWifiCredentials()

bool storeMfrWifiCredentials ( void  )

This function retrieve and store the WIFI credentials(SSID, password).

Returns
Returns true if successfully stored the MFR WIFI credentials, Otherwise false.

Definition at line 3264 of file wifiHalUtiles.cpp.

◆ eraseMfrWifiCredentials()

bool eraseMfrWifiCredentials ( void  )

This function erase the stored MFR WIFI credentials.

Returns
Returns true if successfully erased the MFR WIFI credentials, Otherwise false.

Definition at line 3342 of file wifiHalUtiles.cpp.

◆ getRadioStats()

bool getRadioStats ( WiFi_Radio_Stats_Diag_Params params)

This function is used to get detail radio traffic statistics information.

Parameters
[out]paramsStructure that saves the traffic statistics.
Returns
Returns true if successfully gets all traffic statistics informations, Otherwise false.

◆ getConnectedSSIDInfo()

void getConnectedSSIDInfo ( WiFiConnectedSSIDInfo_t )

This function is used to get the connected SSID informations such as SSID, BSSID, signal strength etc,.

Parameters
[out]WiFiConnectedSSIDInfo_tStructure that saves the connected SSID details.

◆ getEndPointInfo()

void getEndPointInfo ( WiFi_EndPoint_Diag_Params )

This function checks for WIFI connection enable status, If connection enabled, then it provide WIFI statistics information such as enable status, SSID, signal strength, data transmission rate etc.,.

Parameters
[out]WiFi_EndPoint_Diag_ParamsWIFI end point diagnostic parameter.

Definition at line 3364 of file wifiHalUtiles.cpp.

◆ create_wpa_supplicant_conf_from_netapp_db()

int WiFiNetworkMgr::create_wpa_supplicant_conf_from_netapp_db ( const char *  wpa_supplicant_conf_file,
const char *  netapp_db_file 
)
private

This function 1. Extract "SSID", "BSSID", "Password", "Security" from specified netapp_db_file.

  1. Write into specified wpa_supplicant_conf_file in following format: network={ ssid="<SSID>" scan_ssid=1 bssid=<BSSID> psk="<Password" key_mgmt=<Security> auth_alg=OPEN } example: network={ ssid="tukken-axb3-5GHz" scan_ssid=1 bssid=5C:B0:66:00:4D:10 psk="Comcast2015" key_mgmt=Wpa2PskAes auth_alg=OPEN }
Parameters
[in]wpa_supplicant_conf_fileWPA supplicant configuration file to be created.
[in]netapp_db_fileNetAPP DB file to query configuration information.
Returns
Returns 0 if successfully created wpa_supplicant_conf_file, Otherwise 1.
  1. Extract "SSID", "BSSID", "Password", "Security" from specified netapp_db_file.
  2. Write into specified wpa_supplicant_conf_file in following format: network={ ssid="<SSID>" scan_ssid=1 bssid=<BSSID> psk="<Password" key_mgmt=<Security> auth_alg=OPEN } example: network={ ssid="tukken-axb3-5GHz" scan_ssid=1 bssid=5C:B0:66:00:4D:10 psk="Comcast2015" key_mgmt=Wpa2PskAes auth_alg=OPEN }

Definition at line 130 of file wifiSrvMgr.cpp.