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

SrvCfgAddrClass.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: SrvCfgAddrClass.h,v 1.11 2004/12/07 00:43:03 thomson Exp $
00010  *
00011  * $Log: SrvCfgAddrClass.h,v $
00012  * Revision 1.11  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.10  2004/10/25 20:45:53  thomson
00017  * Option support, parsers rewritten. ClntIfaceMgr now handles options.
00018  *
00019  * Revision 1.9  2004/09/08 21:22:45  thomson
00020  * Parser improvements, signed/unsigned issues addressed.
00021  *
00022  * Revision 1.8  2004/09/03 23:20:23  thomson
00023  * RAPID-COMMIT support fixed. (bugs #50, #51, #52)
00024  *
00025  * Revision 1.7  2004/07/05 00:12:30  thomson
00026  * Lots of minor changes.
00027  *
00028  * Revision 1.6  2004/06/29 22:03:36  thomson
00029  * *MaxLease option partialy implemented/fixed.
00030  *
00031  * Revision 1.5  2004/06/28 22:37:59  thomson
00032  * Minor changes.
00033  *
00034  * Revision 1.4  2004/06/17 23:53:54  thomson
00035  * Server Address Assignment rewritten.
00036  *
00037  *                                                                           
00038  */
00039 
00040 class TSrvCfgAddrClass;
00041 #ifndef SRVCONFADDRCLASS_H
00042 #define SRVCONFADDRCLASS_H
00043 
00044 #include <string>
00045 #include <iostream>
00046 #include <iomanip>
00047 
00048 #include "SrvAddrMgr.h"
00049 #include "SrvParsGlobalOpt.h"
00050 #include "DHCPConst.h"
00051 #include "SmartPtr.h"
00052 #include "IPv6Addr.h"
00053 #include "DUID.h"
00054 #include "SmartPtr.h"
00055 
00056 
00057 using namespace std;
00058 
00059 
00060 class TSrvCfgAddrClass
00061 {
00062     friend ostream& operator<<(ostream& out,TSrvCfgAddrClass& iface);
00063  public:
00064     TSrvCfgAddrClass();
00065     
00066     //Is client with this DUID and IP address supported?
00067     bool clntSupported(SmartPtr<TDUID> duid,SmartPtr<TIPv6Addr> clntAddr);
00068     
00069     //checks if the address belongs to the pool
00070     bool addrInPool(SmartPtr<TIPv6Addr> addr);
00071     unsigned long countAddrInPool();
00072     SmartPtr<TIPv6Addr> getRandomAddr();
00073     
00074     unsigned long getT1(long clntT1);
00075     unsigned long getT2(long clntT2);
00076     unsigned long getPref(long clntPref);
00077     unsigned long getValid(long clntValid);
00078     unsigned long getClassMaxLease();
00079     unsigned long getID();
00080 
00081     bool isLinkLocal();
00082 
00083     unsigned long getAssignedCount();
00084     long incrAssigned(int count=1);
00085     long decrAssigned(int count=1);
00086 
00087     void setOptions(SmartPtr<TSrvParsGlobalOpt> opt);
00088     virtual ~TSrvCfgAddrClass();
00089  private:
00090     unsigned long T1Beg;
00091     unsigned long T2Beg;
00092     unsigned long PrefBeg;
00093     unsigned long ValidBeg;
00094     unsigned long T1End;
00095     unsigned long T2End;
00096     unsigned long PrefEnd;
00097     unsigned long ValidEnd;
00098     
00099     long chooseTime(long beg, long end, long clntTime);
00100     
00101     unsigned long ID;
00102     static unsigned long staticID;
00103 
00104     TContainer<SmartPtr<TStationRange> > RejedClnt;
00105     TContainer<SmartPtr<TStationRange> > AcceptClnt;
00106     SmartPtr<TStationRange> Pool;
00107     unsigned long ClassMaxLease;
00108     unsigned long AddrsAssigned;
00109     unsigned long AddrsCount;
00110 };
00111 
00112 #endif
00113 

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