Commit f77fcfce authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[master] Merge remote-tracking branch 'origin/trac2151'

parents aea6e2d1 73291cf0
......@@ -53,6 +53,14 @@ public:
static const size_t MAX_SERIALIZED_LENGTH =
Name::MAX_WIRE + Name::MAX_LABELS + 1;
///
/// \name Well-known LabelSequence constants
///
//@{
/// Wildcard label ("*")
static const LabelSequence& WILDCARD();
//@}
/// \brief Constructs a LabelSequence for the given name
///
/// \note The associated Name MUST remain in scope during the lifetime
......@@ -410,6 +418,13 @@ private:
std::ostream&
operator<<(std::ostream& os, const LabelSequence& label_sequence);
inline const LabelSequence&
LabelSequence::WILDCARD() {
static const uint8_t wildcard_buf[4] = { 0x01, 0x00, 0x01, '*' };
static const LabelSequence wild_ls(wildcard_buf);
return (wild_ls);
}
} // end namespace dns
} // end namespace isc
......
......@@ -1174,4 +1174,10 @@ TEST_F(ExtendableLabelSequenceTest, extendBadData) {
check_equal(full_ls2, els);
}
// Check the static fixed 'wildcard' LabelSequence
TEST(WildCardLabelSequence, wildcard) {
ASSERT_FALSE(LabelSequence::WILDCARD().isAbsolute());
ASSERT_EQ("*", LabelSequence::WILDCARD().toText());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment