resort) definition.
</para></listitem>
<listitem><para>
- When the incoming packet belongs the special DROP class it is
+ When the incoming packet belongs the special class, "DROP", it is
dropped and an informational message is logged with the packet
information.
</para></listitem>
The first step is to assess an incoming packet and assign it to
zero or more classes.
The second step is to choose a subnet, possibly based on the
- class information. When the incoming packet is in the "DROP"
- special class it is dropped and an information message logged.
+ class information. When the incoming packet is in the special
+ class, "DROP", it is dropped and an information message logged.
The next step is to evaluate class expressions depending on the
built-in "KNOWN"/"UNKNOWN" classes after host reservation lookup,
using them for pool selection and assigning classes from host reservations.
The first step is to assess an incoming packet and assign it to
zero or more classes.
Next, a subnet is chosen, possibly based on the
- class information. When the incoming packet is inthe "DROP"
- special class it is dropped and an information message logged.
+ class information. When the incoming packet is in the special
+ class, "DROP", it is dropped and an information message logged.
After that, class expressions are evaluated depending on the
built-in "KNOWN"/"UNKNOWN" classes after host reservation lookup,
using them for pool/pd-pool selection and assigning classes from host
if (query->inClass("DROP")) {
LOG_INFO(packet4_logger, DHCP4_PACKET_DROP_DROP_CLASS)
.arg(query->toText());
- // increase pkt4-receive-drop stats?
+ isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop",
+ static_cast<int64_t>(1));
return;
}
#include <dhcp/tests/iface_mgr_test_config.h>
#include <dhcp4/tests/dhcp4_client.h>
#include <dhcp/option_int.h>
+#include <stats/stats_mgr.h>
#include <algorithm>
#include <vector>
// Option, dropped.
EXPECT_FALSE(client2.getContext().response_);
+
+ // There should also be pkt4-receive-drop stat bumped up.
+ stats::StatsMgr& mgr = stats::StatsMgr::instance();
+ stats::ObservationPtr drop_stat = mgr.getObservation("pkt4-receive-drop");
+
+ // This statistic must be present and must be set to 1.
+ ASSERT_TRUE(drop_stat);
+ EXPECT_EQ(1, drop_stat->getInteger().first);
}
} // end of anonymous namespace
if (query->inClass("DROP")) {
LOG_INFO(packet6_logger, DHCP6_PACKET_DROP_DROP_CLASS)
.arg(query->toText());
- // increase pkt6-receive-drop stats?
+ StatsMgr::instance().addValue("pkt6-receive-drop",
+ static_cast<int64_t>(1));
return;
}
#include <dhcp6/tests/dhcp6_test_utils.h>
#include <dhcp6/tests/dhcp6_client.h>
#include <asiolink/io_address.h>
+#include <stats/stats_mgr.h>
#include <boost/pointer_cast.hpp>
#include <string>
// Option, dropped.
EXPECT_FALSE(client2.getContext().response_);
+
+ // There should also be pkt6-receive-drop stat bumped up.
+ stats::StatsMgr& mgr = stats::StatsMgr::instance();
+ stats::ObservationPtr drop_stat = mgr.getObservation("pkt6-receive-drop");
+
+ // This statistic must be present and must be set to 1.
+ ASSERT_TRUE(drop_stat);
+ EXPECT_EQ(1, drop_stat->getInteger().first);
}
} // end of anonymous namespace