Kea  2.1.7-git
cfg_mac_source.h
Go to the documentation of this file.
1 // Copyright (C) 2014-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_MAC_SOURCE_H
8 #define CFG_MAC_SOURCE_H
9 
10 #include <cc/cfg_to_element.h>
11 #include <stdint.h>
12 #include <vector>
13 #include <string>
14 
15 namespace isc {
16 namespace dhcp {
17 
19 typedef std::vector<uint32_t> CfgMACSources;
20 
26 
27  public:
31  CfgMACSource();
32 
48  static uint32_t MACSourceFromText(const std::string& name);
49 
50 
57  void add(uint32_t source);
58 
63  const CfgMACSources& get() const {
64  return mac_sources_;
65  }
66 
68  void clear() {
69  mac_sources_.clear();
70  }
71 
75  virtual isc::data::ElementPtr toElement() const;
76 
77  protected:
79  CfgMACSources mac_sources_;
80 
81 };
82 
83 };
84 };
85 
86 #endif
void clear()
Removes any configured MAC/Hardware address sources.
void add(uint32_t source)
Adds additional MAC/hardware address acquisition.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
CfgMACSources mac_sources_
Actual MAC sources storage.
CfgMACSource()
Default constructor.
static uint32_t MACSourceFromText(const std::string &name)
Attempts to convert known hardware address sources to uint32_t.
Wrapper class that holds MAC/hardware address sources.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Abstract class for configuration Cfg_* classes.
std::vector< uint32_t > CfgMACSources
Container for defined MAC/hardware address sources.
Defines the logger used by the top-level component of kea-lfc.