14#include <boost/shared_ptr.hpp>
90 HWAddr(
const uint8_t* hwaddr,
size_t len, uint16_t htype);
95 HWAddr(
const std::vector<uint8_t>& hwaddr, uint16_t htype);
122 std::string
toText(
bool include_htype =
true)
const;
static const uint32_t HWADDR_SOURCE_UNKNOWN
Used when actual origin is not known, e.g.
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< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
@ HTYPE_ETHER
Ethernet 10Mbps.
Defines the logger used by the top-level component of kea-lfc.
Hardware type that represents information from DHCPv4 packet.
bool operator==(const HWAddr &other) const
Compares two hardware addresses for equality.
static const size_t MAX_HWADDR_LEN
Maximum size of a hardware address.
static const size_t ETHERNET_HWADDR_LEN
Size of an ethernet hardware address.
uint16_t htype_
Hardware type.
HWAddr()
default constructor
bool operator!=(const HWAddr &other) const
Compares two hardware addresses for inequality.
static HWAddr fromText(const std::string &text, const uint16_t htype=HTYPE_ETHER)
Creates instance of the hardware address from textual format.
std::vector< uint8_t > hwaddr_
uint32_t source_
Hardware address source.
std::string toText(bool include_htype=true) const
Returns textual representation of a hardware address (e.g.