RDK Documentation (Open Sourced RDK Components)
Device_WiFi_SSID.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 Device_WiFi_SSID.h
22  */
23 
24 /**
25  * @defgroup TR69_HOSTIF_WIFI_SSID TR-069 Object (Device.WiFi.SSID.{i}.) Public APIs
26  *
27  * WiFi SSID table (a stackable interface object as described in [Section 4.2/TR-181i2]), where table
28  * entries model the MAC layer. A WiFi SSID entry is typically stacked on top of a Radio object.
29  *
30  * WiFi SSID is also a multiplexing layer, i.e. more than one SSID can be stacked above a single Radio.
31  *
32  * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given
33  * value for Alias, or with a given value for Name. On creation of a new table entry, the CPE MUST choose
34  * initial values for Alias and Name such that the new entry does not conflict with any existing entries.
35  *
36  * At most one enabled entry in this table can exist with a given value for SSID, or with a given value for BSSID.
37  *
38  * @ingroup TR69_HOSTIF_WIFI
39  */
40 
41 
42 
43 /**
44 * @defgroup tr69hostif
45 * @{
46 * @defgroup hostif
47 * @{
48 **/
49 
50 
51 #ifndef DEVICE_WIFI_SSID_H_
52 #define DEVICE_WIFI_SSID_H_
53 
54 #ifdef USE_WIFI_PROFILE
55 /*****************************************************************************
56  * TR069-DEVICE-WIFI API SPECIFIC INCLUDE FILES
57  *****************************************************************************/
58 
59 #include "hostIf_main.h"
60 #include "hostIf_utils.h"
61 #include "hostIf_tr69ReqHandler.h"
62 #include "hostIf_updateHandler.h"
63 #include "Device_WiFi.h"
64 
65 /** @defgroup TR_069_DEVICE_WIFI_API TR-069 Device.WiFi object API.
66  * @ingroup TR_069_API
67  *
68  * The The WiFi object is based on the WiFi Alliance 802.11 specifications ([802.11-2007]).
69  * It defines interface objects (Radio and SSID), and application objects (AccessPoint and EndPoint).
70  *
71  */
72 
73 /** @addtogroup TR_069_DEVICE_WIFI_GETTER_API TR-069 Device.WiFi Getter API.
74  * @ingroup TR_069_DEVICE_WIFI_API
75  *
76  * \section TR-069 Device.WiFi Getter API
77  *
78  * This is the getter group of API for the <b>Device.WiFi</b> object.
79  *
80  * The interface for all functions is identical and is described here.
81  *
82  * @param[in] HOSTIF_MsgData_t This is the host IF Message Request data
83  *
84  * @param[in] bool *pChanged Data type of parameter defined for TR-069. This is same as the
85  * data type used in the Xi3 data-model.xml file.
86  *
87  * @return The status of the operation.
88  * @retval OK If parameter requested was successfully fetched. (Same as <b>NO_ERROR</b>).
89  * @retval NOK If parameter requested was successfully fetched. (Same as <b>OK</b>).
90  *
91  *
92  * @{
93  */
94 
95 
96 class hostIf_WiFi_SSID {
97 
98  static GHashTable *ifHash;
99  int dev_id = 0; //CID:103919 - UNINIT_CTOR
100  hostIf_WiFi_SSID(int dev_id);
101  ~hostIf_WiFi_SSID() {};
102 
103 public:
104  static class hostIf_WiFi_SSID *getInstance(int dev_id);
105  static GList* getAllInstances();
106  static void closeInstance(hostIf_WiFi_SSID *);
107  static void closeAllInstances();
108  int get_Device_WiFi_SSID_Fields(int ssidIndex);
109  void checkWifiSSIDFetch(int radioIndex);
110 
111  bool enable;
112  char status[BUFF_LENGTH_64];
113  char alias[BUFF_LENGTH_64];
114  char name[BUFF_LENGTH_64];
115  unsigned int LastChange;
116  char LowerLayers[BUFF_LENGTH_1024];
117  char BSSID[BUFF_MAC];
118  char MACAddress[BUFF_MAC];
119  char SSID[BUFF_LENGTH_32];
120  /**
121  * @brief Get the MAC Address of an Associated Device of a WiFi Interface.
122  *
123  * This function provides the MAC address of the WiFi interface of the device associated
124  * with this WiFi interface.
125  *
126  * See @ref dev_wifi_if_assocdev_getter
127  *
128  */
129 
130  /**
131  * @ingroup TR69_HOSTIF_WIFI_SSID
132  * @{
133  */
134  /**
135  * @brief Get the status of SSID entry.
136  *
137  * This function provides true/false value based on the Device.WiFi.SSID.Enable parameter.
138  *
139  * @param[out] stMsgData TR-069 Host interface message request.
140  *
141  * @return Returns 0 on success, otherwise will return the appropriate error code.
142  */
143  int get_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData );
144 
145  /**
146  * @brief Set the enable or disable status for the SSID entry.
147  * This parameter is based on ifAdminStatus from [RFC2863].
148  *
149  * This function will update true/false value for the Device.WiFi.SSID.Enable parameter.
150  *
151  * @param[in] stMsgData TR-069 Host interface message request.
152  *
153  * @return Returns 0 on success, otherwise will return the appropriate error code.
154  */
155  int set_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData );
156 
157  /**
158  * @brief Get the current operational state of the SSID entry (see [Section 4.2.2/TR-181i2]).
159  *
160  * The enumuration for SSID entry is:
161  * - Up
162  * - Down
163  * - Unknown
164  * - Dormant
165  * - NotPresent
166  * - LowerLayerDown
167  * - Error (OPTIONAL)
168  *
169  * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error if there is a fault
170  * condition on the interface).
171  *
172  * - When Enable is changed to true then Status SHOULD change to Up if and only if the interface is able
173  * to transmit and receive network traffic; it SHOULD change to Dormant if and only if the interface
174  * is operable but is waiting for external actions before it can transmit and receive network traffic
175  * (and subsequently change to Up if still operable when the expected actions have completed);
176  * - It SHOULD change to LowerLayerDown if and only if the interface is prevented from entering the Up
177  * state because one or more of the interfaces beneath it is down; it SHOULD remain in the Error state
178  * if there is an error or other fault condition detected on the interface; it SHOULD remain in the
179  * NotPresent state if the interface has missing (typically hardware) components;
180  * - It SHOULD change to Unknown if the state of the interface can not be determined for some reason.
181  *
182  * This parameter is based on ifOperStatus from [RFC2863].
183  *
184  * This function provides the output as a string available in Device.WiFi.SSID.Status.
185  *
186  * @param[out] stMsgData TR-069 Host interface message request.
187  *
188  * @return Returns 0 on success, otherwise will return the appropriate error code.
189  */
190  int get_Device_WiFi_SSID_Status(HOSTIF_MsgData_t *stMsgData );
191 
192  /**
193  * @brief Get the Alias based addresing given for SSID.
194  *
195  * This function provides the output as string available in Device.WiFi.SSID.Alias parameter.
196  *
197  * @param[out] stMsgData TR-069 Host interface message request.
198  *
199  * @return Returns 0 on success, otherwise will return the appropriate error code.
200  */
201  int get_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData );
202 
203  /**
204  * @brief Set the Alias based addresing for SSID.
205  *
206  * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to
207  * label this instance for future reference.
208  *
209  * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and
210  * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced:
211  *
212  * - Its value MUST NOT be empty.
213  * - Its value MUST start with a letter.
214  * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix.
215  * - The CPE MUST NOT change the parameter value.
216  *
217  * This function will update the Alias-based addresing in Device.WiFi.SSID.Alias parameter.
218  *
219  * @param[in] stMsgData TR-069 Host interface message request.
220  *
221  * @return Returns 0 on success, otherwise will return the appropriate error code.
222  */
223  int set_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData );
224 
225  /**
226  * @brief Get the textual name of the SSID entry as assigned by the CPE.
227  *
228  * This function provides the output as string available in Device.WiFi.SSID.Name parameter.
229  *
230  * @param[out] stMsgData TR-069 Host interface message request.
231  *
232  * @return Returns 0 on success, otherwise will return the appropriate error code.
233  */
234  int get_Device_WiFi_SSID_Name(HOSTIF_MsgData_t *stMsgData );
235 
236  /**
237  * @brief Get the accumulated time in seconds since the SSID entered its current operational state.
238  *
239  * This function provides the output as unsigned integer value available in Device.WiFi.SSID.LastChange parameter.
240  *
241  * @param[out] stMsgData TR-069 Host interface message request.
242  *
243  * @return Returns 0 on success, otherwise will return the appropriate error code.
244  */
245  int get_Device_WiFi_SSID_LastChange(HOSTIF_MsgData_t *stMsgData );
246 
247  /**
248  * @brief Get a comma-separated list (maximum list length 1024) of strings.
249  * Each list item MUST be the path name of an interface object that is stacked immediately below
250  * this interface object.
251  *
252  * This function provides the output as string available in Device.WiFi.SSID.LowerLayers parameter.
253  *
254  * @param[out] stMsgData TR-069 Host interface message request.
255  *
256  * @return Returns 0 on success, otherwise will return the appropriate error code.
257  */
258  int get_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData );
259 
260  /**
261  * @brief Set a comma-separated list (maximum list length 1024) of strings.
262  * Each list item MUST be the path name of an interface object that is stacked immediately below
263  * this interface object. If the referenced object is deleted, the corresponding item MUST be
264  * removed from the list.
265  *
266  * @see [Section 4.2.1/TR-181i2].
267  *
268  * This function will update the string valu the the Device.WiFi.SSID.LowerLayers parameter.
269  *
270  * @param[in] stMsgData TR-069 Host interface message request.
271  *
272  * @return Returns 0 on success, otherwise will return the appropriate error code.
273  */
274  int set_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData );
275 
276  /**
277  * @brief Get the Basic Service Set ID.
278  *
279  * This is the MAC address of the access point, which can either be local (when this instance models an
280  * access point SSID) or remote (when this instance models an end point SSID).
281  *
282  * This function provides the output as string available in Device.WiFi.SSID.BSSID parameter.
283  *
284  * @param[out] stMsgData TR-069 Host interface message request.
285  *
286  * @return Returns 0 on success, otherwise will return the appropriate error code.
287  */
288  int get_Device_WiFi_SSID_BSSID(HOSTIF_MsgData_t *stMsgData );
289 
290  /**
291  * @brief Get the MAC address of this interface.
292  *
293  * If this instance models an access point SSID, MAC Address is the same as MAC Address.
294  *
295  * @note This is not necessarily the same as the Ethernet header source or destination MAC address,
296  * which is associated with the IP interface and is modeled via the Ethernet.Link.{i}.MACAddress parameter.
297  *
298  * This function provides the output as string available in Device.WiFi.SSID.MACAddress parameter.
299  *
300  * @param[out] stMsgData TR-069 Host interface message request.
301  *
302  * @return Returns 0 on success, otherwise will return the appropriate error code.
303  */
304  int get_Device_WiFi_SSID_MACAddress(HOSTIF_MsgData_t *stMsgData );
305 
306  /**
307  * @brief Get the current service set identifier in use by the connection.
308  * The SSID is an identifier that is attached to packets sent over the wireless LAN that functions as an
309  * ID for joining a particular radio network (BSS).
310  *
311  * This function provides the output as string available in Device.WiFi.SSID.SSID parameter.
312  *
313  * @param[out] stMsgData TR-069 Host interface message request.
314  *
315  * @return Returns 0 on success, otherwise will return the appropriate error code.
316  */
317  int get_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData );
318 
319  /**
320  * @brief Set the current service set identifier in use by the connection.
321  * The SSID is an identifier that is attached to packets sent over the wireless LAN that functions as an
322  * ID for joining a particular radio network (BSS).
323  *
324  * This function will update the SSID value in string format in Device.WiFi.SSID.SSID parameter.
325  *
326  * @param[in] stMsgData TR-069 Host interface message request.
327  *
328  * @return Returns 0 on success, otherwise will return the appropriate error code.
329  */
330  int set_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData );
331 
332  /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_SSID
333 };
334 
335 #endif /* #ifdef USE_WIFI_PROFILE */
336 #endif /* DEVICE_WIFI_SSID_H_ */
337 
338 
339 /** @} */
340 /** @} */
Device_WiFi.h
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_main.h
hostIf_main API.