Usermode/utests - Fix DNS utest, update libc utests to new format (no more EXP files)
[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 = 1,
30         CLASS_CH = 3,   // "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  * \return Non-zero terminates parsing
43  */
44 typedef int     handle_record_t(void *info, const char *name, enum eTypes type, enum eClass class, unsigned int ttl, size_t rdlength, const void *rdata);
45
46 int DNS_Query(int ServerAType, const void *ServerAddr, const char *name, enum eTypes type, enum eClass class, handle_record_t* handle_record, void *info);
47
48 #endif
49

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