| Kea 3.0.2-git

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
isc::dhcp::Option6IA
Definition option6_ia.h:22
isc::dhcp::Option6IA::setT1
void setT1(uint32_t t1)
Sets T1 timer.
Definition option6_ia.h:71
isc::dhcp::Option6IA::getIAID
uint32_t getIAID() const
Returns IA identifier.
Definition option6_ia.h:87
isc::dhcp::Option6IA::iaid_
uint32_t iaid_
keeps IA identifier
Definition option6_ia.h:109
isc::dhcp::Option6IA::getT2
uint32_t getT2() const
Returns T2 timer.
Definition option6_ia.h:97
isc::dhcp::Option6IA::getT1
uint32_t getT1() const
Returns T1 timer.
Definition option6_ia.h:92
isc::dhcp::Option6IA::OPTION6_IA_LEN
static const size_t OPTION6_IA_LEN
Length of IA_NA and IA_PD content.
Definition option6_ia.h:26
isc::dhcp::Option6IA::setIAID
void setIAID(uint32_t iaid)
Sets Identity Association Identifier.
Definition option6_ia.h:81
isc::dhcp::Option6IA::t1_
uint32_t t1_
keeps T1 timer value
Definition option6_ia.h:112
isc::dhcp::Option6IA::len
virtual uint16_t len() const
returns complete length of option
Definition option6_ia.cc:105
isc::dhcp::Option6IA::Option6IA
Option6IA(uint16_t type, uint32_t iaid)
Ctor, used for constructed options, usually during transmission.
Definition option6_ia.cc:25
isc::dhcp::Option6IA::clone
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition option6_ia.cc:53
isc::dhcp::Option6IA::pack
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
isc::dhcp::Option6IA::setT2
void setT2(uint32_t t2)
Sets T2 timer.
Definition option6_ia.h:76
isc::dhcp::Option6IA::toText
virtual std::string toText(int indent=0) const
Provides human readable text representation.
Definition option6_ia.cc:85
isc::dhcp::Option6IA::t2_
uint32_t t2_
keeps T2 timer value
Definition option6_ia.h:115
isc::dhcp::Option6IA::unpack
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
Definition option6_ia.cc:67
isc::dhcp::Option::Option
Option(Universe u, uint16_t type)
ctor, used for options constructed, usually during transmission
Definition option.cc:39
isc::dhcp::Option::check
void check() const
A protected method used for option correctness.
Definition option.cc:90
isc::util::OutputBuffer
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition buffer.h:346
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::OptionBufferConstIter
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition option.h:30
isc::dhcp::Option6IAPtr
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
Definition option6_ia.h:20
isc::dhcp::OptionPtr
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
option.h