Kea  1.5.0
cfg_4o6.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2017 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 <string>
13 
14 namespace isc {
15 namespace dhcp {
16 
22 
27  :enabled_(false), subnet4o6_(std::make_pair(asiolink::IOAddress("::"), 128u)) {
28  }
29 
32  bool enabled() const {
33  return (enabled_);
34  }
35 
38  void enabled(bool enabled) {
39  enabled_ = enabled;
40  }
41 
44  std::string getIface4o6() const {
45  return (iface4o6_);
46  }
47 
50  void setIface4o6(const std::string& iface) {
51  iface4o6_ = iface;
52  enabled_ = true;
53  }
54 
57  std::pair<asiolink::IOAddress, uint8_t> getSubnet4o6() const {
58  return (subnet4o6_);
59  }
60 
64  void setSubnet4o6(const asiolink::IOAddress& subnet, uint8_t prefix) {
65  subnet4o6_ = std::make_pair(subnet, prefix);
66  enabled_ = true;
67  }
68 
72  return (interface_id_);
73  }
74 
77  void setInterfaceId(const OptionPtr& opt) {
78  interface_id_ = opt;
79  enabled_ = true;
80  }
81 
85  virtual isc::data::ElementPtr toElement() const;
86 
87 private:
88 
90  bool enabled_;
91 
93  std::string iface4o6_;
94 
96  std::pair<asiolink::IOAddress, uint8_t> subnet4o6_;
97 
99  OptionPtr interface_id_;
100 };
101 
102 } // end of isc::dhcp namespace
103 } // end of isc namespace
104 
105 #endif
Cfg4o6()
the default constructor.
Definition: cfg_4o6.h:26
std::string getIface4o6() const
Returns the DHCP4o6 interface.
Definition: cfg_4o6.h:44
void setIface4o6(const std::string &iface)
Sets the 4o6-interface.
Definition: cfg_4o6.h:50
bool enabled() const
Returns whether the DHCP4o6 is enabled or not.
Definition: cfg_4o6.h:32
boost::shared_ptr< Option > OptionPtr
Definition: option.h:37
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: cfg_4o6.cc:22
OptionPtr getInterfaceId() const
Returns the interface-id.
Definition: cfg_4o6.h:71
void setSubnet4o6(const asiolink::IOAddress &subnet, uint8_t prefix)
Sets the prefix/length information (content of the 4o6-subnet).
Definition: cfg_4o6.h:64
This structure contains information about DHCP4o6 (RFC7341)
Definition: cfg_4o6.h:21
Abstract class for configuration Cfg_* classes.
void enabled(bool enabled)
Sets the DHCP4o6 enabled status.
Definition: cfg_4o6.h:38
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::pair< asiolink::IOAddress, uint8_t > getSubnet4o6() const
Returns prefix/len for the IPv6 subnet.
Definition: cfg_4o6.h:57
void setInterfaceId(const OptionPtr &opt)
Sets the interface-id.
Definition: cfg_4o6.h:77