Dolda2000 GitWeb
/
icmp-dn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Honor the `nocache' config option.
[icmp-dn.git]
/
idnlookup.c
diff --git
a/idnlookup.c
b/idnlookup.c
index
43518ef
..
be4809b
100644
(file)
--- a/
idnlookup.c
+++ b/
idnlookup.c
@@
-73,11
+73,13
@@
void printdn(FILE *f, unsigned char *dnbuf, size_t size)
fprintf(stderr, "domain name decompression not implemented, aborting\n");
exit(1);
}
fprintf(stderr, "domain name decompression not implemented, aborting\n");
exit(1);
}
-
printf("%.*s.
", (int)*p, p + 1);
+
fprintf(f, "%.*s
", (int)*p, p + 1);
p += 1 + (int)*p;
p += 1 + (int)*p;
+ if(*p != 0)
+ fprintf(f, ".");
}
p++;
}
p++;
-
printf(
"\n");
+
fprintf(f,
"\n");
}
}
}
}
@@
-134,14
+136,19
@@
int main(int argc, char **argv)
struct pollfd pfd;
struct timeval tvb, tvc;
struct sockaddr_storage name;
struct pollfd pfd;
struct timeval tvb, tvc;
struct sockaddr_storage name;
- int timeout, elapsed;
+ int timeout, dispttl;
+ int elapsed;
timeout = 3000;
timeout = 3000;
- while((c = getopt(argc, argv, "ht:")) != -1) {
+ dispttl = 0;
+ while((c = getopt(argc, argv, "hTt:")) != -1) {
switch(c) {
case 't':
timeout = atoi(optarg);
break;
switch(c) {
case 't':
timeout = atoi(optarg);
break;
+ case 'T':
+ dispttl = 1;
+ break;
case 'h':
case '?':
case ':':
case 'h':
case '?':
case ':':
@@
-234,6
+241,8
@@
int main(int argc, char **argv)
}
}
}
}
+ if(dispttl)
+ printf("%i\n", ntohl(rep.ttl));
printdn(stdout, buf + sizeof(iphdr) + sizeof(rep), ret - sizeof(iphdr) - sizeof(rep));
close(s);
printdn(stdout, buf + sizeof(iphdr) + sizeof(rep), ret - sizeof(iphdr) - sizeof(rep));
close(s);