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

SrvCfgMgr.h

Go to the documentation of this file.
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: SrvCfgMgr.h,v 1.7 2004/12/07 00:43:03 thomson Exp $
00010  *
00011  * $Log: SrvCfgMgr.h,v $
00012  * Revision 1.7  2004/12/07 00:43:03  thomson
00013  * Server no longer support link local addresses (bug #38),
00014  * Server now supports stateless mode (bug #71)
00015  *
00016  * Revision 1.6  2004/09/05 15:27:49  thomson
00017  * Data receive switched from recvfrom to recvmsg, unicast partially supported.
00018  *
00019  * Revision 1.5  2004/07/05 00:12:30  thomson
00020  * Lots of minor changes.
00021  *
00022  * Revision 1.4  2004/06/17 23:53:54  thomson
00023  * Server Address Assignment rewritten.
00024  */
00025 
00026 class TSrvCfgMgr;
00027 #ifndef SRVCONFMGR_H
00028 #define SRVCONFMGR_H
00029 #include "SmartPtr.h"
00030 #include "SrvCfgIface.h"
00031 #include "SrvIfaceMgr.h"
00032 #include "CfgMgr.h"
00033 #include "DHCPConst.h"
00034 #include "Container.h"
00035 #include "DUID.h"
00036 
00037 #include "FlexLexer.h"
00038 #include "SrvParser.h"
00039 
00040 class TSrvCfgMgr : public TCfgMgr
00041 {
00042 public:  
00043     friend ostream & operator<<(ostream &strum, TSrvCfgMgr &x);
00044     TSrvCfgMgr(SmartPtr<TSrvIfaceMgr> ifaceMgr, string cfgFile, string xmlFile);
00045 
00046     bool parseConfigFile(string cfgFile);
00047 
00048     //Interfaces acccess methods
00049     void firstIface();
00050     SmartPtr<TSrvCfgIface> getIface();
00051     SmartPtr<TSrvCfgIface> getIfaceByID(int iface);
00052     long countIface();
00053     void addIface(SmartPtr<TSrvCfgIface> iface);
00054 
00055     void dump();
00056     
00057     //Address assignment connected methods
00058     long countAvailAddrs(SmartPtr<TDUID> clntDuid, SmartPtr<TIPv6Addr> clntAddr, int iface);
00059     SmartPtr<TSrvCfgAddrClass> getClassByAddr(int iface, SmartPtr<TIPv6Addr> addr);
00060     SmartPtr<TIPv6Addr> getRandomAddr(SmartPtr<TDUID> duid, SmartPtr<TIPv6Addr> clntAddr, int iface);
00061     bool isClntSupported(SmartPtr<TDUID> duid, SmartPtr<TIPv6Addr> clntAddr, int iface);
00062 
00063     // class' usage management
00064     void delClntAddr(int iface, SmartPtr<TIPv6Addr> addr);
00065     void addClntAddr(int iface, SmartPtr<TIPv6Addr> addr);
00066 
00067     bool isDone();
00068     virtual ~TSrvCfgMgr();
00069     bool setupGlobalOpts(SmartPtr<TSrvParsGlobalOpt> opt);
00070 
00071     // configuration parameters
00072     string getWorkdir();
00073     bool stateless();
00074 
00075 private:    
00076     string XmlFile;
00077 
00078     bool IsDone;
00079     bool validateConfig();
00080     bool validateIface(SmartPtr<TSrvCfgIface> ptrIface);
00081     bool validateClass(SmartPtr<TSrvCfgIface> ptrIface, SmartPtr<TSrvCfgAddrClass> ptrClass);
00082     string LogName;
00083     string LogLevel;
00084     TContainer< SmartPtr<TSrvCfgIface> > SrvCfgIfaceLst;
00085     SmartPtr<TSrvIfaceMgr> IfaceMgr;
00086     bool matchParsedSystemInterfaces(SrvParser *parser);
00087 
00088     // global options
00089     string Workdir;
00090     bool Stateless;
00091 };
00092 
00093 #endif /* SRVCONFMGR_H */
00094 

Generated on Mon Dec 27 21:55:22 2004 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1