ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/res.h
Revision: 32
Committed: Sun Oct 2 20:41:23 2005 UTC (19 years, 10 months ago) by knight
Content type: text/x-chdr
Original Path: ircd-hybrid/include/irc_res.h
File size: 2798 byte(s)
Log Message:
- svn:keywords

File Contents

# Content
1 /*
2 * include/irc_res.h for referencing functions in src/irc_res.c
3 *
4 * $Id$
5 */
6
7 #ifndef INCLUDED_irc_res_h
8 #define INCLUDED_irc_res_h
9
10 #include "listener.h"
11 #include "setup.h"
12
13 /* Here we define some values lifted from nameser.h */
14 #define NS_NOTIFY_OP 4
15 #define NS_INT16SZ 2
16 #define NS_IN6ADDRSZ 16
17 #define NS_INADDRSZ 4
18 #define NS_INT32SZ 4
19 #define NS_CMPRSFLGS 0xc0
20 #define NS_MAXCDNAME 255
21 #define QUERY 0
22 #define IQUERY 1
23 #define NO_ERRORS 0
24 #define SERVFAIL 2
25 #define T_A 1
26 #define T_AAAA 28
27 #define T_PTR 12
28 #define T_CNAME 5
29 #define T_NULL 10
30 #define C_IN 1
31 #define QFIXEDSZ 4
32 #define RRFIXEDSZ 10
33 #define HFIXEDSZ 12
34
35 struct DNSReply
36 {
37 char *h_name;
38 struct irc_ssaddr addr;
39 };
40
41 struct DNSQuery
42 {
43 #ifdef _WIN32
44 dlink_node node;
45 HANDLE handle;
46 char reply[MAXGETHOSTSTRUCT];
47 #endif
48 void *ptr; /* pointer used by callback to identify request */
49 void (*callback)(void* vptr, struct DNSReply *reply); /* callback to call */
50 };
51
52 typedef struct
53 {
54 unsigned id :16; /* query identification number */
55 #ifdef WORDS_BIGENDIAN
56 /* fields in third byte */
57 unsigned qr: 1; /* response flag */
58 unsigned opcode: 4; /* purpose of message */
59 unsigned aa: 1; /* authoritive answer */
60 unsigned tc: 1; /* truncated message */
61 unsigned rd: 1; /* recursion desired */
62 /* fields in fourth byte */
63 unsigned ra: 1; /* recursion available */
64 unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
65 unsigned ad: 1; /* authentic data from named */
66 unsigned cd: 1; /* checking disabled by resolver */
67 unsigned rcode :4; /* response code */
68 #else
69 /* fields in third byte */
70 unsigned rd :1; /* recursion desired */
71 unsigned tc :1; /* truncated message */
72 unsigned aa :1; /* authoritive answer */
73 unsigned opcode :4; /* purpose of message */
74 unsigned qr :1; /* response flag */
75 /* fields in fourth byte */
76 unsigned rcode :4; /* response code */
77 unsigned cd: 1; /* checking disabled by resolver */
78 unsigned ad: 1; /* authentic data from named */
79 unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
80 unsigned ra :1; /* recursion available */
81 #endif
82 /* remaining bytes */
83 unsigned qdcount :16; /* number of question entries */
84 unsigned ancount :16; /* number of answer entries */
85 unsigned nscount :16; /* number of authority entries */
86 unsigned arcount :16; /* number of resource entries */
87 } HEADER;
88
89 extern void init_resolver(void);
90 extern void restart_resolver(void);
91 extern void delete_resolver_queries(const struct DNSQuery *);
92 extern void report_dns_servers(struct Client *);
93 extern void gethost_byname_type(const char *, struct DNSQuery *, int);
94 extern void gethost_byname(const char *, struct DNSQuery *);
95 extern void gethost_byaddr(const struct irc_ssaddr *, struct DNSQuery *);
96 extern void add_local_domain(char *, size_t);
97
98 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Revision