RDK Documentation (Open Sourced RDK Components)
XrdkCentralComRFCStore.cpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #include <algorithm>
21 #include <fstream>
22 #include <string>
23 #include <string.h>
24 #include <ctype.h>
25 #include <sstream>
26 #include "semaphore.h"
27 #include <fcntl.h>
28 
29 #include "XrdkCentralComRFCStore.h"
30 #include "hostIf_utils.h"
31 
32 #define TR181_RFC_STORE_KEY "TR181_STORE_FILENAME"
33 #define RFC_PROPERTIES_FILE "/etc/rfc.properties"
34 #define RFCDEFAULTS_FILE "/tmp/rfcdefaults.ini"
35 #define TR181_STORE_NONPERSISTENT_FILE "/opt/secure/RFC/tr181store_nonpersist.ini"
36 #define TR181_RFC_NONPERSISTENT_PREFIX "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.NonPersistent."
37 #define RFCDEFAULTS_ETC_DIR "/etc/rfcdefaults/"
38 
39 #ifdef ENABLE_LLAMA_PLATCO
40  #define TR181_LOCAL_STORE_KEY "TR181_LOCAL_STORE_AMLOGIC_FILENAME"
41 #else
42  #define TR181_LOCAL_STORE_KEY "TR181_LOCAL_STORE_FILENAME"
43 #endif
44 
45 #define TR181_CLEAR_PARAM "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.ClearParam"
46 XRFCStore* XRFCStore::xrfcInstance = NULL;
47 const char *semName = "localstore";
48 
49 void XRFCStore::clearAll()
50 {
51  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
52  if(!init())
53  {
54  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Init Failed, can't handle the request\n");
55  return;
56  }
57  if(m_updateInProgress)
58  {
59  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Duplicate clear DB request.. ignoring\n");
60  return;
61  }
62  m_updateInProgress = true;
63 
64  ofstream ofs(m_filename, ofstream::trunc);
65  ofs.close();
66 
67  ofstream ofs2(TR181_STORE_NONPERSISTENT_FILE, ofstream::trunc);
68  ofs2.close();
69 
70  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
71 }
72 
73 void XRFCStore::reloadCache()
74 {
75  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
76 
77  if(!m_updateInProgress)
78  {
79  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "ClearDB is not issued yet or Duplicate ClearDBEnd, .. ignoring\n");
80  return;
81  }
82  m_initDone = loadTR181PropertiesIntoCache();
83 
84  m_updateInProgress = false;
85 
86  //copy the local settings from tr181localstore.ini to main DB tr181store.ini
87  for (unordered_map<string, string>::iterator it=m_local_dict.begin(); it!=m_local_dict.end(); ++it)
88  {
89  if(m_dict.find(it->first) == m_dict.end())
90  m_dict[it->first] = it->second;
91  }
92  ofstream ofs(m_filename, ios::trunc | ios::out);
93  if(!ofs.is_open())
94  {
95  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failed to open : %s \n", m_filename.c_str());
96  return;
97  }
98 
99  for (unordered_map<string, string>::iterator it=m_dict.begin(); it!=m_dict.end(); ++it)
100  {
101  ofs << it->first << '=' << it->second << endl;
102  }
103  ofs.flush();
104  ofs.close();
105 
106  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
107 }
108 
109 string XRFCStore::getRawValue(const string &key)
110 {
111  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
112 
113  if (strstr((char *)key.c_str(),TR181_RFC_NONPERSISTENT_PREFIX) != NULL)
114  {
115  ifstream ifs_rfc("/tmp/.rfcSyncDone");
116  if(!ifs_rfc.is_open())
117  {
118  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: file /tmp/.rfcSyncDone doesn't exist, use default value.\n", __FUNCTION__);
119  return "";
120  }
121  unordered_map<string,string>::const_iterator it = m_nonpersist_dict.find(key);
122  if (it == m_nonpersist_dict.end()) {
123  return "";
124  }
125  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s : Value = %s \n", __FUNCTION__, it->second.c_str());
126 
127  return it->second;
128  }
129 
130  unordered_map<string,string>::const_iterator it = m_dict.find(key);
131  if (it == m_dict.end()) {
132  return "";
133  }
134  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s : Value = %s \n", __FUNCTION__, it->second.c_str());
135 
136  return it->second;
137 }
138 
139 bool XRFCStore::setRawValue(const string &key, const string &value)
140 {
141  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
142 
143  if(m_updateInProgress)
144  {
145  ofstream ofs(m_filename, ios::out | ios::app);
146 
147  if(!ofs.is_open())
148  {
149  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failed to open : %s \n", m_filename.c_str());
150  return false;
151  }
152  ofs << key << '=' << value << endl;
153  ofs.flush();
154  ofs.close();
155  }
156  else
157  {
158  return writeHashToFile(key, value, m_dict, m_filename);
159  }
160 
161  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
162  return true;
163 }
164 
165 bool XRFCStore::writeHashToFile(const string &key, const string &value, unordered_map<string, string> &dict, const string &filename)
166 {
167  ofstream ofs(filename, ios::trunc | ios::out);
168 
169  if(!ofs.is_open())
170  {
171  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failed to open : %s \n", filename.c_str());
172  return false;
173  }
174 
175  if (key.compare(TR181_CLEAR_PARAM))
176  {
177  dict[key] = value;
178  }
179 
180  for (unordered_map<string, string>::iterator it=dict.begin(); it!=dict.end(); ++it)
181  {
182  ofs << it->first << '=' << it->second << endl;
183  }
184  ofs.flush();
185  ofs.close();
186 
187  return true;
188 }
189 
190 faultCode_t XRFCStore::clearValue(const string &key, const string &value)
191 {
192  bool foundInLocalStore = false;
193 
194  sem_t *sem_id = sem_open(semName, O_CREAT, 0600, 1);
195  if (sem_id == SEM_FAILED){
196  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_open failed \n", __FUNCTION__);
197  return fcInternalError;
198  }
199 
200  if (sem_wait(sem_id) < 0)
201  {
202  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_wait failed \n", __FUNCTION__);
203  }
204 
205  loadFileToCache(m_local_filename, m_local_dict);
206  unordered_map<string, string> temp_local_dict(m_local_dict);
207 
208  for (unordered_map<string, string>::iterator it=temp_local_dict.begin(); it!=temp_local_dict.end(); ++it)
209  {
210  //Check if the param to be cleared is present in tr181localstore.ini
211  //(Or) if the param to be cleared is a wild card, clear all the params from local store that match with the wild card.
212  if(!it->first.compare(value) || (value.back() == '.' && it->first.find(value) != string::npos) )
213  {
214  RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "Clearing param: %s\n", it->first.c_str());
215  m_local_dict.erase(it->first);
216  m_dict.erase(it->first);
217  foundInLocalStore = true;
218  }
219  }
220 
221  if (foundInLocalStore)
222  {
223  writeHashToFile(key, value, m_local_dict, m_local_filename);
224  writeHashToFile(key, value, m_dict, m_filename);
225  }
226  else
227  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Parameter to be cleared is not present in tr181localstore.ini\n");
228 
229  if (sem_post(sem_id) < 0)
230  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_post failed \n", __FUNCTION__);
231 
232  if (sem_close(sem_id) != 0){
233  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_close failed \n", __FUNCTION__);
234  }
235 
236  return fcNoFault;
237 }
238 
239 faultCode_t XRFCStore::getValue(HOSTIF_MsgData_t *stMsgData)
240 {
241  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
242  if(!init())
243  {
244  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Init Failed, can't handle the request\n");
245  return fcInternalError;
246  }
247  string rawValue = getRawValue(stMsgData->paramName);
248  if(rawValue.length() > 0)
249  {
250  putValue(stMsgData, rawValue.c_str());
251  stMsgData->faultCode = fcNoFault;
252  }
253  else
254  {
255  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "%s : Parameter Not Found in %s\n", stMsgData->paramName, m_filename.c_str());
256  unordered_map<string,string>::const_iterator it = m_dict_rfcdefaults.find(stMsgData->paramName);
257  if (it != m_dict_rfcdefaults.end())
258  {
259  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "%s : Param found in rfcdefaults\n", stMsgData->paramName);
260  rawValue = it->second;
261  if(rawValue.length() > 0)
262  {
263  putValue(stMsgData, rawValue.c_str());
264  stMsgData->faultCode = fcNoFault;
265  }
266  else
267  {
268  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s : Parameter Found in rfcdefaults is empty\n", stMsgData->paramName);
269  stMsgData->faultCode = fcInternalError;
270  }
271  }
272  else
273  {
274  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "%s : Parameter Not Found in rfcdefaults\n", stMsgData->paramName);
275  stMsgData->faultCode = fcInternalError;
276  }
277  }
278  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s\n", __FUNCTION__);
279  return stMsgData->faultCode;
280 }
281 
282 faultCode_t XRFCStore::setValue(HOSTIF_MsgData_t *stMsgData)
283 {
284  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
285  if(!init())
286  {
287  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Init Failed, can't handle the request\n");
288  return fcInternalError;
289  }
290  const string &givenValue = getStringValue(stMsgData);
291 
292  if (!strcmp(stMsgData->paramName,TR181_CLEAR_PARAM))
293  {
294  return clearValue(stMsgData->paramName, givenValue);
295  }
296 
297  if (strstr(stMsgData->paramName,TR181_RFC_NONPERSISTENT_PREFIX) != NULL)
298  {
299  if(stMsgData->requestor == HOSTIF_SRC_RFC)
300  {
301  if(!writeHashToFile(stMsgData->paramName, givenValue, m_nonpersist_dict, TR181_STORE_NONPERSISTENT_FILE))
302  {
303  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failed to write to nonpersistent file \n");
304  return fcInternalError;
305  }
306  else
307  {
308  return fcNoFault;
309  }
310  }
311  else
312  {
313  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Only RFC is allowed to set NonPersistent params.\n");
314  return fcInternalError;
315  }
316  }
317 
318  if (stMsgData->requestor == HOSTIF_SRC_WEBPA) {
319 
320  sem_t *sem_id = sem_open(semName, O_CREAT, 0600, 1);
321  if (sem_id == SEM_FAILED){
322  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_open failed \n", __FUNCTION__);
323  return fcInternalError;
324  }
325 
326  if (sem_wait(sem_id) < 0)
327  {
328  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_wait failed \n", __FUNCTION__);
329  }
330 
331  loadFileToCache(m_local_filename, m_local_dict);
332  bool writeStatus = writeHashToFile(stMsgData->paramName, givenValue, m_local_dict, m_local_filename);
333 
334  if (sem_post(sem_id) < 0)
335  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_post failed \n", __FUNCTION__);
336 
337  if (sem_close(sem_id) != 0){
338  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_close failed \n", __FUNCTION__);
339  }
340 
341  if(!writeStatus)
342  {
343  return fcInternalError;
344  }
345  //if the RFC processing is going on, do not perform local/webpa set on tr181store.ini
346  if(m_updateInProgress)
347  {
348  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Local tr181 set during RFC processing for %s\n", stMsgData->paramName);
349  return fcNoFault;
350  }
351  }
352 
353  if(!m_updateInProgress)
354  {
355  const string &currentValue = getRawValue(stMsgData->paramName);
356  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Given Value : %s ---- Current value : %s \n", givenValue.c_str(), currentValue.c_str());
357 
358  if(strlen(currentValue.c_str()) > 0)
359  {
360  if(!strcasecmp(currentValue.c_str(), givenValue.c_str()))
361  {
362  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Property value exists, don't have to overwrite\n");
363  return fcNoFault;
364  }
365  }
366  }
367 
368  if(setRawValue(stMsgData->paramName, givenValue))
369  {
370  stMsgData->faultCode = fcNoFault;
371  }
372  else
373  {
374  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "Unable to Set Value for given Param\n");
375  stMsgData->faultCode = fcInternalError;
376  }
377  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
378  return stMsgData->faultCode;
379 }
380 
381 void XRFCStore::initTR181PropertiesFileName()
382 {
383  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
384  ifstream ifs_rfc(RFC_PROPERTIES_FILE);
385  if(!ifs_rfc.is_open())
386  {
387  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Trying to open a non-existent file [%s] \n", __FUNCTION__, RFC_PROPERTIES_FILE);
388  }
389  else
390  {
391  string line;
392  while (getline(ifs_rfc, line)) {
393  size_t splitterPos = line.find('=');
394  if (splitterPos < line.length()) {
395  string key = line.substr(0, splitterPos);
396  string value = line.substr(splitterPos+1, line.length());
397  if(!strcmp(key.c_str(), TR181_RFC_STORE_KEY))
398  {
399  m_filename = value;
400  // get rid of quotes, it is quite common with properties files
401  m_filename.erase(remove(m_filename.begin(), m_filename.end(), '\"'), m_filename.end());
402  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "TR181 Properties FileName = %s\n", m_filename.c_str());
403  }
404  else if(!strcmp(key.c_str(), TR181_LOCAL_STORE_KEY))
405  {
406  m_local_filename = value;
407  // get rid of quotes, it is quite common with properties files
408  m_local_filename.erase(remove(m_local_filename.begin(), m_local_filename.end(), '\"'), m_local_filename.end());
409  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "TR181 Local FileName = %s\n", m_local_filename.c_str());
410  }
411  }
412  }
413  ifs_rfc.close();
414 
415  if(m_filename.empty())
416  {
417  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Didn't find %s in %s\n", TR181_RFC_STORE_KEY, RFC_PROPERTIES_FILE);
418  }
419  }
420  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
421 }
422 
423 bool init_rfcdefaults()
424 {
425  DIR *dir;
426  struct dirent *ent;
427  if ((dir = opendir ( RFCDEFAULTS_ETC_DIR )) != NULL)
428  {
429  std::ofstream combined_file( RFCDEFAULTS_FILE, ios::out | ios::app ) ;
430  while ((ent = readdir (dir)) != NULL )
431  {
432  if (strstr(ent->d_name, ".ini"))
433  {
434  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,"rfcdefaults file: %s\n", ent->d_name);
435  string filepath = RFCDEFAULTS_ETC_DIR;
436  std::ifstream file1( filepath.append(ent->d_name) ) ;
437  combined_file << file1.rdbuf();
438  combined_file << "\n";
439  }
440  }
441  closedir (dir);
442  }
443  else
444  {
445  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF,"Could not open dir %s \n", RFCDEFAULTS_ETC_DIR) ;
446  return false;
447  }
448  return true;
449 }
450 
451 bool XRFCStore::loadFileToCache(const string &filename, unordered_map<string, string> &dict)
452 {
453  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
454  if(filename.empty())
455  {
456  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s Invalid/empty filename, Unable to load properties\n", __FUNCTION__);
457  return false;
458  }
459  dict.clear();
460 
461  RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "%s TR181 Properties File : %s \n", __FUNCTION__, filename.c_str());
462  ifstream ifs_tr181(filename);
463  if (!ifs_tr181.is_open()) {
464  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Trying to open a non-existent file [%s] \n", __FUNCTION__, filename.c_str());
465  }
466  else
467  {
468  string line;
469  while (getline(ifs_tr181, line)) {
470  size_t splitterPos = line.find('=');
471  if (splitterPos < line.length()) {
472  string key = line.substr(0, splitterPos);
473  string value = line.substr(splitterPos+1, line.length());
474  dict[key] = value;
475  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Key = %s : Value = %s\n", key.c_str(), value.c_str());
476  }
477  }
478  ifs_tr181.close();
479  }
480  return true;
481 }
482 
483 bool XRFCStore::loadTR181PropertiesIntoCache()
484 {
485  loadFileToCache(m_filename, m_dict);
486 
487  sem_t *sem_id = sem_open(semName, O_CREAT, 0600, 1);
488  if (sem_id == SEM_FAILED){
489  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_open failed \n", __FUNCTION__);
490  return fcInternalError;
491  }
492 
493  if (sem_wait(sem_id) < 0)
494  {
495  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_wait failed \n", __FUNCTION__);
496  }
497 
498  loadFileToCache(m_local_filename, m_local_dict);
499 
500  if (sem_post(sem_id) < 0)
501  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_post failed \n", __FUNCTION__);
502 
503  if (sem_close(sem_id) != 0){
504  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: sem_close failed \n", __FUNCTION__);
505  }
506 
507  loadFileToCache(TR181_STORE_NONPERSISTENT_FILE, m_nonpersist_dict);
508 
509  ifstream ifs_rfcdef(RFCDEFAULTS_FILE);
510  if (!ifs_rfcdef.is_open()) {
511  RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Trying to open a non-existent file [%s] \n", __FUNCTION__, RFCDEFAULTS_FILE);
512 
513  if ( init_rfcdefaults())
514  {
515  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Trying to open %s after newly creating\n", RFCDEFAULTS_FILE);
516  ifs_rfcdef.open(RFCDEFAULTS_FILE, ifstream::in);
517  if (!ifs_rfcdef.is_open())
518  return false;
519  }
520  else
521  return false;
522  }
523 
524  string line;
525  while (getline(ifs_rfcdef, line)) {
526  size_t splitterPos = line.find('=');
527  if (splitterPos < line.length()) {
528  string key = line.substr(0, splitterPos);
529  string value = line.substr(splitterPos+1, line.length());
530  m_dict_rfcdefaults[key] = value;
531  RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "Key = %s : Value = %s\n", key.c_str(), value.c_str());
532  }
533  }
534  ifs_rfcdef.close();
535 
536  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
537  return true;
538 }
539 
540 bool XRFCStore::init()
541 {
542  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
543  if(m_initDone)
544  return m_initDone;
545 
546  initTR181PropertiesFileName();
547 
548  m_initDone = loadTR181PropertiesIntoCache();
549 
550  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
551  return m_initDone;
552 }
553 
554 XRFCStore::XRFCStore()
555 {
556  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
557 
558  m_initDone = false;
559  m_updateInProgress = false;
560 
561  init();
562 
563  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
564 }
565 
566 XRFCStore* XRFCStore::getInstance()
567 {
568  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Entering %s \n", __FUNCTION__);
569 
570  if(!xrfcInstance)
571  xrfcInstance = new XRFCStore;
572 
573  RDK_LOG (RDK_LOG_TRACE1, LOG_TR69HOSTIF, "Leaving %s \n", __FUNCTION__);
574  return xrfcInstance;
575 }
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
faultCode_t
enum _faultCodes faultCode_t
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
_HostIf_MsgData_t::faultCode
faultCode_t faultCode
Definition: hostIf_tr69ReqHandler.h:179
_HostIf_MsgData_t::paramName
char paramName[(4 *1024)]
Definition: hostIf_tr69ReqHandler.h:171
XRFCStore
Definition: XrdkCentralComRFCStore.h:30
_HostIf_MsgData_t::requestor
HostIf_Source_Type_t requestor
Definition: hostIf_tr69ReqHandler.h:180