waiting for next packets. The argument specifies the next signal to
be handled by the server.
-% DHCP4_CCSESSION_STARTED control channel session started on socket %1
-A debug message issued during startup after the DHCPv4 server has
-successfully established a session with the Kea control channel.
-
-% DHCP4_CCSESSION_STARTING starting control channel session, specfile: %1
-This debug message is issued just before the DHCPv4 server attempts
-to establish a session with the Kea control channel.
-
% DHCP4_CLASS_ASSIGNED %1: client packet has been assigned to the following class(es): %2
This debug message informs that incoming packet has been assigned to specified
class or classes. This is a normal behavior and indicates successful operation.
option is skipped. The argument holds the client and transaction identification
information.
+% DHCP4_FLEX_ID flexible identifier generated for incoming packet: %1
+This debug message is printed when host reservation type is set to flexible identifier
+and the expression specified in its configuration generated (was evaluated to)
+an indetifier for incoming packet. This debug message is mainly intended as a
+debugging assistance for flexible identifier.
+
% DHCP4_GENERATE_FQDN %1: client did not send a FQDN or hostname; FQDN will be be generated for the client
This debug message is issued when the server did not receive a Hostname option
from the client and hostname generation is enabled. This provides a means to
/// Structure that holds registered hook indexes
struct Dhcp4Hooks {
- int hook_index_buffer4_receive_;///< index for "buffer4_receive" hook point
- int hook_index_pkt4_receive_; ///< index for "pkt4_receive" hook point
- int hook_index_subnet4_select_; ///< index for "subnet4_select" hook point
- int hook_index_lease4_release_; ///< index for "lease4_release" hook point
- int hook_index_pkt4_send_; ///< index for "pkt4_send" hook point
- int hook_index_buffer4_send_; ///< index for "buffer4_send" hook point
- int hook_index_lease4_decline_; ///< index for "lease4_decline" hook point
+ int hook_index_buffer4_receive_; ///< index for "buffer4_receive" hook point
+ int hook_index_pkt4_receive_; ///< index for "pkt4_receive" hook point
+ int hook_index_subnet4_select_; ///< index for "subnet4_select" hook point
+ int hook_index_lease4_release_; ///< index for "lease4_release" hook point
+ int hook_index_pkt4_send_; ///< index for "pkt4_send" hook point
+ int hook_index_buffer4_send_; ///< index for "buffer4_send" hook point
+ int hook_index_lease4_decline_; ///< index for "lease4_decline" hook point
+ int hook_index_host4_identifier_;///< index for "host4_identifier" hook point
/// Constructor that registers hook points for DHCPv4 engine
Dhcp4Hooks() {
- hook_index_buffer4_receive_= HooksManager::registerHook("buffer4_receive");
- hook_index_pkt4_receive_ = HooksManager::registerHook("pkt4_receive");
- hook_index_subnet4_select_ = HooksManager::registerHook("subnet4_select");
- hook_index_pkt4_send_ = HooksManager::registerHook("pkt4_send");
- hook_index_lease4_release_ = HooksManager::registerHook("lease4_release");
- hook_index_buffer4_send_ = HooksManager::registerHook("buffer4_send");
- hook_index_lease4_decline_ = HooksManager::registerHook("lease4_decline");
+ hook_index_buffer4_receive_ = HooksManager::registerHook("buffer4_receive");
+ hook_index_pkt4_receive_ = HooksManager::registerHook("pkt4_receive");
+ hook_index_subnet4_select_ = HooksManager::registerHook("subnet4_select");
+ hook_index_pkt4_send_ = HooksManager::registerHook("pkt4_send");
+ hook_index_lease4_release_ = HooksManager::registerHook("lease4_release");
+ hook_index_buffer4_send_ = HooksManager::registerHook("buffer4_send");
+ hook_index_lease4_decline_ = HooksManager::registerHook("lease4_decline");
+ hook_index_host4_identifier_ = HooksManager::registerHook("host4_identifier");
}
};
}
}
break;
+ case Host::IDENT_FLEX:
+ if (HooksManager::calloutsPresent(Hooks.hook_index_host4_identifier_)) {
+ CalloutHandlePtr callout_handle = getCalloutHandle(context_->query_);
+ Host::IdentifierType type = Host::IDENT_FLEX;
+ std::vector<uint8_t> id;
+
+ // Delete previously set arguments
+ callout_handle->deleteAllArguments();
+
+ // Pass incoming packet as argument
+ callout_handle->setArgument("query4", context_->query_);
+ callout_handle->setArgument("id_type", type);
+ callout_handle->setArgument("id_value", id);
+
+ // Call callouts
+ HooksManager::callCallouts(Hooks.hook_index_host4_identifier_,
+ *callout_handle);
+
+ callout_handle->getArgument("id_type", type);
+ callout_handle->getArgument("id_value", id);
+
+ if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_CONTINUE) &&
+ !id.empty()) {
+
+ LOG_DEBUG(packet4_logger, DBGLVL_TRACE_BASIC, DHCP4_FLEX_ID)
+ .arg(Host::getIdentifierAsText(type, &id[0], id.size()));
+
+ context_->addHostIdentifier(type, id);
+ }
+ }
+ break;
+
+
default:
;
}
waiting for next packets. The argument specifies the next signal to
be handled by the server.
-% DHCP6_CCSESSION_STARTED control channel session started on socket %1
-A debug message issued during startup after the IPv6 DHCP server has
-successfully established a session with the Kea control channel.
-
-% DHCP6_CCSESSION_STARTING starting control channel session, specfile: %1
-This debug message is issued just before the IPv6 DHCP server attempts
-to establish a session with the Kea control channel.
-
% DHCP6_CLASS_ASSIGNED %1: client packet has been assigned to the following class(es): %2
This debug message informs that incoming packet has been assigned to specified
class or classes. This is a normal behavior and indicates successful operation.