From 5df470d063350a4002ccdf704ab1669262073f0b Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Sat, 31 Oct 2015 11:40:42 +0100 Subject: [PATCH] [master] Finished trac4027 aka Pkt4o6 merge --- src/lib/dhcp/Makefile.am | 2 +- src/lib/dhcp/pkt.cc | 8 ++++---- src/lib/dhcp/pkt4.h | 8 ++++++++ src/lib/dhcp/pkt6.h | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/lib/dhcp/Makefile.am b/src/lib/dhcp/Makefile.am index 349070ec0c..b892192b9c 100644 --- a/src/lib/dhcp/Makefile.am +++ b/src/lib/dhcp/Makefile.am @@ -15,7 +15,7 @@ CLEANFILES = *.gcno *.gcda lib_LTLIBRARIES = libkea-dhcp++.la libkea_dhcp___la_SOURCES = libkea_dhcp___la_SOURCES += classify.cc classify.h -libkea_dhcp___la_SOURCES += dhcp6.h dhcp4.h dhcp4o6.h +libkea_dhcp___la_SOURCES += dhcp6.h dhcp4.h libkea_dhcp___la_SOURCES += duid.cc duid.h libkea_dhcp___la_SOURCES += hwaddr.cc hwaddr.h libkea_dhcp___la_SOURCES += iface_mgr.cc iface_mgr.h diff --git a/src/lib/dhcp/pkt.cc b/src/lib/dhcp/pkt.cc index dfd1f8aa33..1af44ba989 100644 --- a/src/lib/dhcp/pkt.cc +++ b/src/lib/dhcp/pkt.cc @@ -50,10 +50,10 @@ Pkt::Pkt(const uint8_t* buf, uint32_t len, const isc::asiolink::IOAddress& local { if (len != 0) { - if (buf == NULL) { - isc_throw(InvalidParameter, "data buffer passed to Pkt is NULL"); - } - data_.resize(len); + if (buf == NULL) { + isc_throw(InvalidParameter, "data buffer passed to Pkt is NULL"); + } + data_.resize(len); memcpy(&data_[0], buf, len); } } diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h index 0c7d009e16..a4c0cc2db9 100644 --- a/src/lib/dhcp/pkt4.h +++ b/src/lib/dhcp/pkt4.h @@ -375,6 +375,14 @@ public: /// (true) or non-relayed (false). bool isRelayed() const; + /// @brief Checks if a DHCPv4 message has beeb transported over DHCPv6 + /// + /// @return Boolean value which indicates whether the message is + /// transported over DHCPv6 (true) or native DHCPv4 (false) + virtual bool isDhcp4o6() const { + return (false); + } + private: /// @brief Generic method that validates and sets HW address. diff --git a/src/lib/dhcp/pkt6.h b/src/lib/dhcp/pkt6.h index e517c35eed..87dab71a67 100644 --- a/src/lib/dhcp/pkt6.h +++ b/src/lib/dhcp/pkt6.h @@ -244,7 +244,7 @@ public: /// @param option_code code of the requested option /// @param nesting_level see description above /// - /// @return pointer to the option (or NULL if there is no such option) + /// @return pointer to the option (or NULL if there is no such option) OptionPtr getRelayOption(uint16_t option_code, uint8_t nesting_level); /// @brief Return first instance of a specified option -- 2.47.2