tfDnsSetUserOption

Jump to: navigation, search

Table of Contents >> Application Reference >> DNS Resolver


#include <trsocket.h>


int tfDnsSetUserOption (
int optionType,
void * optionValuePtr,
int optionLen
);


Function Description

This function sets various DNS options, which are outlined below. All of the options supported by tfDnsSetOption are also supported here as well.


Parameters

  • optionType
    Option to configure. See list of valid options below.
  • optionValuePtr
    Pointer to appropriate data type containing the new value for this option. See list of data types below.
  • optionLen
    The size of the data type pointed to by optionValuePtr.


Option Data Type Description
TM_DNS_OPTION_RETRIES int Maximum number of times to re-transmit a DNS request. If there is more than one server, a re-transmission occurs after all servers have been queried.
TM_DNS_OPTION_CACHE_SIZE int Maximum number of entries in the DNS cache. The cache contains both completed and ongoing DNS resolution attempts. This value must be greater than zero.
TM_DNS_OPTION_TIMEOUT int Amount of time (in seconds) to wait before retransmitting a DNS request (value used if there only one server.) - Default value is 5.
TM_DNS_OPTION_MIN_TIMEOUT int Amount of time (in seconds) to wait before retransmitting a DNS request (value used if there is more than one server.) - Default value is 4.
TM_DNS_OPTION_CACHE_TTL ttUser32Bit The maximum amount of time to keep a DNS response in the cache. Note: This value only affects new entries as they are added to the cache – existing entries will not be changed.
TM_DNS_OPTION_MAX_SOCKETS_ALLOWED ttUser32Bit The maximum number of sockets that can be opened for outstanding DNS requests.
TM_DNS_OPTION_BINDTODEVICE char * With this option, the user may now bind the DNS sockets to a specific device. The user may create this binding by passing a valid interface name (char *) as the optionValuePtr. The user may remove this binding by passing a NULL string ("") as the optionValuePtr parameter. This requires TM_USE_STRONG_ESL.


Returns

  • TM_EINVAL
    The optionValue was invalid.
  • TM_ENOPROTOOPT
    The optionType was invalid.
  • TM_ENOERROR
    Success.


Table of Contents >> Application Reference >> DNS Resolver