Kea: pkt.cc Source File

| Kea 3.2.0-git

pkt.cc
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#include <config.h>
8#include <utility>
9#include <dhcp/pkt.h>
10#include <dhcp/iface_mgr.h>
11#include <dhcp/hwaddr.h>
12#include <boost/foreach.hpp>
13#include <vector>
14
15using namespace boost::posix_time;
16
17namespace isc {
18namespace dhcp {
19
20const std::string PktEvent::SOCKET_RECEIVED("socket_received");
21const std::string PktEvent::BUFFER_READ("buffer_read");
22const std::string PktEvent::RESPONSE_SENT("response_sent");
23
24Pkt::Pkt(uint32_t transid, const isc::asiolink::IOAddress& local_addr,
25 const isc::asiolink::IOAddress& remote_addr, uint16_t local_port,
26 uint16_t remote_port)
27 : transid_(transid), iface_(""), ifindex_(UNSET_IFINDEX), local_addr_(local_addr),
28 remote_addr_(remote_addr), local_port_(local_port),
29 remote_port_(remote_port), buffer_out_(0), copy_retrieved_options_(false) {
30}
31
32 Pkt::Pkt(const uint8_t* buf, uint32_t len, const isc::asiolink::IOAddress& local_addr,
33 const isc::asiolink::IOAddress& remote_addr, uint16_t local_port,
34 uint16_t remote_port)
35 : transid_(0), iface_(""), ifindex_(UNSET_IFINDEX), local_addr_(local_addr),
36 remote_addr_(remote_addr), local_port_(local_port),
37 remote_port_(remote_port), buffer_out_(0), copy_retrieved_options_(false) {
38 if (len != 0) {
39 if (buf == NULL) {
40 isc_throw(InvalidParameter, "data buffer passed to Pkt is NULL");
41 }
42 data_.resize(len);
43 memcpy(&data_[0], buf, len);
44 }
45}
46
47 OptionCollection
48Pkt::cloneOptions() {
49 OptionCollection options;
50 for (auto const& option : options_) {
51 options.emplace(std::make_pair(option.second->getType(), option.second->clone()));
52 }
53 return (options);
54}
55
56void
57Pkt::addOption(const OptionPtr& opt) {
58 options_.insert(std::pair<int, OptionPtr>(opt->getType(), opt));
59}
60
61 OptionPtr
62Pkt::getNonCopiedOption(const uint16_t type) const {
63 auto const& x = options_.find(type);
64 if (x != options_.end()) {
65 return (x->second);
66 }
67 return (OptionPtr());
68}
69
70 OptionPtr
71Pkt::getOption(const uint16_t type) {
72 auto const& x = options_.find(type);
73 if (x != options_.end()) {
74 if (copy_retrieved_options_) {
75 OptionPtr option_copy = x->second->clone();
76 x->second = option_copy;
77 }
78 return (x->second);
79 }
80 return (OptionPtr()); // NULL
81}
82
83 OptionCollection
84Pkt::getNonCopiedOptions(const uint16_t opt_type) const {
85 std::pair<OptionCollection::const_iterator,
86 OptionCollection::const_iterator> range = options_.equal_range(opt_type);
87 return (OptionCollection(range.first, range.second));
88}
89
90 OptionCollection
91Pkt::getOptions(const uint16_t opt_type) {
92 OptionCollection options_copy;
93
94 std::pair<OptionCollection::iterator,
95 OptionCollection::iterator> range = options_.equal_range(opt_type);
96 // If options should be copied on retrieval, we should now iterate over
97 // matching options, copy them and replace the original ones with new
98 // instances.
99 if (copy_retrieved_options_) {
100 BOOST_FOREACH(auto& opt_it, range) {
101 OptionPtr option_copy = opt_it.second->clone();
102 opt_it.second = option_copy;
103 }
104 }
105 // Finally, return updated options. This can also be empty in some cases.
106 return (OptionCollection(range.first, range.second));
107}
108
109bool
110Pkt::delOption(uint16_t type) {
111 auto const& x = options_.find(type);
112 if (x != options_.end()) {
113 options_.erase(x);
114 return (true); // delete successful
115 } else {
116 return (false); // can't find option to be deleted
117 }
118}
119
120bool
121Pkt::inClass(const ClientClass& client_class) {
122 return (classes_.contains(client_class));
123}
124
125void
126Pkt::addClass(const ClientClass& client_class) {
127 if (!classes_.contains(client_class)) {
128 classes_.insert(client_class);
129 static_cast<void>(subclasses_.push_back(SubClassRelation(client_class, client_class)));
130 }
131}
132
133void
134Pkt::addAdditionalClass(const ClientClass& client_class) {
135 if (!additional_classes_.contains(client_class)) {
136 additional_classes_.insert(client_class);
137 // Since this list is pre-evaluation, we do not add subclass relationship.
138 }
139}
140
141void
142Pkt::addSubClass(const ClientClass& class_def, const ClientClass& subclass) {
143 if (!classes_.contains(subclass)) {
144 classes_.insert(subclass);
145 static_cast<void>(subclasses_.push_back(SubClassRelation(subclass, subclass)));
146 }
147 if (!classes_.contains(class_def)) {
148 classes_.insert(class_def);
149 static_cast<void>(subclasses_.push_back(SubClassRelation(class_def, subclass)));
150 }
151}
152
153void
154Pkt::updateTimestamp() {
155 timestamp_ = boost::posix_time::microsec_clock::universal_time();
156}
157
158 void Pkt::repack() {
159 if (!data_.empty()) {
160 buffer_out_.writeData(&data_[0], data_.size());
161 }
162}
163
164void
165 Pkt::setRemoteHWAddr(const uint8_t htype, const uint8_t hlen,
166 const std::vector<uint8_t>& hw_addr) {
167 setHWAddrMember(htype, hlen, hw_addr, remote_hwaddr_);
168}
169
170void
171Pkt::setRemoteHWAddr(const HWAddrPtr& hw_addr) {
172 if (!hw_addr) {
173 isc_throw(BadValue, "Setting remote HW address to NULL is"
174 << " forbidden.");
175 }
176 remote_hwaddr_ = hw_addr;
177}
178
179void
180Pkt::setHWAddrMember(const uint8_t htype, const uint8_t,
181 const std::vector<uint8_t>& hw_addr,
182 HWAddrPtr& storage) {
183 storage.reset(new HWAddr(hw_addr, htype));
184}
185
186 HWAddrPtr
187Pkt::getMAC(uint32_t hw_addr_src) {
188 HWAddrPtr mac;
189
191
192 // Method 1: from raw sockets.
193 if (hw_addr_src & HWAddr::HWADDR_SOURCE_RAW) {
194 mac = getRemoteHWAddr();
195 if (mac) {
196 mac->source_ = HWAddr::HWADDR_SOURCE_RAW;
197 return (mac);
198 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_RAW) {
199 // If we're interested only in RAW sockets as source of that info,
200 // there's no point in trying other options.
201 return (HWAddrPtr());
202 }
203 }
204
205 // Method 2: From client link-layer address option inserted by a relay
206 if (hw_addr_src & HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
207 mac = getMACFromIPv6RelayOpt();
208 if (mac) {
209 return (mac);
210 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
211 // If we're interested only in RFC6939 link layer address as source
212 // of that info, there's no point in trying other options.
213 return (HWAddrPtr());
214 }
215 }
216
217 // Method 3: Extracted from DUID-LLT or DUID-LL
218 if(hw_addr_src & HWAddr::HWADDR_SOURCE_DUID) {
219 mac = getMACFromDUID();
220 if (mac) {
221 return (mac);
222 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_DUID) {
223 // If the only source allowed is DUID then we can skip the other
224 // methods.
225 return (HWAddrPtr());
226 }
227 }
228
229 // Method 4: Extracted from source IPv6 link-local address
230 if (hw_addr_src & HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
231 mac = getMACFromSrcLinkLocalAddr();
232 if (mac) {
233 return (mac);
234 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
235 // If we're interested only in link-local addr as source of that
236 // info, there's no point in trying other options.
237 return (HWAddrPtr());
238 }
239 }
240
241 // Method 5: From remote-id option inserted by a relay
242 if(hw_addr_src & HWAddr::HWADDR_SOURCE_REMOTE_ID) {
243 mac = getMACFromRemoteIdRelayOption();
244 if (mac) {
245 return (mac);
246 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_REMOTE_ID) {
247 // If the only source allowed is remote-id option then we can skip
248 // the other methods.
249 return (HWAddrPtr());
250 }
251 }
252
253 // Method 6: From subscriber-id option inserted by a relay
254
255 // Method 7: From docsis options
256 if (hw_addr_src & HWAddr::HWADDR_SOURCE_DOCSIS_CMTS) {
257 mac = getMACFromDocsisCMTS();
258 if (mac) {
259 return (mac);
260 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_DOCSIS_CMTS) {
261 // If we're interested only in CMTS options as a source of that
262 // info, there's no point in trying other options.
263 return (HWAddrPtr());
264 }
265 }
266
267 // Method 8: From docsis options
268 if (hw_addr_src & HWAddr::HWADDR_SOURCE_DOCSIS_MODEM) {
269 mac = getMACFromDocsisModem();
270 if (mac) {
271 return (mac);
272 } else if (hw_addr_src == HWAddr::HWADDR_SOURCE_DOCSIS_MODEM) {
273 // If we're interested only in CMTS options as a source of that
274 // info, there's no point in trying other options.
275 return (HWAddrPtr());
276 }
277 }
278
279 // Ok, none of the methods were suitable. Return NULL.
280 return (HWAddrPtr());
281}
282
283 HWAddrPtr
284Pkt::getMACFromIPv6(const isc::asiolink::IOAddress& addr) {
285 HWAddrPtr mac;
286
287 if (addr.isV6LinkLocal()) {
288 std::vector<uint8_t> bin = addr.toBytes();
289
290 // Double check that it's of appropriate size
291 if ((bin.size() == isc::asiolink::V6ADDRESS_LEN) &&
292 // Check that it's link-local (starts with fe80).
293 (bin[0] == 0xfe) && (bin[1] == 0x80) &&
294 // Check that u bit is set and g is clear.
295 // See Section 2.5.1 of RFC2373 for details.
296 ((bin[8] & 3) == 2) &&
297 // And that the IID is of EUI-64 type.
298 (bin[11] == 0xff) && (bin[12] == 0xfe)) {
299
300 // Remove 8 most significant bytes
301 bin.erase(bin.begin(), bin.begin() + 8);
302
303 // Ok, we're down to EUI-64 only now: XX:XX:XX:ff:fe:XX:XX:XX
304 bin.erase(bin.begin() + 3, bin.begin() + 5);
305
306 // MAC-48 to EUI-64 involves inverting u bit (see explanation
307 // in Section 2.5.1 of RFC2373). We need to revert that.
308 bin[0] = bin[0] ^ 2;
309
310 // Let's get the interface this packet was received on.
311 // We need it to get hardware type
312 IfacePtr iface = IfaceMgr::instance().getIface(iface_);
313 uint16_t hwtype = 0; // not specified
314 if (iface) {
315 hwtype = iface->getHWType();
316 }
317
318 mac.reset(new HWAddr(bin, hwtype));
319 mac->source_ = HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL;
320 }
321 }
322
323 return (mac);
324}
325
326
327void
328Pkt::addPktEvent(const std::string& label, const boost::posix_time::ptime& timestamp) {
329 events_.push_back(PktEvent(label, timestamp));
330}
331
332void
333Pkt::setPktEvent(const std::string& label, const ptime& timestamp) {
334 for (auto& event : events_) {
335 if (event.label_ == label) {
336 event.timestamp_ = timestamp;
337 return;
338 }
339 }
340
341 events_.push_back(PktEvent(label, timestamp));
342}
343
344void
345 Pkt::addPktEvent(const std::string& label, const struct timeval& tv) {
346 time_t time_t_secs = tv.tv_sec;
347 ptime timestamp = from_time_t(time_t_secs);
348 time_duration usecs(0, 0, 0, tv.tv_usec);
349 timestamp += usecs;
350 addPktEvent(label, timestamp);
351}
352
353ptime
354Pkt::getPktEventTime(const std::string& label) const {
355 for (auto const& event : events_) {
356 if (event.label_ == label) {
357 return (event.timestamp_);
358 }
359 }
360
361 return (PktEvent::EMPTY_TIME());
362}
363
364void
365Pkt::clearPktEvents() {
366 events_.clear();
367}
368
369std::string
370Pkt::dumpPktEvents(bool verbose /* = false */) const {
371 std::stringstream oss;
372 if (verbose) {
373 oss << "Event log: " << std::endl;
374 }
375
376 bool first_pass = true;
377 boost::posix_time::ptime beg_time;
378 boost::posix_time::ptime prev_time;
379 for (auto const& event : events_) {
380 if (!verbose) {
381 oss << (first_pass ? "" : ", ") << event.timestamp_ << " : " << event.label_;
382 } else {
383 oss << event.timestamp_ << " : " << event.label_;
384 if (first_pass) {
385 oss << std::endl;
386 beg_time = event.timestamp_;
387 } else {
388 oss << " elapsed: " << event.timestamp_ - prev_time << std::endl;
389 }
390
391 prev_time = event.timestamp_;
392 }
393
394 first_pass = false;
395 }
396
397 if (verbose) {
398 oss << "total elapsed: " << prev_time - beg_time;
399 }
400
401 return (oss.str());
402}
403
404} // end of namespace isc::dhcp
405} // end of namespace isc
isc::BadValue
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Definition exceptions/exceptions.h:132
isc::InvalidParameter
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
Definition exceptions/exceptions.h:124
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
isc::asiolink::IOAddress::toBytes
std::vector< uint8_t > toBytes() const
Return address as set of bytes.
Definition io_address.cc:81
isc::asiolink::IOAddress::isV6LinkLocal
bool isV6LinkLocal() const
checks whether and address is IPv6 and is link-local
Definition io_address.cc:105
isc::dhcp::IfaceMgr::getIface
IfacePtr getIface(const unsigned int ifindex)
Returns interface specified interface index.
Definition iface_mgr.cc:937
isc::dhcp::IfaceMgr::instance
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:52
isc::dhcp::PktEvent
Describes an event during the life cycle of a packet.
Definition pkt.h:89
isc::dhcp::PktEvent::BUFFER_READ
static const std::string BUFFER_READ
Event that marks when a packet is read from the socket buffer by application.
Definition pkt.h:97
isc::dhcp::PktEvent::SOCKET_RECEIVED
static const std::string SOCKET_RECEIVED
Event that marks when a packet is placed in the socket buffer by the kernel.
Definition pkt.h:93
isc::dhcp::PktEvent::RESPONSE_SENT
static const std::string RESPONSE_SENT
Event that marks when a packet is been written to the socket by application.
Definition pkt.h:101
isc::dhcp::PktEvent::EMPTY_TIME
static boost::posix_time::ptime & EMPTY_TIME()
Fetch an empty timestamp, used for logic comparisons.
Definition pkt.h:124
isc::dhcp::Pkt::delOption
bool delOption(uint16_t type)
Attempts to delete first suboption of requested type.
Definition pkt.cc:110
isc::dhcp::Pkt::getMACFromDocsisModem
virtual HWAddrPtr getMACFromDocsisModem()=0
Attempts to extract MAC/Hardware address from DOCSIS options inserted by the modem itself.
isc::dhcp::Pkt::getOptions
isc::dhcp::OptionCollection getOptions(const uint16_t type)
Returns all instances of specified type.
Definition pkt.cc:91
isc::dhcp::Pkt::remote_addr_
isc::asiolink::IOAddress remote_addr_
Remote IP address.
Definition pkt.h:947
isc::dhcp::Pkt::getMACFromDocsisCMTS
virtual HWAddrPtr getMACFromDocsisCMTS()=0
Attempts to extract MAC/Hardware address from DOCSIS options inserted by the CMTS (the relay agent).
isc::dhcp::Pkt::addClass
void addClass(const isc::dhcp::ClientClass &client_class)
Adds a specified class to the packet.
Definition pkt.cc:126
isc::dhcp::Pkt::local_port_
uint16_t local_port_
local TDP or UDP port
Definition pkt.h:950
isc::dhcp::Pkt::transid_
uint32_t transid_
Transaction-id (32 bits for v4, 24 bits for v6).
Definition pkt.h:925
isc::dhcp::Pkt::addAdditionalClass
void addAdditionalClass(const isc::dhcp::ClientClass &client_class)
Adds a specified class to the packet's additional class list.
Definition pkt.cc:134
isc::dhcp::Pkt::repack
void repack()
Copies content of input buffer to output buffer.
Definition pkt.cc:158
isc::dhcp::Pkt::local_addr_
isc::asiolink::IOAddress local_addr_
Local IP (v4 or v6) address.
Definition pkt.h:941
isc::dhcp::Pkt::getMACFromRemoteIdRelayOption
virtual HWAddrPtr getMACFromRemoteIdRelayOption()=0
Attempts to obtain MAC address from remote-id relay option.
isc::dhcp::Pkt::data_
OptionBuffer data_
Unparsed data (in received packets).
Definition pkt.h:415
isc::dhcp::Pkt::getRemoteHWAddr
HWAddrPtr getRemoteHWAddr() const
Returns the remote HW address obtained from raw sockets.
Definition pkt.h:744
isc::dhcp::Pkt::getMACFromSrcLinkLocalAddr
virtual HWAddrPtr getMACFromSrcLinkLocalAddr()=0
Attempts to obtain MAC address from source link-local IPv6 address.
isc::dhcp::Pkt::classes_
ClientClasses classes_
Classes this packet belongs to.
Definition pkt.h:781
isc::dhcp::Pkt::setPktEvent
void setPktEvent(const std::string &label, const boost::posix_time::ptime &timestamp=PktEvent::now())
Updates (or adds) an event in the event stack.
Definition pkt.cc:333
isc::dhcp::Pkt::len
virtual size_t len()=0
Returns packet size in binary format.
isc::dhcp::Pkt::remote_port_
uint16_t remote_port_
remote TCP or UDP port
Definition pkt.h:953
isc::dhcp::Pkt::remote_hwaddr_
HWAddrPtr remote_hwaddr_
Definition pkt.h:975
isc::dhcp::Pkt::options_
isc::dhcp::OptionCollection options_
Collection of options present in this message.
Definition pkt.h:813
isc::dhcp::Pkt::buffer_out_
isc::util::OutputBuffer buffer_out_
Output buffer (used during message transmission).
Definition pkt.h:963
isc::dhcp::Pkt::getMACFromDUID
virtual HWAddrPtr getMACFromDUID()=0
Attempts to obtain MAC address from DUID-LL or DUID-LLT.
isc::dhcp::Pkt::subclasses_
SubClassRelationContainer subclasses_
SubClasses this packet belongs to.
Definition pkt.h:803
isc::dhcp::Pkt::addPktEvent
void addPktEvent(const std::string &label, const boost::posix_time::ptime &timestamp=PktEvent::now())
Adds an event to the end of the event stack.
Definition pkt.cc:328
isc::dhcp::Pkt::clearPktEvents
void clearPktEvents()
Discards contents of the packet event stack.
Definition pkt.cc:365
isc::dhcp::Pkt::getNonCopiedOptions
OptionCollection getNonCopiedOptions(const uint16_t opt_type) const
Returns all option instances of specified type without copying.
Definition pkt.cc:84
isc::dhcp::Pkt::Pkt
Pkt(uint32_t transid, const isc::asiolink::IOAddress &local_addr, const isc::asiolink::IOAddress &remote_addr, uint16_t local_port, uint16_t remote_port)
Constructor.
Definition pkt.cc:24
isc::dhcp::Pkt::getPktEventTime
boost::posix_time::ptime getPktEventTime(const std::string &label) const
Fetches the timestamp for a given event in the stack.
Definition pkt.cc:354
isc::dhcp::Pkt::cloneOptions
OptionCollection cloneOptions()
Clones all options so that they can be safely modified.
Definition pkt.cc:48
isc::dhcp::Pkt::getOption
OptionPtr getOption(const uint16_t type)
Returns the first option of specified type.
Definition pkt.cc:71
isc::dhcp::Pkt::setRemoteHWAddr
void setRemoteHWAddr(const HWAddrPtr &hw_addr)
Sets remote hardware address.
Definition pkt.cc:171
isc::dhcp::Pkt::addSubClass
void addSubClass(const isc::dhcp::ClientClass &class_def, const isc::dhcp::ClientClass &subclass)
Adds a specified subclass to the packet.
Definition pkt.cc:142
isc::dhcp::Pkt::inClass
bool inClass(const isc::dhcp::ClientClass &client_class)
Checks whether a client belongs to a given class.
Definition pkt.cc:121
isc::dhcp::Pkt::getMACFromIPv6RelayOpt
virtual HWAddrPtr getMACFromIPv6RelayOpt()=0
Attempts to obtain MAC address from relay option client-linklayer-addr.
isc::dhcp::Pkt::ifindex_
unsigned int ifindex_
Interface index.
Definition pkt.h:935
isc::dhcp::Pkt::timestamp_
boost::posix_time::ptime timestamp_
packet timestamp
Definition pkt.h:972
isc::dhcp::Pkt::getMAC
HWAddrPtr getMAC(uint32_t hw_addr_src)
Returns MAC address.
Definition pkt.cc:187
isc::dhcp::Pkt::additional_classes_
ClientClasses additional_classes_
Classes to be evaluated during additional class evaluation.
Definition pkt.h:795
isc::dhcp::Pkt::updateTimestamp
void updateTimestamp()
Update packet timestamp.
Definition pkt.cc:154
isc::dhcp::Pkt::copy_retrieved_options_
bool copy_retrieved_options_
Indicates if a copy of the retrieved option should be returned when Pkt::getOption is called.
Definition pkt.h:969
isc::dhcp::Pkt::iface_
std::string iface_
Name of the network interface the packet was received/to be sent over.
Definition pkt.h:928
isc::dhcp::Pkt::dumpPktEvents
std::string dumpPktEvents(bool verbose=false) const
Creates a dump of the stack contents to a string for logging.
Definition pkt.cc:370
isc::dhcp::Pkt::getNonCopiedOption
OptionPtr getNonCopiedOption(const uint16_t type) const
Returns the first option of specified type without copying.
Definition pkt.cc:62
isc::dhcp::Pkt::getMACFromIPv6
HWAddrPtr getMACFromIPv6(const isc::asiolink::IOAddress &addr)
Attempts to convert IPv6 address into MAC.
Definition pkt.cc:284
isc::dhcp::Pkt::addOption
virtual void addOption(const OptionPtr &opt)
Adds an option to this packet.
Definition pkt.cc:57
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
isc::dhcp::HWAddr::HWADDR_SOURCE_RAW
static const uint32_t HWADDR_SOURCE_RAW
Obtained first hand from raw socket (100% reliable).
Definition hwaddr.h:44
isc::dhcp::HWAddr::HWADDR_SOURCE_REMOTE_ID
static const uint32_t HWADDR_SOURCE_REMOTE_ID
A relay can insert remote-id.
Definition hwaddr.h:63
isc::dhcp::HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
static const uint32_t HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
Get it from RFC6939 option.
Definition hwaddr.h:59
isc::dhcp::HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL
static const uint32_t HWADDR_SOURCE_IPV6_LINK_LOCAL
Extracted from IPv6 link-local address.
Definition hwaddr.h:53
isc::dhcp::HWAddr::HWADDR_SOURCE_DOCSIS_MODEM
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...
Definition hwaddr.h:79
isc::dhcp::HWAddr::HWADDR_SOURCE_DUID
static const uint32_t HWADDR_SOURCE_DUID
Extracted from DUID-LL or DUID-LLT (not 100% reliable as the client can send fake DUID).
Definition hwaddr.h:48
isc::dhcp::HWAddr::HWADDR_SOURCE_DOCSIS_CMTS
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...
Definition hwaddr.h:73
hwaddr.h
iface_mgr.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::ClientClass
std::string ClientClass
Defines a single class name.
Definition classify.h:44
isc::dhcp::IfacePtr
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
Definition iface_mgr.h:555
isc::dhcp::OptionCollection
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
Definition option.h:40
isc::dhcp::HWAddrPtr
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Definition hwaddr.h:154
isc::dhcp::UNSET_IFINDEX
constexpr unsigned int UNSET_IFINDEX
A value used to signal that the interface index was not set.
Definition pkt.h:30
isc::dhcp::OptionPtr
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
pkt.h
isc::dhcp::HWAddr
Hardware type that represents information from DHCPv4 packet.
Definition hwaddr.h:20
isc::dhcp::SubClassRelation
Defines a subclass to template class relation.
Definition classify.h:69