Kea  2.5.2
option6_ia.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2022 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 
50  void pack(isc::util::OutputBuffer& buf, bool check = true) const;
51 
59  virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
60 
66  virtual std::string toText(int indent = 0) const;
67 
71  void setT1(uint32_t t1) { t1_ = t1; }
72 
76  void setT2(uint32_t t2) { t2_ = t2; }
77 
81  void setIAID(uint32_t iaid) { iaid_ = iaid; }
82 
87  uint32_t getIAID() const { return iaid_; }
88 
92  uint32_t getT1() const { return t1_; }
93 
97  uint32_t getT2() const { return t2_; }
98 
104  virtual uint16_t len() const;
105 
106 protected:
107 
109  uint32_t iaid_;
110 
112  uint32_t t1_;
113 
115  uint32_t t2_;
116 };
117 
118 } // isc::dhcp namespace
119 } // isc namespace
120 
121 #endif // OPTION_IA_H
void setT1(uint32_t t1)
Sets T1 timer.
Definition: option6_ia.h:71
uint32_t getIAID() const
Returns IA identifier.
Definition: option6_ia.h:87
uint32_t iaid_
keeps IA identifier
Definition: option6_ia.h:109
uint32_t getT2() const
Returns T2 timer.
Definition: option6_ia.h:97
uint32_t getT1() const
Returns T1 timer.
Definition: option6_ia.h:92
static const size_t OPTION6_IA_LEN
Length of IA_NA and IA_PD content.
Definition: option6_ia.h:26
void setIAID(uint32_t iaid)
Sets Identity Association Identifier.
Definition: option6_ia.h:81
uint32_t t1_
keeps T1 timer value
Definition: option6_ia.h:112
virtual uint16_t len() const
returns complete length of option
Definition: option6_ia.cc:105
Option6IA(uint16_t type, uint32_t iaid)
Ctor, used for constructed options, usually during transmission.
Definition: option6_ia.cc:25
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition: option6_ia.cc:53
void pack(isc::util::OutputBuffer &buf, bool check=true) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option.
Definition: option6_ia.cc:57
void setT2(uint32_t t2)
Sets T2 timer.
Definition: option6_ia.h:76
virtual std::string toText(int indent=0) const
Provides human readable text representation.
Definition: option6_ia.cc:85
uint32_t t2_
keeps T2 timer value
Definition: option6_ia.h:115
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
Definition: option6_ia.cc:67
void check() const
A protected method used for option correctness.
Definition: option.cc:90
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
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
Definition: option6_ia.h:17
boost::shared_ptr< Option > OptionPtr
Definition: option.h:36
Defines the logger used by the top-level component of kea-lfc.