Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SrvOptIA_NA.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  *
7  * released under GNU GPL v2 only licence
8  *
9  */
10 
11 class TSrvOptIA_NA;
12 #ifndef SRVOPTIA_NA_H
13 #define SRVOPTIA_NA_H
14 
15 #include "OptIA_NA.h"
16 #include "SrvOptIAAddress.h"
17 #include "SmartPtr.h"
18 #include "DUID.h"
19 #include "Container.h"
20 #include "IPv6Addr.h"
21 #include "SrvMsg.h"
22 
23 class TSrvOptIA_NA : public TOptIA_NA
24 {
25  public:
26 
28  int iface, unsigned long &addrCount, int msgType , TMsg* parent);
29  TSrvOptIA_NA(char* buf, int bufsize, TMsg* parent);
30  TSrvOptIA_NA(long IAID, long T1, long T2, TMsg* parent);
31  TSrvOptIA_NA(long IAID, long T1, long T2, int Code, const std::string& Msg, TMsg* parent);
32  TSrvOptIA_NA(SPtr<TSrvOptIA_NA> queryOpt, SPtr<TSrvMsg> queryMsg, TMsg* parent);
33 
34  void releaseAllAddrs(bool quiet);
35 
36  void solicit(SPtr<TSrvOptIA_NA> queryOpt, unsigned long &addrCount);
37  void request(SPtr<TSrvOptIA_NA> queryOpt, unsigned long &addrCount);
38  bool renew(SPtr<TSrvOptIA_NA> queryOpt, bool complainIfMissing);
39  void rebind(SPtr<TSrvOptIA_NA> queryOpt, unsigned long &addrCount);
40  void release(SPtr<TSrvOptIA_NA> queryOpt, unsigned long &addrCount);
41  void decline(SPtr<TSrvOptIA_NA> queryOpt, unsigned long &addrCount);
42  bool doDuties();
43  private:
44  bool assignCachedAddr(bool quiet);
45  bool assignRequestedAddr(SPtr<TSrvMsg> queryMsg, SPtr<TSrvOptIA_NA> queryOpt, bool quiet);
46  bool assignSequentialAddr(SPtr<TSrvMsg> clientMsg, bool quiet);
47  bool assignRandomAddr(SPtr<TSrvMsg> queryMsg, bool quiet);
49  bool assignAddr(SPtr<TIPv6Addr> addr, uint32_t pref, uint32_t valid, bool quiet);
50  bool assignFixedLease(SPtr<TSrvOptIA_NA> req, bool quiet);
51 
54  int Iface;
55 
58 };
59 
60 #endif
61