Kea: pkt.h Source File

| Kea 3.2.0-git

pkt.h
Go to the documentation of this file.
1// Copyright (C) 2014-2025 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 PKT_H
8#define PKT_H
9
10#include <asiolink/io_address.h>
11#include <util/buffer.h>
12#include <dhcp/option.h>
13#include <dhcp/hwaddr.h>
14#include <dhcp/classify.h>
15#include <hooks/callout_handle_associate.h>
16
17#include <boost/date_time/posix_time/posix_time.hpp>
18#include <boost/shared_ptr.hpp>
19
20#include <limits>
21#include <utility>
22
23namespace isc {
24
25namespace dhcp {
26
30 constexpr unsigned int UNSET_IFINDEX = std::numeric_limits<unsigned int>::max();
31
45template<typename PktType>
46 class ScopedEnableOptionsCopy {
47public:
48
50 typedef boost::shared_ptr<PktType> PktTypePtr;
51
58 ScopedEnableOptionsCopy(const PktTypePtr& pkt1,
59 const PktTypePtr& pkt2 = PktTypePtr())
60 : pkts_(pkt1, pkt2) {
61 if (pkt1) {
62 pkt1->setCopyRetrievedOptions(true);
63 }
64 if (pkt2) {
65 pkt2->setCopyRetrievedOptions(true);
66 }
67 }
68
72 ~ScopedEnableOptionsCopy() {
73 if (pkts_.first) {
74 pkts_.first->setCopyRetrievedOptions(false);
75 }
76 if (pkts_.second) {
77 pkts_.second->setCopyRetrievedOptions(false);
78 }
79 }
80
81private:
82
84 std::pair<PktTypePtr, PktTypePtr> pkts_;
85};
86
87
89 class PktEvent {
90public:
93 static const std::string SOCKET_RECEIVED;
94
97 static const std::string BUFFER_READ;
98
101 static const std::string RESPONSE_SENT;
102
107 PktEvent(const std::string& label, boost::posix_time::ptime timestamp)
108 : label_(label), timestamp_(timestamp) {
109 }
110
112 ~PktEvent() = default;
113
117 static boost::posix_time::ptime now() {
118 return (boost::posix_time::microsec_clock::universal_time());
119 }
120
124 static boost::posix_time::ptime& EMPTY_TIME() {
125 static boost::posix_time::ptime empty_time;
126 return (empty_time);
127 }
128
132 static boost::posix_time::ptime& MIN_TIME() {
133 static auto min_time = boost::posix_time::ptime(boost::posix_time::min_date_time);
134 return (min_time);
135 }
136
140 static boost::posix_time::ptime& MAX_TIME() {
141 static auto max_time = boost::posix_time::ptime(boost::posix_time::max_date_time);
142 return (max_time);
143 }
144
146 std::string label_;
147
149 boost::posix_time::ptime timestamp_;
150};
151
161 class Pkt : public hooks::CalloutHandleAssociate {
162protected:
163
176 Pkt(uint32_t transid, const isc::asiolink::IOAddress& local_addr,
177 const isc::asiolink::IOAddress& remote_addr, uint16_t local_port,
178 uint16_t remote_port);
179
193 Pkt(const uint8_t* buf, uint32_t len,
194 const isc::asiolink::IOAddress& local_addr,
195 const isc::asiolink::IOAddress& remote_addr, uint16_t local_port,
196 uint16_t remote_port);
197
198public:
199
215 virtual void pack() = 0;
216
231 virtual void unpack() = 0;
232
245 isc::util::OutputBuffer& getBuffer() {
246 return (buffer_out_);
247 }
248
256 virtual void addOption(const OptionPtr& opt);
257
266 bool delOption(uint16_t type);
267
275 virtual std::string getLabel() const {
276 isc_throw(NotImplemented, "Pkt::getLabel()");
277 }
278
289 virtual std::string toText(bool verbose = false) const = 0;
290
301 virtual size_t len() = 0;
302
310 virtual uint8_t getType() const = 0;
311
319 virtual void setType(uint8_t type) = 0;
320
330 virtual const char* getName() const = 0;
331
335 void setTransid(uint32_t transid) {
336 transid_ = transid;
337 }
338
342 uint32_t getTransid() const {
343 return (transid_);
344 }
345
350 bool inClass(const isc::dhcp::ClientClass& client_class);
351
359 void addClass(const isc::dhcp::ClientClass& client_class);
360
368 void addAdditionalClass(const isc::dhcp::ClientClass& client_class);
369
378 void addSubClass(const isc::dhcp::ClientClass& class_def,
379 const isc::dhcp::ClientClass& subclass);
380
385 const ClientClasses& getClasses() const {
386 return (classes_);
387 }
388
393 const ClientClasses& getAdditionalClasses() const {
394 return (additional_classes_);
395 }
396
403 const SubClassRelationContainer& getSubClassesRelations() const {
404 return (subclasses_);
405 }
406
415 OptionBuffer data_;
416
417protected:
418
430 OptionPtr getNonCopiedOption(const uint16_t type) const;
431
444 OptionCollection getNonCopiedOptions(const uint16_t opt_type) const;
445
446public:
447
451 OptionCollection cloneOptions();
452
463 OptionPtr getOption(const uint16_t type);
464
472 isc::dhcp::OptionCollection getOptions(const uint16_t type);
473
498 virtual void setCopyRetrievedOptions(const bool copy) {
499 copy_retrieved_options_ = copy;
500 }
501
507 bool isCopyRetrievedOptions() const {
508 return (copy_retrieved_options_);
509 }
510
517 void updateTimestamp();
518
525 const boost::posix_time::ptime& getTimestamp() const {
526 return timestamp_;
527 }
528
532 void setTimestamp(boost::posix_time::ptime& timestamp) {
533 timestamp_ = timestamp;
534 }
535
541 void addPktEvent(const std::string& label,
542 const boost::posix_time::ptime& timestamp = PktEvent::now());
543
550 void addPktEvent(const std::string& label, const struct timeval& timestamp);
551
561 void setPktEvent(const std::string& label,
562 const boost::posix_time::ptime& timestamp = PktEvent::now());
563
567 void clearPktEvents();
568
573 boost::posix_time::ptime getPktEventTime(const std::string& label) const;
574
578 const std::list<PktEvent>& getPktEvents() {
579 return (events_);
580 }
581
586 std::string dumpPktEvents(bool verbose = false) const;
587
594 void repack();
595
599 void setRemoteAddr(const isc::asiolink::IOAddress& remote) {
600 remote_addr_ = remote;
601 }
602
606 const isc::asiolink::IOAddress& getRemoteAddr() const {
607 return (remote_addr_);
608 }
609
613 void setLocalAddr(const isc::asiolink::IOAddress& local) {
614 local_addr_ = local;
615 }
616
620 const isc::asiolink::IOAddress& getLocalAddr() const {
621 return (local_addr_);
622 }
623
630 void setLocalPort(uint16_t local) {
631 local_port_ = local;
632 }
633
640 uint16_t getLocalPort() const {
641 return (local_port_);
642 }
643
650 void setRemotePort(uint16_t remote) {
651 remote_port_ = remote;
652 }
653
657 uint16_t getRemotePort() const {
658 return (remote_port_);
659 }
660
664 void setIndex(const unsigned int ifindex) {
665 ifindex_ = ifindex;
666 }
667
669 void resetIndex() {
670 ifindex_ = UNSET_IFINDEX;
671 }
672
676 int getIndex() const {
677 return (ifindex_);
678 }
679
683 bool indexSet() const {
684 return (ifindex_ != UNSET_IFINDEX);
685 }
686
693 std::string getIface() const {
694 return (iface_);
695 }
696
703 void setIface(const std::string& iface) {
704 iface_ = iface;
705 }
706
718 void setRemoteHWAddr(const HWAddrPtr& hw_addr);
719
738 void setRemoteHWAddr(const uint8_t htype, const uint8_t hlen,
739 const std::vector<uint8_t>& hw_addr);
740
744 HWAddrPtr getRemoteHWAddr() const {
745 return (remote_hwaddr_);
746 }
747
765 HWAddrPtr getMAC(uint32_t hw_addr_src);
766
772 virtual ~Pkt() {
773 }
774
781 ClientClasses classes_;
782
795 ClientClasses additional_classes_;
796
803 SubClassRelationContainer subclasses_;
804
813 isc::dhcp::OptionCollection options_;
814
815protected:
816
836 virtual HWAddrPtr getMACFromSrcLinkLocalAddr() = 0;
837
852 virtual HWAddrPtr getMACFromIPv6RelayOpt() = 0;
853
866 virtual HWAddrPtr getMACFromDUID() = 0;
867
880 virtual HWAddrPtr getMACFromRemoteIdRelayOption() = 0;
881
895 HWAddrPtr
896 getMACFromIPv6(const isc::asiolink::IOAddress& addr);
897
909 virtual HWAddrPtr getMACFromDocsisModem() = 0;
910
922 virtual HWAddrPtr getMACFromDocsisCMTS() = 0;
923
925 uint32_t transid_;
926
928 std::string iface_;
929
935 unsigned int ifindex_;
936
941 isc::asiolink::IOAddress local_addr_;
942
947 isc::asiolink::IOAddress remote_addr_;
948
950 uint16_t local_port_;
951
953 uint16_t remote_port_;
954
963 isc::util::OutputBuffer buffer_out_;
964
969 bool copy_retrieved_options_;
970
972 boost::posix_time::ptime timestamp_;
973
974 // remote HW address (src if receiving packet, dst if sending packet)
975 HWAddrPtr remote_hwaddr_;
976
977private:
978
990 virtual void setHWAddrMember(const uint8_t htype, const uint8_t hlen,
991 const std::vector<uint8_t>& hw_addr,
992 HWAddrPtr& storage);
993
995 std::list<PktEvent> events_;
996};
997
999 typedef boost::shared_ptr<isc::dhcp::Pkt> PktPtr;
1000
1013 class ScopedSubOptionsCopy {
1014public:
1015
1021 ScopedSubOptionsCopy(const OptionPtr& opt) : option_(opt) {
1022 if (opt) {
1023 options_ = opt->getMutableOptions();
1024 }
1025 }
1026
1030 ~ScopedSubOptionsCopy() {
1031 if (option_) {
1032 option_->getMutableOptions() = options_;
1033 }
1034 }
1035
1036private:
1037
1039 OptionPtr option_;
1040
1042 OptionCollection options_;
1043};
1044
1057template<typename PktType>
1058 class ScopedPktOptionsCopy {
1059public:
1060
1066 ScopedPktOptionsCopy(PktType& pkt) : pkt_(pkt), options_(pkt.options_) {
1067 pkt_.options_ = pkt_.cloneOptions();
1068 }
1069
1073 ~ScopedPktOptionsCopy() {
1074 pkt_.options_ = options_;
1075 }
1076
1077private:
1078
1080 PktType& pkt_;
1081
1083 OptionCollection options_;
1084};
1085
1086} // end of namespace isc::dhcp
1087} // end of namespace isc
1088
1089#endif
buffer.h
callout_handle_associate.h
classify.h
Defines elements for storing the names of client classes.
isc::NotImplemented
A generic exception that is thrown when a function is not implemented.
Definition exceptions/exceptions.h:166
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
isc::dhcp::ClientClasses
Container for storing client class names.
Definition classify.h:110
isc::dhcp::PktEvent::~PktEvent
~PktEvent()=default
Destructor.
isc::dhcp::PktEvent::now
static boost::posix_time::ptime now()
Fetch the current UTC system time, microsecond precision.
Definition pkt.h:117
isc::dhcp::PktEvent::label_
std::string label_
Label identifying this event.
Definition pkt.h:146
isc::dhcp::PktEvent::PktEvent
PktEvent(const std::string &label, boost::posix_time::ptime timestamp)
Constructor.
Definition pkt.h:107
isc::dhcp::PktEvent::MAX_TIME
static boost::posix_time::ptime & MAX_TIME()
Fetches the maximum timestamp.
Definition pkt.h:140
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::timestamp_
boost::posix_time::ptime timestamp_
Timestamp at which the event occurred.
Definition pkt.h:149
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::MIN_TIME
static boost::posix_time::ptime & MIN_TIME()
Fetches the minimum timestamp.
Definition pkt.h:132
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::toText
virtual std::string toText(bool verbose=false) const =0
Returns text representation of the packet.
isc::dhcp::Pkt::getType
virtual uint8_t getType() const =0
Returns message type (e.g.
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::getName
virtual const char * getName() const =0
Returns name of the DHCP message.
isc::dhcp::Pkt::setType
virtual void setType(uint8_t type)=0
Sets message type (e.g.
isc::dhcp::Pkt::isCopyRetrievedOptions
bool isCopyRetrievedOptions() const
Returns whether the copying of retrieved options is enabled.
Definition pkt.h:507
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::getIndex
int getIndex() const
Returns interface index.
Definition pkt.h:676
isc::dhcp::Pkt::getSubClassesRelations
const SubClassRelationContainer & getSubClassesRelations() const
Returns the class set including template classes associated with subclasses.
Definition pkt.h:403
isc::dhcp::Pkt::resetIndex
void resetIndex()
Resets interface index to negative value.
Definition pkt.h:669
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::pack
virtual void pack()=0
Prepares on-wire format of DHCP (either v4 or v6) packet.
isc::dhcp::Pkt::getMACFromRemoteIdRelayOption
virtual HWAddrPtr getMACFromRemoteIdRelayOption()=0
Attempts to obtain MAC address from remote-id relay option.
isc::dhcp::Pkt::getClasses
const ClientClasses & getClasses() const
Returns the class set.
Definition pkt.h:385
isc::dhcp::Pkt::unpack
virtual void unpack()=0
Parses on-wire form of DHCP (either v4 or v6) packet.
isc::dhcp::Pkt::data_
OptionBuffer data_
Unparsed data (in received packets).
Definition pkt.h:415
isc::dhcp::Pkt::getLocalAddr
const isc::asiolink::IOAddress & getLocalAddr() const
Returns local IP address.
Definition pkt.h:620
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::getPktEvents
const std::list< PktEvent > & getPktEvents()
Fetches the current event stack contents.
Definition pkt.h:578
isc::dhcp::Pkt::getRemoteAddr
const isc::asiolink::IOAddress & getRemoteAddr() const
Returns remote IP address.
Definition pkt.h:606
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::setIface
void setIface(const std::string &iface)
Sets interface name.
Definition pkt.h:703
isc::dhcp::Pkt::indexSet
bool indexSet() const
Checks if interface index has been set.
Definition pkt.h:683
isc::dhcp::Pkt::getBuffer
isc::util::OutputBuffer & getBuffer()
Returns reference to output buffer.
Definition pkt.h:245
isc::dhcp::Pkt::getLocalPort
uint16_t getLocalPort() const
Returns local UDP (and soon TCP) port.
Definition pkt.h:640
isc::dhcp::Pkt::setLocalPort
void setLocalPort(uint16_t local)
Sets local UDP (and soon TCP) port.
Definition pkt.h:630
isc::dhcp::Pkt::getAdditionalClasses
const ClientClasses & getAdditionalClasses() const
Returns the additional class list.
Definition pkt.h:393
isc::dhcp::Pkt::remote_port_
uint16_t remote_port_
remote TCP or UDP port
Definition pkt.h:953
isc::dhcp::Pkt::setIndex
void setIndex(const unsigned int ifindex)
Sets interface index.
Definition pkt.h:664
isc::dhcp::Pkt::remote_hwaddr_
HWAddrPtr remote_hwaddr_
Definition pkt.h:975
isc::dhcp::Pkt::getTransid
uint32_t getTransid() const
Returns value of transaction-id field.
Definition pkt.h:342
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::getIface
std::string getIface() const
Returns interface name.
Definition pkt.h:693
isc::dhcp::Pkt::getMACFromDUID
virtual HWAddrPtr getMACFromDUID()=0
Attempts to obtain MAC address from DUID-LL or DUID-LLT.
isc::dhcp::Pkt::setCopyRetrievedOptions
virtual void setCopyRetrievedOptions(const bool copy)
Controls whether the option retrieved by the Pkt::getOption should be copied before being returned.
Definition pkt.h:498
isc::dhcp::Pkt::getTimestamp
const boost::posix_time::ptime & getTimestamp() const
Returns packet timestamp.
Definition pkt.h:525
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::setTimestamp
void setTimestamp(boost::posix_time::ptime &timestamp)
Set socket receive timestamp.
Definition pkt.h:532
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::getRemotePort
uint16_t getRemotePort() const
Returns remote port.
Definition pkt.h:657
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::setTransid
void setTransid(uint32_t transid)
Sets transaction-id value.
Definition pkt.h:335
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::setRemoteAddr
void setRemoteAddr(const isc::asiolink::IOAddress &remote)
Sets remote IP address.
Definition pkt.h:599
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::setLocalAddr
void setLocalAddr(const isc::asiolink::IOAddress &local)
Sets local IP address.
Definition pkt.h:613
isc::dhcp::Pkt::setRemotePort
void setRemotePort(uint16_t remote)
Sets remote UDP (and soon TCP) port.
Definition pkt.h:650
isc::dhcp::Pkt::getLabel
virtual std::string getLabel() const
Returns text representation primary packet identifiers.
Definition pkt.h:275
isc::dhcp::Pkt::addOption
virtual void addOption(const OptionPtr &opt)
Adds an option to this packet.
Definition pkt.cc:57
isc::dhcp::Pkt::~Pkt
virtual ~Pkt()
Virtual destructor.
Definition pkt.h:772
isc::dhcp::ScopedEnableOptionsCopy::ScopedEnableOptionsCopy
ScopedEnableOptionsCopy(const PktTypePtr &pkt1, const PktTypePtr &pkt2=PktTypePtr())
Constructor.
Definition pkt.h:58
isc::dhcp::ScopedEnableOptionsCopy::PktTypePtr
boost::shared_ptr< PktType > PktTypePtr
Pointer to an encapsulated packet.
Definition pkt.h:50
isc::dhcp::ScopedEnableOptionsCopy::~ScopedEnableOptionsCopy
~ScopedEnableOptionsCopy()
Destructor.
Definition pkt.h:72
isc::dhcp::ScopedPktOptionsCopy::~ScopedPktOptionsCopy
~ScopedPktOptionsCopy()
Destructor.
Definition pkt.h:1073
isc::dhcp::ScopedPktOptionsCopy::ScopedPktOptionsCopy
ScopedPktOptionsCopy(PktType &pkt)
Constructor.
Definition pkt.h:1066
isc::dhcp::ScopedSubOptionsCopy::ScopedSubOptionsCopy
ScopedSubOptionsCopy(const OptionPtr &opt)
Constructor.
Definition pkt.h:1021
isc::dhcp::ScopedSubOptionsCopy::~ScopedSubOptionsCopy
~ScopedSubOptionsCopy()
Destructor.
Definition pkt.h:1030
isc::hooks::CalloutHandleAssociate
Base class for classes which need to be associated with a CalloutHandle object.
Definition callout_handle_associate.h:37
isc::util::OutputBuffer
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition buffer.h:346
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
hwaddr.h
io_address.h
isc::data::copy
ElementPtr copy(ConstElementPtr from, unsigned level)
Copy the data up to a nesting level.
Definition data.cc:1522
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::PktPtr
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
Definition pkt.h:999
isc::dhcp::ClientClass
std::string ClientClass
Defines a single class name.
Definition classify.h:44
isc::dhcp::OptionCollection
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
Definition option.h:40
isc::dhcp::SubClassRelationContainer
boost::multi_index_container< SubClassRelation, boost::multi_index::indexed_by< boost::multi_index::sequenced< boost::multi_index::tag< TemplateClassSequenceTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< TemplateClassNameTag >, boost::multi_index::member< SubClassRelation, ClientClass, &SubClassRelation::class_def_ > > > > SubClassRelationContainer
the subclass multi-index.
Definition classify.h:104
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::OptionBuffer
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
Definition option.h:24
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
option.h