Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AddrAddr.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 #ifndef ADDRADDR_H
11 #define ADDRADDR_H
12 
13 #include <list>
14 #include <iostream>
15 #include "IPv6Addr.h"
16 #include "SmartPtr.h"
17 #include "DHCPConst.h"
18 
19 class TAddrAddr
20 {
21  friend std::ostream & operator<<(std::ostream & strum, TAddrAddr &x);
22  public:
23 
24  TAddrAddr(SPtr<TIPv6Addr> addr, long pref, long valid);
25  TAddrAddr(SPtr<TIPv6Addr> addr, long pref, long valid, int prefix);
26 
27  // return address in packed format (char[16])
28  SPtr<TIPv6Addr> get();
29 
30  // lifetime related
31  unsigned long getPref();
32  unsigned long getValid();
33  unsigned long getPrefTimeout();
34  void setPref(unsigned long pref);
35  void setValid(unsigned long valid);
36  unsigned long getValidTimeout();
37  int getPrefix();
38 
39  // timestamp
40  long getTimestamp();
41  void setTimestamp(long ts);
42  void setTimestamp();
43 
44  // tentative
46  void setTentative(enum EAddrStatus state);
47 
48  protected:
50 
51  unsigned long Prefered;
52  unsigned long Valid;
54  unsigned long Timestamp;
55  int Prefix;
56 };
57 
58 typedef std::list< SPtr<TIPv6Addr> > TAddrList;
59 
60 #endif
61