Kea 2.5.8
cfg_4o6.h
Go to the documentation of this file.
1// Copyright (C) 2015-2019 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 CFG_4OVER6_H
8#define CFG_4OVER6_H
9
10#include <asiolink/io_address.h>
11#include <cc/cfg_to_element.h>
12#include <util/optional.h>
13#include <string>
14
15namespace isc {
16namespace dhcp {
17
23
28 :enabled_(false), subnet4o6_(std::make_pair(asiolink::IOAddress("::"), 128u), true) {
29 }
30
33 bool enabled() const {
34 return (enabled_);
35 }
36
39 void enabled(bool enabled) {
40 enabled_ = enabled;
41 }
42
46 return (iface4o6_);
47 }
48
51 void setIface4o6(const std::string& iface) {
52 iface4o6_ = iface;
53 enabled_ = true;
54 }
55
59 return (subnet4o6_);
60 }
61
65 void setSubnet4o6(const asiolink::IOAddress& subnet, uint8_t prefix) {
66 subnet4o6_ = std::make_pair(subnet, prefix);
67 enabled_ = true;
68 }
69
73 return (interface_id_);
74 }
75
78 void setInterfaceId(const OptionPtr& opt) {
79 interface_id_ = opt;
80 enabled_ = true;
81 }
82
86 virtual isc::data::ElementPtr toElement() const;
87
88private:
89
91 bool enabled_;
92
95
98
100 OptionPtr interface_id_;
101};
102
103} // end of isc::dhcp namespace
104} // end of isc namespace
105
106#endif
A template representing an optional value.
Definition: optional.h:36
boost::shared_ptr< Element > ElementPtr
Definition: data.h:28
boost::shared_ptr< Option > OptionPtr
Definition: option.h:37
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.
This structure contains information about DHCP4o6 (RFC7341)
Definition: cfg_4o6.h:22
void setIface4o6(const std::string &iface)
Sets the 4o6-interface.
Definition: cfg_4o6.h:51
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: cfg_4o6.cc:22
Cfg4o6()
the default constructor.
Definition: cfg_4o6.h:27
util::Optional< std::string > getIface4o6() const
Returns the DHCP4o6 interface.
Definition: cfg_4o6.h:45
util::Optional< std::pair< asiolink::IOAddress, uint8_t > > getSubnet4o6() const
Returns prefix/len for the IPv6 subnet.
Definition: cfg_4o6.h:58
void setSubnet4o6(const asiolink::IOAddress &subnet, uint8_t prefix)
Sets the prefix/length information (content of the 4o6-subnet).
Definition: cfg_4o6.h:65
void enabled(bool enabled)
Sets the DHCP4o6 enabled status.
Definition: cfg_4o6.h:39
bool enabled() const
Returns whether the DHCP4o6 is enabled or not.
Definition: cfg_4o6.h:33
OptionPtr getInterfaceId() const
Returns the interface-id.
Definition: cfg_4o6.h:72
void setInterfaceId(const OptionPtr &opt)
Sets the interface-id.
Definition: cfg_4o6.h:78