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
ISC Open Source Projects
Kea
Commits
d824cbb6
Commit
d824cbb6
authored
Oct 15, 2015
by
Tomek Mrugalski
🛰
Browse files
[3987] Changes after review:
- comments, message corrected - unit-tests renamed to follow naming convention better
parent
b6849afe
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/dhcp6_hooks.dox
View file @
d824cbb6
...
...
@@ -181,7 +181,7 @@ packet processing. Hook points that are not specific to packet processing
- name: @b lease6, type: isc::dhcp::Lease6Ptr, direction: <b>in/out</b>
- @b Description: This callout is executed when the server engine is
about to decline an existing lease. The client's
request
is provided as
about to decline an existing lease. The client's
DECLINE
is provided as
the "query6" argument and the existing lease with the appropriate fields
already modified is given in the "lease6" argument. The lease contains
the lease before it is being declined.
...
...
src/bin/dhcp6/dhcp6_messages.mes
View file @
d824cbb6
...
...
@@ -292,12 +292,13 @@ or released leases), but the response will not be send to the client.
The argument includes the client and transaction identification
information.
% DHCP6_HOOK_DECLINE_SKIP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to
DROP, ignoring packet
.
% DHCP6_HOOK_DECLINE_SKIP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to
SKIP, skipping decline
.
This message indicates that the server received DECLINE message, it was verified
to be correct and matching server's lease information. The server called hooks
for the lease6_decline hook point and one of the callouts set next step status to SKIP.
The server will skip the operation of moving the lease to the declined state and
will continue processing.
will continue processing the packet. In particular, it will send a REPLY message
as if the decline actually took place.
% DHCP6_HOOK_DECLINE_DROP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to DROP, dropping packet.
This message indicates that the server received DECLINE message, it was verified
...
...
src/bin/dhcp6/dhcp6_srv.cc
View file @
d824cbb6
...
...
@@ -2807,7 +2807,7 @@ Dhcpv6Srv::declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
}
// Callouts decided to DROP the packet. Let's simply log it and
// return false, so
upper lay
ers will act accordingly.
// return false, so
call
ers will act accordingly.
if
(
callout_handle
->
getStatus
()
==
CalloutHandle
::
NEXT_STEP_DROP
)
{
LOG_DEBUG
(
hooks_logger
,
DBG_DHCP6_DETAIL
,
DHCP6_HOOK_DECLINE_DROP
)
.
arg
(
decline
->
getLabel
())
...
...
src/bin/dhcp6/tests/hooks_unittest.cc
View file @
d824cbb6
...
...
@@ -557,7 +557,7 @@ boost::shared_ptr<Option6IA> HooksDhcpv6SrvTest::callback_ia_na_;
//
// Note that the test name does not follow test naming convention,
// but the proper hook name is "buffer6_receive".
TEST_F
(
HooksDhcpv6SrvTest
,
simple
_b
uffer6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
simple
B
uffer6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -590,7 +590,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_buffer6_receive) {
// Checks if callouts installed on buffer6_receive is able to change
// the values and the parameters are indeed used by the server.
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
_b
uffer6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
B
uffer6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -627,7 +627,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_buffer6_receive) {
// Checks if callouts installed on buffer6_receive is able to delete
// existing options and that change impacts server processing (mandatory
// client-id option is deleted, so the packet is expected to be dropped)
TEST_F
(
HooksDhcpv6SrvTest
,
deleteClientId
_b
uffer6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
deleteClientId
B
uffer6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -651,7 +651,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteClientId_buffer6_receive) {
// Checks if callouts installed on buffer6_received is able to set skip flag that
// will cause the server to not process the packet (drop), even though it is valid.
TEST_F
(
HooksDhcpv6SrvTest
,
skip
_b
uffer6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
skip
B
uffer6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -678,7 +678,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_buffer6_receive) {
//
// Note that the test name does not follow test naming convention,
// but the proper hook name is "pkt6_receive".
TEST_F
(
HooksDhcpv6SrvTest
,
simple
_p
kt6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
simple
P
kt6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -711,7 +711,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_pkt6_receive) {
// Checks if callouts installed on pkt6_received is able to change
// the values and the parameters are indeed used by the server.
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
_p
kt6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
P
kt6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -747,7 +747,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_receive) {
// Checks if callouts installed on pkt6_received is able to delete
// existing options and that change impacts server processing (mandatory
// client-id option is deleted, so the packet is expected to be dropped)
TEST_F
(
HooksDhcpv6SrvTest
,
deleteClientId
_p
kt6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
deleteClientId
P
kt6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -771,7 +771,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteClientId_pkt6_receive) {
// Checks if callouts installed on pkt6_received is able to set skip flag that
// will cause the server to not process the packet (drop), even though it is valid.
TEST_F
(
HooksDhcpv6SrvTest
,
skip
_p
kt6
_r
eceive
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
skip
P
kt6
R
eceive
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -796,7 +796,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_pkt6_receive) {
// Checks if callouts installed on pkt6_send are indeed called and the
// all necessary parameters are passed.
TEST_F
(
HooksDhcpv6SrvTest
,
simple
_p
kt6
_s
end
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
simple
P
kt6
S
end
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -832,7 +832,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_pkt6_send) {
// Checks if callouts installed on pkt6_send is able to change
// the values and the packet sent contains those changes
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
_p
kt6
_s
end
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
valueChange
P
kt6
S
end
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -869,7 +869,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_send) {
// existing options and that server applies those changes. In particular,
// we are trying to send a packet without server-id. The packet should
// be sent
TEST_F
(
HooksDhcpv6SrvTest
,
deleteServerId
_p
kt6
_s
end
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
deleteServerId
P
kt6
S
end
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -900,7 +900,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteServerId_pkt6_send) {
// Checks if callouts installed on pkt6_skip is able to set skip flag that
// will cause the server to not process the packet (drop), even though it is valid.
TEST_F
(
HooksDhcpv6SrvTest
,
skip
_p
kt6
_s
end
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
skip
P
kt6
S
end
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -931,7 +931,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_pkt6_send) {
// This test checks if subnet6_select callout is triggered and reports
// valid parameters
TEST_F
(
HooksDhcpv6SrvTest
,
subnet6
_s
elect
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
subnet6
S
elect
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -1004,7 +1004,7 @@ TEST_F(HooksDhcpv6SrvTest, subnet6_select) {
// This test checks if callout installed on subnet6_select hook point can pick
// a different subnet.
TEST_F
(
HooksDhcpv6SrvTest
,
subnet
_
select
_c
hange
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
subnet
6S
select
C
hange
)
{
// Install pkt6_receive_callout
EXPECT_NO_THROW
(
HooksManager
::
preCalloutsLibraryHandle
().
registerCallout
(
...
...
@@ -1077,7 +1077,7 @@ TEST_F(HooksDhcpv6SrvTest, subnet_select_change) {
// This test verifies that incoming (positive) RENEW can be handled properly,
// and the lease6_renew callouts are triggered.
TEST_F
(
HooksDhcpv6SrvTest
,
basic
_l
ease6
_r
enew
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
basic
L
ease6
R
enew
)
{
NakedDhcpv6Srv
srv
(
0
);
// Install pkt6_receive_callout
...
...
@@ -1176,7 +1176,7 @@ TEST_F(HooksDhcpv6SrvTest, basic_lease6_renew) {
// This test verifies that incoming (positive) RENEW can be handled properly,
// and the lease6_renew callouts are able to change the lease being updated.
TEST_F
(
HooksDhcpv6SrvTest
,
leaseUpdate
_l
ease6
_r
enew
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
leaseUpdate
L
ease6
R
enew
)
{
NakedDhcpv6Srv
srv
(
0
);
// Install pkt6_receive_callout
...
...
@@ -1269,7 +1269,7 @@ TEST_F(HooksDhcpv6SrvTest, leaseUpdate_lease6_renew) {
// This test verifies that incoming (positive) RENEW can be handled properly,
// and the lease6_renew callouts are able to set the skip flag that will
// reject the renewal
TEST_F
(
HooksDhcpv6SrvTest
,
skip
_l
ease6
_r
enew
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
skip
L
ease6
R
enew
)
{
NakedDhcpv6Srv
srv
(
0
);
// Install pkt6_receive_callout
...
...
@@ -1347,7 +1347,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_lease6_renew) {
// - returned REPLY message has server-id
// - returned REPLY message has IA that does not include an IAADDR
// - lease is actually removed from LeaseMgr
TEST_F
(
HooksDhcpv6SrvTest
,
basic
_l
ease6
_r
elease
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
basic
L
ease6
R
elease
)
{
NakedDhcpv6Srv
srv
(
0
);
// Install pkt6_receive_callout
...
...
@@ -1429,7 +1429,7 @@ TEST_F(HooksDhcpv6SrvTest, basic_lease6_release) {
// - returned REPLY message has server-id
// - returned REPLY message has IA that does not include an IAADDR
// - lease is actually removed from LeaseMgr
TEST_F
(
HooksDhcpv6SrvTest
,
skip
_l
ease6
_r
elease
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
skip
L
ease6
R
elease
)
{
NakedDhcpv6Srv
srv
(
0
);
// Install pkt6_receive_callout
...
...
@@ -1493,7 +1493,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_lease6_release) {
// This test checks that the basic decline hook (lease6_decline) is
// triggered properly.
TEST_F
(
HooksDhcpv6SrvTest
,
d
ecline
Basic
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
basicLease6D
ecline
)
{
IfaceMgrTestConfig
test_config
(
true
);
// Install lease6_decline callout
...
...
@@ -1537,7 +1537,7 @@ TEST_F(HooksDhcpv6SrvTest, declineBasic) {
}
// Test that the lease6_decline hook point can handle SKIP status.
TEST_F
(
HooksDhcpv6SrvTest
,
d
eclineSkip
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
lease6D
eclineSkip
)
{
IfaceMgrTestConfig
test_config
(
true
);
// Install lease6_decline callout. It will set the status to skip
...
...
@@ -1581,7 +1581,7 @@ TEST_F(HooksDhcpv6SrvTest, declineSkip) {
}
// Test that the lease6_decline hook point can handle DROP status.
TEST_F
(
HooksDhcpv6SrvTest
,
d
eclineDrop
)
{
TEST_F
(
HooksDhcpv6SrvTest
,
lease6D
eclineDrop
)
{
IfaceMgrTestConfig
test_config
(
true
);
// Install lease6_decline callout. It will set the status to skip
...
...
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