Kea 2.5.5
option6_dnr.h
Go to the documentation of this file.
1// Copyright (C) 2023 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_DNR_H
8#define OPTION6_DNR_H
9
10#include <dhcp/option4_dnr.h>
11
12namespace isc {
13namespace dhcp {
14
27class Option6Dnr : public Option, public DnrInstance {
28public:
42
58 Option6Dnr(const uint16_t service_priority,
59 const std::string& adn,
60 const Option6Dnr::AddressContainer& ip_addresses,
61 const std::string& svc_params)
62 : Option(V6, D6O_V6_DNR), DnrInstance(V6, service_priority, adn, ip_addresses, svc_params) {
63 }
64
75 Option6Dnr(const uint16_t service_priority, const std::string& adn)
76 : Option(V6, D6O_V6_DNR), DnrInstance(V6, service_priority, adn) {}
77
81 OptionPtr clone() const override;
82
94 void pack(util::OutputBuffer& buf, bool check = false) const override;
95
104 void unpack(OptionBufferConstIter begin, OptionBufferConstIter end) override;
105
111 std::string toText(int indent = 0) const override;
112
117 uint16_t len() const override;
118
127 void packAddresses(isc::util::OutputBuffer& buf) const override;
128
139};
140
142typedef boost::shared_ptr<Option6Dnr> Option6DnrPtr;
143
144} // namespace dhcp
145} // namespace isc
146
147#endif // OPTION6_DNR_H
Represents DNR Instance which is used both in DHCPv4 and DHCPv6 Encrypted DNS Option.
Definition: option4_dnr.h:50
std::vector< isc::asiolink::IOAddress > AddressContainer
A Type defined for container holding IP addresses.
Definition: option4_dnr.h:53
Represents DHCPv6 Encrypted DNS Option (code 144).
Definition: option6_dnr.h:27
uint16_t len() const override
Returns length of the complete option (data length + DHCPv4/DHCPv6 option header)
Definition: option6_dnr.cc:93
void packAddresses(isc::util::OutputBuffer &buf) const override
Writes the IP address(es) in the wire format into a buffer.
Definition: option6_dnr.cc:43
void unpackAddresses(OptionBufferConstIter &begin, OptionBufferConstIter end) override
Unpacks IP address(es) from wire data and stores it/them in ip_addresses_.
Definition: option6_dnr.cc:98
Option6Dnr(const uint16_t service_priority, const std::string &adn)
Constructor of the Option in ADN only mode.
Definition: option6_dnr.h:75
Option6Dnr(const uint16_t service_priority, const std::string &adn, const Option6Dnr::AddressContainer &ip_addresses, const std::string &svc_params)
Constructor of the Option with all fields from params.
Definition: option6_dnr.h:58
std::string toText(int indent=0) const override
Returns string representation of the option.
Definition: option6_dnr.cc:84
void unpack(OptionBufferConstIter begin, OptionBufferConstIter end) override
Parses received wire data buffer.
Definition: option6_dnr.cc:55
void pack(util::OutputBuffer &buf, bool check=false) const override
Writes option in wire-format to a buffer.
Definition: option6_dnr.cc:27
OptionPtr clone() const override
Copies this option and returns a pointer to the copy.
Definition: option6_dnr.cc:22
Option6Dnr(OptionBufferConstIter begin, OptionBufferConstIter end)
Constructor of the Option from on-wire data.
Definition: option6_dnr.cc:16
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:294
@ D6O_V6_DNR
Definition: dhcp6.h:159
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:30
boost::shared_ptr< Option6Dnr > Option6DnrPtr
A pointer to the Option6Dnr object.
Definition: option6_dnr.h:142
boost::shared_ptr< Option > OptionPtr
Definition: option.h:37
Defines the logger used by the top-level component of kea-lfc.