From 7421476de661d45b44e9c6a0ec5b2b37ab90afa8 Mon Sep 17 00:00:00 2001 From: Samuel Jero Date: Tue, 5 Feb 2013 22:10:09 -0500 Subject: [PATCH] Switch debug (-d) flag to a verbose (-v) flag --- README | 4 ++-- dccp2tcp.c | 24 ++++++++++-------------- dccp2tcp.pod | 6 +++--- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/README b/README index f811a85..b771de8 100644 --- a/README +++ b/README @@ -16,8 +16,8 @@ from http://www.tcptrace.org and the version of xplot available from http://www. Usage is pretty simple: -dccp2tcp dccp_file tcp_file [-d] [-V] [h] [-y] [-g] [-s] - -d is debug +dccp2tcp dccp_file tcp_file [-v] [-V] [h] [-y] [-g] [-s] + -v is verbose. Repeat for additional verbosity. -V is Version information -h is help -y shifts the window line in tcptrace (yellow) to the highest received acknowledgment. Normally this line is just a constant amount more than the ack number(i.e. useless). diff --git a/dccp2tcp.c b/dccp2tcp.c index afe462f..caa7d6a 100644 --- a/dccp2tcp.c +++ b/dccp2tcp.c @@ -90,23 +90,20 @@ int main(int argc, char *argv[]) } } }else{ - if(argv[i][1]=='d' && strlen(argv[i])==2){ /* -d */ + if(argv[i][1]=='v' && strlen(argv[i])==2){ /* -v */ debug++; - } - if(argv[i][1]=='y' && strlen(argv[i])==2){ /* -y */ + }else if(argv[i][1]=='y' && strlen(argv[i])==2){ /* -y */ yellow=1; - } - if(argv[i][1]=='g' && strlen(argv[i])==2){ /* -g */ + }else if(argv[i][1]=='g' && strlen(argv[i])==2){ /* -g */ green=1; - } - if(argv[i][1]=='s' && strlen(argv[i])==2){ /* -s */ + }else if(argv[i][1]=='s' && strlen(argv[i])==2){ /* -s */ sack++; - } - if(argv[i][1]=='h' && strlen(argv[i])==2){ /* -h */ + }else if(argv[i][1]=='h' && strlen(argv[i])==2){ /* -h */ usage(); - } - if(argv[i][1]=='V' && strlen(argv[i])==2){ /* -V */ + }else if(argv[i][1]=='V' && strlen(argv[i])==2){ /* -V */ version(); + }else{ + usage(); } } } @@ -118,7 +115,6 @@ int main(int argc, char *argv[]) /*all options validated*/ if(debug){ - dbgprintf(1,"Debug On\n"); if(green){ dbgprintf(1,"Tcptrace green line at highest acknowledgment\n"); }else{ @@ -1229,8 +1225,8 @@ void version() /*Usage information for program*/ void usage() { - dbgprintf(0,"Usage: dccp2tcp [-d] [-h] [-V] [-y] [-g] [-s] dccp_file tcp_file\n"); - dbgprintf(0, " -d Debug. May be repeated for aditional verbosity.\n"); + dbgprintf(0,"Usage: dccp2tcp [-v] [-h] [-V] [-y] [-g] [-s] dccp_file tcp_file\n"); + dbgprintf(0, " -v verbose. May be repeated for additional verbosity.\n"); dbgprintf(0, " -V Version information\n"); dbgprintf(0, " -h Help\n"); dbgprintf(0, " -y Yellow line is highest ACK\n"); diff --git a/dccp2tcp.pod b/dccp2tcp.pod index 51a891c..034c939 100644 --- a/dccp2tcp.pod +++ b/dccp2tcp.pod @@ -4,7 +4,7 @@ dccp2tcp - convert DCCP packet captures to TCP captures for analysis with B [-d] [-V] [-h] [-y] [-g] [-s] I I +B [-v] [-V] [-h] [-y] [-g] [-s] I I =head1 DESCRIPTION @@ -22,9 +22,9 @@ if you attempt to process a connection with short sequence numbers. =over 5 -=item B<-d> +=item B<-v> -Debug, repeat for additional verbosity +Verbose, repeat for additional verbosity =item B<-V> -- 2.39.2