+2172. [func] fdupont
+ Completed and imporved logs showing what client classes
+ are assigned to queries during processing.
+ (Gitlab #2908)
+
Kea 2.5.0 (development) released on July 26, 2023
2171. [build] andrei
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
+extern const isc::log::MessageID DHCP4_CLASSES_ASSIGNED = "DHCP4_CLASSES_ASSIGNED";
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED = "DHCP4_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED = "DHCP4_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED = "DHCP4_CLASS_UNDEFINED";
"DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
- "DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
+ "DHCP4_CLASSES_ASSIGNED", "%1: client packet has been assigned to following classes: %2",
+ "DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class: %2",
"DHCP4_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP4_CLASS_UNDEFINED", "required class %1 has no definition",
"DHCP4_CLASS_UNTESTABLE", "required class %1 has no test expression",
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
+extern const isc::log::MessageID DHCP4_CLASSES_ASSIGNED;
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED;
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
-% DHCP4_CLASS_ASSIGNED %1: client packet has been assigned to the following class(es): %2
+% DHCP4_CLASSES_ASSIGNED %1: client packet has been assigned to following classes: %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.
+classes. This is a normal behavior and indicates successful operation.
The first argument specifies the client and transaction identification
information. The second argument includes all classes to which the
packet has been assigned.
+% DHCP4_CLASS_ASSIGNED %1: client packet has been assigned to the following class: %2
+This debug message informs that incoming packet has been assigned to specified
+class. This is a normal behavior and indicates successful operation.
+The first argument specifies the client and transaction identification
+information. The second argument includes the new class to which the
+packet has been assigned.
+
% DHCP4_CLASS_UNCONFIGURED %1: client packet belongs to an unconfigured class: %2
This debug message informs that incoming packet belongs to a class
which cannot be found in the configuration. Either a hook written
evaluateClasses(query, true);
const ClientClasses& classes = query_->getClasses();
- if (!classes.empty()) {
- LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_ASSIGNED)
- .arg(query_->getLabel())
- .arg(classes.toText());
- }
+ LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASSES_ASSIGNED)
+ .arg(query_->getLabel())
+ .arg(classes.toText());
// Check the DROP special class.
if (query_->inClass("DROP")) {
// Required classification
requiredClassify(ex);
+ LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASSES_ASSIGNED)
+ .arg(discover->getLabel())
+ .arg(discover->getClasses().toText());
+
buildCfgOptionList(ex);
appendRequestedOptions(ex);
appendRequestedVendorOptions(ex);
// Required classification
requiredClassify(ex);
+ LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASSES_ASSIGNED)
+ .arg(request->getLabel())
+ .arg(request->getClasses().toText());
+
buildCfgOptionList(ex);
appendRequestedOptions(ex);
appendRequestedVendorOptions(ex);
requiredClassify(ex);
+ LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASSES_ASSIGNED)
+ .arg(inform->getLabel())
+ .arg(inform->getClasses().toText());
+
buildCfgOptionList(ex);
appendRequestedOptions(ex);
appendRequestedVendorOptions(ex);
if (status) {
LOG_INFO(dhcp4_logger, EVAL_RESULT)
.arg(*cclass)
- .arg(status);
+ .arg("true");
// Matching: add the class
query->addClass(*cclass);
} else {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, EVAL_RESULT)
.arg(*cclass)
- .arg(status);
+ .arg("false");
}
} catch (const Exception& ex) {
LOG_ERROR(dhcp4_logger, EVAL_RESULT)
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
+extern const isc::log::MessageID DHCP6_CLASSES_ASSIGNED = "DHCP6_CLASSES_ASSIGNED";
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED = "DHCP6_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED = "DHCP6_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED = "DHCP6_CLASS_UNDEFINED";
"DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
- "DHCP6_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
+ "DHCP6_CLASSES_ASSIGNED", "%1: client packet has been assigned to following classes: %2",
+ "DHCP6_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class: %2",
"DHCP6_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP6_CLASS_UNDEFINED", "required class %1 has no definition",
"DHCP6_CLASS_UNTESTABLE", "required class %1 has no test expression",
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
+extern const isc::log::MessageID DHCP6_CLASSES_ASSIGNED;
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED;
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
-% DHCP6_CLASS_ASSIGNED %1: client packet has been assigned to the following class(es): %2
+% DHCP6_CLASSES_ASSIGNED %1: client packet has been assigned to following classes: %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.
+classes. This is a normal behavior and indicates successful operation.
The first argument specifies the client and transaction identification
information. The second argument includes all classes to which the
packet has been assigned.
+% DHCP6_CLASS_ASSIGNED %1: client packet has been assigned to the following class: %2
+This debug message informs that incoming packet has been assigned to specified
+class. This is a normal behavior and indicates successful operation.
+The first argument specifies the client and transaction identification
+information. The second argument includes the new class to which the
+packet has been assigned.
+
% DHCP6_CLASS_UNCONFIGURED %1: client packet belongs to an unconfigured class: %2
This debug message informs that incoming packet belongs to a class
which cannot be found in the configuration. Either a hook written
evaluateClasses(pkt, true);
const ClientClasses& classes = pkt->getClasses();
- if (!classes.empty()) {
- LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASS_ASSIGNED)
- .arg(pkt->getLabel())
- .arg(classes.toText());
- }
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(pkt->getLabel())
+ .arg(classes.toText());
// Check the DROP special class.
if (pkt->inClass("DROP")) {
conditionallySetReservedClientClasses(solicit, ctx);
requiredClassify(solicit, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(solicit->getLabel())
+ .arg(solicit->getClasses().toText());
+
copyClientOptions(solicit, response);
CfgOptionList co_list;
buildCfgOptionList(solicit, ctx, co_list);
conditionallySetReservedClientClasses(request, ctx);
requiredClassify(request, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(request->getLabel())
+ .arg(request->getClasses().toText());
+
copyClientOptions(request, reply);
CfgOptionList co_list;
buildCfgOptionList(request, ctx, co_list);
conditionallySetReservedClientClasses(renew, ctx);
requiredClassify(renew, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(renew->getLabel())
+ .arg(renew->getClasses().toText());
+
copyClientOptions(renew, reply);
CfgOptionList co_list;
buildCfgOptionList(renew, ctx, co_list);
conditionallySetReservedClientClasses(rebind, ctx);
requiredClassify(rebind, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(rebind->getLabel())
+ .arg(rebind->getClasses().toText());
+
copyClientOptions(rebind, reply);
CfgOptionList co_list;
buildCfgOptionList(rebind, ctx, co_list);
conditionallySetReservedClientClasses(confirm, ctx);
requiredClassify(confirm, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(confirm->getLabel())
+ .arg(confirm->getClasses().toText());
+
// Get IA_NAs from the Confirm. If there are none, the message is
// invalid and must be discarded. There is nothing more to do.
OptionCollection ias = confirm->getOptions(D6O_IA_NA);
conditionallySetReservedClientClasses(release, ctx);
requiredClassify(release, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(release->getLabel())
+ .arg(release->getClasses().toText());
+
// Create an empty Reply message.
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, release->getTransid()));
conditionallySetReservedClientClasses(decline, ctx);
requiredClassify(decline, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(decline->getLabel())
+ .arg(decline->getClasses().toText());
+
// Create an empty Reply message.
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, decline->getTransid()));
conditionallySetReservedClientClasses(inf_request, ctx);
requiredClassify(inf_request, ctx);
+ LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASSES_ASSIGNED)
+ .arg(inf_request->getLabel())
+ .arg(inf_request->getClasses().toText());
+
// Create a Reply packet, with the same trans-id as the client's.
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, inf_request->getTransid()));
pkt->addClass(*cclass);
}
}
-
- const ClientClasses& classes = pkt->getClasses();
- if (!classes.empty()) {
- LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASS_ASSIGNED)
- .arg(pkt->getLabel())
- .arg(classes.toText());
- }
}
void
if (status) {
LOG_INFO(dhcp6_logger, EVAL_RESULT)
.arg(*cclass)
- .arg(status);
+ .arg("true");
// Matching: add the class
pkt->addClass(*cclass);
} else {
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL, EVAL_RESULT)
.arg(*cclass)
- .arg(status);
+ .arg("false");
}
} catch (const Exception& ex) {
LOG_ERROR(dhcp6_logger, EVAL_RESULT)
if (status) {
LOG_INFO(dhcpsrv_logger, EVAL_RESULT)
.arg(getName())
- .arg(status);
+ .arg("true");
// Matching: add the class
pkt->addClass(getName());
} else {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, EVAL_RESULT)
.arg(getName())
- .arg(status);
+ .arg("false");
}
} catch (const Exception& ex) {
LOG_ERROR(dhcpsrv_logger, EVAL_RESULT)