Commit Graph

90 Commits

Author SHA1 Message Date
Gerald Combs 4a7be0aaa7 doc: Update wiki URLs in man pages. 2020-09-17 14:18:43 -07:00
David Perry d24c9df384 editcap: add capture-file comments to output file
Add the `--capture-comment "comment"` option for appending pcapng
comments to the SHB of the output file(s).

Add the `--discard-capture-comment` option for removing pcapng comments
present in the input file SHB(s) before writing to the output file(s).

Supports multiple comments per SHB. Noted in the documentation that
Wireshark itself doesn't support multiple comments.

Bug: 15033
Change-Id: If07a4e7a93505438639018783a11343cd5992f2a
Reviewed-on: https://code.wireshark.org/review/38074
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-07 08:24:19 +00:00
David Perry 555b89492a editcap: support fractional seconds in -A/-B opts
Allow user to specify time resolutions as fine as 1 nanosecond for the
start and stop times (-A and -B options) for editcap. Uses `nstime_t`
for the user options and `nstime_cmp()` to compare with packet
timestamps.

Change-Id: I2340bc4830c7d9a6b17a5e53fa4e8837e231bcb6
Reviewed-on: https://code.wireshark.org/review/38057
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-05 21:32:45 +00:00
Dario Lombardo bb7014731c doc: add reordercap to editcap references.
Ping-Bug: 16231
Change-Id: Id4fb9bab7230561e64fcdc49c02bcb2016ed23e7
Reviewed-on: https://code.wireshark.org/review/35249
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-11-28 16:00:02 +00:00
Gerald Combs 8147af211d Editcap: Allow floating point split intervals.
Update the `-i` option to allow floating point values as suggested at
https://stackoverflow.com/questions/57004719/split-wireshark-to-miliseconds

Change-Id: I24028d409bc441ed3b45ac2179f7c42b2bc424bc
Reviewed-on: https://code.wireshark.org/review/33938
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-16 06:43:09 +00:00
Peter Wu 94b211977a Add support for embedding WireGuard keys in a pcapng file
pcapng spec update is here: https://github.com/pcapng/pcapng/pull/62

Bug: 15571
Change-Id: I2f1921b1da70ac0bab8c38dd5138a9dfe7843fea
Reviewed-on: https://code.wireshark.org/review/33300
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-17 00:48:29 +00:00
Guy Harris 28f49a0a9a Add --discard-all-secrets to remove decryption secrets.
Bug: 15435
Change-Id: I78503c9c31ab3eda39908b91dca3ef3fb9af34bf
Reviewed-on: https://code.wireshark.org/review/32100
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-19 09:57:52 +00:00
Peter Wu 079fbb8b82 editcap: document --inject-secrets in --help
Change-Id: Icc027f3c53e1da580c2e49042134b1075ad65cf2
Reviewed-on: https://code.wireshark.org/review/31666
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-22 04:58:53 +00:00
Jaap Keuter a58904f387 PCAP/PCAPNG: Be consistent in documentation, etc
1) The default build configuration is to select PCAPNG as
output format, but it can be selected as PCAP. Some of the
command line tools have the option to select the output
format and default towards the build configuration.
This has to be reflected in their help output also.

2) Various documentation files are still stating that PCAP is
the default format of various tools. With the default build
configuration being PCAPNG these have to be adjusted as well.
(with lack of dynamic content the documentation can only refer
to the default build configuration format).

Change-Id: I51d19642a7ed8c99817971c1f25d20972095021e
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/30951
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-07 06:00:14 +00:00
Peter Wu e2e0fd1dbd editcap: add --inject-secrets option
Add a new option to insert decryption secrets into a pcapng file.

Change-Id: I0e024585cac9a8a328e88d32f9eb03d37d350e2a
Ping-Bug: 15252
Reviewed-on: https://code.wireshark.org/review/30693
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20 05:13:37 +00:00
Nils Björklund 8332b718a2 editcap: add seed option
Implement a --seed option to be used in conjunction with -E. The option
allows the user to set the seed for the pseudo-random number generator,
which can be useful for recreating a particular sequence of errors.

Change-Id: Id427ab5fd7711652ad56c72271b2e0acb7380858
Reviewed-on: https://code.wireshark.org/review/29306
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-31 05:53:50 +00:00
Gerald Combs dfc7fcc815 Docs: Make our Pod documentation encoding uniform.
We've set "=encoding utf8" in wireshark.pod for a long time. Do so in
the rest of our .pod files.

Change-Id: I3ef0fb3a88ed63275b4ff4362b6afbf13d79a0bc
Reviewed-on: https://code.wireshark.org/review/29182
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-08-18 14:29:41 +00:00
Alexis Green 620fc587e4 editcap: Add ability to skip radiotap header.
This is useful when processing packets that were captured by multiple radios on the same channel.

Change-Id: I9dacc35294a4ed4e817014e563e7c9a54ee05e40
Reviewed-on: https://code.wireshark.org/review/28843
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-06 04:22:18 +00:00
Jaap Keuter b28b07379f editcap: handle too short frames in frame comparison
With option -I one can ignore the first number of bytes from the frame
while doing duplicate frame removal. This doesn't handle shorter frames
correctly. Add safeguards for this, and update the help text.

Bug: 13378
Change-Id: Ia6b65d0797f4069f0b89fa134114d88d80988211
Reviewed-on: https://code.wireshark.org/review/20004
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-02-08 22:31:43 +00:00
Alexis La Goutte 409914a143 doc: fix spelling-error-in-manpage found by lintian
Change-Id: I848159f0c960e0e8ece09c7c96dda6deb0ec6046
Reviewed-on: https://code.wireshark.org/review/13329
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-16 17:55:12 +00:00
Dario Lombardo 0b7d1611d0 editcap: add change offset.
This option skips some bytes when fuzzing, that prevents some headers from being changed. This focuses fuzzer to a smaller part of the packet.

Change-Id: I1db83235e93f2774a9991e3af70f633487b816fa
Reviewed-on: https://code.wireshark.org/review/9982
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-12 21:23:30 +00:00
Martin Mathieson 1141033884 editcap: add new option (-a) to help
Change-Id: Ic1a07e29d30d96bf1dd86e10b198c42dd9349838
Reviewed-on: https://code.wireshark.org/review/9198
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-29 02:41:54 +00:00
Herwin Weststrate 1df34d9a9c Typo fix in manpage of editcap
Positve => Positive

Change-Id: I09190b44783d8b7f4e8e90208d8a82d192a6a189
Reviewed-on: https://code.wireshark.org/review/7971
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-04-07 15:26:08 +00:00
kardam ba8617f040 Add -I option in editcap to extend Duplicate packet removal
Description:
Ignore the specified bytes number at the beginning of the frame during MD5 hash calculation.
Useful to remove duplicated packets taken on several routers or SW(differents mac addresses for example).
e.g. -I 26 in case of Ether/IP/ will ignore ether(14) and IP header(20 - 4(src ip) - 4(dst ip)).
The default value is 0.
This option is only relevant when used with -d|-D|-w

Bug: 8511
Change-Id: I009a09d32778a182b2d88f372651f658a4938882
Reviewed-on: https://code.wireshark.org/review/4104
Tested-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-20 18:11:35 +00:00
Gerald Combs 175039128a Update the doc directory to use https://www.wireshark.org.
Change-Id: I9bfc57cb6b6ab6962b80ff58d98eb351d6f69829
Reviewed-on: https://code.wireshark.org/review/4140
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-17 00:12:26 +00:00
Jeff Morriss 3773a7561c Add command-line argument to request the version to a number of the utilities.
In some cases "-v" was already used so "-V" is the option.
Note that the version information in these utilities is much shorter than what
is presented by the big programs.

As requested by https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5804

Bug: 5804
Change-Id: I35db35a4eace2797afd895f9be7322ef39928480
Reviewed-on: https://code.wireshark.org/review/2489
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 01:05:02 +00:00
Chris Maynard 9d49aa7dd7 Replace the simpler chop example with a more detailed example.
svn path=/trunk/; revision=51901
2013-09-09 21:32:03 +00:00
Chris Maynard fe4fc3cf51 Fix typo.
svn path=/trunk/; revision=51887
2013-09-09 19:43:37 +00:00
Chris Maynard 51ccb61256 Fix the "crossed chopping region" problem. Also, move chopping to its own function for both clarity and correctness since we need to compute chop offsets and lengths on a per-packet basis whereas previously this was not being done.
Lastly, try to improve the documentation a bit concerning chopping and provide another example depicting 2 separate chopping regions.  *Maybe* this is clearer?

One more example here for posterity:  Given the following 75 byte packet, there
are 8 different ways to chop the 2 regions marked as 10 and 20 in a single pass:

    <--------------------------- 75 ---------------------------->
 
    +---+-------+-----------+---------------+-------------------+
    | 5 |   10  |     15    |       20      |         25        |
    +---+-------+-----------+---------------+-------------------+

1) editcap -C 5:10 -C -25:-20 in.pcap out.pcap
2) editcap -C 5:10 -C 50:-20 in.pcap out.pcap
3) editcap -C -70:10 -C -25:-20 in.pcap out.pcap
4) editcap -C -70:10 -C 50:-20 in.pcap out.pcap
5) editcap -C 30:20 -C -60:-10 in.pcap out.pcap
6) editcap -C 30:20 -C 15:-10 in.pcap out.pcap
7) editcap -C -45:20 -C -60:-10 in.pcap out.pcap
8) editcap -C -45:20 -C 15:-10 in.pcap out.pcap


svn path=/trunk/; revision=51886
2013-09-09 19:39:45 +00:00
Chris Maynard eeba21136c OK, allow either positive or negative offsets no matter if we're chopping from the beginning or the end.
Given the following example, it's now possible to chop the 10 bytes depicted from the 100 byte packet 4 different ways and achieve the exact same results:

    <-------- 100 -------->       Methods:
                                  1) editcap -C 20:10 in.pcap out.pcap
    +------+----+---------+       2) editcap -C -80:10 in.pcap out.pcap
    |  20  | 10 |   70    |       3) editcap -C -70:-10 in.pcap out.pcap
    +------+----+---------+       4) editcap -C 30:-10 in.pcap out.pcap


svn path=/trunk/; revision=51854
2013-09-09 01:04:13 +00:00
Chris Maynard ba3a77bb9a Specify the optional offset as a positive value, regardless of chopping from packet beginning or packet end. I *think* this will be easier syntax to remember.
svn path=/trunk/; revision=51848
2013-09-08 21:35:24 +00:00
Chris Maynard 54adc0d2ff Allow an optional offset to be specified when chopping bytes from packets.
svn path=/trunk/; revision=51845
2013-09-08 20:29:26 +00:00
Guy Harris a4ad9e9f74 If a core Wireshark developer repeatedly can't remember that the
argument to the -F flag for pcap format is "libpcap", not "pcap", we
have a problem.  Make it "pcap", and add a backwards-compatibility hack
to support using "libpcap" as well.

Update the man pages to refer to it as pcap as well, and fix the
capitalization of "WinPcap" (see http://www.winpcap.org) while we're at
it.

Also, refer to http://www.tcpdump.org/linktypes.html for the list of
link-layer header types for pcap and pcap-ng.

svn path=/trunk/; revision=50989
2013-07-28 21:12:07 +00:00
Chris Maynard cab1f9fc0c Allow -C <choplen> to be used more than once so it is now possible to chop bytes from both the beginning and end of a packet in a single step.
svn path=/trunk/; revision=50536
2013-07-12 17:14:19 +00:00
Chris Maynard e7a7293bee 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
2013-07-10 20:02:45 +00:00
Chris Maynard e62f4cc4f6 Fix all errors and warnings found by podchecker.
svn path=/trunk/; revision=49837
2013-06-07 17:06:27 +00:00
Chris Maynard 08b0f7296a If tcpdump doesn't exist, why refer to it? Omit this confusing phrase.
svn path=/trunk/; revision=49427
2013-05-20 02:21:07 +00:00
Jeff Morriss 26a40dd999 editcap does not support the -H and -W options, remove the description of
those options (which had been cut-n-paste from the tshark man page).

For editcap to support these options it would either need to be linked
against libwireshark or the address resolution stuff would need to be moved
from libwireshark to, for example, libwsutil.

svn path=/trunk/; revision=45975
2012-11-08 23:13:58 +00:00
Chris Maynard 9c7b936e79 Sort the options. Delete all the line-terminating "g's" added in 40820.
svn path=/trunk/; revision=41563
2012-03-15 14:50:07 +00:00
Jörg Mayer 801392d5d3 The libpcap puts pcap-filter into the misc section (which seems to be 7).
Refer to pcap-filter and mention tcpdump only as a fallback.

svn path=/trunk/; revision=40820
2012-02-03 09:07:24 +00:00
Gerald Combs fcf51fc73b Add initial pcapng name resolution record support. Wireshark has read
support; TShark has read+write support. Additionally TShark can read a
"hosts" file and write those records to a capture file.

This uses "struct addrinfo" in many places and probably won't compile on
some platforms.

svn path=/trunk/; revision=36318
2011-03-24 22:47:57 +00:00
Sake Blok b723ee91a0 From Jason Masker (bug 5240):
`
Allow editcap to chop from beginning of packet for decapsulation


svn path=/trunk/; revision=35832
2011-02-04 21:09:55 +00:00
Sake Blok 9cf1d89732 Make editcap -B work like expected: output no packets after the stop time.
Old behavior was to include a packet with a timestamp of 12:00:00.934 if -B "YYYY-MM-DD 12:00:00" was used.


svn path=/trunk/; revision=34913
2010-11-16 20:22:20 +00:00
Chris Maynard 86db02c22e Fixed typos.
svn path=/trunk/; revision=34816
2010-11-09 03:20:15 +00:00
Gerald Combs 07354a18c1 From Jim Young via bug 4331:
This patch adds a new '-S' option to editcap that will rewrite timestamps of
packets to insure that the new capture file is in strict chronological order.

This option's primary use case is to fixup the occasional timestamps that have
a negative delta time relative to previous packet.

This feature is related to (but does not depend on) capinfos enhancement
submitted in bug #4315 which helps identify tracefiles with "out-of-order"
packets.

svn path=/trunk/; revision=33042
2010-06-02 00:30:25 +00:00
Bill Meier 910c5bd1a0 SYNOPSYS --> SYNOPSIS
svn path=/trunk/; revision=28338
2009-05-12 21:10:38 +00:00
Bill Meier 927fabd0e5 Update man pages; Add several missing options; Fix typos, Do minor rewording;
editcap: Add description of -i option;
 dumpcap: Add description of -S option;

svn path=/trunk/; revision=28336
2009-05-12 16:24:57 +00:00
Jaap Keuter 0886c83ba1 From Reinhard Speyerer:
This patch fixes several misspellings/typos in Wireshark documentation.

svn path=/trunk/; revision=28240
2009-05-02 06:42:08 +00:00
Balint Reczey 14fa469df3 From Jim Young <jyoung@gsu.edu>:
- New duplicate packet removal options for editcap
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3168

I changed the patch a bit:
- Adapted to 80 chars wide screen
- Merged -w and -W parameters

svn path=/trunk/; revision=28074
2009-04-17 15:21:46 +00:00
Jörg Mayer 13fae81007 Add some programs to 'see also'
svn path=/trunk/; revision=18867
2006-08-10 09:19:03 +00:00
Gerald Combs 9045703e2c Add duplicate frame detection (and removal) to editcap. (Some switches
generate duplicate packets when a mirror/SPAN port is misconfigured).

svn path=/trunk/; revision=18800
2006-07-27 17:53:29 +00:00
Jörg Mayer 64078e4bba Add a note how to change headers (od+text2pcap)
svn path=/trunk/; revision=18725
2006-07-13 05:39:27 +00:00
Gerald Combs 82fd788f99 Remove the numeric component in man page links.
svn path=/trunk/; revision=18698
2006-07-10 18:55:15 +00:00
Guy Harris d26ea2b24d Use L<> on all links.
Don't use anything on man page references - pod2man handles that.

Don't refer to "the capture file format section" of the Wireshark man
page, as there's no section explicitly labelled as such; just refer to
the beginning of the DESCRIPTION section.

svn path=/trunk/; revision=18694
2006-07-09 22:45:48 +00:00
Gerald Combs eb71f7fb96 Rename the main executable to "wireshark", along with more conversions:
ethereal.com -> wireshark.org
  mailing lists and addresses
  ETHEREAL -> WIRESHARK
  Man pages
  Automake/Autoconf names


svn path=/trunk/; revision=18271
2006-05-31 19:12:15 +00:00