Kea 2.7.5
cfg_mac_source.h
Go to the documentation of this file.
1// Copyright (C) 2014-2024 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
15namespace isc {
16namespace dhcp {
17
19typedef std::vector<uint32_t> CfgMACSources;
20
26
27 public:
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:
80
81};
82
83} // namespace dhcp
84} // namespace isc
85
86#endif
Wrapper class that holds MAC/hardware address sources.
void add(uint32_t source)
Adds additional MAC/hardware address acquisition.
void clear()
Removes any configured MAC/Hardware address sources.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
const CfgMACSources & get() const
Provides access to the configure MAC/Hardware address sources.
CfgMACSource()
Default constructor.
CfgMACSources mac_sources_
Actual MAC sources storage.
static uint32_t MACSourceFromText(const std::string &name)
Attempts to convert known hardware address sources to uint32_t.
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
std::vector< uint32_t > CfgMACSources
Container for defined MAC/hardware address sources.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.