Usermode/libnet - Starting work on DNS resolver
[tpg/acess2.git] / Usermode / Libraries / libnet.so_src / include / dns.h
1 /*
2  */
3 #ifndef _DNS_H_
4 #define _DNS_H_
5
6 enum eTypes
7 {
8         TYPE_A = 1,
9         TYPE_NS = 2,
10         TYPE_CNAME = 5,
11         TYPE_SOA = 6,
12         TYPE_NULL = 10,
13         TYPE_PTR = 12,
14         TYPE_HINFO = 13,
15         TYPE_MX = 15,
16         TYPE_TXT = 16,
17         QTYPE_STAR = 255,
18 };
19
20 enum eClass
21 {
22         CLASS_IN,
23         CLASS_CH,       // "Chaos"
24         CLASS_STAR = 255,
25 };
26
27 /**
28  * \brief Handler for a DNS record obtained by DNS_Query
29  * \param info  Value passed as the last argument to DNS_Query
30  * \param name  NUL-terminated name associated with the returned record
31  * \param type  Record type (may not be equal to requested)
32  * \param class Record class (may not be equal to requested)
33  * \param rdlength      Length of data pointed to by 'rdata'
34  * \param rdata Record data
35  */
36 typedef void    handle_record_t(void *info, const char *name, enum eTypes type, enum eClass class, unsigned int ttl, size_t rdlength, const void *rdata);
37
38 int DNS_Query(int ServerAType, const void *ServerAddr, const char *name, enum eTypes type, enum eClass class, handle_record_t* handle_record, void *info);
39
40 #endif
41

UCC git Repository :: git.ucc.asn.au