25#ifndef __TUYA_BASE_UNI_DNS_CACHE_H__
26#define __TUYA_BASE_UNI_DNS_CACHE_H__
28#include "tuya_iot_config.h"
29#include "tuya_cloud_types.h"
42#define MAX_DOMAIN_NAME_LEN 128
48#if defined(TLS_MODE) && (TLS_MODE!=TLS_DISABLE)
49#if defined(TLS_MODE) && ( (TLS_MODE==TLS_TUYA_PSK_ONLY) || (TLS_MODE==TLS_TUYA_ECC_PSK) )
51#define HTTP_DNS_SERVER_DOMAIN "h3.iot-dns.com"
52#define HTTP_DNS_SERVER_DOMAIN_WE "h3-we.iot-dns.com"
53#elif defined(TLS_MODE) && (TLS_MODE==TLS_TUYA_ECC_CLIENT_AUTH)
55#define HTTP_DNS_SERVER_DOMAIN "h4.iot-dns.com"
56#define HTTP_DNS_SERVER_DOMAIN_WE "h4-we.iot-dns.com"
59#define HTTP_DNS_SERVER_DOMAIN "h2.iot-dns.com"
60#define HTTP_DNS_SERVER_DOMAIN_WE "h2-we.iot-dns.com"
64#error "tls mode must be set."
72#define E_REGION_DYNAMIC 0
86#define DNS_PRIO_REGION 0
87#define DNS_PRIO_RANDOM 1
88#define DNS_PRIO_SYSTEM 2
DNS entry info
Definition: uni_network.h:95
Common process - Initialization
OPERATE_RET unw_clear_dns_cache(CONST CHAR_T *domain)
clear the specific domain dns cache
OPERATE_RET unm_set_dns_cache_priority(TY_DNS_PRIO_T dns_prio)
set the dns priority
OPERATE_RET unw_gethostbyname(CONST CHAR_T *domain, UNW_IP_ADDR_T *addr)
get the domain ip address info by the domain name
UINT_T REGION_E
each TLS MODE have specific iot-dns domain name
Definition: uni_network.h:71
OPERATE_RET unm_set_dns_region(REGION_E region)
set the dns current region
OPERATE_RET unw_clear_all_dns_cache(VOID)
clean all dynamic dns cache
TY_DNS_PRIO_T unm_get_dns_cache_priority(VOID)
get the dns current priority
OPERATE_RET unw_init_dns_cache(VOID)
init the dns module
VOID unm_lower_dns_cache_priority(VOID)
decrease the dns current priority
UINT_T TY_DNS_PRIO_T
DNS priority
Definition: uni_network.h:85
OPERATE_RET unw_connect_to_domain(INT_T *sockfd, CHAR_T *hostname, UINT16_T port, UINT_T retry_cnt, UINT_T timeout)
connect to a domain with specific tcp port
OPERATE_RET unw_add_dns_cache(CONST CHAR_T *domain, CONST UNW_IP_ADDR_T ip)
add dns information to dynamic dns cache