| Kea 3.0.2-git

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
15 namespace isc {
16 namespace dhcp {
17
19 typedef std::vector<uint32_t> CfgMACSources;
20
25 class CfgMACSource : public isc::data::CfgToElement {
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} // namespace dhcp
84} // namespace isc
85
86#endif
cfg_to_element.h
isc::dhcp::CfgMACSource::add
void add(uint32_t source)
Adds additional MAC/hardware address acquisition.
Definition cfg_mac_source.cc:57
isc::dhcp::CfgMACSource::clear
void clear()
Removes any configured MAC/Hardware address sources.
Definition cfg_mac_source.h:68
isc::dhcp::CfgMACSource::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition cfg_mac_source.cc:67
isc::dhcp::CfgMACSource::get
const CfgMACSources & get() const
Provides access to the configure MAC/Hardware address sources.
Definition cfg_mac_source.h:63
isc::dhcp::CfgMACSource::CfgMACSource
CfgMACSource()
Default constructor.
Definition cfg_mac_source.cc:41
isc::dhcp::CfgMACSource::mac_sources_
CfgMACSources mac_sources_
Actual MAC sources storage.
Definition cfg_mac_source.h:79
isc::dhcp::CfgMACSource::MACSourceFromText
static uint32_t MACSourceFromText(const std::string &name)
Attempts to convert known hardware address sources to uint32_t.
Definition cfg_mac_source.cc:47
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::CfgMACSources
std::vector< uint32_t > CfgMACSources
Container for defined MAC/hardware address sources.
Definition cfg_mac_source.h:19
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
isc::data::CfgToElement
Abstract class for configuration Cfg_* classes.
Definition cfg_to_element.h:29