mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 13:50:28 +00:00
73126f7099
This commit adds `Dns::Name` type which provides a set of helper methods to encode/decode DNS names. `AppendName()` method encodes and appends a full name (e.g., "test.example.com") to a message. Other helper methods enable appending labels (or groups of labels) and/or constructing a compressed name (using pointer labels). `ParseName()` method parses and skips over a full name in a message. `ReadLabel()` method reads labels one by one and works independently of whether the encoded name is compressed or not. `ReadName()` method read an entire name from message. The new methods are used in `Dns::Client`. This commit also add a unit test `test-dns` covering the behavior of the newly added helper methods. Finally, this commit adds few helper methods in `ResourceRecords` to get the size and check the type of a DNS record.