RDK Documentation (Open Sourced RDK Components)
Device_WiFi_AccessPoint_Security.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 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_AccessPoint_Security.cpp
23  *
24  * @brief Device_WiFi_EndPoint_AccessPoint_WPS 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_AccessPoint_Security.h"
39 
40 GHashTable* hostIf_WiFi_AccessPoint_Security::ifHash = NULL;
41 
42 hostIf_WiFi_AccessPoint_Security* hostIf_WiFi_AccessPoint_Security::getInstance(int dev_id)
43 {
45 
46  if(ifHash)
47  {
48  pRet = (hostIf_WiFi_AccessPoint_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_AccessPoint_Security(dev_id);
59  } catch(int e)
60  {
61  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint_Security instance..\n");
62  }
63  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
64  }
65  return pRet;
66 }
67 
68 GList* hostIf_WiFi_AccessPoint_Security::getAllInstances()
69 {
70  if(ifHash)
71  return g_hash_table_get_keys(ifHash);
72  return NULL;
73 }
74 
75 
76 void hostIf_WiFi_AccessPoint_Security::closeInstance(hostIf_WiFi_AccessPoint_Security *pDev)
77 {
78  if(pDev)
79  {
80  g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
81  delete pDev;
82  }
83 }
84 
85 void hostIf_WiFi_AccessPoint_Security::closeAllInstances()
86 {
87  if(ifHash)
88  {
89  GList* tmp_list = g_hash_table_get_values (ifHash);
90 
91  while(tmp_list)
92  {
94  tmp_list = tmp_list->next;
95  closeInstance(pDev);
96  }
97  }
98 }
99 
100 hostIf_WiFi_AccessPoint_Security::hostIf_WiFi_AccessPoint_Security(int dev_id):
101  dev_id(0),
102  RekeyingInterval(0),
103  RadiusServerPort(0)
104 {
105  memset(ModesSupported, 0, 20);
106  memset(ModeEnabled, 0, 20);
107  memset(WEPKey, 0, 64);
108  memset(PreSharedKey, 0, 64);
109  memset(KeyPassphrase, 0, 64);
110  memset(RadiusServerIPAddr, 0, 45);
111  memset(RadiusSecret, 0, 64);
112 }
113 /**
114  * @brief Get the MAC Address of an Associated Device of a MoCA Interface.
115  *
116  * This function provides the MAC address of the MoCA interface of the device associated
117  * with this MoCA interface.
118  *
119  * See @ref dev_moca_if_assocdev_getter
120  *
121  */
123 {
124  return 0;
125 
126 }
127 
129 {
130  return 0;
131 
132 }
133 
135 {
136  return 0;
137 
138 }
139 
141 {
142  return 0;
143 
144 }
146 {
147  return 0;
148 
149 }
151 {
152  return 0;
153 
154 }
156 {
157  return 0;
158 
159 }
160 
162 {
163  return 0;
164 
165 }
166 
168 {
169  return 0;
170 
171 }
172 
173 #endif /* #ifdef USE_WIFI_PROFILE */
174 
hostIf_WiFi_AccessPoint_Security
Definition: Device_WiFi_AccessPoint_Security.h:44
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_PreSharedKey
int get_hostIf_WiFi_AccessPoint_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData)
A literal PreSharedKey (PSK) expressed as a hexadecimal string.
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_ModesSupported
int get_hostIf_WiFi_AccessPoint_Security_ModesSupported(HOSTIF_MsgData_t *stMsgData)
Get the comma-separated list of strings, indicate which security modes this AccessPoint instance is c...
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_WEPKey
int get_hostIf_WiFi_AccessPoint_Security_WEPKey(HOSTIF_MsgData_t *stMsgData)
Provide A WEP key expressed as a hexadecimal string.
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_ModeEnabled
int get_hostIf_WiFi_AccessPoint_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData)
Get the security mode enabled for wifi device. The value must be a member of the list reported by the...
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_KeyPassphrase
int get_hostIf_WiFi_AccessPoint_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData)
Provide a passphrase from which the PreSharedKey is to be generated, for WPA-Personal or WPA2-Persona...
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusServerIPAddr
int get_hostIf_WiFi_AccessPoint_Security_RadiusServerIPAddr(HOSTIF_MsgData_t *stMsgData)
Get the IP Address of the RADIUS server used for WLAN security. RadiusServerIPAddr is only applicable...
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusServerPort
int get_hostIf_WiFi_AccessPoint_Security_RadiusServerPort(HOSTIF_MsgData_t *stMsgData)
Get the port number of the RADIUS server used for WLAN security. RadiusServerPort is only applicable ...
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RekeyingInterval
int get_hostIf_WiFi_AccessPoint_Security_RekeyingInterval(HOSTIF_MsgData_t *stMsgData)
Get the interval (expressed in seconds) in which the keys are re-generated.
hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusSecret
int get_hostIf_WiFi_AccessPoint_Security_RadiusSecret(HOSTIF_MsgData_t *stMsgData)
The secret used for handshaking with the RADIUS server [RFC2865]. When read, this parameter returns a...