handle->setArgument("query", query);
handle->setArgument("response", response);
HooksManager::callCallouts(lease_hook_index, *handle_ptr);
-if (! handle_ptr->getStatus() != CalloutHandle::NEXT_STEP_SKIP) {
+if (handle_ptr->getStatus() != CalloutHandle::NEXT_STEP_SKIP) {
// Skip flag not set, do the address allocation
:
}
handle->setArgument("query", query);
handle->setArgument("response", response);
HooksManager::callCallouts(lease_hook_index, *handle);
- if ( handle->getStatus() != CalloutHandle::NEXT_STEP_DROP ) {
+ if (handle->getStatus() != CalloutHandle::NEXT_STEP_DROP) {
// Next step allows us to continue, do the address allocation
:
}
boolean flag called skip that also doubled in some cases as an indicator
to drop the packet) several hooks use SKIP status to drop the packet.
-The methods to get and set the "skip" flag are getSkip and setSkip. Their
-usage is intuitive:
+The methods to get and set the "skip" or "drop" state are getStatus and
+setStatus. Their usage is intuitive:
@code
// Get the current setting of the next step status.
// Do something...
:
+ if (status == CalloutHandle::NEXT_STEP_SKIP)
+ // Do something...
+ :
+
// Do some processing...
:
if (lease_allocated) {
Like arguments, the next step status is passed to all callouts on a hook. Callouts
later in the list are able to examine (and modify) the settings of earlier ones.
+If using multiple libraries, when the library wants to drop the current packet,
+the DROP status must be used instead of the SKIP status so that the packet
+processing ends at that specific hook point.
+
+It is recommended for all callouts to check the status before doing any
+processing. As callouts can modify the status, it is recommended to take good
+care when doing so, because this will have impact on all remaining hooks as well.
+It is highly recommended to not reset the SKIP or DROP status to CONTINUE, even
+though possible, so that the rest of the loaded hooks and the server can check
+and perform the proper action.
+
+As stated before, the order of loading libraries is crucial in achieving the
+desired behavior, so please read @ref hooksdgMultipleLibraries when configuring
+multiple libraries.
+
@subsubsection hooksdgSkipFlag The "Skip" Flag (deprecated)
In releases 0.9.2 and earlier, the functionality currently offered by next step