-
Notifications
You must be signed in to change notification settings - Fork 4
RDKEMW-14684 Implement Radio Data Model Parameters for RDKE #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
118f7ca
f9c91ed
f63731d
3a105c3
809e540
1847417
9d11f79
97a3560
aba887f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
|
Check failure on line 3 in src/hostif/profiles/wifi/Device_WiFi_Radio.cpp
|
||
| * | ||
| * Copyright 2018 RDK Management | ||
| * | ||
|
|
@@ -155,9 +155,10 @@ | |
| memset(TransmitPowerSupported, 0, sizeof(TransmitPowerSupported)); | ||
| memset(RegulatoryDomain, 0, sizeof(RegulatoryDomain)); | ||
| } | ||
| #ifdef RDKV_NM | ||
|
|
||
| int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Props_Fields(int radioIndex) | ||
| { | ||
| #ifdef RDKV_NM | ||
| IARM_Result_t retVal = IARM_RESULT_SUCCESS; | ||
| IARM_BUS_WiFi_DiagsPropParam_t param = {0}; | ||
| int ret; | ||
|
|
@@ -208,6 +209,20 @@ | |
| RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); | ||
| return NOK; | ||
| } | ||
| #else | ||
| hostIf_WiFi_Radio *pDev = hostIf_WiFi_Radio::getInstance(dev_id); | ||
| if(pDev) | ||
| { | ||
| snprintf(OperatingChannelBandwidth,BUFF_MIN_16,"80MHz"); | ||
| radioFirstExTime = time (NULL); | ||
| return OK; | ||
| } | ||
|
Comment on lines
+212
to
+219
|
||
| else | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); | ||
| return NOK; | ||
| } | ||
| #endif | ||
| } | ||
|
|
||
| void hostIf_WiFi_Radio::checkWifiRadioFetch(int radioIndex) | ||
|
|
@@ -224,6 +239,8 @@ | |
| } | ||
| } | ||
|
|
||
| #ifdef RDKV_NM | ||
|
|
||
| int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Enable(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
|
|
||
|
|
@@ -465,6 +482,8 @@ | |
| return OK; | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| int hostIf_WiFi_Radio::get_Device_WiFi_Radio_OperatingChannelBandwidth(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
@@ -476,6 +495,8 @@ | |
| return OK; | ||
| } | ||
|
|
||
| #ifdef RDKV_NM | ||
|
|
||
| int hostIf_WiFi_Radio::get_Device_WiFi_Radio_ExtensionChannel(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
|
Check failure on line 3 in src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp
|
||
| * | ||
| * Copyright 2018 RDK Management | ||
| * | ||
|
|
@@ -44,9 +44,7 @@ | |
| #endif | ||
|
|
||
| GHashTable* hostIf_WiFi_Radio_Stats::ifHash = NULL; | ||
| #ifdef RDKV_NM | ||
| static time_t radioFirstExTime = 0; | ||
| #endif | ||
|
|
||
| hostIf_WiFi_Radio_Stats *hostIf_WiFi_Radio_Stats::getInstance(int dev_id) | ||
| { | ||
|
|
@@ -119,9 +117,9 @@ | |
|
|
||
| } | ||
|
|
||
| #ifdef RDKV_NM | ||
| int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_Props_Fields(int radioIndex) | ||
| { | ||
| #ifdef RDKV_NM | ||
| IARM_Result_t retVal = IARM_RESULT_SUCCESS; | ||
| IARM_BUS_WiFi_DiagsPropParam_t param = {0}; | ||
| int ret; | ||
|
|
@@ -153,6 +151,21 @@ | |
| RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); | ||
| return NOK; | ||
| } | ||
| #else | ||
| hostIf_WiFi_Radio_Stats *pDev = hostIf_WiFi_Radio_Stats::getInstance(dev_id); | ||
| if(pDev) | ||
| { | ||
| PacketsReceived = 65568; | ||
| NoiseFloor = -100; | ||
| radioFirstExTime = time (NULL); | ||
| return OK; | ||
| } | ||
|
Comment on lines
+154
to
+162
|
||
| else | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); | ||
| return NOK; | ||
| } | ||
| #endif | ||
|
|
||
| } | ||
|
|
||
|
|
@@ -170,6 +183,8 @@ | |
| } | ||
| } | ||
|
|
||
| #ifdef RDKV_NM | ||
|
|
||
| int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_BytesSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
@@ -205,6 +220,8 @@ | |
| return OK; | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
@@ -216,6 +233,8 @@ | |
| return OK; | ||
| } | ||
|
|
||
| #ifdef RDKV_NM | ||
|
|
||
| int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_ErrorsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
@@ -259,6 +278,9 @@ | |
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); | ||
| return OK; | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_NoiseFloor(HOSTIF_MsgData_t *stMsgData,int radioIndex ) | ||
| { | ||
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); | ||
|
|
@@ -269,6 +291,5 @@ | |
| RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); | ||
| return OK; | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* #ifdef USE_WIFI_PROFILE */ | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,3 +1,4 @@ | ||||
|
|
||||
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside
get_Device_WiFi_Radio_Props_Fields()(in the#ifdef RDKV_NMsection), severalsnprintf()calls pass the source string as the format argument (format-string vulnerability) and at least one call uses a size (BUFF_LENGTH_1024) that is larger than the destination buffer (OperatingChannelBandwidthischar[BUFF_MIN_16]), risking memory corruption. Please switch these to safe string copies (e.g.,strcpy_s/strncpy) orsnprintf(dest, sizeof(dest), "%s", src)with the correct destination size for every field.