It is possible to not use the default DNS configuration when resolving a specific host such as specifying a particular DNS server, different number of request retry and so on. When calling DNSc_GetHost() it is possible to specify a request configuration in the parameter p_cfg.
µC/DNSc request configuration is based on a structure that contains different configuration sections with many parameter settings.This section describes the request configuration settings, and should provide you an in-depth understanding of all parameters configuration. You will also discover which settings to modify in order to enhance the functionalities. Refer to the configuration field description section for further details.
Request Configuration
µC/DNS use the following structure to configure request:
typedef struct DNSc_req_cfg { DNSc_ADDR_OBJ *ServerAddrPtr; NET_PORT_NBR ServerPort; CPU_INT16U TaskDly_ms; CPU_INT16U ReqTimeout_ms; CPU_INT08U ReqRetry; } DNSc_REQ_CFG;
Structure Fields
Structure Field | Type | Description | Possible Values |
---|---|---|---|
ServerAddrPtr | CPU_CHAR | Server IP address | DEF_NULL to use the default server Pointer to a string that contains the IP address. |
ServerPort | NET_PORT_NBR | Port number | NET_PORT_NBR_NONE Default DNS port MUST be >= NET_PORT_NBR_MIN Must be <= NET_PORT_NBR_MAX |
TaskDly_ms | CPU_INT16U | Configure task delay in integer milliseconds | Default value: [DNSc_DFLT_TASK_DLY_MS] = 50ms MUST be >= 1 |
ReqTimeout_ms | CPU_INT16U | Configure timeout before a request resolution retry | Default value: [DNSc_DFLT_REQ_RETRY_TIMEOUT_MS] = 1000ms MUST be >= 100 |
ReqRetry | CPU_INT08U | Configure maximum of request resolution retry. | Default value: [DNSc_DFLT_REQ_RETRY_NBR_MAX] = 2 MUST be >= 1 |