Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SrvParsClassOpt.h
Go to the documentation of this file.
1 /*
2  * Dibbler - a portable DHCPv6
3  *
4  * authors: Tomasz Mrugalski <thomson@klub.com.pl>
5  * Marek Senderski <msend@o2.pl>
6  * changes: Nguyen Vinh Nghiem
7  *
8  * released under GNU GPL v2 only licence
9  *
10  */
11 
12 class TSrvParsClassOpt;
13 #ifndef TSRVPARSCLASS_H
14 #define TSRVPARSCLASS_H
15 
16 #include <string>
17 #include "DHCPConst.h"
18 #include "Container.h"
19 #include "SmartPtr.h"
20 #include "HostID.h"
21 #include "HostRange.h"
22 #include "IPv6Addr.h"
23 #include "SrvOptAddrParams.h"
24 
26 {
27  public:
28  TSrvParsClassOpt(void);
29  ~TSrvParsClassOpt(void);
30 
31  //T1,T2,Valid,Prefered time routines
32  void setT1Beg(unsigned long t1);
33  void setT1End(unsigned long t1);
34  unsigned long getT1Beg();
35  unsigned long getT1End();
36 
37  void setT2Beg(unsigned long t2);
38  void setT2End(unsigned long t2);
39  unsigned long getT2Beg();
40  unsigned long getT2End();
41 
42  void setPrefBeg(unsigned long pref);
43  void setPrefEnd(unsigned long pref);
44  unsigned long getPrefBeg();
45  unsigned long getPrefEnd();
46 
47  void setShare(unsigned long share);
48  unsigned long getShare();
49 
50  void setValidEnd(unsigned long valid);
51  void setValidBeg(unsigned long valid);
52  unsigned long getValidEnd();
53  unsigned long getValidBeg();
54 
55  //Rejected clients access routines
56  void addRejedClnt(SPtr<THostRange> addr);
57  void firstRejedClnt();
59  void setRejedClnt(TContainer<SPtr<THostRange> > *rejedClnt);
60 
61  //Accepted clients access routines
63  void firstAcceptClnt();
65  void setAcceptClnt(TContainer<SPtr<THostRange> > *acceptClnt);
66 
67  //Pool access routines
68  void addPool(SPtr<THostRange> addr);
69  void firstPool();
71  void setPool(TContainer<SPtr<THostRange> > *pool);
72  long countPool();
73 
74  // leases count
75  void setClassMaxLease(unsigned long maxClntLeases);
76  unsigned long getClassMaxLease();
77 
78  void setAddrParams(int prefix, int bitfield);
80 
81  // Allow and deny list
82 
83  void setAllowClientClass(std::string s);
84  List(std::string) getAllowClientClassString();
85 
86  void setDenyClientClass(std::string s);
87  List(std::string) getDenyClientClassString();
88 
89 private:
90  //Ranges of T1 i T2
91  unsigned long T1Beg;
92  unsigned long T1End;
93  unsigned long T2End;
94  unsigned long T2Beg;
95  unsigned long PrefBeg;
96  unsigned long PrefEnd;
97  unsigned long ValidBeg;
98  unsigned long ValidEnd;
99  unsigned long Share;
100 
101  TContainer<SPtr<THostRange> > RejedClnt;
102  TContainer<SPtr<THostRange> > AcceptClnt;
103  TContainer<SPtr<THostRange> > Pool;
104 
105  unsigned long ClassMaxLease;
106 
107  // AddrParams fields
109 
110  List(std::string) allowLst;
111  List(std::string) denyLst;
112 };
113 #endif
114