00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __PANA_CONFIG_H__
00035 #define __PANA_CONFIG_H__
00036
00037 #include <list>
00038 #include <string>
00039 #include "ace/OS.h"
00040 #include "ace/Synch.h"
00041 #include "ace/Singleton.h"
00042 #include "pana_exports.h"
00043 #include "pana_device_id.h"
00044
00048 typedef struct {
00049
00053 ACE_UINT32 irt_;
00054
00058 ACE_UINT32 mrc_;
00059
00063 ACE_UINT32 mrt_;
00064
00068 ACE_UINT32 mrd_;
00069
00070 } PANA_CfgRetransmissionParam;
00071
00075 typedef struct {
00076
00080 ACE_UINT32 id_;
00081
00085 std::string name_;
00086
00087 } PANA_CfgProviderInfo;
00088
00089 typedef std::list<PANA_CfgProviderInfo*> PANA_CfgProviderList;
00090
00094 typedef struct {
00095
00099 std::string paa_ip_address_;
00100
00104 ACE_UINT32 paa_port_number_;
00105
00109 std::string paa_mcast_address_;
00110
00114 ACE_UINT32 paa_mcast_port_number_;
00115
00119 ACE_UINT32 s_flag_;
00120
00124 PANA_CfgProviderInfo isp_info_;
00125
00126 } PANA_CfgClient;
00127
00131 typedef struct {
00132
00136 ACE_UINT32 s_flag_;
00137
00141 ACE_UINT32 use_cookie_;
00142
00146 ACE_UINT32 eap_piggyback_;
00147
00151 PANA_CfgProviderInfo nap_info_;
00152
00156 PANA_CfgProviderList isp_info_;
00157
00161 ACE_UINT32 sessionLifetime_;
00162
00166 ACE_UINT32 gracePeriod_;
00167
00171 std::string mcast_address_;
00172
00176 ACE_UINT32 mcast_port_number_;
00177
00181 PANA_DeviceIdContainer ep_id_;
00182
00186 ACE_UINT32 request_dev_id_;
00187
00188 } PANA_CfgAuthAgent;
00189
00194 typedef struct {
00195
00199 ACE_UINT32 listen_port_;
00200
00204 std::string iface_name_;
00205
00209 ACE_UINT32 protection_capability_;
00210
00214 std::string dictionary_fname_;
00215
00219 ACE_UINT32 mobility_;
00220
00224 PANA_CfgRetransmissionParam rt_;
00225
00226 } PANA_CfgGeneral;
00227
00228 typedef struct {
00229
00233 PANA_CfgGeneral general_;
00234
00238 PANA_CfgClient client_;
00239
00243 PANA_CfgAuthAgent auth_agent_;
00244
00245 } PANA_Cfg;
00246
00252 class PANA_EXPORT PANA_CfgManager {
00253 public:
00257 PANA_CfgManager();
00258
00262 virtual ~PANA_CfgManager();
00263
00272 void open(std::string &cfg_file);
00273
00278 void close();
00279
00283 PANA_Cfg &data() { return data_; }
00284
00288 PANA_CfgGeneral &general() { return data_.general_; }
00289
00293 PANA_CfgClient &client() { return data_.client_; }
00294
00298 PANA_CfgAuthAgent &authAgent() { return data_.auth_agent_; }
00299
00300 private:
00301
00302 PANA_Cfg data_;
00303 };
00304
00308 typedef ACE_Singleton<PANA_CfgManager, ACE_Null_Mutex> PANA_Cfg_S;
00309
00313 #define PANA_CONFIG_OPEN(x) PANA_Cfg_S::instance()->open((x))
00314 #define PANA_CONFIG_DATA() PANA_Cfg_S::instance()->data()
00315 #define PANA_CONFIG_GENERAL() PANA_Cfg_S::instance()->general()
00316 #define PANA_CONFIG_CLIENT() PANA_Cfg_S::instance()->client()
00317 #define PANA_CONFIG_AUTHAGENT() PANA_Cfg_S::instance()->authAgent()
00318 #define PANA_CONFIG_CLOSE() PANA_Cfg_S::instance()->close()
00319
00320 #endif