|const struct sockaddr * addressPtr,|
|char * hostname,|
|char * serviceName,|
Translates an address into itâs corresponding nodename (hostname). Similar to tfDnsGetHostByAddr(). Retrieving a service name or port number is not supported in our implementation of getnameinfo(), so serviceName must be set to NULL.
Like all of the other DNS functions, getnameinfo can be used in non-blocking mode by specifying TM_BLOCKING_OFF when tfDnsInit() is called. In non-blocking mode, getnameinfo may return TM_EWOULDBLOCK. This indicates that the operation is in progress. Continue to call getnameinfo() until a value other than TM_EWOULDBLOCK is returned, which indicates that the operation is complete. For example code using getnameinfo(), please see the examples/txdns.c file.
- Pointer to address to translate.
- Length of address structure.
- Buffer to copy nodename into on completion.
- Size of hostname buffer.
- Not used.
- Not used.
- Hostname info retrieved successfully.
- DNS request failed â requests to DNS server timed out.
- No route to DNS server.
- Indicates that an operation is currently in progress and has not yet completed. Only returned in non-blocking mode. (see above)
- NI_NUMERICHOST flag was set, but couldnât convert binary address into string.
- Unrecognized or unsupported address family.
- Memory allocation failure
- Non-recoverable error occurred.
- No entry found for this address.
- Error from DNS server: Format error. The name server was unable to interpret the query.
- Error from DNS server: Server failure. The name server was unable to process this query due to a problem with the name server.
- Error from DNS server: Name error. Meaningful only for responses from an authoritative name server, this code signifies that the domain name referenced in the query does not exist.
- Error from DNS server: Not implemented. The name server does not support the requested kind of query.
- Error from DNS server: Refused. The name server refuses to perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.
- No answer received from name server (i.e., response packet received, but it did not contain the answer to our query).
- Treck was unable to successfully allocate a socket for the DNS request. This could indicate Treck did not have the resources to allocate another socket. It could also be due to Treck hitting the limit of sockets set by TM_DNS_MAX_SOCKETS_ALLOWED or the tfDnsSetOption() option: TM_DNS_OPTION_MAX_SOCKETS_ALLOWED.