Kea: option6_pdexclude.h Source File

| Kea 3.2.0-git

option6_pdexclude.h
Go to the documentation of this file.
1// Copyright (C) 2016-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_PDEXCLUDE_H
8#define OPTION6_PDEXCLUDE_H
9
10#include <asiolink/io_address.h>
11#include <dhcp/option.h>
12#include <boost/shared_ptr.hpp>
13#include <stdint.h>
14
15namespace isc {
16namespace dhcp {
17
25 class Option6PDExclude: public Option {
26public:
27
38 Option6PDExclude(const isc::asiolink::IOAddress& delegated_prefix,
39 const uint8_t delegated_prefix_length,
40 const isc::asiolink::IOAddress& excluded_prefix,
41 const uint8_t excluded_prefix_length);
42
50 Option6PDExclude(OptionBufferConstIter begin, OptionBufferConstIter end);
51
53 virtual OptionPtr clone() const;
54
68 virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
69
74 virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
75
80 virtual uint16_t len() const;
81
85 virtual std::string toText(int indent = 0) const;
86
95 asiolink::IOAddress
96 getExcludedPrefix(const asiolink::IOAddress& delegated_prefix,
97 const uint8_t delegated_prefix_length) const;
98
100 uint8_t getExcludedPrefixLength() const {
101 return (excluded_prefix_length_);
102 }
103
105 const std::vector<uint8_t>& getExcludedPrefixSubnetID() const {
106 return (subnet_id_);
107 }
108
109private:
110
114 uint8_t getSubnetIDLength(const uint8_t delegated_prefix_length,
115 const uint8_t excluded_prefix_length) const;
116
118 uint8_t excluded_prefix_length_;
119
121 std::vector<uint8_t> subnet_id_;
122};
123
125 typedef boost::shared_ptr<Option6PDExclude> Option6PDExcludePtr;
126
127} // isc::dhcp namespace
128} // isc namespace
129
130#endif // OPTION6_PDEXCLUDE_H
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
isc::dhcp::Option6PDExclude::clone
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition option6_pdexclude.cc:123
isc::dhcp::Option6PDExclude::getExcludedPrefix
asiolink::IOAddress getExcludedPrefix(const asiolink::IOAddress &delegated_prefix, const uint8_t delegated_prefix_length) const
Returns excluded prefix.
Definition option6_pdexclude.cc:193
isc::dhcp::Option6PDExclude::getExcludedPrefixSubnetID
const std::vector< uint8_t > & getExcludedPrefixSubnetID() const
Returns an excluded prefix in a binary format.
Definition option6_pdexclude.h:105
isc::dhcp::Option6PDExclude::toText
virtual std::string toText(int indent=0) const
Returns Prefix Exclude option in textual format.
Definition option6_pdexclude.cc:184
isc::dhcp::Option6PDExclude::Option6PDExclude
Option6PDExclude(const isc::asiolink::IOAddress &delegated_prefix, const uint8_t delegated_prefix_length, const isc::asiolink::IOAddress &excluded_prefix, const uint8_t excluded_prefix_length)
Constructor.
Definition option6_pdexclude.cc:28
isc::dhcp::Option6PDExclude::len
virtual uint16_t len() const
Returns length of the complete option (data length + DHCPv6 option header).
Definition option6_pdexclude.cc:179
isc::dhcp::Option6PDExclude::pack
virtual void pack(isc::util::OutputBuffer &buf, bool check=true) const
Writes option in wire-format to a buffer.
Definition option6_pdexclude.cc:128
isc::dhcp::Option6PDExclude::unpack
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
Definition option6_pdexclude.cc:147
isc::dhcp::Option6PDExclude::getExcludedPrefixLength
uint8_t getExcludedPrefixLength() const
Returns excluded prefix length.
Definition option6_pdexclude.h:100
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
io_address.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::Option6PDExcludePtr
boost::shared_ptr< Option6PDExclude > Option6PDExcludePtr
Pointer to the Option6PDExclude object.
Definition option6_pdexclude.h:125
isc::dhcp::OptionBufferConstIter
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition option.h:30
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