Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SrvOptIA_PD.h
Go to the documentation of this file.
1 /*
2  * Dibbler - a portable DHCPv6
3  *
4  * author: Krzysztof Wnuk <keczi@poczta.onet.pl>
5  * changes: Tomasz Mrugalski <thomson@klub.com.pl>
6  *
7  * released under GNU GPL v2 only licence
8  *
9  *
10  */
11 
12 class TSrvOptIA_PD;
13 
14 #ifndef SRVOPTIA_PD_H
15 #define SRVOPTIA_PD_H
16 
17 #include "OptIA_PD.h"
18 #include "SrvOptIAPrefix.h"
19 #include "SmartPtr.h"
20 #include "DUID.h"
21 #include "Container.h"
22 #include "IPv6Addr.h"
23 #include "SrvCfgIface.h"
24 
25 class TSrvOptIA_PD : public TOptIA_PD
26 {
27  public:
28  TSrvOptIA_PD(SPtr<TSrvMsg> clientMsg, SPtr<TSrvOptIA_PD> queryOpt, TMsg* parent);
29  TSrvOptIA_PD(char * buf, int bufsize, TMsg* parent);
30  TSrvOptIA_PD(uint32_t IAID, uint32_t T1, uint32_t T2, TMsg* parent);
31  TSrvOptIA_PD(uint32_t IAID, uint32_t T1, uint32_t T2, int Code,
32  const std::string& Msg, TMsg* parent);
33 
34  void releaseAllPrefixes(bool quiet);
35 
36  void solicitRequest(SPtr<TSrvMsg> clientMsg, SPtr<TSrvOptIA_PD> queryOpt,
37  SPtr<TSrvCfgIface> ptr, bool fake);
39  void rebind (SPtr<TSrvOptIA_PD> queryOpt, SPtr<TSrvCfgIface> iface);
40  void release (SPtr<TSrvOptIA_PD> queryOpt, SPtr<TSrvCfgIface> iface);
41  void confirm (SPtr<TSrvOptIA_PD> queryOpt, SPtr<TSrvCfgIface> iface);
42  void decline (SPtr<TSrvOptIA_PD> queryOpt, SPtr<TSrvCfgIface> iface);
43  bool doDuties();
44  private:
47 
49  int Iface;
50 
51  bool existingLease();
52  bool assignPrefix(SPtr<TSrvMsg> clientMsg, SPtr<TIPv6Addr> hint, bool fake);
54 
55  TContainer< SPtr<TIPv6Addr> > getFreePrefixes(SPtr<TSrvMsg> clientMsg, SPtr<TIPv6Addr> hint);
56 
59  unsigned long PDLength;
60 
61 };
62 
63 #endif
64