62204f0513d2399b6dd8ae5e0f738dc6cab79f4c
[tpg/acess2.git] / Usermode / Libraries / libnet.so_src / include / dns.h
1 /*
2  * Acess2 Networking Toolkit
3  * By John Hodge (thePowersGang)
4  * 
5  * dns.h
6  * - DNS Protocol Interface
7  */
8 #ifndef _DNS_H_
9 #define _DNS_H_
10
11 #include <stddef.h>
12
13 enum eTypes
14 {
15         TYPE_A = 1,
16         TYPE_NS = 2,
17         TYPE_CNAME = 5,
18         TYPE_SOA = 6,
19         TYPE_NULL = 10,
20         TYPE_PTR = 12,
21         TYPE_HINFO = 13,
22         TYPE_MX = 15,
23         TYPE_TXT = 16,
24         QTYPE_STAR = 255,
25 };
26
27 enum eClass
28 {
29         CLASS_IN,
30         CLASS_CH,       // "Chaos"
31         QCLASS_STAR = 255,
32 };
33
34 /**
35  * \brief Handler for a DNS record obtained by DNS_Query
36  * \param info  Value passed as the last argument to DNS_Query
37  * \param name  NUL-terminated name associated with the returned record
38  * \param type  Record type (may not be equal to requested)
39  * \param class Record class (may not be equal to requested)
40  * \param rdlength      Length of data pointed to by 'rdata'
41  * \param rdata Record data
42  */
43 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);
44
45 int DNS_Query(int ServerAType, const void *ServerAddr, const char *name, enum eTypes type, enum eClass class, handle_record_t* handle_record, void *info);
46
47 #endif
48

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