RDK Documentation (Open Sourced RDK Components)
hostIf_main.h
Go to the documentation of this file.
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 * @file hostIf_main.h
22 *
23 * @brief hostIf_main API.
24 *
25 * This API defines the core operations for hostIf
26 *
27 * @par Document
28 * Document reference.
29 *
30 * @par Open Issues (in no particular order)
31 * -# None
32 *
33 * @par Assumptions
34 * -# None
35 *
36 * @par Abbreviations
37 * - BE: ig-Endian.
38 * - cb: allback function (suffix).
39 * - DS: Device Settings.
40 * - FPD: Front-Panel Display.
41 * - HAL: Hardware Abstraction Layer.
42 * - LE: Little-Endian.
43 * - LS: Least Significant.
44 * - MBZ: Must be zero.
45 * - MS: Most Significant.
46 * - RDK: Reference Design Kit.
47 * - _t: Type (suffix).
48 *
49 * @par Implementation Notes
50 * -# None
51 *
52 */
53 
54 /** @defgroup IARM_BUS IARM_BUS
55 * @ingroup IARM_BUS
56 *
57 * IARM-Bus is a platform agnostic Inter-process communication (IPC) interface. It allows
58 * applications to communicate with each other by sending Events or invoking Remote
59 * Procedure Calls. The common programming APIs offered by the RDK IARM-Bus interface is
60 * independent of the operating system or the underlying IPC mechanism.
61 *
62 * Two applications connected to the same instance of IARM-Bus are able to exchange events
63 * or RPC calls. On a typical system, only one instance of IARM-Bus instance is needed. If
64 * desired, it is possible to have multiple IARM-Bus instances. However, applications
65 * connected to different buses will not be able to communicate with each other.
66 */
67 
68 /** @addtogroup IARM_BUS_IARM_CORE_API IARM-Core library.
69 * @ingroup IARM_BUS
70 *
71 * Described herein are the functions that are part of the
72 * IARM Core library.
73 *
74 * @{
75 */
76 
77 
78 /**
79 * @defgroup tr69hostif
80 * @{
81 * @defgroup hostif
82 * @{
83 **/
84 
85 
86 #ifndef HOSTIF_MAIN_H_
87 #define HOSTIF_MAIN_H_
88 
89 
90 
91 #include <iostream>
92 #include <cstdlib>
93 #include <pthread.h>
94 #include <stdlib.h>
95 #include <vector>
96 #include <string.h>
97 #include <exception>
98 #include <glib.h>
99 #include <glib/gstdio.h>
100 #include <stdio.h>
101 #include <stdlib.h>
102 #include <unistd.h>
103 #include <sys/types.h>
104 #include <sys/syscall.h>
105 #include <signal.h>
106 #include <getopt.h>
107 #include <string.h>
108  #include <sys/time.h>
109 #include "rdk_debug.h"
110 
111 extern gchar *date_str;
112 
113 void tr69hostIf_logger (const gchar *log_domain, GLogLevelFlags log_level,const gchar *message, gpointer user_data);
114 
115 #define G_LOG_DOMAIN ((gchar*) 0)
116 #define LOG_TR69HOSTIF "LOG.RDK.TR69HOSTIF"
117 
118 using namespace std;
119 
120 enum {
121  OK = 0,
122  NOK = -1,
123  NOT_HANDLED = -2
124 };
125 
126 typedef struct argsList {
127  char logFileName[64];
128  char confFile[100];
129  int httpPort;
130 #ifndef NEW_HTTP_SERVER_DISABLE
131  int httpServerPort; //new HTTP Server Port for JSON Requests
132 #endif
133 } T_ARGLIST;
134 
135 static volatile sig_atomic_t time_to_quit = 0;
136 
137 void quit_handler (int sig_received);
138 void exit_gracefully (int sig_received);
139 
140 void *tr69IfHandlerThread(void *);
141 void *jsonIfHandlerThread(void *);
142 pid_t getTid();
143 
144 
145 #endif /* HOSTIF_MAIN_H_ */
146 
147 /* End of IARM_BUS_IARM_CORE_API doxygen group */
148 /**
149  * @}
150  */
151 
152 
153 
154 
155 /** @} */
156 /** @} */
rdk_debug.h
argsList
Definition: hostIf_main.h:126