Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SrvCfgTA.h
Go to the documentation of this file.
1 /*
2  * Dibbler - a portable DHCPv6
3  *
4  * authors: Tomasz Mrugalski <thomson@klub.com.pl>
5  * changes: Nguyen Vinh Nghiem
6  *
7  * released under GNU GPL v2 only licence
8  *
9  */
10 
11 class TSrcCfgTA;
12 #ifndef SRVCONFTA_H
13 #define SRVCONFTA_H
14 
15 #include <string>
16 #include <iostream>
17 #include <iomanip>
18 
19 #include "SrvAddrMgr.h"
20 #include "SrvParsGlobalOpt.h"
21 #include "DHCPConst.h"
22 #include "SmartPtr.h"
23 #include "IPv6Addr.h"
24 #include "DUID.h"
25 
26 class TSrvCfgTA
27 {
28  friend std::ostream& operator<<(std::ostream& out, TSrvCfgTA& iface);
29  public:
30  TSrvCfgTA();
31 
32  //Is client with this DUID and IP address supported?
33  bool clntSupported(SPtr<TDUID> duid,SPtr<TIPv6Addr> clntAddr);
34  //Is client with this DUID and IP address prefered? (is in accept-only?)
35  bool clntPrefered(SPtr<TDUID> duid,SPtr<TIPv6Addr> clntAddr);
36 
37  unsigned long countAddrInPool();
39  bool addrInPool(SPtr<TIPv6Addr> addr);
40 
41  unsigned long getPref();
42  unsigned long getValid();
43  unsigned long getClassMaxLease();
44  unsigned long getID();
45 
46  unsigned long getAssignedCount();
47  long incrAssigned(int count=1);
48  long decrAssigned(int count=1);
49 
51  virtual ~TSrvCfgTA();
52 
53  void mapAllowDenyList( TContainer< SPtr<TSrvCfgClientClass> > clientClassLst);
54  bool clntSupported(SPtr<TDUID> duid,SPtr<TIPv6Addr> clntAddr, SPtr<TSrvMsg> msg);
55  private:
56  unsigned long Pref;
57  unsigned long Valid;
58 
59  unsigned long ID; // this is not IAID, just internal ID counter
60  static unsigned long staticID;
61 
62  TContainer<SPtr<THostRange> > RejedClnt;
63  TContainer<SPtr<THostRange> > AcceptClnt;
65  unsigned long ClassMaxLease;
66  unsigned long AddrsAssigned;
67  unsigned long AddrsCount;
68 
69  List(std::string) allowLst;
70  List(std::string) denyLst;
71 
74 };
75 
76 #endif
77