00001 /* 00002 * Dibbler - a portable DHCPv6 00003 * 00004 * authors: Tomasz Mrugalski <thomson@klub.com.pl> 00005 * Marek Senderski <msend@o2.pl> 00006 * 00007 * released under GNU GPL v2 or later licence 00008 * 00009 * $Id: RelCfgMgr.h,v 1.3 2005/02/01 00:57:36 thomson Exp $ 00010 * 00011 * $Log: RelCfgMgr.h,v $ 00012 * Revision 1.3 2005/02/01 00:57:36 thomson 00013 * no message 00014 * 00015 * Revision 1.2 2005/01/13 22:45:55 thomson 00016 * Relays implemented. 00017 * 00018 * Revision 1.1 2005/01/11 22:53:35 thomson 00019 * Relay skeleton implemented. 00020 * 00021 * 00022 */ 00023 00024 class TRelCfgMgr; 00025 #ifndef RELCFGMGR_H 00026 #define RELCFGMGR_H 00027 00028 #include "RelCommon.h" 00029 #include "RelCfgIface.h" 00030 00031 #include "CfgMgr.h" 00032 #include "DHCPConst.h" 00033 00034 #define RELAY_MIN_IFINDEX 1024; 00035 00036 class TRelCfgMgr : public TCfgMgr 00037 { 00038 public: 00039 friend ostream & operator<<(ostream &strum, TRelCfgMgr &x); 00040 TRelCfgMgr(TCtx ctx, string cfgFile, string xmlFile); 00041 virtual ~TRelCfgMgr(); 00042 00043 bool parseConfigFile(string cfgFile); 00044 00045 //Interfaces acccess methods 00046 void firstIface(); 00047 SmartPtr<TRelCfgIface> getIface(); 00048 SmartPtr<TRelCfgIface> getIfaceByID(int iface); 00049 SmartPtr<TRelCfgIface> getIfaceByInterfaceID(int iface); 00050 long countIface(); 00051 void addIface(SmartPtr<TRelCfgIface> iface); 00052 00053 void dump(); 00054 00055 bool isDone(); 00056 00057 bool setupGlobalOpts(SmartPtr<TRelParsGlobalOpt> opt); 00058 00059 // configuration parameters 00060 string getWorkdir(); 00061 00062 private: 00063 TCtx Ctx; 00064 string XmlFile; 00065 00066 static int NextRelayID; 00067 00068 bool IsDone; 00069 bool validateConfig(); 00070 bool validateIface(SmartPtr<TRelCfgIface> ptrIface); 00071 TContainer< SmartPtr<TRelCfgIface> > IfaceLst; 00072 00073 bool matchParsedSystemInterfaces(TContainer< SmartPtr<TRelCfgIface> > * lst); 00074 00075 // global options 00076 string Workdir; 00077 }; 00078 00079 #endif /* RELCONFMGR_H */ 00080