Kea  1.9.9-git
option6_ia.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef OPTION_IA_H
8 #define OPTION_IA_H
9 
10 #include <dhcp/option.h>
11 #include <boost/shared_ptr.hpp>
12 #include <stdint.h>
13 
14 namespace isc {
15 namespace dhcp {
16 
17 class Option6IA;
18 
20 typedef boost::shared_ptr<Option6IA> Option6IAPtr;
21 
22 class Option6IA: public Option {
23 
24 public:
26  const static size_t OPTION6_IA_LEN = 12;
27 
32  Option6IA(uint16_t type, uint32_t iaid);
33 
39  Option6IA(uint16_t type, OptionBuffer::const_iterator begin,
40  OptionBuffer::const_iterator end);
41 
43  virtual OptionPtr clone() const;
44 
49  void pack(isc::util::OutputBuffer& buf) const;
50 
58  virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
59 
65  virtual std::string toText(int indent = 0) const;
66 
70  void setT1(uint32_t t1) { t1_ = t1; }
71 
75  void setT2(uint32_t t2) { t2_ = t2; }
76 
80  void setIAID(uint32_t iaid) { iaid_ = iaid; }
81 
86  uint32_t getIAID() const { return iaid_; }
87 
91  uint32_t getT1() const { return t1_; }
92 
96  uint32_t getT2() const { return t2_; }
97 
103  virtual uint16_t len() const;
104 
105 protected:
106 
108  uint32_t iaid_;
109 
111  uint32_t t1_;
112 
114  uint32_t t2_;
115 };
116 
117 } // isc::dhcp namespace
118 } // isc namespace
119 
120 #endif // OPTION_IA_H
uint32_t getIAID() const
Returns IA identifier.
Definition: option6_ia.h:86
virtual std::string toText(int indent=0) const
Provides human readable text representation.
Definition: option6_ia.cc:85
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
Definition: option6_ia.cc:67
void pack(isc::util::OutputBuffer &buf) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option...
Definition: option6_ia.cc:57
uint32_t getT2() const
Returns T2 timer.
Definition: option6_ia.h:96
boost::shared_ptr< Option > OptionPtr
Definition: option.h:36
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition: option6_ia.cc:53
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
Definition: option6_ia.h:17
virtual uint16_t len() const
returns complete length of option
Definition: option6_ia.cc:105
uint32_t t1_
keeps T1 timer value
Definition: option6_ia.h:111
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:30
Defines the logger used by the top-level component of kea-dhcp-ddns.
uint32_t getT1() const
Returns T1 timer.
Definition: option6_ia.h:91
uint32_t iaid_
keeps IA identifier
Definition: option6_ia.h:108
void setT2(uint32_t t2)
Sets T2 timer.
Definition: option6_ia.h:75
void setIAID(uint32_t iaid)
Sets Identity Association Identifier.
Definition: option6_ia.h:80
static const size_t OPTION6_IA_LEN
Length of IA_NA and IA_PD content.
Definition: option6_ia.h:26
uint32_t t2_
keeps T2 timer value
Definition: option6_ia.h:114
void setT1(uint32_t t1)
Sets T1 timer.
Definition: option6_ia.h:70
Option6IA(uint16_t type, uint32_t iaid)
Ctor, used for constructed options, usually during transmission.
Definition: option6_ia.cc:25