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: ClntCfgMgr.h,v 1.8 2005/02/01 00:57:36 thomson Exp $ 00010 * 00011 * $Log: ClntCfgMgr.h,v $ 00012 * Revision 1.8 2005/02/01 00:57:36 thomson 00013 * no message 00014 * 00015 * Revision 1.7 2004/12/07 20:51:35 thomson 00016 * Link local safety checks added (bug #39) 00017 * 00018 * Revision 1.6 2004/12/07 00:45:41 thomson 00019 * Clnt managers creation unified and cleaned up. 00020 * 00021 * Revision 1.5 2004/10/27 22:07:55 thomson 00022 * Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST 00023 * message is now sent properly. Valid lifetime granted by server fixed. 00024 * 00025 * Revision 1.4 2004/05/23 20:41:03 thomson 00026 * *** empty log message *** 00027 * 00028 * 00029 */ 00030 00031 class TClntCfgMgr; 00032 #ifndef CLNTCFGMGR_H 00033 #define CLNTCFGMGR_H 00034 00035 #include <string> 00036 #include "SmartPtr.h" 00037 #include "Container.h" 00038 #include "ClntIfaceMgr.h" 00039 #include "ClntCfgIface.h" 00040 #include "ClntCfgGroup.h" 00041 #include "CfgMgr.h" 00042 #include "FlexLexer.h" 00043 #include "ClntParser.h" 00044 00045 class TClntCfgMgr : public TCfgMgr 00046 { 00047 friend ostream & operator<<(ostream &strum, TClntCfgMgr &x); 00048 public: 00049 TClntCfgMgr(SmartPtr<TClntIfaceMgr> IfaceMgr, 00050 const string cfgFile,const string oldCfgFile); 00051 ~TClntCfgMgr(); 00052 00053 // --- Iface related --- 00054 SmartPtr<TClntCfgIA> getIA(long IAID); 00055 SmartPtr<TClntCfgIface> getIface(); 00056 SmartPtr<TClntCfgIface> getIface(int id); 00057 void firstIface(); 00058 void addIface(SmartPtr<TClntCfgIface> x); 00059 int countIfaces(); 00060 void dump(); 00061 00062 bool getReconfigure(); 00063 00064 //IA related 00065 bool setIAState(int iface, int iaid, enum EState state); 00066 int countAddrForIA(long IAID); 00067 00068 SmartPtr<TClntCfgGroup> getGroupForIA(long IAID); 00069 SmartPtr<TClntCfgIface> TClntCfgMgr::getIfaceByIAID(int iaid); 00070 bool isDone(); 00071 00072 private: 00073 SmartPtr<TClntIfaceMgr> IfaceMgr; 00074 TContainer< SmartPtr<TClntCfgIface> > ClntCfgIfaceLst; 00075 00076 bool validateConfig(); 00077 bool validateIface(SmartPtr<TClntCfgIface> iface); 00078 bool validateIA(SmartPtr<TClntCfgIface> ptrIface, SmartPtr<TClntCfgIA> ptrIA); 00079 bool validateAddr(SmartPtr<TClntCfgIface> ptrIface, 00080 SmartPtr<TClntCfgIA> ptrIA, 00081 SmartPtr<TClntCfgAddr> ptrAddr); 00082 00083 bool matchParsedSystemInterfaces(clntParser *parser); 00084 }; 00085 00086 #endif 00087