Kea 2.5.8
option6_addrlst.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 OPTION6_ADDRLST_H
8#define OPTION6_ADDRLST_H
9
10#include <asiolink/io_address.h>
11#include <dhcp/option.h>
12#include <boost/shared_ptr.hpp>
13#include <vector>
14
15namespace isc {
16namespace dhcp {
17
22class Option6AddrLst: public Option {
23
24public:
26 typedef std::vector<isc::asiolink::IOAddress> AddressContainer;
27
32 Option6AddrLst(uint16_t type, const AddressContainer& addrs);
33
38 Option6AddrLst(uint16_t type, const isc::asiolink::IOAddress& addr);
39
45 Option6AddrLst(uint16_t type, OptionBufferConstIter begin,
47
48 virtual OptionPtr clone() const;
49
54 void pack(isc::util::OutputBuffer& buf, bool check = true) const;
55
60 virtual void unpack(OptionBufferConstIter begin,
62
63 virtual std::string toText(int indent = 0) const;
64
68 void setAddress(const isc::asiolink::IOAddress& addr);
69
73 void setAddresses(const AddressContainer& addrs);
74
84
85 // returns data length (data length + DHCPv4/DHCPv6 option header)
86 virtual uint16_t len() const;
87
88protected:
90};
91
93typedef boost::shared_ptr<Option6AddrLst> Option6AddrLstPtr;
94
95} // isc::dhcp namespace
96} // isc namespace
97
98#endif // OPTION_ADDRLST_H
DHCPv6 Option class for handling list of IPv6 addresses.
void setAddresses(const AddressContainer &addrs)
Sets list of addresses.
virtual uint16_t len() const
Returns length of the complete option (data length + DHCPv4/DHCPv6 option header)
virtual std::string toText(int indent=0) const
Returns string representation of the option.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received data.
AddressContainer getAddresses() const
Returns vector with addresses.
void setAddress(const isc::asiolink::IOAddress &addr)
Sets a single address.
std::vector< isc::asiolink::IOAddress > AddressContainer
a container for (IPv6) addresses
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
void pack(isc::util::OutputBuffer &buf, bool check=true) const
Assembles on-wire form of this option.
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:347
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:30
boost::shared_ptr< Option6AddrLst > Option6AddrLstPtr
Pointer to the Option6AddrLst object.
boost::shared_ptr< Option > OptionPtr
Definition: option.h:37
Defines the logger used by the top-level component of kea-lfc.