RDK Documentation (Open Sourced RDK Components)
hostIf_main.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 2016 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 
21 /**
22 * @defgroup tr69hostif
23 * @{
24 * @defgroup hostif
25 * @{
26 **/
27 
28 #ifndef NEW_HTTP_SERVER_DISABLE
29 #include <fstream>
30 #endif
31 #include "hostIf_main.h"
32 #include "hostIf_tr69ReqHandler.h"
33 #include "hostIf_jsonReqHandler.h"
34 
35 #ifndef NEW_HTTP_SERVER_DISABLE
36 #include "hostIf_msgHandler.h"
37 #include "http_server.h"
38 #include "hostIf_utils.h"
39 #endif
40 
41 #include "hostIf_updateHandler.h"
42 #include "XrdkCentralComBSStore.h"
43 
44 #if defined(USE_WIFI_PROFILE)
45 #include "Device_WiFi.h"
46 #endif
47 
48 #include "libpd.h"
49 #include <semaphore.h>
50 #include <errno.h>
51 #include "libIBus.h"
52 
53 #define LOG_FILE "./tr69hostIflog.txt"
54 #ifdef WEBPA_RFC_ENABLED
55 #define RFC_BUFFER_SIZE 256
56 #endif
57 
58 #ifdef ENABLE_SD_NOTIFY
59 #include <systemd/sd-daemon.h>
60 #endif
61 #include <mutex>
62 #include <condition_variable>
63 
64 #ifdef WEB_CONFIG_ENABLED
65 #ifdef __cplusplus
66 extern "C" {
67 #include <webcfg.h>
68 }
69 #endif
70 #include "cJSON.h"
71 #include <sys/file.h>
72 #endif
73 
74 #ifdef WEBCONFIG_LITE_ENABLE
75 #include<webconfig_lite.h>
76 #endif
77 
79 #include "Device_DeviceInfo.h"
80 #include "safec_lib.h"
81 
82 //------------------------------------------------------------------------------
83 // Initialize global variables and functions.
84 //------------------------------------------------------------------------------
85 GThread *hostIf_JsonIfThread = NULL;
86 GThread *updateHandler_runThread = NULL;
87 #ifndef NEW_HTTP_SERVER_DISABLE
88 GThread *HTTPServerThread = NULL;
89 #define LEGACY_RFC_ENABLED_PATH "/opt/RFC/.RFC_LegacyRFCEnabled.ini"
90 #endif
91 //GTimeVal timeval;
92 static GMainLoop *main_loop = NULL;
93 gchar *date_str = NULL;
94 const gchar* logfilename = NULL;
95 FILE *logfile = NULL;
96 int rdk_logger_enabled = 0;
97 GHashTable* paramMgrhash = NULL;
98 static void usage();
99 T_ARGLIST argList = {{'\0'}, 0};
100 static int isShutdownTriggered = 0;
101 
102 std::mutex mtx_httpServerThreadDone;
103 std::condition_variable cv_httpServerThreadDone;
104 bool httpServerThreadDone = false;
105 
106 // Parodus Init Thread
107 pthread_t parodus_init_tid;
108 
109 #ifdef WEBCONFIG_LITE_ENABLE
110 pthread_t webconfig_threadId;
111 #endif
112 char *hostIf_JsonIfMsg = (char *)"hostIf_JsonIfThread";
113 #ifndef NEW_HTTP_SERVER_DISABLE
114 char *HTTPServerName = (char *)"HTTPServerThread";
115 GError *httpError = NULL;
116 #endif
117 GError *err1 = NULL ;
118 
119 /* Globals associated with the shutdown thread which frees all resources and exits the process
120  when signalled to do so */
121 static pthread_t shutdown_thread = 0; /* The thread ID */
122 static void *shutdown_thread_entry(void *arg); /* Thread entry function */
123 static sem_t shutdown_thread_sem; /* Semaphore used to signal shutdown */
124 static int shutdown_sig_received = 0; /* The signal that triggered the shutdown */
125 pthread_mutex_t graceful_exit_mutex;
126 #define UNUSED(x) ((void)(x))
127 
128 //------------------------------------------------------------------------------
129 // shutdown_thread_entry: frees all resources and exits the process
130 // when signalled to do so
131 //------------------------------------------------------------------------------
132 static void *shutdown_thread_entry(void *arg)
133 {
134  UNUSED(arg);
135 
136  /* Wait forever on the shutdown semaphore */
137  while ((sem_wait(&shutdown_thread_sem) == -1) && (errno == EINTR))
138  {
139  continue; /* Restart if interrupted by handler */
140  }
141 
142  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] TR69 Host-If received signal handler with sigNum : %d \n",__FILE__, __FUNCTION__, shutdown_sig_received);
143 
144  switch (shutdown_sig_received)
145  {
146  case SIGINT:
147  RDK_LOG(RDK_LOG_NOTICE,LOG_TR69HOSTIF,"SIGINT received (CTRL+C was pressed) \n");
148  break;
149  case SIGTERM:
150  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"SIGTERM received\n");
151  break;
152  case SIGQUIT:
153  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"SIGQUIT received\n");
154  break;
155  case SIGSEGV:
156  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"SIGSEGV received (Segmentation fault was detected)\n");
157  break;
158  default:
159  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Signal %d received\n", shutdown_sig_received);
160  break;
161  }
162 
163  exit_gracefully(shutdown_sig_received);
164  return NULL;
165 }
166 
167 #ifdef WEBPA_RFC_ENABLED
168 /* Utility funciton to get the console output. */
169 int GetFeatureEnabled(char *cmd)
170 {
171  FILE * pipeStream = NULL;
172  char buffer[RFC_BUFFER_SIZE];
173  int isFeatureEnabled = 0;
174 
175  memset(buffer, 0, RFC_BUFFER_SIZE);
176  pipeStream = popen(cmd, "r");
177  if (pipeStream != NULL)
178  {
179  if (fgets(buffer, RFC_BUFFER_SIZE, pipeStream) != NULL)
180  sscanf(buffer,"%d",&isFeatureEnabled);
181  else
182  RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s] %s End of stream.\n", __FUNCTION__, cmd);
183  pclose(pipeStream);
184  }
185  return isFeatureEnabled;
186 }
187 #endif
188 
189 
190 
191 
192 //------------------------------------------------------------------------------
193 // main: HostIfMgr main
194 //------------------------------------------------------------------------------
195 int main(int argc, char *argv[])
196 {
197  int ch = 0;
198  errno_t rc = -1;
199 #ifdef WEBPA_RFC_ENABLED
200  int retVal=0;
201 #endif
202  const char* debugConfigFile = NULL;
203  const char* webpaNotifyConfigFile = NULL;
204  //------------------------------------------------------------------------------
205  // Signal handlers:
206  //------------------------------------------------------------------------------
207  struct sigaction sigact;
208  sigset_t sigset;
209 
210  while (1)
211  {
212  static struct option long_options[] =
213  {
214  /* These options don't set a flag.
215  We distinguish them by their indices. */
216  {"help", no_argument, 0, 'h'},
217  {"logfile", required_argument, 0, 'l'},
218  {"conffile", required_argument, 0, 'c'},
219  {"port", required_argument, 0, 'p'},
220 #ifndef NEW_HTTP_SERVER_DISABLE
221  {"httpserverport", required_argument, 0, 's'},
222 #endif
223  {"debugconfig", required_argument, 0, 'd'},
224  {"notifyconfig", required_argument, 0, 'w'},
225  {0, 0, 0, 0}
226  };
227 
228  /* getopt_long stores the option index here. */
229  int option_index = 0;
230 #ifndef NEW_HTTP_SERVER_DISABLE
231  ch = getopt_long (argc, argv, "hHl:c:p:s:d:w:",
232  long_options, &option_index);
233 #else
234  ch = getopt_long (argc, argv, "hHl:c:p:d:w:",
235  long_options, &option_index);
236 #endif
237  /* Detect the end of the options. */
238  if (ch == -1)
239  break;
240 
241  switch (ch)
242  {
243  case 'c':
244  if(optarg)
245  {
246  memset(argList.confFile, '\0', sizeof (argList.confFile));
247  rc=strcpy_s (argList.confFile,sizeof(argList.confFile),optarg);
248  if(rc!=EOK)
249  {
250  ERR_CHK(rc);
251  }
252 // RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"argList.confFile : %s optarg : %s\n", argList.confFile, optarg);
253  }
254  break;
255 
256  case 'd':
257  if(optarg)
258  {
259  debugConfigFile = optarg;
260  }
261  break;
262  case 'w':
263  if(optarg)
264  {
265  webpaNotifyConfigFile = optarg;
266  }
267  break;
268 
269  case 'p':
270  if(optarg)
271  {
272  argList.httpPort = atoi(optarg);
273  }
274  break;
275 #ifndef NEW_HTTP_SERVER_DISABLE
276  case 's':
277  if(optarg)
278  {
279  argList.httpServerPort = atoi(optarg);
280  }
281  break;
282 #endif
283  case 'h':
284  case 'H':
285  case '?':
286  default:
287  usage();
288  exit(0);
289  }
290  }
291 
292  /* Enable RDK logger.*/
293  if(rdk_logger_init(debugConfigFile) == 0) rdk_logger_enabled = 1;
294 
295  if (optind < argc)
296  {
297  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"non-option ARGV-elements: ");
298  while (optind < argc)
299  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"%s ", argv[optind++]);
300  putchar ('\n');
301  usage();
302  exit (0);
303  }
304 
305 #ifdef WEBPA_RFC_ENABLED
306  retVal = GetFeatureEnabled(". /lib/rdk/isFeatureEnabled.sh WEBPAXG");
307  RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"[%s] WEBPAXG returns %d\n", __FUNCTION__, retVal);
308  if( retVal == 0)
309  {
310  system("systemctl stop tr69hostif.service");
311  return ch;
312  }
313 #endif
314 
315  if (sem_init(&shutdown_thread_sem, 0, 0) == -1)
316  {
317  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] sem_init() failed\n", __FUNCTION__, __FILE__);
318  return 1;
319  }
320 
321  if (pthread_create(&shutdown_thread, NULL, shutdown_thread_entry, NULL) != 0)
322  {
323  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] pthread_create() failed\n", __FUNCTION__, __FILE__);
324  return 1;
325  }
326 
327  // The actions for SIGINT, SIGTERM, SIGSEGV, and SIGQUIT are set
328  sigemptyset(&sigact.sa_mask);
329  sigact.sa_handler = quit_handler;
330  sigact.sa_flags = SA_ONSTACK;
331 
332  sigaction (SIGINT, &sigact, NULL);
333  sigaction (SIGTERM, &sigact, NULL);
334  sigaction (SIGHUP, &sigact, NULL);
335 #ifndef RDK_DEVICE_CISCO_XI4
336 #if 0
337  sigaction (SIGSEGV, &sigact, NULL);
338  sigaction (SIGILL, &sigact, NULL);
339  sigaction (SIGFPE, &sigact, NULL);
340  sigaction (SIGABRT, &sigact, NULL);
341  sigaction (SIGQUIT, &sigact, NULL);
342 #endif
343 #endif
344  signal (SIGPIPE, SIG_IGN);
345 
346  setvbuf(stdout, NULL, _IOLBF, 0);
347 
348  //------------------------------------------------------------------------------
349  // Initialize the glib, g_time and logger
350  //------------------------------------------------------------------------------
351 #if GLIB_VERSION_CUR_STABLE <= GLIB_VERSION_2_32
352  if(!g_thread_supported())
353  {
354  g_thread_init(NULL);
355  RDK_LOG(RDK_LOG_NOTICE,LOG_TR69HOSTIF,"g_thread supported\n");
356  }
357  else
358  {
359  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"g_thread NOT supported\n");
360  }
361 #endif
362  /* Enable RDK logger.*/
363  if(rdk_logger_init(debugConfigFile) == 0) rdk_logger_enabled = 1;
364 
365 #if defined(USE_WIFI_PROFILE)
366  /* Perform the necessary operations to initialise the WiFi device */
367  (void)WiFiDevice::init();
368 #endif
369 // g_get_current_time(&timeval);
370 // char* logoutfile = (char *)LOG_FILE;
371 #if 0
372  /* Commented: Since logs are directed to /opt/logs/ folder,
373  * so no need to use separate log file */
374  char* logoutfile = (char *)argList.logFileName;
375 
376 
377  g_log_set_handler(G_LOG_DOMAIN, (GLogLevelFlags)(G_LOG_LEVEL_INFO | G_LOG_LEVEL_MESSAGE | \
378  G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | \
379  G_LOG_LEVEL_ERROR), tr69hostIf_logger, (void *)logoutfile);
380 #endif
381  RDK_LOG(RDK_LOG_NOTICE,LOG_TR69HOSTIF,"Starting tr69HostIf Service\n");
382 
383 
384 
385  /*Commented: This function will replace hostIf_initalize_ConfigManger()
386  This shall read all configuration properties of hostif like, profile Manager List,
387  any hardcoded path used in reboot/reset or config paths. This uses g_key_file_new() to read
388  based on the group of configuration. */
389  //if(false == hostIf_ConfigProperties_Init())
390 
391  if(false == hostIf_initalize_ConfigManger())
392  {
393  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Failed to hostIf_initalize_ConfigManger()\n");
394  }
395 
396 #ifndef NEW_HTTP_SERVER_DISABLE
397  ifstream ifs_legacyEnabled(LEGACY_RFC_ENABLED_PATH);
398  if(!ifs_legacyEnabled.is_open())
399  {
400  setLegacyRFCEnabled(false);
401  }
402  else
403  {
404  setLegacyRFCEnabled(true);
405  ifs_legacyEnabled.close();
406  }
407 #endif
408 
409  if(false == hostIf_IARM_IF_Start() )
410  {
411  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Failed to start hostIf_IARM_IF_Start()\n");
412  }
413 
414  /* Load the data model xml file*/
415  DB_STATUS status = loadDataModel();
416  if(status != DB_SUCCESS)
417  {
418  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Error in Data Model Initialization\n");
419  return DB_FAILURE;
420  }
421  else
422  {
423  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"Successfully initialize Data Model.\n");
424  }
425 
426  //------------------------------------------------------------------------------
427  // hostIf_HttpServerStart: Soup HTTP Server
428  //------------------------------------------------------------------------------
429  if( (hostIf_JsonIfThread = g_thread_create( (GThreadFunc)jsonIfHandlerThread,
430  (void *)hostIf_JsonIfMsg,
431  TRUE,
432  &err1)) == NULL)
433  {
434  g_critical("Thread create failed: %s!!\n", err1->message );
435  g_error_free (err1);
436  }
437 
438 
439 #ifndef NEW_HTTP_SERVER_DISABLE
440  if(!legacyRFCEnabled())
441  {
442  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"legacyRFC Set to False, Starting New HTTP Server\n");
443  if((HTTPServerThread = g_thread_create((GThreadFunc)HTTPServerStartThread,
444  (void *)HTTPServerName,
445  TRUE,
446  &httpError)) == NULL)
447  {
448  g_critical("New HTTP Server Thread Create failed: %s!!\n", httpError->message );
449  g_error_free (httpError);
450  }
451  }
452  else
453  {
454  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"legacyRFC Set to True, New HTTP Server is not started\n");
455  }
456 #endif
457 
458 #ifdef PID_FILE_PATH
459 #define xstr(s) str(s)
460 #define str(s) #s
461  // write pidfile because sd_notify() does not work inside container
462  IARM_Bus_WritePIDFile(xstr(PID_FILE_PATH) "/tr69hostif.pid");
463 #endif
464 
465  //------------------------------------------------------------------------------
466  // updateHandler::init : Update handler thread for polling table profiles
467  //------------------------------------------------------------------------------
468  updateHandler::Init();
469 
470  //------------------------------------------------------------------------------
471  // Initialize WebPA Module
472  //------------------------------------------------------------------------------
473 
474  RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"Starting WEBPA Parodus Connections\n");
475  libpd_set_notifyConfigFile(webpaNotifyConfigFile);
476  if(0 == pthread_create(&parodus_init_tid, NULL, libpd_client_mgr, NULL))
477  {
478  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"Initiating Connection with PARODUS success.. \n");
479  }
480  else
481  {
482  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Parodus init thread create failed\n");
483  }
484 
485 
486 #if defined(WEB_CONFIG_ENABLED)
487  initWebConfigMultipartTask(0);
488 #elif defined(WEBCONFIG_LITE_ENABLE)
489  if(0 == pthread_create(&webconfig_threadId, NULL, initWebConfigTask, NULL))
490  {
491  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"webconfig thread created success.. \n");
492  }
493  else
494  {
495  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"webconfig thread created failed.. \n");
496  }
497 #endif
498 
499  /* Initialized Rbus interface for TR181 Data*/
500  init_rbus_dml_provider();
501 
502  // Send sd notify event after http server thread is complete.
503  if (httpServerThreadDone == false)
504  {
505  std::unique_lock<std::mutex> lck(mtx_httpServerThreadDone);
506  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Waiting(max 10 sec) for http server thread to be complete...\n");
507  auto sec = chrono::seconds(1);
508  cv_httpServerThreadDone.wait_for(lck, 10*sec, [] {return httpServerThreadDone;});
509  }
510 #ifdef ENABLE_SD_NOTIFY
511  sd_notifyf(0, "READY=1\n"
512  "STATUS=tr69hostif is Successfully Initialized\n"
513  "MAINPID=%lu", (unsigned long) getpid());
514  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"tr69hostif sd notify envent is sent Successfully, httpServerThreadDone=%d\n", httpServerThreadDone);
515 #endif
516 
517  hostIf_DeviceInfo::send_DeviceManageableNotification();
518 
519  main_loop = g_main_loop_new (NULL, FALSE);
520 
521  if(main_loop) {
522  g_main_loop_run(main_loop);
523  g_main_loop_unref (main_loop);
524  }
525  else {
526  RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s]Fails to Create a main loop.", __FUNCTION__);
527  }
528 
529  if(hostIf_JsonIfThread)
530  g_thread_join(hostIf_JsonIfThread);
531 
532 #ifndef NEW_HTTP_SERVER_DISABLE
533  if(HTTPServerThread)
534  g_thread_join(HTTPServerThread);
535 #endif
536  if(parodus_init_tid)
537  pthread_join(parodus_init_tid,NULL);
538 
539  RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"\n\n----------------------EXITING MAIN PROGRAM----------------------\n");
540  return 0 ;
541 }
542 
543 //------------------------------------------------------------------------------
544 // returns id of current thread, which called this function
545 //------------------------------------------------------------------------------
546 pid_t getTid()
547 {
548  return (pid_t)syscall(__NR_gettid);
549 }
550 
551 //------------------------------------------------------------------------------
552 // quit_handler: signal the shutdown thread to log and exit
553 //
554 // NOTE: This function is called in signal handler context, meaning that we can
555 // only call a small set of functions that are deemed async-signal-safe.
556 // Refer to the "overview of signals" man page (man 7 signal) to view the
557 // set of functions. It's probably worth pointing out that printf() is NOT
558 // part of the set of async-signal-safe functions.
559 //------------------------------------------------------------------------------
560 void quit_handler (int sig_received)
561 {
562  /* Save the received signal and increment the shutdown semaphore to instruct
563  the shutdown thread to log and exit */
564  shutdown_sig_received = sig_received;
565  (void)sem_post(&shutdown_thread_sem);
566 }
567 
568 //------------------------------------------------------------------------------
569 // exit_gracefully: close all global file descriptors, ports, clear and exit
570 //------------------------------------------------------------------------------
571 
572 void exit_gracefully (int sig_received)
573 {
574 
575  if((pthread_mutex_trylock(&graceful_exit_mutex) == 0) && (isShutdownTriggered == 0)) {
576  RDK_LOG(RDK_LOG_NOTICE,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
577  isShutdownTriggered = 1;
578 
579 #if defined(USE_WIFI_PROFILE)
580  /* Perform the necessary operations to shut down the WiFi device */
581  WiFiDevice::shutdown();
582 #endif
583 
584  // Kill Parodus Thread
586 
587  /*Stop libSoup server and exit Json Thread */
589 
590  updateHandler::stop();
591  XBSStore::getInstance()->stop();
592 
593  if(logfile) fclose (logfile);
594 
595  if(paramMgrhash) {
596  g_hash_table_destroy(paramMgrhash);
597  paramMgrhash = NULL;
598  }
599  hostIf_IARM_IF_Stop();
600 
601  RDK_LOG(RDK_LOG_NOTICE,LOG_TR69HOSTIF,"[%s:%s] Exiting program gracefully..\n", __FUNCTION__, __FILE__);
602  if (g_main_loop_is_running(main_loop)) {
603  g_main_loop_quit(main_loop);
604 #ifndef NEW_HTTP_SERVER_DISABLE
605  /*Stop HTTP Server Thread*/
606  HttpServerStop();
607 #endif
608  }
609  pthread_mutex_unlock(&graceful_exit_mutex);
610  }
611 }
612 
613 
614 //------------------------------------------------------------------------------
615 // hostIf_logger: logged the messages
616 //------------------------------------------------------------------------------
617 static void usage()
618 {
619 #ifndef NEW_HTTP_SERVER_DISABLE
620  cout << "\nUsage: tr69hostIf -p[http port] [-l][LogFileName]\n\
621  \nDisplay tr69hostIf options:\n\
622  -p HTTP PORT HTTP Server port number.\n\
623  -s HTTP PORT New HTTP Server Port. \n\
624  -l LOG FILE NAME Output log file name with path.\n\
625  -c CONFIG FILE NAME Configure file contains Manager list .\n\
626  -d DEBUG CONFIG FILE NAME Config file contain debug configurations. \n\
627  -h Help\n\
628  \nExamples:\n\
629  ================================================================================\n\
630  tr69hostIf -l /opt/logs/tr69hostIf.log -c mgrlist.conf -p 5001 -d /etc/debug.ini\n\
631  ================================================================================\n\
632  \n" << endl;
633 #else
634  cout << "\nUsage: tr69hostIf -p[http port] [-l][LogFileName]\n\
635  \nDisplay tr69hostIf options:\n\
636  -p HTTP PORT HTTP Server port number.\n\
637  -l LOG FILE NAME Output log file name with path.\n\
638  -c CONFIG FILE NAME Configure file contains Manager list .\n\
639  -d DEBUG CONFIG FILE NAME Config file contain debug configurations. \n\
640  -h Help\n\
641  \nExamples:\n\
642  ================================================================================\n\
643  tr69hostIf -l /opt/logs/tr69hostIf.log -c mgrlist.conf -p 5001 -d /etc/debug.ini\n\
644  ================================================================================\n\
645  \n" << endl;
646 #endif
647 }
648 
649 /** @} */
650 /** @} */
Device_WiFi.h
libpd_set_notifyConfigFile
void libpd_set_notifyConfigFile(const char *configFile)
Set Initial Notify config files.
Definition: libpd.cpp:80
libpd.h
IARM_Bus_WritePIDFile
void IARM_Bus_WritePIDFile(const char *path)
Write PID file.
hostIf_main.h
hostIf_main API.
hostIf_rbus_Dml_Provider.h
The header file provides HostIf message handler information APIs.
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
libIBus.h
RDK IARM-Bus API Declarations.
Device_DeviceInfo.h
The header file provides TR69 device information APIs.
hostIf_HttpServerStop
void hostIf_HttpServerStop()
It handles the request and response IARM member processes.
Definition: hostIf_jsonReqHandlerThread.cpp:382
hostIf_jsonReqHandler.h
The header file provides HostIf IP json request handler information APIs.
argsList
Definition: hostIf_main.h:126
libpd_client_mgr
void * libpd_client_mgr(void *)
Initialize libparodus connection and load DB.
Definition: libpd.cpp:93
stop_parodus_recv_wait
void stop_parodus_recv_wait()
Stops parodus receive wait thread.
Definition: libpd.cpp:85
hostIf_msgHandler.h
The header file provides HostIf message handler information APIs.
rdk_logger_init
rdk_Error rdk_logger_init(const char *debugConfigFile)
Initialize the logger. Sets up the environment variable storage by parsing debug configuration file t...
Definition: rdk_logger_init.c:57
TRUE
#define TRUE
Defines for TRUE/FALSE/ENABLE flags.
Definition: wifi_common_hal.h:199