| b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | /** | 
 | 2 |  *@file     quectel_nslookup.h | 
 | 3 |  *@date     2017-07-05 | 
 | 4 |  *@author   running.qian | 
 | 5 |  *@brief    Simple DNS Reslove | 
 | 6 |  */ | 
 | 7 | #ifndef _QUECTEL_NSLOOKUP_H_ | 
 | 8 | #define _QUECTEL_NSLOOKUP_H_ | 
 | 9 |  | 
 | 10 | #include <arpa/inet.h> | 
 | 11 |  | 
 | 12 | typedef enum  { | 
 | 13 |     QUERY_IPV4_E, | 
 | 14 |     QUERY_IPV6_E | 
 | 15 | } QUERY_IP_TYPE; | 
 | 16 |  | 
 | 17 |  | 
 | 18 | typedef struct { | 
 | 19 |     int addr_cnt;//must be set 0 when call QL_nslookup  | 
 | 20 |     struct in_addr addr[5]; | 
 | 21 |      | 
 | 22 |     int addr6_cnt;//must be set 0 when call QL_nslookup | 
 | 23 |     struct in6_addr addr6[5]; | 
 | 24 | } hostaddr_info_u; | 
 | 25 |  | 
 | 26 | /** | 
 | 27 |  * Perform a DNS query by sending a packet | 
 | 28 |  */ | 
 | 29 | void ql_nslookup(char *host, char *dns_server_ip, QUERY_IP_TYPE ip_type, hostaddr_info_u *resolved_addr); | 
 | 30 | #endif |