Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClntAddrMgr.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 #ifndef CLNTADDRMGR_H
12 #define CLNTADDRMGR_H
13 
14 #include "Container.h"
15 #include "SmartPtr.h"
16 #include "AddrIA.h"
17 #include "AddrMgr.h"
18 #include "Portable.h"
19 #include "IPv6Addr.h"
20 #include "ScriptParams.h"
21 
22 #define ClntAddrMgr() (TClntAddrMgr::instance())
23 
24 class TClntAddrMgr : public TAddrMgr
25 {
26  private:
27  TClntAddrMgr(SPtr<TDUID> clientDuid, bool useConfirm, const std::string& xmlFile, bool loadDB);
28 
29  public:
30  static TClntAddrMgr& instance();
31  static void instanceCreate(SPtr<TDUID> clientDUID, bool useConfirm,
32  const std::string& xmlFile, bool loadDB);
33 
34  unsigned long getT1Timeout();
35  unsigned long getT2Timeout();
36  unsigned long getPrefTimeout();
37  unsigned long getValidTimeout();
38 
39  unsigned long getTimeout();
40  unsigned long getTentativeTimeout();
41 
42  // --- IA ---
43  void firstIA();
45  SPtr<TAddrIA> getIA(unsigned long IAID);
46  void addIA(SPtr<TAddrIA> ptr);
47  bool delIA(long IAID);
48  int countIA();
49  void setIA2Confirm(volatile link_state_notify_t * changedLinks);
51 
52  // --- PD ---
53  void firstPD();
55  SPtr<TAddrIA> getPD(unsigned long IAID);
56  void addPD(SPtr<TAddrIA> ptr);
57  bool delPD(long IAID);
58  int countPD();
59  bool addPrefix(SPtr<TDUID> srvDuid , SPtr<TIPv6Addr> srvAddr,
60  const std::string& ifacename, int iface, unsigned long IAID, unsigned long T1, unsigned long T2,
61  SPtr<TIPv6Addr> prefix, unsigned long pref, unsigned long valid,
62  int length, bool quiet);
63 
64  bool updatePrefix(SPtr<TDUID> srvDuid , SPtr<TIPv6Addr> srvAddr,
65  const std::string& ifname,
66  int iface, unsigned long IAID, unsigned long T1, unsigned long T2,
67  SPtr<TIPv6Addr> prefix, unsigned long pref, unsigned long valid,
68  int length, bool quiet);
69 
70  // --- TA ---
71  void firstTA();
73  SPtr<TAddrIA> getTA(unsigned long iaid);
74  void addTA(SPtr<TAddrIA> ptr);
75  bool delTA(unsigned long iaid);
76  int countTA();
77 
78  ~TClntAddrMgr();
79 
80  void doDuties();
81  void processLoadedDB();
82 
83  protected:
84  void print(std::ostream &x);
85  private:
88 };
89 
90 #endif
91