cyg_mdns_name_uncompress — Uncompress encoded string


#include <mdns.h>

cyg_uint16 cyg_mdns_name_uncompress(char *dst, cyg_uint16 dstlimit, struct pbuf *p, cyg_uint16 index, cyg_bool raw);


This function is used to build a copy of the Resource Record encoded string in the supplied destination buffer. The p pointer references a lwIP packet buffer containing the encoded string to be processed at the given index offset within the packet. If the supplied dst pointer is NULL then the function does not copy the data, but can be used to step over an encoded string. When dst is not-NULL then the dstlimit value defines the amount of space available in the destination buffer. When copying the function will not copy more than dstlimit characters.

When the boolean raw parameter is true, the function will copy the uncompressed individual fields to the destination buffer, still using the encoded string style (length byte followed by UTF-8 character data). Whereas raw=false will build a '.' separated name in the destination buffer.

Return value

The return value is the lwIP packet buffer index for the first data byte after the encoded string.