From e7a7293bee542cb88ed0b4f00123407fd14a0aa9 Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Wed, 10 Jul 2013 20:02:45 +0000 Subject: [PATCH] Add -L option to allow adjustment of original frame length. This change was motivated by a question on ask where the user currently has to jump through hoops to accomplish the same thing which can now be done in 1 step via: editcap -T wpan -C 16 -L -F libpcap test.pcap test_wpan.pcap I thought it would be useful enough for others as well. Ref: http://ask.wireshark.org/questions/22689/problems-with-editcap-and-wpan-encapsulation-option svn path=/trunk/; revision=50491 --- doc/editcap.pod | 7 ++ editcap.c | 228 ++++++++++++++++++++++++++---------------------- 2 files changed, 132 insertions(+), 103 deletions(-) diff --git a/doc/editcap.pod b/doc/editcap.pod index 0204cd8855..e30424cd89 100644 --- a/doc/editcap.pod +++ b/doc/editcap.pod @@ -14,6 +14,7 @@ S<[ B<-E> Eerror probabilityE ]> S<[ B<-F> Efile formatE ]> S<[ B<-h> ]> S<[ B<-i> Eseconds per fileE ]> +S<[ B<-L> ]> S<[ B<-r> ]> S<[ B<-s> EsnaplenE ]> S<[ B<-S> Estrict time adjustmentE ]> @@ -150,6 +151,12 @@ be created with a suffix -nnnnn, starting with 00000. If packets for the specifi time interval are written to the output file, the next output file is opened. The default is to use a single output file. +=item -L + +Adjust the original frame length accordingly when chopping and/or snapping +(in addition to the captured length, which is always adjusted regardless of +whether B<-L> is specified or not). See also B<-C > and B<-s >. + =item -r Reverse the packet selection. diff --git a/editcap.c b/editcap.c index 34a1509bed..0080e536f2 100644 --- a/editcap.c +++ b/editcap.c @@ -734,6 +734,7 @@ usage(gboolean is_error) fprintf(output, " -C chop each packet by bytes. Positive values\n"); fprintf(output, " chop at the packet beginning, negative values at the\n"); fprintf(output, " packet end.\n"); + fprintf(output, " -L adjust the frame length when chopping and/or snapping\n"); fprintf(output, " -t