RDK Documentation (Open Sourced RDK Components)
hostIf_tr69ReqHandler.h
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_tr69MsgHandler.h
22 *
23 * @brief hostIf Common Message Handler API.
24 *
25 * This API defines the core operations for Host interface
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 * - hostIf: Host Interface.
40 * - DS: Device Settings.
41 * - FPD: Front-Panel Display.
42 * - HAL: Hardware Abstraction Layer.
43 * - LE: Little-Endian.
44 * - LS: Least Significant.
45 * - MBZ: Must be zero.
46 * - MS: Most Significant.
47 * - RDK: Reference Design Kit.
48 * - _t: Type (suffix).
49 *
50 * @par Implementation Notes
51 * -# None
52 *
53 */
54 
55 /**
56 * HOST-IF is a platform agnostic Inter-process communication (IPC) interface. It allows
57 * applications to communicate with each other by sending Events or invoking Remote
58 * Procedure Calls. The common programming APIs offered by the RDK IARM-Bus interface is
59 * independent of the operating system or the underlying IPC mechanism.
60 *
61 */
62 
63 /** @addtogroup IARM_BUS_IARM_CORE_API IARM-Core library.
64 * @ingroup IARM_BUS
65 *
66 * Described herein are the functions that are part of the
67 * IARM Core library.
68 *
69 * @{
70 */
71 
72 
73 /**
74 * @defgroup tr69hostif
75 * @{
76 * @defgroup hostif
77 * @{
78 **/
79 
80 
81 #ifndef HOSTIF_TR69REQHANDLER_H_
82 #define HOSTIF_TR69REQHANDLER_H_
83 
84 
85 #define IARM_BUS_TR69HOSTIFMGR_NAME "tr69HostIfMgr" /*!< Host-If manager IARM bus name */
86 #define IARM_TR69_CLIENT "tr69Client"
87 bool hostIf_IARM_IF_Start();
88 void hostIf_IARM_IF_Stop();
89 /*
90  * Declare RPC API names and their arguments
91  */
92 #define IARM_BUS_TR69HOSTIFMGR_API_SetParams "tr69HostIfSetParams" /*!< Sets the parameter values to the tr69hostIf*/
93 
94 #define IARM_BUS_TR69HOSTIFMGR_API_GetParams "tr69HostIfGetParams" /*!< Retrives parameter values fom the tr69hostIf*/
95 
96 #define IARM_BUS_TR69HOSTIFMGR_API_SetAttributes "tr69HostIfGetAttributes" /*!< Retrives attribute values fom the tr69hostIf*/
97 #define IARM_BUS_TR69HOSTIFMGR_API_GetAttributes "tr69HostIfSetAttributes" /*!< Sets attribute values fom the tr69hostIf*/
98 
99 
100 #define IARM_BUS_TR69HOSTIFMGR_API_RegisterForEvents "tr69HostIfRegisterForEvents" /*!< Registers for events from tr69hostIf, on this call, add/remove events will be re-broadcasted*/
101 
102 #define TR69HOSTIFMGR_MAX_PARAM_LEN (4*1024)
103 
104 #define TR69HOSTIFMGR_MAX_LONG_PARAM_LEN (200*1024)
105 
106 #define _BUF_LEN_16 16
107 
108 #define _BUF_LEN_32 32
109 
110 #define _BUF_LEN_64 64
111 
112 #define _BUF_LEN_128 128
113 
114 #define _BUF_LEN_256 256
115 
116 #define _BUF_LEN_512 512
117 
118 #define _BUF_LEN_1024 1024
119 
120 /*! Parameter for Getpowerstate call*/
121 /*! Host IF Message Parameter data-type*/
122 typedef enum _HostIf_ParamType
123 {
124  hostIf_StringType = 0,
125  hostIf_IntegerType,
126  hostIf_UnsignedIntType,
127  hostIf_BooleanType,
128  hostIf_DateTimeType,
129  hostIf_UnsignedLongType
130 }
132 
133 /*! Host IF request type*/
134 typedef enum _HostIf_ReqType
135 {
136  HOSTIF_INVALID_TYPE = 0,
137  HOSTIF_GET = 1,
138  HOSTIF_SET = 2,
139  HOSTIF_GETATTRIB = 3,
140  HOSTIF_SETATTRIB = 4
142 
143 /*! Host IF Error Fault Code type*/
144 typedef enum _faultCodes
145 {
146  fcNoFault = 0,
147  fcMethodNotSupported = 9000,
148  fcRequestDenied,
149  fcInternalError,
150  fcInvalidArguments,
151  fcResourcesExceeded,
152  fcInvalidParameterName,
153  fcInvalidParameterType,
154  fcInvalidParameterValue,
155  fcAttemptToSetaNonWritableParameter = 9008,
156 } faultCode_t;
157 
158 /*! Host IF source type used for various purposes*/
160 {
161  HOSTIF_NONE = 0,
162  HOSTIF_SRC_ALL,
163  HOSTIF_SRC_WEBPA,
164  HOSTIF_SRC_RFC,
165  HOSTIF_SRC_IARM,
166  HOSTIF_SRC_DEFAULT
168 
169 /*! Host IF Message Request data*/
170 typedef struct _HostIf_MsgData_t {
171  char paramName[TR69HOSTIFMGR_MAX_PARAM_LEN]; /*!< Parameter name with complete request path */
172  char paramValue[TR69HOSTIFMGR_MAX_PARAM_LEN]; /*!< Parameter Value */
173  char* paramValueLong; /*Heap allocation for lengthy param val*/
174  char transactionID[_BUF_LEN_256]; /*!< transaction identifier Value */
175  short paramLen; /*!< Size of Response parameter data*/
176  short instanceNum; /*!< Instances number of Response parameter data*/
177  HostIf_ParamType_t paramtype; /*!< Parameter type */
178  HostIf_ReqType_t reqType; /*!< Host interface request type [HOSTIF_GET/HOSTIF_SET]*/
179  faultCode_t faultCode; /*!< Fault codes as per BroadBand cwmp amendment*/
180  HostIf_Source_Type_t requestor; /*!< Requestor that made the set/get request*/
181  HostIf_Source_Type_t bsUpdate; /*!< Bootstrap update level*/
182  bool isLengthyParam;
184 
185 /*! Events published from TR69 host interface */
189  IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED, /*!< Value changed Event */
190  IARM_BUS_TR69HOSTIFMGR_EVENT_MAX, /*!< Maximum event id*/
192 
193 
194 /*! tr69HostIfMgr Event Data */
196 
197  char paramName[TR69HOSTIFMGR_MAX_PARAM_LEN];
198  char paramValue[TR69HOSTIFMGR_MAX_PARAM_LEN];
199  HostIf_ParamType_t paramtype; /*!< Parameter type */
200 
202 
203 
204 #endif /* HOSTIF_TR69REQHANDLER_H_*/
205 
206 /* End of HOST_IF_API doxygen group */
207 /**
208  * @}
209  */
210 
211 
212 /** @} */
213 /** @} */
_HostIf_MsgData_t::reqType
HostIf_ReqType_t reqType
Definition: hostIf_tr69ReqHandler.h:178
IARM_BUS_TR69HOSTIFMGR_EVENT_REMOVE
@ IARM_BUS_TR69HOSTIFMGR_EVENT_REMOVE
Definition: hostIf_tr69ReqHandler.h:188
_HostIf_MsgData_t::instanceNum
short instanceNum
Definition: hostIf_tr69ReqHandler.h:176
_HostIf_Source_Type_t
_HostIf_Source_Type_t
Definition: hostIf_tr69ReqHandler.h:159
_HostIf_MsgData_t::bsUpdate
HostIf_Source_Type_t bsUpdate
Definition: hostIf_tr69ReqHandler.h:181
IARM_BUS_TR69HOSTIFMGR_EVENT_ADD
@ IARM_BUS_TR69HOSTIFMGR_EVENT_ADD
Definition: hostIf_tr69ReqHandler.h:187
_HostIf_ReqType
_HostIf_ReqType
Definition: hostIf_tr69ReqHandler.h:134
IARM_Bus_tr69HostIfMgr_EventData_t
struct _tr69HostIfMgr_EventData_t IARM_Bus_tr69HostIfMgr_EventData_t
HostIf_Source_Type_t
enum _HostIf_Source_Type_t HostIf_Source_Type_t
_tr69HostIfMgr_EventData_t
Definition: hostIf_tr69ReqHandler.h:195
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
_tr69HostIfMgr_EventId_t
_tr69HostIfMgr_EventId_t
Definition: hostIf_tr69ReqHandler.h:186
_tr69HostIfMgr_EventData_t::paramtype
HostIf_ParamType_t paramtype
Definition: hostIf_tr69ReqHandler.h:199
HOSTIF_MsgData_t
struct _HostIf_MsgData_t HOSTIF_MsgData_t
IARM_Bus_tr69HostIfMgr_EventId_t
enum _tr69HostIfMgr_EventId_t IARM_Bus_tr69HostIfMgr_EventId_t
faultCode_t
enum _faultCodes faultCode_t
_HostIf_MsgData_t::paramtype
HostIf_ParamType_t paramtype
Definition: hostIf_tr69ReqHandler.h:177
HostIf_ParamType_t
enum _HostIf_ParamType HostIf_ParamType_t
_HostIf_MsgData_t::faultCode
faultCode_t faultCode
Definition: hostIf_tr69ReqHandler.h:179
_HostIf_ParamType
_HostIf_ParamType
Definition: hostIf_tr69ReqHandler.h:122
_HostIf_MsgData_t::paramName
char paramName[(4 *1024)]
Definition: hostIf_tr69ReqHandler.h:171
IARM_BUS_TR69HOSTIFMGR_EVENT_MAX
@ IARM_BUS_TR69HOSTIFMGR_EVENT_MAX
Definition: hostIf_tr69ReqHandler.h:190
_faultCodes
_faultCodes
Definition: hostIf_tr69ReqHandler.h:144
_HostIf_MsgData_t::paramValue
char paramValue[(4 *1024)]
Definition: hostIf_tr69ReqHandler.h:172
_HostIf_MsgData_t::transactionID
char transactionID[256]
Definition: hostIf_tr69ReqHandler.h:174
HostIf_ReqType_t
enum _HostIf_ReqType HostIf_ReqType_t
_HostIf_MsgData_t::requestor
HostIf_Source_Type_t requestor
Definition: hostIf_tr69ReqHandler.h:180
IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED
@ IARM_BUS_TR69HOSTIFMGR_EVENT_VALUECHANGED
Definition: hostIf_tr69ReqHandler.h:189
_HostIf_MsgData_t::paramLen
short paramLen
Definition: hostIf_tr69ReqHandler.h:175