Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

pana_config_manager.h

00001 /* BEGIN_COPYRIGHT                                                        */
00002 /*                                                                        */
00003 /* Open Diameter: Open-source software for the Diameter and               */
00004 /*                Diameter related protocols                              */
00005 /*                                                                        */
00006 /* Copyright (C) 2002-2004 Open Diameter Project                          */
00007 /*                                                                        */
00008 /* This library is free software; you can redistribute it and/or modify   */
00009 /* it under the terms of the GNU Lesser General Public License as         */
00010 /* published by the Free Software Foundation; either version 2.1 of the   */
00011 /* License, or (at your option) any later version.                        */
00012 /*                                                                        */
00013 /* This library is distributed in the hope that it will be useful,        */
00014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of         */
00015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      */
00016 /* Lesser General Public License for more details.                        */
00017 /*                                                                        */
00018 /* You should have received a copy of the GNU Lesser General Public       */
00019 /* License along with this library; if not, write to the Free Software    */
00020 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307    */
00021 /* USA.                                                                   */
00022 /*                                                                        */
00023 /* In addition, when you copy and redistribute some or the entire part of */
00024 /* the source code of this software with or without modification, you     */
00025 /* MUST include this copyright notice in each copy.                       */
00026 /*                                                                        */
00027 /* If you make any changes that are appeared to be useful, please send    */
00028 /* sources that include the changed part to                               */
00029 /* diameter-developers@lists.sourceforge.net so that we can reflect your  */
00030 /* changes to one unified version of this software.                       */
00031 /*                                                                        */
00032 /* END_COPYRIGHT                                                          */
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_; /*<< configuration 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 /* __PANA_CORE_H__ */

Generated on Fri Jun 25 19:18:29 2004 for PANA by doxygen 1.3.5