RDK Documentation (Open Sourced RDK Components)
Device_WiFi_EndPoint_Profile_Security.cpp
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 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 
21 /**
22  * @file Device_WiFi_EndPoint_Profile_Security.cpp
23  *
24  * @brief Device_WiFi_EndPoint_Stats API Implementation.
25  *
26  * This is the implementation of the WiFi API.
27  *
28  * @par Document
29  */
30 /** @addtogroup TR-069 WiFi Implementation
31  * This is the implementation of the Device Public API.
32  * @{
33  */
34 #ifdef USE_WIFI_PROFILE
35 /*****************************************************************************
36  * STANDARD INCLUDE FILES
37  *****************************************************************************/
38 #include "Device_WiFi_EndPoint_Profile_Security.h"
39 
40 GHashTable* hostIf_WiFi_EndPoint_Profile_Security::ifHash = NULL;
41 
42 hostIf_WiFi_EndPoint_Profile_Security* hostIf_WiFi_EndPoint_Profile_Security::getInstance(int dev_id)
43 {
45 
46  if(ifHash)
47  {
48  pRet = (hostIf_WiFi_EndPoint_Profile_Security *)g_hash_table_lookup(ifHash,(gpointer) dev_id);
49  }
50  else
51  {
52  ifHash = g_hash_table_new(NULL,NULL);
53  }
54 
55  if(!pRet)
56  {
57  try {
58  pRet = new hostIf_WiFi_EndPoint_Profile_Security(dev_id);
59  } catch(int e)
60  {
61  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_Profile_Security instance..\n");
62  }
63  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
64  }
65  return pRet;
66 }
67 
68 
69 GList* hostIf_WiFi_EndPoint_Profile_Security::getAllInstances()
70 {
71  if(ifHash)
72  return g_hash_table_get_keys(ifHash);
73  return NULL;
74 }
75 
76 
77 void hostIf_WiFi_EndPoint_Profile_Security::closeInstance(hostIf_WiFi_EndPoint_Profile_Security *pDev)
78 {
79  if(pDev)
80  {
81  g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
82  delete pDev;
83  }
84 }
85 
86 void hostIf_WiFi_EndPoint_Profile_Security::closeAllInstances()
87 {
88  if(ifHash)
89  {
90  GList* tmp_list = g_hash_table_get_values (ifHash);
91 
92  while(tmp_list)
93  {
95  tmp_list = tmp_list->next;
96  closeInstance(pDev);
97  }
98  }
99 }
100 
101 
102 hostIf_WiFi_EndPoint_Profile_Security::hostIf_WiFi_EndPoint_Profile_Security(int dev_id):
103  dev_id(0)
104 {
105  memset(ModeEnabled, 0, 64);
106  memset(WEPKey, 0, 64);
107  memset(PreSharedKey, 0, 64);
108  memset(KeyPassphrase, 0, 64);
109 }
110 
112 {
113  return 0;
114 }
115 
117 {
118  return 0;
119 
120 }
122 {
123  return 0;
124 
125 }
127 {
128  return 0;
129 
130 }
131 #endif /* #ifdef USE_WIFI_PROFILE */
132 
hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_PreSharedKey
int get_hostIf_WiFi_EndPoint_Profile_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData)
Get a literal PreSharedKey (PSK) expressed as a hexadecimal string.
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_ModeEnabled
int get_hostIf_WiFi_EndPoint_Profile_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData)
This function is used to get which security mode is enabled for wireless end point....
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_WEPKey
int get_hostIf_WiFi_EndPoint_Profile_Security_WEPKey(HOSTIF_MsgData_t *stMsgData)
Get a WEP key expressed as a hexadecimal string.
hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_KeyPassphrase
int get_hostIf_WiFi_EndPoint_Profile_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData)
Get a passphrase from which the PreSharedKey is to be generated, for WPA-Personal or WPA2-Personal or...
hostIf_WiFi_EndPoint_Profile_Security
Definition: Device_WiFi_EndPoint_Profile_Security.h:44