2 * (c) Oleg Puchinin 2006-2008
3 * graycardinalster@gmail.com
10 #ifndef DEFINE_GCLIB2_H
14 #ifndef DEFINE_DNS_INTERNALS_H
28 void set_timeout (int sec
) ;
31 char * A (char *host
) ;
32 char * async_A (char *host
, dns_query
** qRet
= NULL
) ;
33 char * MX (char *host
) ;
34 char * async_MX (char *IP
, dns_query
** qRet
= NULL
) ;
35 char * ip2name (char *IP
) ;
36 char * async_ip2name (char *IP
, dns_query
** qRet
= NULL
) ;
39 char * bestServer () ;
40 dns_query
* query_async (uint16_t flags
, uint16_t dr_type
, uint16_t dr_class
, char * host
) ;
41 List
* query_sync(uint16_t flags
, uint16_t dr_type
, uint16_t dr_class
, char * host
,
42 char ** d_resp
= NULL
, int *d_resp_len
= NULL
) ;
43 dns_reply
* scan (List
*list
, uint16_t dr_type
, uint16_t dr_class
) ;
44 __dlist_entry_t
* inquiries_scan (char * host
, uint16_t dr_type
, uint16_t dr_class
) ;
45 dns_reply
* bestMXReply (List
* list
) ;
46 char * __name2dns (char *name
, int *len
) ;
47 char * __ddup (char * ptr
, unsigned char ch
) ;
48 char * __dns_rd_chunk (DPBuf
* p
, char ** ptr
, char * done
) ;
49 char * __dns_resp_domain (DPBuf
* p
, char * domain
, char **domain_end
) ;
50 char * make_dns_pkt (uint16_t id
, uint16_t flags
, uint16_t d_type
,
51 uint16_t d_class
, char * domain
, int *len
) ;
52 List
* resp_split (dns_header
*hdr
, char *pkt
, int len
) ;
53 void resp_clean (List
* list
) ;
54 char * ip2arpa (char *IP
) ;
55 void clean_query (dns_query
* q
) ;
65 __export
int dns_init () ;
66 __export
char * dns_A (char *host
) ;
67 __export
char * dns_async_A (char *host
, dns_query
** qRet
= NULL
) ;
68 __export
char * dns_MX (char *host
) ;
69 __export
char * dns_async_MX (char *IP
, dns_query
** qRet
= NULL
) ;
70 __export
char * dns_ip2name (char *IP
) ;
71 __export
char * dns_async_ip2name (char *IP
, dns_query
** qRet
= NULL
) ;
72 __export
void dns_clean () ;
73 __export
int dns_get_socket () ;
74 dns_query
* dns_loop () ;