ot::Dns::Name::AppendLabel() method
Encodes and appends a single name label to a message. The @p aLabel is assumed to contain a single name label as a C string (null-terminated). Unlike `AppendMultipleLabels()` which parses the label string and treats it as sequence of multiple (dot-separated) labels, this method always appends @p aLabel as a single whole label. This allows the label string to even contain dot '.' character, which, for example, is useful for "Service Instance Names" where portion is a user-friendly name and can contain dot characters.
Arguments
aLabel
The label string to append. MUST NOT be `nullptr`.
aMessage
The message to append to.
Return value
kErrorNone Successfully encoded and appended the name label to @p aMessage. kErrorInvalidArgs @p aLabel is not valid (e.g., label length is not within valid range). kErrorNoBufs Insufficient available buffers to grow the message.
ot::Dns::Name::AppendLabel() is called by 3 functions and calls 3 functions:
![]()
ot::Dns::Name::AppendLabel()
ot::Dns::Name::AppendLabel() reads 4 variables:
![]()
ot::Dns::Name::AppendLabel()