Kea: option6_ia.h Source File

| Kea 3.2.0-git

option6_ia.h
Go to the documentation of this file.
1// Copyright (C) 2011-2026 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
14namespace isc {
15namespace dhcp {
16
17class Option6IA;
18
20 typedef boost::shared_ptr<Option6IA> Option6IAPtr;
21
22 class Option6IA: public Option {
23
24public:
26 const static size_t OPTION6_IA_LEN = 12;
27
32 Option6IA(uint16_t type, uint32_t iaid);
33
40 Option6IA(uint16_t type, OptionBuffer::const_iterator begin,
41 OptionBuffer::const_iterator end, size_t rec_level = 0);
42
44 virtual OptionPtr clone() const;
45
51 void pack(isc::util::OutputBuffer& buf, bool check = true) const;
52
60 virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
61
67 void unpack(OptionBufferConstIter begin, OptionBufferConstIter end,
68 size_t rec_level);
69
75 virtual std::string toText(int indent = 0) const;
76
80 void setT1(uint32_t t1) { t1_ = t1; }
81
85 void setT2(uint32_t t2) { t2_ = t2; }
86
90 void setIAID(uint32_t iaid) { iaid_ = iaid; }
91
96 uint32_t getIAID() const { return iaid_; }
97
101 uint32_t getT1() const { return t1_; }
102
106 uint32_t getT2() const { return t2_; }
107
113 virtual uint16_t len() const;
114
115protected:
116
118 uint32_t iaid_;
119
121 uint32_t t1_;
122
124 uint32_t t2_;
125};
126
127} // isc::dhcp namespace
128} // isc namespace
129
130#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:80
isc::dhcp::Option6IA::getIAID
uint32_t getIAID() const
Returns IA identifier.
Definition option6_ia.h:96
isc::dhcp::Option6IA::iaid_
uint32_t iaid_
keeps IA identifier
Definition option6_ia.h:118
isc::dhcp::Option6IA::getT2
uint32_t getT2() const
Returns T2 timer.
Definition option6_ia.h:106
isc::dhcp::Option6IA::getT1
uint32_t getT1() const
Returns T1 timer.
Definition option6_ia.h:101
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:90
isc::dhcp::Option6IA::t1_
uint32_t t1_
keeps T1 timer value
Definition option6_ia.h:121
isc::dhcp::Option6IA::len
virtual uint16_t len() const
returns complete length of option
Definition option6_ia.cc:111
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:85
isc::dhcp::Option6IA::toText
virtual std::string toText(int indent=0) const
Provides human readable text representation.
Definition option6_ia.cc:91
isc::dhcp::Option6IA::t2_
uint32_t t2_
keeps T2 timer value
Definition option6_ia.h:124
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 check_exists_add.cc:18
option.h