Name

cyg_mdns_build_strtab_vector — Build vector of pointers to individual encoded string fields

Synopsis

#include <mdns.h>

cyg_uint8 cyg_mdns_build_strtab_vector(const cyg_uint8 *strtab, cyg_uint8 **labels, cyg_uint8 vlen);

Description

This helper function is used to construct a vector of the individual label fields present in the supplied, uncompressed, contiguous strtab string-table.

[Note]Note

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

If the passed labels value is NULL then the function counts the number of entries needed to hold pointers to the individual label field entries within the NUL-terminated string-table, so can be used to ascertain the size of vector needed for a specific encoded string. When labels is non-NULL the vlen parameter specifies the number of vector slots available to receive pointers into the strtab buffer for the individual label field entries. When populating the supplied labels vector a terminating NULL pointer is added.

This function is similar in operation to the cyg_mdns_build_txt_vector() function, so a similar approach it its example can be used to build and subsequently process a vector of pointers.

Return value

Returns a count of the number of fields within the referenced uncompressed encoded string.