Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OptIAPrefix.h
Go to the documentation of this file.
1 /*
2  * Dibbler - a portable DHCPv6
3  *
4  * author: Krzysztof Wnuk <keczi@poczta.onet.pl>
5  *
6  * released under GNU GPL v2 only licence
7  *
8  *
9  */
10 
11 #ifndef OPTIAPREFIX_H
12 #define OPTIAPREFIX_H
13 
14 #include "SmartPtr.h"
15 #include "Container.h"
16 #include "Opt.h"
17 #include "IPv6Addr.h"
18 
19 class TOptIAPrefix : public TOpt
20 {
21  public:
22  TOptIAPrefix(const char * addr, size_t len, TMsg* parent);
23  TOptIAPrefix(SPtr<TIPv6Addr> addr, char prefix_length,unsigned long pref,
24  unsigned long valid, TMsg* parent);
25  size_t getSize();
26 
27  char * storeSelf( char* buf);
28  SPtr<TIPv6Addr> getPrefix() const;
29  uint8_t getPrefixLength() const;
30  unsigned long getPref() const;
31  unsigned long getValid() const;
32  void setPref(unsigned long pref);
33  void setValid(unsigned long valid);
34  void setPrefixLenght(char prefix_length);
35  virtual bool isValid() const;
36  virtual bool doDuties() { return true; }
37 
38  private:
40  unsigned long PrefLifetime_;
41  unsigned long ValidLifetime_;
42  char PrefixLength_; // this I am not sure (because prefix should be only 1 byte )
43  bool Valid_;
44 };
45 
46 #endif
47