ot::Dns::Name::AppendMultipleLabels() method
Encodes and appends a sequence of name labels to a given message. The @p aLabels must follow "..", i.e., a sequence of labels separated by dot '.' char. E.g., "_http._tcp", "_http._tcp." (same as previous one), "host-1.test". Validates that the @p aLabels is a valid name format, i.e., no empty label, and labels are `kMaxLabelLength` (63) characters or less.
Arguments
aLabels
A name label string. Can be `nullptr` (then treated as "").
aMessage
The message to which to append the encoded name.
Return value
kErrorNone Successfully encoded and appended the name label(s) to @p aMessage. kErrorInvalidArgs Name label @p aLabels is not valid. kErrorNoBufs Insufficient available buffers to grow the message.
Notes
This method NEVER adds a label terminator (empty label) to the message, even in the case where @p aLabels ends with a dot character, e.g., "host-1.test." is treated same as "host-1.test".
ot::Dns::Name::AppendMultipleLabels() is called by 2 functions and calls 1 function:
![]()
ot::Dns::Name::AppendMultipleLabels()
ot::Dns::Name::AppendMultipleLabels() reads 5 variables:
![]()
ot::Dns::Name::AppendMultipleLabels()