Skip to content

Commit 02e7cb2

Browse files
committed
[#2022] Added PARK status handle
1 parent 89a34ee commit 02e7cb2

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/bin/dhcp6/dhcp6_messages.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ extern const isc::log::MessageID DHCP6_HOOK_PACKET_RCVD_SKIP = "DHCP6_HOOK_PACKE
8484
extern const isc::log::MessageID DHCP6_HOOK_PACKET_SEND_DROP = "DHCP6_HOOK_PACKET_SEND_DROP";
8585
extern const isc::log::MessageID DHCP6_HOOK_PACKET_SEND_SKIP = "DHCP6_HOOK_PACKET_SEND_SKIP";
8686
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_DROP = "DHCP6_HOOK_SUBNET6_SELECT_DROP";
87+
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_PARK = "DHCP6_HOOK_SUBNET6_SELECT_PARK";
8788
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_SKIP = "DHCP6_HOOK_SUBNET6_SELECT_SKIP";
8889
extern const isc::log::MessageID DHCP6_INIT_FAIL = "DHCP6_INIT_FAIL";
8990
extern const isc::log::MessageID DHCP6_LEASE_ADVERT = "DHCP6_LEASE_ADVERT";
@@ -258,6 +259,7 @@ const char* values[] = {
258259
"DHCP6_HOOK_PACKET_SEND_DROP", "%1: prepared DHCPv6 response was not sent because a callout set the next ste to DROP",
259260
"DHCP6_HOOK_PACKET_SEND_SKIP", "%1: prepared DHCPv6 response is not built because a callout set the next step to SKIP",
260261
"DHCP6_HOOK_SUBNET6_SELECT_DROP", "%1: packet was dropped because a callout set the drop flag",
262+
"DHCP6_HOOK_SUBNET6_SELECT_PARK", "%1: packet was parked",
261263
"DHCP6_HOOK_SUBNET6_SELECT_SKIP", "%1: no subnet was selected because a callout set the next step to SKIP",
262264
"DHCP6_INIT_FAIL", "failed to initialize Kea server: %1",
263265
"DHCP6_LEASE_ADVERT", "%1: lease for address %2 and iaid=%3 will be advertised",

src/bin/dhcp6/dhcp6_messages.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ extern const isc::log::MessageID DHCP6_HOOK_PACKET_RCVD_SKIP;
8585
extern const isc::log::MessageID DHCP6_HOOK_PACKET_SEND_DROP;
8686
extern const isc::log::MessageID DHCP6_HOOK_PACKET_SEND_SKIP;
8787
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_DROP;
88+
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_PARK;
8889
extern const isc::log::MessageID DHCP6_HOOK_SUBNET6_SELECT_SKIP;
8990
extern const isc::log::MessageID DHCP6_INIT_FAIL;
9091
extern const isc::log::MessageID DHCP6_LEASE_ADVERT;

src/bin/dhcp6/dhcp6_messages.mes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ point, the setting of the flag instructs the server to drop the
472472
received packet. The argument holds the client and transaction
473473
identification information.
474474

475+
% DHCP6_HOOK_SUBNET6_SELECT_PARK %1: packet was parked
476+
This debug message is printed when a callout installed on the
477+
subnet6_select hook point set the park flag. The argument holds the
478+
client and transaction identification information.
479+
475480
% DHCP6_HOOK_SUBNET6_SELECT_SKIP %1: no subnet was selected because a callout set the next step to SKIP
476481
This debug message is printed when a callout installed on the
477482
subnet6_select hook point set the next step to SKIP value. For this particular hook

src/bin/dhcp6/dhcp6_srv.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,15 @@ Dhcpv6Srv::selectSubnet(const Pkt6Ptr& question, bool& drop) {
20132013
return (Subnet6Ptr());
20142014
}
20152015

2016+
// Callouts parked the packet. Same as drop but callouts will resume
2017+
// processing or drop the packet later.
2018+
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_PARK) {
2019+
LOG_DEBUG(hooks_logger, DBG_DHCP6_HOOKS, DHCP6_HOOK_SUBNET6_SELECT_PARK)
2020+
.arg(question->getLabel());
2021+
drop = true;
2022+
return (Subnet6Ptr());
2023+
}
2024+
20162025
// Use whatever subnet was specified by the callout
20172026
callout_handle->getArgument("subnet6", subnet);
20182027
}

0 commit comments

Comments
 (0)