tfGetHostRecord
Table of Contents >> Application Reference >> DNS Resolver
| #include <trsocket.h> |
| int tfGetHostRecord | ( |
| int index, | |
| char TM_FAR * hostnameStr, | |
| int hostnameStrLength, | |
| struct sockaddr_storage TM_FAR * addressPtr, | |
| int TM_FAR * addressFamilyPtr | |
| ); |
Function Description
Return the hostname, address and address family of the entry at index.
Parameters
- index
- Index of entry to retrieve; first entry is 1
- hostnameStr
- Pointer to buffer to receive the hostname
- hostnameStrLength
- Size of hostnameStr buffer
- addressPtr
- Pointer to buffer to receive the host address
- addressFamilyPtr
- Pointer to variable to receive the address family
Returns
- TM_ENOERROR
- Success.
- TM_EPERM
- Call tfDnsInit() first.
- TM_EINVAL
- One of the following:
- index is less than 1
- hostnameStr is NULL
- hostnameStrLenth is less than 1
- addressPtr is NULL
- addressFamilyPtr is NULL
- TM_ERANGE
- index is too large.
- TM_ENOSPC
- hostnameStrLength is less than the actual length of the hostname string (including null string terminator).