Name

cyg_mdns_strlen_uncompressed — Length of uncompressed encoded string

Synopsis

#include <mdns.h>

cyg_uint16 cyg_mdns_strlen_uncompressed(const cyg_uint8 *us);

Description

This function is used to calculate the length of an uncompressed, encoded string terminated by a zero-length (NUL) field.

[Note]Note

This function is not available if the system is not configured with CYGIMP_NET_MDNS_DNSSD enabled.

static const cyg_uint8 encoded_string[] = {
  0x08,'t','e','s','t','n','a','m','e',
  0x05,'_','h','t','t','p',
  0x00
};

…

cyg_uint16 elen = cyg_mdns_strlen_uncompressed(encoded_string);
// elen == ((1 + 8) + (1 + 5) + 1) == 16

Return value

The number of bytes occupied by the encoded string.