diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-12-12 02:56:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-12-12 02:56:35 +0000 |
commit | abc1304aef4b27d3bae85adc9a82163aea069318 (patch) | |
tree | c8473ac81546444265fea7bd833b1f90e6870aa8 /src/or/eventdns.c | |
parent | fc125b1ef4fbd630da542b78078ddeb17104a370 (diff) | |
download | tor-abc1304aef4b27d3bae85adc9a82163aea069318.tar.gz tor-abc1304aef4b27d3bae85adc9a82163aea069318.zip |
r11494@Kushana: nickm | 2006-12-11 14:50:20 -0500
Export DNS types and classes in eventdns.h so that server code can use them.
svn:r9083
Diffstat (limited to 'src/or/eventdns.c')
-rw-r--r-- | src/or/eventdns.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c index a7b85d998b..84b4a3fb51 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -317,12 +317,11 @@ typedef unsigned int uint; #define MAX_ADDRS 4 // maximum number of addresses from a single packet // which we bother recording -#define TYPE_A 1 -#define TYPE_CNAME 5 -#define TYPE_PTR 12 -#define TYPE_AAAA 28 +#define TYPE_A EVDNS_TYPE_A +#define TYPE_PTR EVDNS_TYPE_PTR +#define TYPE_AAAA EVDNS_TYPE_AAAA -#define CLASS_INET 1 +#define CLASS_INET EVDNS_CLASS_INET struct request { u8 *request; // the dns packet data @@ -2916,15 +2915,15 @@ evdns_server_callback(struct evdns_server_request *req, void *data) /* dummy; give 192.168.11.11 as an answer for all A questions. */ for (i = 0; i < req->nquestions; ++i) { u32 ans = htonl(0xc0a80b0bUL); - if (req->questions[i]->type == TYPE_A && - req->questions[i]->class == CLASS_INET) { + if (req->questions[i]->type == EVDNS_TYPE_A && + req->questions[i]->class == EVDNS_CLASS_INET) { printf(" -- replying for %s (A)\n", req->questions[i]->name); r = evdns_request_add_a_reply(req, req->questions[i]->name, 1, &ans, 10); if (r<0) printf("eeep, didn't work.\n"); - } else if (req->questions[i]->type == TYPE_PTR && - req->questions[i]->class == CLASS_INET) { + } else if (req->questions[i]->type == EVDNS_TYPE_PTR && + req->questions[i]->class == EVDNS_CLASS_INET) { printf(" -- replying for %s (PTR)\n", req->questions[i]->name); r = evdns_request_add_ptr_reply(req, NULL, req->questions[i]->name, "foo.bar.example.com", 10); |