Kea  1.9.9-git
option6_addrlst.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2016 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 
15 namespace isc {
16 namespace dhcp {
17 
22 class Option6AddrLst: public Option {
23 
24 public:
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 
53  void pack(isc::util::OutputBuffer& buf) const;
54 
59  virtual void unpack(OptionBufferConstIter begin,
61 
62  virtual std::string toText(int indent = 0) const;
63 
67  void setAddress(const isc::asiolink::IOAddress& addr);
68 
72  void setAddresses(const AddressContainer& addrs);
73 
82  AddressContainer getAddresses() const { return addrs_; };
83 
84  // returns data length (data length + DHCPv4/DHCPv6 option header)
85  virtual uint16_t len() const;
86 
87 protected:
88  AddressContainer addrs_;
89 };
90 
92 typedef boost::shared_ptr<Option6AddrLst> Option6AddrLstPtr;
93 
94 } // isc::dhcp namespace
95 } // isc namespace
96 
97 #endif // OPTION_ADDRLST_H
void pack(isc::util::OutputBuffer &buf) const
Assembles on-wire form of this option.
boost::shared_ptr< Option > OptionPtr
Definition: option.h:36
DHCPv6 Option class for handling list of IPv6 addresses.
virtual std::string toText(int indent=0) const
Returns string representation of the option.
boost::shared_ptr< Option6AddrLst > Option6AddrLstPtr
Pointer to the Option6AddrLst object.
std::vector< isc::asiolink::IOAddress > AddressContainer
a container for (IPv6) addresses
void setAddress(const isc::asiolink::IOAddress &addr)
Sets a single address.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received data.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
Option6AddrLst(uint16_t type, const AddressContainer &addrs)
Constructor used during option generation.
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:30
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
AddressContainer getAddresses() const
Returns vector with 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) ...