libdhcp4_la_SOURCES += json_config_parser.cc json_config_parser.h
libdhcp4_la_SOURCES += dhcp4_log.cc dhcp4_log.h
libdhcp4_la_SOURCES += dhcp4_srv.cc dhcp4_srv.h
-libdhcp4_la_SOURCES += dhcp4_dhcp4o6_ipc.cc dhcp4_dhcp4o6_ipc.h
+libdhcp4_la_SOURCES += dhcp4to6_ipc.cc dhcp4to6_ipc.h
libdhcp4_la_SOURCES += kea_controller.cc
#include <cc/data.h>
#include <dhcp4/ctrl_dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h>
-#include <dhcp4/dhcp4_dhcp4o6_ipc.h>
+#include <dhcp4/dhcp4to6_ipc.h>
#include <hooks/hooks_manager.h>
#include <dhcp4/json_config_parser.h>
#include <dhcpsrv/cfgmgr.h>
#include <util/buffer.h>
#include <dhcp/iface_mgr.h>
#include <dhcpsrv/cfgmgr.h>
-#include <dhcp4/dhcp4_dhcp4o6_ipc.h>
+#include <dhcp4/dhcp4to6_ipc.h>
using namespace std;
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef DHCP4_DHCP4O6_IPC_H
-#define DHCP4_DHCP4O6_IPC_H
+#ifndef DHCP4TO6_IPC_H
+#define DHCP4TO6_IPC_H
-/// @file dhcp4_dhcp4o6_ipc.h Defines the Dhcp4o6Ipc class.
+/// @file dhcp4to6_ipc.h Defines the Dhcp4o6Ipc class.
/// This file defines the class Kea uses to act as the DHCPv4 server
/// side of DHCPv4-over-DHCPv6 communication between servers.
///
dhcp4_unittests_SOURCES += out_of_range_unittest.cc
dhcp4_unittests_SOURCES += decline_unittest.cc
dhcp4_unittests_SOURCES += kea_controller_unittest.cc
-dhcp4_unittests_SOURCES += dhcp4o6_ipc_unittest.cc
+dhcp4_unittests_SOURCES += dhcp4to6_ipc_unittest.cc
nodist_dhcp4_unittests_SOURCES = marker_file.h test_libraries.h
#include <dhcp/pkt4o6.h>
#include <dhcp/pkt6.h>
#include <dhcp/tests/iface_mgr_test_config.h>
-#include <dhcp4/dhcp4_dhcp4o6_ipc.h>
+#include <dhcp4/dhcp4to6_ipc.h>
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/testutils/dhcp4o6_test_ipc.h>
#include <gtest/gtest.h>
libdhcp6_la_SOURCES += dhcp6_srv.cc dhcp6_srv.h
libdhcp6_la_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h
libdhcp6_la_SOURCES += json_config_parser.cc json_config_parser.h
-libdhcp6_la_SOURCES += dhcp6_dhcp4o6_ipc.cc dhcp6_dhcp4o6_ipc.h
+libdhcp6_la_SOURCES += dhcp6to4_ipc.cc dhcp6to4_ipc.h
libdhcp6_la_SOURCES += kea_controller.cc
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/cfg_db_access.h>
#include <dhcp6/ctrl_dhcp6_srv.h>
-#include <dhcp6/dhcp6_dhcp4o6_ipc.h>
+#include <dhcp6/dhcp6to4_ipc.h>
#include <dhcp6/dhcp6_log.h>
#include <dhcp6/json_config_parser.h>
#include <hooks/hooks_manager.h>
#include <dhcp/option_vendor_class.h>
#include <dhcp/option_int_array.h>
#include <dhcp/pkt6.h>
-#include <dhcp6/dhcp6_dhcp4o6_ipc.h>
+#include <dhcp6/dhcp6to4_ipc.h>
#include <dhcp6/dhcp6_log.h>
#include <dhcp6/dhcp6_srv.h>
#include <dhcpsrv/callout_handle_store.h>
#include <util/buffer.h>
#include <dhcp/iface_mgr.h>
#include <dhcpsrv/cfgmgr.h>
-#include <dhcp6/dhcp6_dhcp4o6_ipc.h>
+#include <dhcp6/dhcp6to4_ipc.h>
using namespace std;
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef DHCP6_DHCP4O6_IPC_H
-#define DHCP6_DHCP4O6_IPC_H
+#ifndef DHCP6TO4_IPC_H
+#define DHCP6TO4_IPC_H
-/// @file dhcp6_dhcp4o6_ipc.h Defines the Dhcp6to4Ipc class.
+/// @file dhcp6to4_ipc.h Defines the Dhcp6to4Ipc class.
/// This file defines the class Kea uses to act as the DHCPv6 server
/// side of DHCPv4-over-DHCPv6 communication between servers.
///
dhcp6_unittests_SOURCES += decline_unittest.cc
dhcp6_unittests_SOURCES += dhcp6_message_test.cc dhcp6_message_test.h
dhcp6_unittests_SOURCES += kea_controller_unittest.cc
-dhcp6_unittests_SOURCES += dhcp4o6_ipc_unittest.cc
+dhcp6_unittests_SOURCES += dhcp6to4_ipc_unittest.cc
nodist_dhcp6_unittests_SOURCES = marker_file.h test_libraries.h
#include <dhcp/iface_mgr.h>
#include <dhcp/tests/iface_mgr_test_config.h>
#include <dhcp/tests/pkt_filter6_test_stub.h>
-#include <dhcp6/dhcp6_dhcp4o6_ipc.h>
+#include <dhcp6/dhcp6to4_ipc.h>
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/testutils/dhcp4o6_test_ipc.h>
#include <gtest/gtest.h>
/// @brief Creates an instance of the DHCPv4o6 Message option.
///
+ /// The option will contain an empty DHCPREQUEST message, with
+ /// just the Message Type option inside and nothing else.
+ ///
/// @return Pointer to the instance of the DHCPv4-query Message option.
OptionPtr createDHCPv4MsgOption() const;
#include <dhcp/option_string.h>
#include <dhcp/option_vendor.h>
#include <dhcpsrv/dhcp4o6_ipc.h>
+#include <dhcpsrv/dhcpsrv_log.h>
+
#include <boost/pointer_cast.hpp>
+
#include <errno.h>
#include <netinet/in.h>
#include <sys/fcntl.h>
// Vendor option must exist.
if (!option_vendor) {
+ LOG_WARN(dhcpsrv_logger, DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET)
+ .arg("no ISC vendor option");
isc_throw(Dhcp4o6IpcError, "option " << D6O_VENDOR_OPTS
<< " with ISC enterprise id is not present in the DHCP4o6"
" message sent between the servers");
OptionStringPtr ifname = boost::dynamic_pointer_cast<
OptionString>(option_vendor->getOption(ISC_V6_4O6_INTERFACE));
if (!ifname) {
+ LOG_WARN(dhcpsrv_logger, DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET)
+ .arg("no interface suboption");
isc_throw(Dhcp4o6IpcError, "option " << D6O_VENDOR_OPTS
<< " doesn't contain the " << ISC_V6_4O6_INTERFACE
<< " option required in the DHCP4o6 message sent"
// Check if this interface is present in the system.
IfacePtr iface = IfaceMgr::instance().getIface(ifname->getValue());
if (!iface) {
+ LOG_WARN(dhcpsrv_logger, DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET)
+ .arg("can't get interface " + ifname->getValue());
isc_throw(Dhcp4o6IpcError, "option " << ISC_V6_4O6_INTERFACE
<< " sent in the DHCP4o6 message contains non-existing"
" interface name '" << ifname->getValue() << "'");
OptionCustomPtr srcs = boost::dynamic_pointer_cast<
OptionCustom>(option_vendor->getOption(ISC_V6_4O6_SRC_ADDRESS));
if (!srcs) {
+ LOG_WARN(dhcpsrv_logger, DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET)
+ .arg("no source address suboption");
isc_throw(Dhcp4o6IpcError, "option " << D6O_VENDOR_OPTS
<< " doesn't contain the " << ISC_V6_4O6_SRC_ADDRESS
<< " option required in the DHCP4o6 message sent"
/// @param endpoint_type Endpoint type (DHCPv4 or DHCPv6 server).
///
/// @return New socket descriptor.
+ /// @throw isc::dhcp::Dhcp4o6IpcError on system call errors.
int open(uint16_t port, EndpointType endpoint_type);
public:
///
/// @return a pointer to a DHCPv6 message with interface and remote
/// address set from the IPC message
+ /// @throw isc::dhcp::Dhcp4o6IpcError on system call error or
+ /// malformed packets.
Pkt6Ptr receive();
/// @brief Send message over IPC.
///
/// @param pkt Pointer to a DHCPv6 message with interface and remote
/// address.
+ /// @throw isc::dhcp::Dhcp4o6IpcError.
void send(const Pkt6Ptr& pkt);
protected: