1 --- /home/uwe/djbdns-1.05/server.c Sun Feb 11 21:11:45 2001
2 +++ ./server.c Fri May 4 07:40:54 2001
7 +static uint64 stats_numq;
8 +static uint64 stats_plus;
9 +static uint64 stats_minus;
10 +static uint64 stats_nx;
11 +static uint64 stats_notimp;
12 +static uint64 stats_weird;
13 +static uint64 stats_noq;
15 +/* work around gcc 2.95.2 bug */
16 +#define number(x) ( (u64 = (x)), u64_print() )
18 +static void u64_print(void)
26 + ubuf[--pos] = '0' + (u64 % 10);
30 + buffer_put(buffer_2,ubuf + pos,sizeof ubuf - pos);
33 +static void string(const char *s)
35 + buffer_puts(buffer_2,s);
38 +static void line(void)
41 + buffer_flush(buffer_2);
44 +static void log_stats(void)
47 + number(stats_numq); string(" ");
48 + number(stats_plus); string(" ");
49 + number(stats_minus); string(" ");
50 + number(stats_nx); string(" ");
51 + number(stats_notimp); string(" ");
52 + number(stats_weird); string(" ");
65 if (len >= sizeof buf) goto NOQ;
66 pos = dns_packet_copy(buf,len,0,header,12); if (!pos) goto NOQ;
69 case_lowerb(q,dns_domain_length(q));
70 if (!respond(q,qtype,ip)) {
72 qlog(ip,port,header,q,qtype," - ");
75 - qlog(ip,port,header,q,qtype," + ");
77 + if ((response[2] & 4) && (response[3] & 3)) {
79 + qlog(ip,port,header,q,qtype," N ");
83 + qlog(ip,port,header,q,qtype," + ");
91 qlog(ip,port,header,q,qtype," I ");
98 qlog(ip,port,header,q,qtype," C ");
103 qlog(ip,port,"\0\0","","\0\0"," / ");
110 + unsigned char flag=0;
115 buffer_putsflush(buffer_2,starting);
118 + if ((flag++)%32==1)
120 len = socket_recv4(udp53,buf,sizeof buf,ip,&port);
121 if (len < 0) continue;
122 if (!doit()) continue;