22 {
"any", HWAddr::HWADDR_SOURCE_ANY },
23 {
"raw", HWAddr::HWADDR_SOURCE_RAW },
24 {
"duid", HWAddr::HWADDR_SOURCE_DUID },
25 {
"ipv6-link-local", HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL },
26 {
"client-link-addr-option", HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION },
27 {
"rfc6939", HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION },
28 {
"remote-id", HWAddr::HWADDR_SOURCE_REMOTE_ID },
29 {
"rfc4649", HWAddr::HWADDR_SOURCE_REMOTE_ID },
30 {
"subscriber-id", HWAddr::HWADDR_SOURCE_SUBSCRIBER_ID },
31 {
"rfc4580", HWAddr::HWADDR_SOURCE_SUBSCRIBER_ID },
32 {
"docsis-cmts", HWAddr::HWADDR_SOURCE_DOCSIS_CMTS },
33 {
"docsis-modem", HWAddr::HWADDR_SOURCE_DOCSIS_MODEM }
41 CfgMACSource::CfgMACSource() {
44 mac_sources_.push_back(HWAddr::HWADDR_SOURCE_ANY);
47 uint32_t CfgMACSource::MACSourceFromText(
const std::string& name) {
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);
57 void CfgMACSource::add(uint32_t source) {
58 for (CfgMACSources::const_iterator it = mac_sources_.begin();
59 it != mac_sources_.end(); ++it) {
62 <<
"' specified twice.");
65 mac_sources_.push_back(source);
70 for (CfgMACSources::const_iterator source = mac_sources_.cbegin();
71 source != mac_sources_.cend(); ++source) {
73 for (
unsigned i = 0; i <
sizeof(sources)/
sizeof(sources[0]); ++i) {
74 if (sources[i].type == *source) {
75 name = sources[i].name;
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
boost::shared_ptr< Element > ElementPtr
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Defines the logger used by the top-level component of kea-dhcp-ddns.
static ElementPtr create(const Position &pos=ZERO_POSITION())