48 for (
unsigned i = 0; i <
sizeof(sources)/
sizeof(sources[0]); ++i) {
49 if (name.compare(sources[i].name) == 0) {
50 return (sources[i].type);
61 <<
"' specified twice.");
71 for (
unsigned i = 0; i <
sizeof(sources)/
sizeof(sources[0]); ++i) {
72 if (sources[i].type == source) {
73 name = sources[i].name;
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
static ElementPtr create(const Position &pos=ZERO_POSITION())
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
void add(uint32_t source)
Adds additional MAC/hardware address acquisition.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
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.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
static const uint32_t HWADDR_SOURCE_RAW
Obtained first hand from raw socket (100% reliable).
static const uint32_t HWADDR_SOURCE_REMOTE_ID
A relay can insert remote-id.
static const uint32_t HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
Get it from RFC6939 option.
static const uint32_t HWADDR_SOURCE_IPV6_LINK_LOCAL
Extracted from IPv6 link-local address.
static const uint32_t HWADDR_SOURCE_DOCSIS_MODEM
A cable modem (acting as DHCP client) that supports DOCSIS standard can insert DOCSIS options that co...
static const uint32_t HWADDR_SOURCE_DUID
Extracted from DUID-LL or DUID-LLT (not 100% reliable as the client can send fake DUID).
static const uint32_t HWADDR_SOURCE_DOCSIS_CMTS
A CMTS (acting as DHCP relay agent) that supports DOCSIS standard can insert DOCSIS options that cont...
static const uint32_t HWADDR_SOURCE_SUBSCRIBER_ID
A relay can insert a subscriber-id option.
static const uint32_t HWADDR_SOURCE_ANY
Not really a type, only used in getMAC() calls.
boost::shared_ptr< Element > ElementPtr
Defines the logger used by the top-level component of kea-lfc.