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

AddrMgr.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 licence
00008  *
00009  * $Id: AddrMgr.h,v 1.9 2004/12/07 00:45:41 thomson Exp $
00010  *
00011  * $Log: AddrMgr.h,v $
00012  * Revision 1.9  2004/12/07 00:45:41  thomson
00013  * Clnt managers creation unified and cleaned up.
00014  *
00015  * Revision 1.8  2004/06/17 23:53:54  thomson
00016  * Server Address Assignment rewritten.
00017  *
00018  * Revision 1.7  2004/06/04 19:03:46  thomson
00019  * Resolved warnings with signed/unisigned
00020  *
00021  * Revision 1.4  2004/04/11 18:04:53  thomson
00022  * LIBXML2 is now an optional feature
00023  *
00024  */
00025 
00026 class TAddrMgr;
00027 #ifndef ADDRMGR_H
00028 #define ADDRMGR_H
00029 
00030 #include <string>
00031 #include "SmartPtr.h"
00032 #include "Container.h"
00033 #include "AddrClient.h"
00034 #include "AddrIA.h"
00035 
00036 #ifdef LIBXML2
00037 #include <libxml/xmlmemory.h>
00038 #include <libxml/parser.h>
00039 
00040 #define ADDRDB_DTD (xmlChar*)"AddrMgr.dtd"
00041 #endif
00042 
00043 class TAddrMgr
00044 {
00045   public:
00046     friend ostream & operator<<(ostream & strum,TAddrMgr &x);
00047     TAddrMgr(string addrdb, bool loadfile = false);
00048     virtual ~TAddrMgr();
00049     
00050     //--- Client container ---
00051     void addClient(SmartPtr<TAddrClient> x);
00052     void firstClient();
00053     SmartPtr<TAddrClient> getClient();
00054     SmartPtr<TAddrClient> getClient(SmartPtr<TDUID> duid);
00055     int countClient();
00056     bool delClient(SmartPtr<TDUID> duid);
00057 
00058     //--- Time related methods ---
00059     unsigned long getT1Timeout();
00060     unsigned long getT2Timeout();
00061     unsigned long getPrefTimeout();
00062     unsigned long getValidTimeout();
00063     unsigned long getAddrCount(SmartPtr<TDUID> duid, int iface);
00064     
00065     // --- backup/restore ---
00066     void dbLoad();
00067     void dump();
00068     bool isDone();
00069 
00070 #ifdef LIBXML2
00071     xmlDocPtr xmlLoad(const char * filename);
00072     SmartPtr<TAddrAddr> parseAddrAddr(xmlDocPtr doc, xmlNodePtr xmlAddr, int depth);
00073     SmartPtr<TAddrIA> parseAddrIA(xmlDocPtr doc, xmlNodePtr xmlIA, int depth);
00074     SmartPtr<TAddrClient> parseAddrClient(xmlDocPtr doc, xmlNodePtr xmlClient, int depth);
00075     void parseAddrMgr(xmlDocPtr doc,int depth);
00076 #endif
00077 
00078 protected:
00079     bool IsDone;
00080     TContainer< SmartPtr<TAddrClient> > ClntsLst;
00081     string XmlFile;
00082 };
00083 
00084 #endif
00085 

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