Developer

API Reference

IDNS_ParseDomain()

Brew Release
Brew MP 1.0.2
See Also
Description
This function converts a DNS representation of a domain name into a zero-terminated string with dot (that is, period, or ".") delimiters.
Parameters
  • pIDNS
    []:
    The IDNS interface pointer.
  • pbyDomain
    []:
    A pointer to the start of the domain name. This pointer must point into the DNS response data as described by an AEEDNSItem record. This can be used to decode pbyDomain values, or to decode values within the pbyData[] array.
  • pcb
    []:
    A pointer to value to hold the number of bytes occupied by the domain name (in the source byte array, not in the resulting string). In the case of a mal-formed domain name, *pcb will be set to zero. If pcb==NULL, it will be ignored.
Interface
Prototype
char *IDNS_ParseDomain(IDNS *pIDNS, const byte *pbyDomain, int *pcb);
Return
This function returns a zero-terminated string giving the host name, or NULL on failure.
Domain names are returned in dotted notation, with no terminating dot character at the end.
Failure could be due to an allocation failure or a mal-formed domain name; *pcb can be used to distinguish between the two.
Side Effect
None.
Comment
Returned strings do not include terminating dots, which usually indicate fully qualified domain names, because all domains are treated as fully qualified by IDNS. An empty domain is returned as an empty string ("") instead of a single dot (".").
  • Follow