From e172b003e179ce9b70459eadbef8a73a4f218e0e Mon Sep 17 00:00:00 2001 From: "fredrik@DOLDA2000.COM" Date: Fri, 29 Apr 2005 02:56:48 +0000 Subject: [PATCH] Added -T to display the TTL. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/icmp-dn@219 959494ce-11ee-0310-bf91-de5d638817bd --- idnlookup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/idnlookup.c b/idnlookup.c index 27b26fd..be4809b 100644 --- a/idnlookup.c +++ b/idnlookup.c @@ -136,14 +136,19 @@ int main(int argc, char **argv) struct pollfd pfd; struct timeval tvb, tvc; struct sockaddr_storage name; - int timeout, elapsed; + int timeout, dispttl; + int elapsed; 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; + case 'T': + dispttl = 1; + break; case 'h': case '?': case ':': @@ -236,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); -- 2.11.0