ot::Dns::Name::ExtractLabels() method
Extracts label(s) from a name by checking that it contains a given suffix name (e.g., suffix name can be a domain name) and removing it. Both @p aName and @p aSuffixName MUST follow the same style regarding inclusion of trailing dot ('.'). Otherwise `kErrorParse` is returned. The @p aLabels buffer may be the same as @p aName for in-place label extraction. In this case, the implementation avoids unnecessary character copies.
Arguments
aName
The name to extract labels from.
aSuffixName
The suffix name (e.g., can be domain name).
aLabels
Pointer to buffer to copy the extracted labels.
aLabelsSize
Size of @p aLabels buffer.
Return value
kErrorNone Successfully extracted the labels, @p aLabels is updated. kErrorParse @p aName does not contain @p aSuffixName. kErrorNoBufs Could not fit the labels in @p aLabelsSize.