HWAddrPtr hw_addr(new HWAddr(HWAddr::fromText(scenario.hw_str_, 10)));
query->setHWAddr(hw_addr);
+ srv.classifyPacket(query);
+
// Process it.
Pkt4Ptr response = srv.processDiscover(query);
// The client class should be assigned to the message to indicate that the
// server1 should process this message.
- ASSERT_EQ(2, query4->getClasses().size());
- EXPECT_TRUE(query4->inClass("ALL"));
+ ASSERT_EQ(1, query4->getClasses().size());
EXPECT_TRUE(query4->inClass("HA_server1"));
// Check that the message has been parsed. The DHCP message type should
// The client class should be assigned to the message to indicate that the
// server1 should process this message.
- ASSERT_EQ(2, query6->getClasses().size());
- EXPECT_TRUE(query6->inClass("ALL"));
+ ASSERT_EQ(1, query6->getClasses().size());
EXPECT_TRUE(query6->inClass("HA_server1"));
// Check that the message has been parsed. The DHCP message type should
void
Pkt::addClass(const ClientClass& client_class, bool required) {
- // Always have ALL first.
- if (classes_.empty()) {
- classes_.insert("ALL");
- }
ClientClasses& classes = !required ? classes_ : required_classes_;
if (!classes.contains(client_class)) {
classes.insert(client_class);
void
Pkt::addSubClass(const ClientClass& class_def, const ClientClass& subclass) {
- // Always have ALL first.
- if (classes_.empty()) {
- classes_.insert("ALL");
- }
if (!classes_.contains(class_def)) {
classes_.insert(class_def);
static_cast<void>(subclasses_.push_back(SubClassRelation(class_def, subclass)));