Kea: option6_iaprefix.h Source File

| Kea 1.5.0

option6_iaprefix.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2017 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 OPTION6_IAPREFIX_H
8 #define OPTION6_IAPREFIX_H
9
10 #include <asiolink/io_address.h>
11 #include <dhcp/option6_iaaddr.h>
12 #include <dhcp/option.h>
13
14 namespace isc {
15 namespace dhcp {
16
17
51 class Option6IAPrefix : public Option6IAAddr {
52
53 public:
55 static const size_t OPTION6_IAPREFIX_LEN = 25;
56
64 Option6IAPrefix(uint16_t type, const isc::asiolink::IOAddress& addr,
65 uint8_t prefix_length, uint32_t preferred, uint32_t valid);
66
74 Option6IAPrefix(uint32_t type, OptionBuffer::const_iterator begin,
75 OptionBuffer::const_iterator end);
76
78 virtual OptionPtr clone() const;
79
88 void pack(isc::util::OutputBuffer& buf) const;
89
101 virtual void unpack(OptionBufferConstIter begin,
102 OptionBufferConstIter end);
103
109 virtual std::string toText(int indent = 0) const;
110
115 void setPrefix(const isc::asiolink::IOAddress& prefix,
116 uint8_t length) { addr_ = prefix; prefix_len_ = length; }
117
118 uint8_t getLength() const { return prefix_len_; }
119
121 virtual uint16_t len() const;
122
123 private:
124
133 void mask(OptionBuffer::const_iterator begin,
134 OptionBuffer::const_iterator end,
135 const uint8_t len,
136 OptionBuffer& output_address) const;
137
138 uint8_t prefix_len_;
139 };
140
142 typedef boost::shared_ptr<Option6IAPrefix> Option6IAPrefixPtr;
143
144 } // isc::dhcp namespace
145 } // isc namespace
146
147 #endif // OPTION_IAPREFIX_H
isc::dhcp::OptionBuffer
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition: option.h:25
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic)
Definition: io_address.h:45
io_address.h
isc::dhcp::Option6IAPrefix::unpack
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
Definition: option6_iaprefix.cc:74
isc::dhcp::Option6IAPrefix::getLength
uint8_t getLength() const
Definition: option6_iaprefix.h:118
isc::dhcp::Option6IAAddr
Definition: option6_iaaddr.h:22
isc::dhcp::Option6IAPrefix
Class that represents IAPREFIX option in DHCPv6.
Definition: option6_iaprefix.h:51
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::dhcp::Option6IAPrefix::toText
virtual std::string toText(int indent=0) const
Returns string representation of the option.
Definition: option6_iaprefix.cc:99
isc::dhcp::Option6IAAddr::addr_
isc::asiolink::IOAddress addr_
contains an IPv6 address
Definition: option6_iaaddr.h:116
isc::util::OutputBuffer
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
isc::dhcp::Option6IAPrefix::pack
void pack(isc::util::OutputBuffer &buf) const
Writes option in wire-format.
Definition: option6_iaprefix.cc:53
isc::dhcp::Option6IAPrefix::setPrefix
void setPrefix(const isc::asiolink::IOAddress &prefix, uint8_t length)
sets address in this option.
Definition: option6_iaprefix.h:115
isc::dhcp::OptionPtr
boost::shared_ptr< Option > OptionPtr
Definition: option.h:37
isc::dhcp::Option6IAPrefix::clone
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition: option6_iaprefix.cc:49
isc::dhcp::Option::valid
virtual bool valid() const
returns if option is valid (e.g.
Definition: option.cc:192
isc::dhcp::Option6IAPrefix::Option6IAPrefix
Option6IAPrefix(uint16_t type, const isc::asiolink::IOAddress &addr, uint8_t prefix_length, uint32_t preferred, uint32_t valid)
Constructor, used for options constructed (during transmission).
Definition: option6_iaprefix.cc:29
option6_iaaddr.h
option.h
isc::dhcp::Option6IAPrefixPtr
boost::shared_ptr< Option6IAPrefix > Option6IAPrefixPtr
Pointer to the Option6IAPrefix object.
Definition: option6_iaprefix.h:142
isc::dhcp::OptionBufferConstIter
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:31
isc::dhcp::Option6IAPrefix::len
virtual uint16_t len() const
returns data length (data length + DHCPv4/DHCPv6 option header)
Definition: option6_iaprefix.cc:110
isc::dhcp::Option6IAPrefix::OPTION6_IAPREFIX_LEN
static const size_t OPTION6_IAPREFIX_LEN
length of the fixed part of the IAPREFIX option
Definition: option6_iaprefix.h:55