Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
828ef399
Commit
828ef399
authored
Jun 16, 2016
by
Francis Dupont
Browse files
[4106_update] Addressed last comments
parent
d8280d80
Changes
15
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/Makefile.am
View file @
828ef399
...
...
@@ -62,7 +62,7 @@ libdhcp4_la_SOURCES += ctrl_dhcp4_srv.cc ctrl_dhcp4_srv.h
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
_dhcp4
o6_ipc.cc dhcp4
_dhcp4
o6_ipc.h
libdhcp4_la_SOURCES
+=
dhcp4
t
o6_ipc.cc dhcp4
t
o6_ipc.h
libdhcp4_la_SOURCES
+=
kea_controller.cc
...
...
src/bin/dhcp4/ctrl_dhcp4_srv.cc
View file @
828ef399
...
...
@@ -8,7 +8,7 @@
#include
<cc/data.h>
#include
<dhcp4/ctrl_dhcp4_srv.h>
#include
<dhcp4/dhcp4_log.h>
#include
<dhcp4/dhcp4
_dhcp4
o6_ipc.h>
#include
<dhcp4/dhcp4
t
o6_ipc.h>
#include
<hooks/hooks_manager.h>
#include
<dhcp4/json_config_parser.h>
#include
<dhcpsrv/cfgmgr.h>
...
...
src/bin/dhcp4/dhcp4
_dhcp4
o6_ipc.cc
→
src/bin/dhcp4/dhcp4
t
o6_ipc.cc
View file @
828ef399
...
...
@@ -9,7 +9,7 @@
#include
<util/buffer.h>
#include
<dhcp/iface_mgr.h>
#include
<dhcpsrv/cfgmgr.h>
#include
<dhcp4/dhcp4
_dhcp4
o6_ipc.h>
#include
<dhcp4/dhcp4
t
o6_ipc.h>
using
namespace
std
;
...
...
src/bin/dhcp4/dhcp4
_dhcp4
o6_ipc.h
→
src/bin/dhcp4/dhcp4
t
o6_ipc.h
View file @
828ef399
...
...
@@ -4,10 +4,10 @@
// 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
_DHCP4
O6_IPC_H
#define DHCP4
_DHCP4
O6_IPC_H
#ifndef DHCP4
T
O6_IPC_H
#define DHCP4
T
O6_IPC_H
/// @file dhcp4
_dhcp4
o6_ipc.h Defines the Dhcp4o6Ipc class.
/// @file dhcp4
t
o6_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.
///
...
...
src/bin/dhcp4/tests/Makefile.am
View file @
828ef399
...
...
@@ -93,7 +93,7 @@ dhcp4_unittests_SOURCES += release_unittest.cc
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
+=
dhcp4
t
o6_ipc_unittest.cc
nodist_dhcp4_unittests_SOURCES
=
marker_file.h test_libraries.h
...
...
src/bin/dhcp4/tests/dhcp4o6_ipc_unittest.cc
→
src/bin/dhcp4/tests/dhcp4
t
o6_ipc_unittest.cc
View file @
828ef399
...
...
@@ -9,7 +9,7 @@
#include
<dhcp/pkt4o6.h>
#include
<dhcp/pkt6.h>
#include
<dhcp/tests/iface_mgr_test_config.h>
#include
<dhcp4/dhcp4
_dhcp4
o6_ipc.h>
#include
<dhcp4/dhcp4
t
o6_ipc.h>
#include
<dhcpsrv/cfgmgr.h>
#include
<dhcpsrv/testutils/dhcp4o6_test_ipc.h>
#include
<gtest/gtest.h>
...
...
src/bin/dhcp6/Makefile.am
View file @
828ef399
...
...
@@ -63,7 +63,7 @@ libdhcp6_la_SOURCES += dhcp6_log.cc dhcp6_log.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
+=
dhcp6
to4
_ipc.cc dhcp6
to4
_ipc.h
libdhcp6_la_SOURCES
+=
kea_controller.cc
...
...
src/bin/dhcp6/ctrl_dhcp6_srv.cc
View file @
828ef399
...
...
@@ -11,7 +11,7 @@
#include
<dhcpsrv/cfgmgr.h>
#include
<dhcpsrv/cfg_db_access.h>
#include
<dhcp6/ctrl_dhcp6_srv.h>
#include
<dhcp6/dhcp6
_dhcp4o6
_ipc.h>
#include
<dhcp6/dhcp6
to4
_ipc.h>
#include
<dhcp6/dhcp6_log.h>
#include
<dhcp6/json_config_parser.h>
#include
<hooks/hooks_manager.h>
...
...
src/bin/dhcp6/dhcp6_srv.cc
View file @
828ef399
...
...
@@ -25,7 +25,7 @@
#include
<dhcp/option_vendor_class.h>
#include
<dhcp/option_int_array.h>
#include
<dhcp/pkt6.h>
#include
<dhcp6/dhcp6
_dhcp4o6
_ipc.h>
#include
<dhcp6/dhcp6
to4
_ipc.h>
#include
<dhcp6/dhcp6_log.h>
#include
<dhcp6/dhcp6_srv.h>
#include
<dhcpsrv/callout_handle_store.h>
...
...
src/bin/dhcp6/dhcp6
_dhcp4o6
_ipc.cc
→
src/bin/dhcp6/dhcp6
to4
_ipc.cc
View file @
828ef399
...
...
@@ -9,7 +9,7 @@
#include
<util/buffer.h>
#include
<dhcp/iface_mgr.h>
#include
<dhcpsrv/cfgmgr.h>
#include
<dhcp6/dhcp6
_dhcp4o6
_ipc.h>
#include
<dhcp6/dhcp6
to4
_ipc.h>
using
namespace
std
;
...
...
src/bin/dhcp6/dhcp6
_dhcp4o6
_ipc.h
→
src/bin/dhcp6/dhcp6
to4
_ipc.h
View file @
828ef399
...
...
@@ -4,10 +4,10 @@
// 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 DHCP6
TO4
_IPC_H
#define DHCP6
TO4
_IPC_H
/// @file dhcp6
_dhcp4o6
_ipc.h Defines the Dhcp6to4Ipc class.
/// @file dhcp6
to4
_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.
///
...
...
src/bin/dhcp6/tests/Makefile.am
View file @
828ef399
...
...
@@ -95,7 +95,7 @@ dhcp6_unittests_SOURCES += infrequest_unittest.cc
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
+=
dhcp
4o6
_ipc_unittest.cc
dhcp6_unittests_SOURCES
+=
dhcp
6to4
_ipc_unittest.cc
nodist_dhcp6_unittests_SOURCES
=
marker_file.h test_libraries.h
...
...
src/bin/dhcp6/tests/dhcp
4o6
_ipc_unittest.cc
→
src/bin/dhcp6/tests/dhcp
6to4
_ipc_unittest.cc
View file @
828ef399
...
...
@@ -10,7 +10,7 @@
#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/dhcp6
to4
_ipc.h>
#include
<dhcpsrv/cfgmgr.h>
#include
<dhcpsrv/testutils/dhcp4o6_test_ipc.h>
#include
<gtest/gtest.h>
...
...
@@ -51,6 +51,9 @@ public:
/// @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
;
...
...
src/lib/dhcpsrv/dhcp4o6_ipc.cc
View file @
828ef399
...
...
@@ -13,7 +13,10 @@
#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>
...
...
@@ -151,6 +154,8 @@ Pkt6Ptr Dhcp4o6IpcBase::receive() {
// 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"
);
...
...
@@ -160,6 +165,8 @@ Pkt6Ptr Dhcp4o6IpcBase::receive() {
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"
...
...
@@ -169,6 +176,8 @@ Pkt6Ptr Dhcp4o6IpcBase::receive() {
// 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
()
<<
"'"
);
...
...
@@ -178,6 +187,8 @@ Pkt6Ptr Dhcp4o6IpcBase::receive() {
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"
...
...
src/lib/dhcpsrv/dhcp4o6_ipc.h
View file @
828ef399
...
...
@@ -84,6 +84,7 @@ protected:
/// @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:
...
...
@@ -98,6 +99,8 @@ 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.
...
...
@@ -110,6 +113,7 @@ public:
///
/// @param pkt Pointer to a DHCPv6 message with interface and remote
/// address.
/// @throw isc::dhcp::Dhcp4o6IpcError.
void
send
(
const
Pkt6Ptr
&
pkt
);
protected:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment