1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
--- resolver-test.cpp.orig Mon Jun 7 08:37:17 2004
+++ resolver-test.cpp Tue Jul 6 16:16:12 2004
@@ -1,12 +1,15 @@
-#include "resolver.hh"
+#include <sys/param.h>
+
#include <assert.h>
+
+#include "resolver.hh"
/*
Originally Written by John MacPherson <jrm21@cs.waikato.ac.nz>
*/
// grrr... stupid intel little endian!
-#define dottedquad(a,b,c,d) (a) + (b << 8) + (c << 16) + (d << 24);
+#define dottedquad(a,b,c,d) htonl((d) + (c << 8) + (b << 16) + (a << 24));
int main(void) {
@@ -32,16 +35,16 @@
}
/* Use Root Servers because they are unlikey to change IP */
- i.s_addr = dottedquad(128,9,0,107);
+ i.s_addr = dottedquad(192,228,79,201);
t = r.get_name(i);
if (t) {
if (strcasecmp(t, "b.root-servers.net")!=0) {
- fprintf(stderr, "FAILED: 128.9.0.107 resolves to %s"
+ fprintf(stderr, "FAILED: 192.228.79.201 resolves to %s"
" expected b.root-servers.net please check "
"your resolver!\n", t);
}
} else {
- fprintf(stderr, "FAILED: Unable to resolve 128.9.0.107\n");
+ fprintf(stderr, "FAILED: Unable to resolve 192.228.79.201\n");
}
i.s_addr = dottedquad(192,203,230,10);
|