A debug message printing the details of the received packet. The first
argument includes the client and the transaction identification
information. Packet fields ciaddr, yiaddr, siaddr, giaddr, sname, and file
-will be included not empty.
+will be included when not empty.
% DHCP4_QUERY_LABEL received query: %1
This information message indicates that a query was received. It displays
identification information. The second and third argument contains the
packet name and type respectively. The fourth argument contains detailed
packet information. Packet fields ciaddr, yiaddr, siaddr, giaddr, sname,
-and file will be included not empty.
+and file will be included when not empty.
% DHCP4_RESPONSE_FQDN_DATA %1: including FQDN option in the server's response: %2
Logged at debug log level 55.
printOrDump(const std::vector<uint8_t>& data, size_t max_dump) {
auto it = data.begin();
bool print_it = true;
- while (it != data.end() && *it != 0) {
+ for ( ; it != data.end() && *it != 0; ++it) {
if (!isprint(*it)) {
print_it = false;
break;
}
-
- ++it;
}
if (print_it && it != data.begin()) {
bool zeros = std::all_of(data.begin(), data.end(), [](int i) { return i==0; });
if (!zeros) {
if (data.size() > max_dump) {
- return (std::string(dumpAsHex(&data[0], max_dump) + std::string("..")));
+ return (dumpAsHex(&data[0], max_dump) + std::string(".."));
}
return (dumpAsHex(&data[0], data.size()));
EXPECT_FALSE(isPrintable(content));
}
-// Verifies the printOrDUmp operates correctly.
+// Verifies the printOrDump operates correctly.
TEST_F(StringUtilTest, printOrDump) {
struct Scenario {
size_t line_;