Commit Graph

395 Commits

Author SHA1 Message Date
Michael Mann 6fa77a6acb Add data structures necessary to support multiple Section Header blocks.
This doesn't try to use any data from multiple Section Header blocks, it
just converts single Section Header block usage into a GArray, so the
potential is there to then use/support multiple Section Header blocks
within a file format (like pcapng)

Change-Id: I6ad1f7b8daf4b1ad7ba0eb1ecf2e170421505486
Reviewed-on: https://code.wireshark.org/review/15636
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-01 14:33:23 +00:00
Michael Mann 81d65ccec6 Add wtap_optionblock_set_option_string_format
Also add a length parameter to wtap_optionblock_set_option_string

Change-Id: I8c7bbc48aa96b5c2a91ab9a17980928d6894f1ee
Reviewed-on: https://code.wireshark.org/review/15505
Reviewed-by: Anthony Coddington <anthony.coddington@endace.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-22 23:39:14 +00:00
João Valverde 3db13a7fc9 Link version code statically again
This allows keeping the code-sharing with the static linking.

This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more
external dependencies to wsutil than strictly necessary.

A nice side-effect is that libwsutil no longer depends on version.h.

Follow up to f95976eefc.

Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23
Reviewed-on: https://code.wireshark.org/review/15002
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-21 18:59:56 +00:00
Gerald Combs cf6501eb45 Windows: Remove the need for _CRT_NONSTDC_NO_DEPRECATE.
Replace some function calls with their non-deprecated equivalents so
that we can remove _CRT_NONSTDC_NO_DEPRECATE from CMakeLists.txt and
config.nmake.

Leave _CRT_SECURE_NO_DEPRECATE in place. Removing it failed with 145
warnings and 72 errors.

Note that we could probably improve startup performance by using wmem
in diam_dict.*.

Change-Id: I6e130003de838aebedbdd1aa78c50de8a339ddcb
Reviewed-on: https://code.wireshark.org/review/14883
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-13 02:16:20 +00:00
João Valverde ecb4dc396e Include ws_diag_control.h in config.h
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317
Reviewed-on: https://code.wireshark.org/review/14749
Petri-Dish: João Valverde <j@v6e.pt>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04 23:05:31 +00:00
João Valverde f95976eefc Move zlib version check to wsutil
Change-Id: I0950f61e90af5bb21c0017204de0c0b509616e5c
Reviewed-on: https://code.wireshark.org/review/14747
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-03 02:58:04 +00:00
Joerg Mayer 7e5dae90d6 Fix warnings/errors of type -Wused-but-marked-unused
Change-Id: I34c2d9953272822da0745d1b24c64d8466e43b37
Reviewed-on: https://code.wireshark.org/review/14668
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 13:27:52 +00:00
Daniël van Eeden a0b1354583 Fix compile errors when compiling w/o zlib
Change-Id: I443cd0d4a143e456e11b5939891312a0501770a0
Reviewed-on: https://code.wireshark.org/review/14636
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-26 16:19:34 +00:00
Jaap Keuter 99db1c5c98 Remove superfluous pointer checks (CID-280599, 280600 and 280601)
The preceding code takes every effort to make sure that the
frac and end pointers are relevant pointers. Don't go back and
check for NULL yet again.

Change-Id: If805aee5a77a8c23eac7b074bd11d3743c5e1a3b
Reviewed-on: https://code.wireshark.org/review/14398
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-09 13:20:10 +00:00
Guy Harris ad3afb02c3 Properly fetch the ethertype.
The ethertype is 16 bits and big-endian, so fetch it with pntoh16() to
convert it to host byte order (and to handle unaligned values).

Fixes Coverity CID 1355352.

Change-Id: I14980e2813c3ea19c6df01681f8ed7aaad5c3f59
Reviewed-on: https://code.wireshark.org/review/14359
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-06 17:24:05 +00:00
Michael Mann 08d49ff2e0 Making wiretap option blocks more generic.
This was inspired by https://code.wireshark.org/review/9729/, but takes it in a different direction where all options are put into an array, regardless of whether they are "standard" or "custom".  It should be easier to add "custom" options in this design. Some, but not all blocks have been converted.
Descriptions of some of the block options have been moved from wtap.h to pcapng.h as it seems to be the one that implements the description of the blocks.

Also what could be added/refactored is registering block behavior.

Change-Id: I3dffa38f0bb088f98749a4f97a3b7655baa4aa6a
Reviewed-on: https://code.wireshark.org/review/13667
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-23 00:39:38 +00:00
Jonas Falkevik 780f886d29 editcap: flag for ignore vlan duplication removal
Add additional --novlan flag for removing vlan tag info before checking for duplicates.
When capturing with -i any you could see packets more than once and some drivers include vlan info.
With the --novlan the vlan info is removed from the packet so that checksum duplication detection can be used,
if the rest of the packets are the same.

Change-Id: I5dca6e20259a0a396875919e9e60cc42291579d3
Reviewed-on: https://code.wireshark.org/review/13414
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-15 05:33:14 +00:00
Guy Harris 41d734ec67 Adjust time stamps even if the secs value of the time stamp is 0.
If the seconds value in a time stamp is 0, that says nothing whatsoever
about whether it's supported or not - it's the presence flag, which
we've already tested and found to be set, that indicates whether the
time stamp is supported.

Bug: 12116
Change-Id: I91354783af7b6356d9806c7559d35da44ea4567f
Reviewed-on: https://code.wireshark.org/review/13913
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-12 02:13:53 +00:00
Guy Harris 48267465c8 More structure assignments for nstime_t.
Change-Id: I4d320b50d7d74b6fc423014c9611a60d49c6be02
Reviewed-on: https://code.wireshark.org/review/13503
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 08:05:37 +00:00
Alexis La Goutte d326eb98f6 fix spelling-error-in-binary found by lintian
Change-Id: I2bdb40d287b2c19d40679fb73a8bae5f1debdd98
Reviewed-on: https://code.wireshark.org/review/13330
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-01-16 14:06:10 +00:00
Michael Mann 7bde1d70f2 [editcap] Pacify OS X buildbot.
Change-Id: I3ec3c4723d29d84b25419982712707126351a01c
Reviewed-on: https://code.wireshark.org/review/13301
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-15 01:13:34 +00:00
Matej Košík 93193465dd [editcap] Remove excess parsing when packets are kept.
Also allow for range to include "the rest" (ex 10- would include all the packets starting at number 10)

Bug: 9686
Change-Id: Ib02e52b22acf49b0e52df0a75fa4fa0d5f37aa31
Reviewed-on: https://code.wireshark.org/review/13291
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-14 22:36:57 +00:00
Michael Mann baf3321942 [editcap] Bugfix tree compare function.
Bug: 12007
Change-Id: Icd31988ebbfe1e0bf4d29f32462c58c6c2c55547
Reviewed-on: https://code.wireshark.org/review/13277
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-14 18:44:55 +00:00
Guy Harris 71c603b2fc Clean up more includes of wtap.h.
Change-Id: Ie53b64f7e5b39a50dffb62fc0b886da71e0a3bd2
Reviewed-on: https://code.wireshark.org/review/13066
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-06 00:25:19 +00:00
João Valverde fbf2e3cf8f Make init_progfile_dir() take a function pointer [-Wpedantic]
Change-Id: I45f8ea5ee6ccc5a484c60ad6e686aaf30f6b0c98
Reviewed-on: https://code.wireshark.org/review/12557
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-14 23:52:28 +00:00
João Valverde 2aab706c5a Remove -Wwrite-strings compiler flag
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are
not useful, they're impossible to fix in a sane way and therefore are being
handled with casts of static strings to (char *).

This just moves the warning to [-Wcast-qual] and a compiler pragma is
in turn required (and used) to squelch that warning.

Remove the Wwrite-strings warning. Let that responsibility fall on the
programmer (as is done by casting).

Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5
Reviewed-on: https://code.wireshark.org/review/12162
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-12 16:21:19 +00:00
Pascal Quantin fb3d38225e Update user guide for development release
Change-Id: I9b4c5ab2e98ad6daa618bcda20b53a23467e16e0
Reviewed-on: https://code.wireshark.org/review/11734
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-11 17:31:31 +00:00
Guy Harris 827b7dd756 Skip only the actual file descriptor close when writing to stdout.
Have a "this is stdout" flag for a wtap_dumper, and have "open the
standard output for dumping" routines that set that flag.  When closing
a wtap_dumper, do most of the work regardless of whether we're writing
to the standard output or not (so that everything gets written out) and
only skip the closing of the underlying file descriptor.

Change-Id: I9f7e4d142b3bd598055d806b7ded1cb4c378de8e
Reviewed-on: https://code.wireshark.org/review/11673
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-10 10:11:50 +00:00
Guy Harris 6c3c6de340 Treat "-" as "standard input" in the CLI, not in libwiretap.
That's a UI convention, and the GUI shouldn't honor that convention - a
user might get confused if they try to save to "-" and end up with
nothing (and with a ton of crap in a log file if programs launched from
the GUI end up with their standard output and error logged).

While we're at it, make randcap report write and close errors.

Change-Id: I9c450f0ca0320ce4c36d13d209b56d72edb43012
Reviewed-on: https://code.wireshark.org/review/11666
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-10 01:23:22 +00:00
Guy Harris ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Dario Lombardo 1f9fb57773 editcap/reordercap: rename time to frame_time.
According to checkAPI.

Change-Id: Iddad6253fc4711ed7870eccadb91d94e5fecd24d
Reviewed-on: https://code.wireshark.org/review/10672
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-28 17:18:38 +00:00
Guy Harris 4d71ae7df7 Have separate variables for read and write errors.
That way, when we check for read errors, we don't run the risk of
thinking we have a read error after we get a write error.

Change-Id: Idb79822d30989b2529433878798c577a76eacca7
Reviewed-on: https://code.wireshark.org/review/10295
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-28 22:55:29 +00:00
Hadriel Kaplan e25562badd Pcapng: clean up Section Header Block handling
Change-Id: I8516d0c561ed0b63e49a3594027c9c15bb789258
Reviewed-on: https://code.wireshark.org/review/9726
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-18 05:52:45 +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
Hadriel Kaplan 910438b17f Pcapng: support Name Resolution Block options
Make pcapng decode options in an NRB during read, and store the comment
option, and write it back out as well. Also make it handle plugin handlers
for unknown options in received NRB(s).

Change-Id: I81863ef8d85cb1c8b5ba6673ba0e562efe77714f
Reviewed-on: https://code.wireshark.org/review/9723
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-06 03:32:13 +00:00
Martin Mathieson dd16c55e9f editcap: allow command-line option to set comments for given frame numbers
Change-Id: I608d3c5f56acc58ef7b3e59821a15be49344cc35
Reviewed-on: https://code.wireshark.org/review/9154
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-26 00:02:31 +00:00
Martin Mathieson 6c3f1f2c53 editcap: split usage output so won't wrap in cmd.exe window
Change-Id: I8a8ed3721e525ceb685f8e105147a0cc012fc912
Reviewed-on: https://code.wireshark.org/review/9001
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-21 12:19:22 +00:00
Martin Mathieson 649c48482e editcap: trivial changes while looking into the -L option
Change-Id: I94dd83af160eebb9dc44c123b2b83674bc5866f6
Reviewed-on: https://code.wireshark.org/review/9000
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-21 11:47:24 +00:00
Guy Harris 65303efe4d Remove some unneeded includes of <sys/time.h>.
Change-Id: I9e4e6efa9f8c7dbff7627f8d5fc3278ab383618d
Reviewed-on: https://code.wireshark.org/review/7441
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-28 04:59:08 +00:00
Gerald Combs 95382c3afb Suppress a bunch of cast-qual warnings.
Squelch

    warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]

similar to g630f54f.

Change strtod to g_ascii_strtod to squelch a checkAPIs error.

Change-Id: Ib2d26ef89f08827a5adc07e35eaf876cd7b8d14e
Reviewed-on: https://code.wireshark.org/review/7269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-20 04:04:15 +00:00
Guy Harris 9423a13b2d Just have init_progfile_dir() take a void pointer.
dladdr() takes a void * as a code pointer; have init_progfile_dir() do
so, and do the casting in the calls.  We don't care about the signature
of the function whose address we're passing, we just want to pass a
pointer to *something* in the main program.

Change-Id: I9372620a97b0eb53c2bb3c0c41a238b4408f3709
Reviewed-on: https://code.wireshark.org/review/7270
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-20 00:24:08 +00:00
Guy Harris 27be466c9b Do the full string in get_{compiled,runtime}_version_info().
Have them start the string with "Compiled" or "Running on", and return
the string when done.

Change-Id: Ic4d290c963621fa0385dc5aab766fd4ad31d3810
Reviewed-on: https://code.wireshark.org/review/6155
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 06:29:11 +00:00
Guy Harris c1f30471ca Move the version_info.c stuff to wsutil/ws_version_info.c.
Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde
Reviewed-on: https://code.wireshark.org/review/6153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 03:41:02 +00:00
Guy Harris e08eba9b9e Only include <wsutil/os_version_info.h> if we need it.
Change-Id: Idee0e7205969ac2e7b33c4748a1463a0bfffe0a6
Reviewed-on: https://code.wireshark.org/review/6051
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-25 21:03:45 +00:00
Guy Harris 20503c7047 Check for getopt_long(), not getopt().
We support three types of platforms:

	1) UN*Xes that have both getopt() and getopt_long();

	2) UN*Xes that have getopt() but not getopt_long();

	3) Windows, which has neither.

Checking for getopt_long() lets us distinguish between 1) and 2) and
build getopt_long() for them.

Change-Id: Iaf0f142f9bebaa2eed2128d544ec9786711def45
Reviewed-on: https://code.wireshark.org/review/6045
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-25 01:11:10 +00:00
Stephen Fisher 2d8ec49ffa Move twelve show_version() functions from the varoius programs and
Wireshark UI files into a single one in wsutil.

Change-Id: I0a64f0cc8106bd681bd185289c36272c4c43baad
Reviewed-on: https://code.wireshark.org/review/6026
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-24 16:51:45 +00:00
Guy Harris 0885d29451 Make sure err_info is always set, and print it iff it's non-null.
Change-Id: Ib5c600c491a3d8adcfa91c00fa9445283610545b
Reviewed-on: https://code.wireshark.org/review/5830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 04:04:19 +00:00
Guy Harris 6011a047d3 WTAP_ERR_UNWRITABLE_ errors aren't returned by reads or open-for-reading.
Check for them *only* on opening for writing and writes.

Change-Id: I4b537d511ec04bcfc81f69166a2b9a2ee9310067
Reviewed-on: https://code.wireshark.org/review/5827
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 00:41:43 +00:00
Guy Harris aa27e665b1 Rename WTAP_ERR_REC_TYPE_UNSUPPORTED to WTAP_ERR_UNWRITABLE_REC_TYPE.
That indicates that it's a problem specific to *writing* capture files;
we've already converted some errors to that style, and added a new one
in that style.

Change-Id: I8268316fd8b1a9e301bf09ae970b4b1fbcb35c9d
Reviewed-on: https://code.wireshark.org/review/5826
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 00:32:14 +00:00
Guy Harris 51522b3372 Handle "I can't map this for that file format" better.
For cases where record (meta)data is something that can't be written out
in a particular file format, return WTAP_ERR_UNWRITABLE_REC_DATA along
with an err_info string.

Report (and free) that err_info string in cases where
WTAP_ERR_UNWRITABLE_REC_DATA is returned.

Clean up some other error reporting cases, and flag with an XXX some
cases where we aren't reporting errors at all, while we're at it.

Change-Id: I91d02093af0d42c24ec4634c2c773b30f3d39ab3
Reviewed-on: https://code.wireshark.org/review/5823
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 00:03:26 +00:00
Guy Harris dbdcae80ba Rename WTAP_ERR_UNSUPPORTED_ENCAP to WTAP_ERR_UNWRITABLE_ENCAP.
That makes it clearer what the problem is, and that it should only be
returned by the dump code path, not by the read code path.

Change-Id: Icc5c9cff43be6c073f0467607555fa7138c5d074
Reviewed-on: https://code.wireshark.org/review/5797
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17 06:41:45 +00:00
Guy Harris 4acf4955f5 Rename the strnatcmp.c routines and make them use the g_ascii_XXX() routines.
Rename strnatcmp()/strnatcasecmp() to ws_ascii_XXX(), and make them use
the g_ascii_XXX() routines rather than ctype.h routines, to eliminate
locale-dependent behavior.

(If you want locale-dependent "natural order" sorting, you probably want
"dictionary order" sorting, which is more complicated than just natural
order sorting.)

Change-Id: I837f2776b2a909b547dc9a6072e497911b5380e5
Reviewed-on: https://code.wireshark.org/review/4985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-29 17:54:51 +00:00
Guy Harris 982c7d38a4 Support nanosecond-resolution time stamp adjustment.
Based on https://code.wireshark.org/review/#/c/4304/ from Peter Hatina.

Change-Id: Ibc5e230b0682990fd4ca1f29597a9a045cb73928
Reviewed-on: https://code.wireshark.org/review/4356
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28 23:42:39 +00:00
Evan Huus df35a959c4 Ensure pcapng application name is always dynamically allocated
Change-Id: I408944dfb0fa35bae6019ed0d6d810525b2ffcae
Reviewed-on: https://code.wireshark.org/review/4254
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-22 20:53:44 +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
Graham Bloice 97546165fa Modify includes of config.h so that out-of-tree builds, i.e. CMake
don't pick up the in-tree copy.

Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71
Reviewed-on: https://code.wireshark.org/review/3798
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-24 08:04:08 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Guy Harris b4ce352539 Make --help and --version information a bit more uniform.
Have --version print the version number, the copyright information, the
"compiled with" information, the "running on/with" information, and the
compiler information.

Have --help print the version number, a one-line summary of what the
program does, a reference to http://www.wireshark.org for more
information, a Usage: line, and a list of command-line options.

This means programs doing that don't need to include version.h; that's
left up to get_ws_vcs_version_info() to do.

Change-Id: Idac641bc10e4dfd04c9914d379b3a3e0cc5ca8cb
Reviewed-on: https://code.wireshark.org/review/2794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 08:46:01 +00:00
Guy Harris 8afe331369 More getopt_long, to add --help and --version support.
Change-Id: I946067b972a70154f02ab561bc0fd029a7a5abc4
Reviewed-on: https://code.wireshark.org/review/2791
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 04:51:20 +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
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Guy Harris f635efb6a6 More checks for the presence of a time stamp.
And make sure we have a pointer to the struct wtap_pkthdr for the packet
before we check it for a time stamp.

Change-Id: I26b205e5467a3a1236e9fd1f7633e86ece5e9040
Reviewed-on: https://code.wireshark.org/review/1762
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 21:04:06 +00:00
Guy Harris 8a7e1f4879 Don't assume all packets have time stamps.
Pcap-ng files might have Simple Packet Blocks, which don't have time
stamps, and some other file formats might not have time stamps as well.

Only check the time stamp if we have one, and don't use "the start time
stamp is unset" as an indication that we've just read the first packet,
use "the count of packets we've read is 1" as an indication that we've
just read the first packet.

Change-Id: I097c54867655efb5c343fb880a113b3583736bbd
Reviewed-on: https://code.wireshark.org/review/1757
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 18:53:45 +00:00
Guy Harris a344c9736e Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c.

A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes.  That is in-progress.

Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 10:50:10 +00:00
Guy Harris c0c480d08c Allow wtap_read() and wtap_seek_read() to return non-packet records.
This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest
of Wireshark, but this at least gets the ball rolling.

Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 03:02:32 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00
Michael Mann 1abeb277f5 Refactor Wiretap
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality.

The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes.

bug:9607
Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae
Reviewed-on: https://code.wireshark.org/review/1485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09 03:04:39 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Michal Labedzki 579e7e19ce Wireshark: Add option to choose format type of capture file
The best heuristic can fail, so add possibility to manually choose
capture file format type, so not correctly recognize file format can be
loaded in Wireshark.

On the other side now it is possible to open capture file
as file format to be dissected.

Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a
Reviewed-on: https://code.wireshark.org/review/16
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:43:13 +00:00
Gerald Combs f966980937 Replace "svn" with "git" all over the place.
Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate.
Rename "svnversion.h" to "version.h" as Evan suggested. Update some
URLs. In make-version.pl, make sure we don't set an improper upstream
branch name. Use the number of commits + short hash from `git describe`
for package names by default.

Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96
Reviewed-on: https://code.wireshark.org/review/139
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-07 23:03:03 +00:00
Alexis La Goutte c6022b3b85 Drop support of Visual Studio 2005
* Remove _MSC_VER < 1500 check
* Cleanup config.nmake

See http://www.wireshark.org/lists/wireshark-dev/201305/msg00159.html

svn path=/trunk/; revision=54965
2014-01-26 12:56:32 +00:00
Bill Meier 86930ddde2 Given that we allow the 'outfile file' to be stdout, then presumably all
text messages (including informational) should go to stderr.

svn path=/trunk/; revision=54930
2014-01-23 15:11:00 +00:00
Bill Meier 9be9ba5ba1 printf(...) --> fprintf(stderr,...) (in a commented out line of code)
svn path=/trunk/; revision=54929
2014-01-23 14:39:29 +00:00
Guy Harris 90d7c5f59b Don't write out packets that have a "captured length" bigger than we're
willing to read or that's bigger than will fit in the file format;
instead, report an error.

For the "I can't write a packet of that type in that file type" error,
report the file type in question.

svn path=/trunk/; revision=54882
2014-01-22 00:26:36 +00:00
Martin Kaiser c852f994ea From Toralf Förster
fix format strings for signed integers

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9637

svn path=/trunk/; revision=54835
2014-01-17 20:06:39 +00:00
Bill Meier 58a92b1f14 For '-h' option: exit(0) as per convention;
No need to build a constant string on the stack at runtime;
Fix a typo;
Do some whitespace changes;
Change tab-width & etc to 8 in editor modelines.

svn path=/trunk/; revision=54581
2014-01-03 14:30:09 +00:00
Bill Meier 8ab9c55618 From Ville Skyttä: Spelling Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591


svn path=/trunk/; revision=54387
2013-12-23 15:53:13 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Chris Maynard bde2a9493b Fix chopping when offset is 0. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9422
svn path=/trunk/; revision=53345
2013-11-15 22:31:11 +00:00
Jakub Zawadzki 38edae1c71 Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. 

svn path=/trunk/; revision=53184
2013-11-09 10:38:02 +00:00
Guy Harris 853da2eb9b The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Martin Kaiser a876a4306d From Peter Wu
write editcap debug infos to stderr
print some of those messages only in verbose mode 

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9342

svn path=/trunk/; revision=52942
2013-10-29 08:34:35 +00:00
Alexis La Goutte 58e4750ecb Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=52097
2013-09-16 07:56:04 +00:00
Chris Maynard cc39b0898c Remove a leftover #if 0 block.
svn path=/trunk/; revision=51888
2013-09-09 19:46:02 +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 4b4aaf35ff The file was a weird mix of 2 and 4 indent so use a consistent 4-space indent scheme and add modelines to match. Also, declare a few variables static.
(A fix for crossed chopping regions should be coming in the near future ...)

svn path=/trunk/; revision=51863
2013-09-09 06:26:42 +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
Jeff Morriss 2df54da6e2 Move a bunch of the crypt modules and pint.h into wsutil.
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100
2013-08-01 23:34:47 +00:00
Jeff Morriss 2d30d5beb1 Move strnatcmp.{h,c} from epan into wsutil: there's nothing epan-specific
there and moving it avoids having to recompile the file for use in editcap
and mergecap (which don't link against libwireshark).

svn path=/trunk/; revision=50650
2013-07-16 01:16:50 +00:00
Jeff Morriss 54bb2e7a5c Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark).
svn path=/trunk/; revision=50598
2013-07-15 02:48:26 +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 d602662b36 Add strnatcmp by Martin Pool for 'natural order' string comparisons, and make use of it in editcap and mergecap for listing encapsulation types. For example:
Before:
    user0 - USER 0
    user1 - USER 1
    user10 - USER 10
    user11 - USER 11
    user12 - USER 12
    user13 - USER 13
    user14 - USER 14
    user15 - USER 15
    user2 - USER 2
    user3 - USER 3
    user4 - USER 4
    user5 - USER 5
    user6 - USER 6
    user7 - USER 7
    user8 - USER 8
    user9 - USER 9

After:
    user0 - USER 0
    user1 - USER 1
    user2 - USER 2
    user3 - USER 3
    user4 - USER 4
    user5 - USER 5
    user6 - USER 6
    user7 - USER 7
    user8 - USER 8
    user9 - USER 9
    user10 - USER 10
    user11 - USER 11
    user12 - USER 12
    user13 - USER 13
    user14 - USER 14
    user15 - USER 15


svn path=/trunk/; revision=50482
2013-07-10 16:18:37 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
A bunch of files didn't really need to include these header files so remove
the include line rather than changing it.

svn path=/trunk/; revision=50154
2013-06-25 22:02:20 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Gerald Combs 29ceca1b26 From Balint:
[PATCH 1/2] Revert "Try to fix the "LNK4217: locally defined symbol"
warnings.

This reverts commit r48158.

[PATCH 2/2] Employ small hack in editcap to link with a few objects from
libwireshark properly


From me:

Add the ability to reset symbol exports via ws_symbol_export.h's include
guard and do so in capinfos.c and editcap.c. We include ws_symbol_export.h
in over 200 files so it didn't seem to make sense to remove its include
guard entirely.

svn path=/trunk/; revision=48170
2013-03-07 17:20:12 +00:00
Anders Broman b204e38aef Use explicit casts.
svn path=/trunk/; revision=48108
2013-03-05 22:15:20 +00:00
Gerald Combs bd4cffae58 When any of our executables start on Windows create or open a "Wireshark
is running" mutex. Have the NSIS installer check for this mutex and ask
the user to close Wireshark if it's found. While not perfect this makes
the WinSparkle update process much less annoying.

svn path=/trunk/; revision=47758
2013-02-20 01:19:42 +00:00
Jeff Morriss 664d138ea2 Previous commit put a little too much of the README.developer boilerplate in...
svn path=/trunk/; revision=47065
2013-01-14 15:47:55 +00:00
Jeff Morriss e64d2f9b3f In response to http://ask.wireshark.org/questions/17660/licence-of-editcap
and as per email response from Richard Sharpe, add GPLv2+ boilerplate header
and license.

svn path=/trunk/; revision=47063
2013-01-14 15:25:49 +00:00
Pascal Quantin deb4f08cb2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later

svn path=/trunk/; revision=46930
2013-01-04 14:56:27 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Anders Broman f682f1955b From Jim Young:
Have editcap use modulo when calculating filenum component of fileset name .

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7863

svn path=/trunk/; revision=45556
2012-10-15 08:40:43 +00:00
Anders Broman eb618abad9 From Bill Parker:
Explicitly declare/cast 'unsigned <variable>' as 'unsigned int <variable>'

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7810

svn path=/trunk/; revision=45418
2012-10-09 08:40:02 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Evan Huus 9c0dd8c7dc Make count variable in editcap unsigned, fixes more format string
mismatches.

svn path=/trunk/; revision=44820
2012-09-09 14:23:38 +00:00
Martin Mathieson 3019949943 Fix a copy+paste error ('capinfos' appearing in error string).
svn path=/trunk/; revision=43738
2012-07-16 02:37:42 +00:00
Anders Broman 665b95d154 Try to fix pcap-ng - most files created by editcap -c have no IDB
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7350

By using wtap_dump_open_ng() in all places.

svn path=/trunk/; revision=43271
2012-06-15 12:27:21 +00:00
Jeff Morriss 603b4d4348 Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This fixes the double-free editcap crashes that the buildbot's been seeing lately.
svn path=/trunk/; revision=41542
2012-03-14 01:08:09 +00:00
Anders Broman 7605b01482 From Jose Pedro Oliveira:
the shb_userappl value wasn't being changed.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6937

svn path=/trunk/; revision=41530
2012-03-13 14:11:08 +00:00
Anders Broman ead0764cd9 A modified version of "pcapng: shd_userappl in newly created files"
to only add the name if no name if there yet. Original patch from
Jose Pedro Oliveira. 

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6937

svn path=/trunk/; revision=41524
2012-03-13 09:13:27 +00:00
Anders Broman 3394b453af Free idb_inf and shb_hdr when done.
svn path=/trunk/; revision=41501
2012-03-12 14:18:04 +00:00
Guy Harris 25ae6ac329 Use wtap_dump_open_ng(), so we preserve all the interfaces in pcap-NG
files.

svn path=/trunk/; revision=41328
2012-03-03 00:14:16 +00:00
Bill Meier 174d06e4c6 Revert SVN #40866 (which used g_fprintf() in place of fprintf()).
Using g_fprintf() fails (crashes) on Windows because the Windows GLib DLL
is linked with (depends upon) MSVCRT while editcap is linked with
(depends upon) MSVCR90.

IOW: "You can't do that ... (on Windows)"

See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6695 (Comment 2)
for some additional information.


svn path=/trunk/; revision=41168
2012-02-24 05:17:46 +00:00
Anders Broman 23928d9923 From Alexander Koeppe:
Eliminate Mixture of libc and glibc in editcap.c

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6695

svn path=/trunk/; revision=40866
2012-02-05 13:25:36 +00:00
Anders Broman e553c70fe8 From Michael Mann:
help page update (pcapng is now the default file format).

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6551

svn path=/trunk/; revision=40658
2012-01-23 07:48:53 +00:00
Jörg Mayer 2097912587 Rename crypt-xxx to xxx
svn path=/trunk/; revision=40511
2012-01-15 12:29:44 +00:00
Guy Harris d94bd07f99 Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any
form of corruption/bogosity in a file, including in a file header as
well as in records in the file.  Change the error message
wtap_strerror() returns for it to reflect that.

Use it for some file header problems for which it wasn't already being
used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only
be used for files that we have no reason to believe are invalid but that
have a version number we don't know about or some other
non-link-layer-encapsulation-type value we don't know about.

svn path=/trunk/; revision=40175
2011-12-13 09:53:50 +00:00
Guy Harris 2929c93ea2 When reporting "sorry, *this* packet can't be written to a file of that
type" when writing out a capture file (i.e., writing a
per-packet-encapsulation capture to a file type that supports it but
doesn't support one of the packet's encapsulations), report the packet
number and, when doing this in a merge operation, report the file from
which it came.

When reporting "sorry, that file can't be written to a file of that
type, period", show the file type rather than the input file link-layer
type that causes the problem.  (We could show both.  We could be
*really* ambitious and iterate through all possible file types and show
the ones that will or at least might work....)

file_write_error_message() is documented as handling only UNIX-style
errnos, and libwireshark should be usable without libwiretap, so leave
it up to its callers to handle Wiretap errors such as
WTAP_ERR_SHORT_WRITE.

Clean up indentation.

svn path=/trunk/; revision=39949
2011-11-19 20:18:01 +00:00
Jeff Morriss bf95c7b5e4 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :
getopt() can/should normally be found in unistd.h, so:

- When testing for getopt(), define that we HAVE_GETOPT instead of
  HAVE_GETOPT_H (to avoid confusion).
- Don't attempt to include getopt.h: not all OS's have it (for example,
  Solaris 9 does not).
- (All the places which need getopt already include unistd.h (if we have it).)

If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check.

svn path=/trunk/; revision=38437
2011-08-09 21:02:10 +00:00
Jeff Morriss 8589a0eb1d Remove the snaplen check added in r37633: the change in r37634 makes it
unnecessary.

svn path=/trunk/; revision=38155
2011-07-21 21:19:18 +00:00
Martin Mathieson 3a88c5c7dd Don't sanity-check snaplen against frame length if snaplen is 0.
svn path=/trunk/; revision=38132
2011-07-20 12:24:41 +00:00
Stig Bjørlykke 7da7f34750 Prohibited APIs: strncpy -> g_strlcpy.
svn path=/trunk/; revision=37768
2011-06-23 13:50:07 +00:00
Gerald Combs 4d603719d0 Have mergecap, tshark, and editcap write pcap-ng files by default. This
is mainly an attempt to fix the currently-broken "test.sh" step on the
XP buildbot. If this causes too many problems we might want to have
suite-capture.sh:capture_step_snapshot pass "-P" to dumpcap instead.

svn path=/trunk/; revision=37736
2011-06-20 23:31:26 +00:00
Guy Harris f783d2d904 See if this squelches some compiler warnings.
svn path=/trunk/; revision=37669
2011-06-15 19:23:58 +00:00
Jeff Morriss 90e539b55f Simplify timestamp checking: only check the packet's timestamp if
check_startstop is set.

Refuse to write packets that do not fit in the file type we're writing.  This
allows fuzz testing to be done on JPEGs without generating bogus files (with
packets bigger than the maximum packet size).  This fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6010 .

Note that this is only a problem with editcap is run with -T to force the
encapsulation type.

Maybe this needs a more generic solution (e.g., should this check be done in
the wiretap routines?), but at least for now it'll pacify the buildbot.

svn path=/trunk/; revision=37633
2011-06-09 18:27:11 +00:00
Chris Maynard 91bd619c64 Handle snaplen before choplen for consistency. Also, if chopping more bytes
than present, just chop all by setting caplen to 0.  In all cases, don't touch
len.  In other words, change incl_len but leave orig_len alone.

svn path=/trunk/; revision=37488
2011-05-31 20:24:26 +00:00
Chris Maynard ec494af010 When a snaplen is specified using "-s <snaplen", if it's smaller than the
original capture file's snaplen, save the new snaplen in the capture file
header so wireshark and capinfos can report it.

svn path=/trunk/; revision=37480
2011-05-31 15:31:34 +00:00
Gerald Combs a24687ce8e Move the Windows argument list conversion code to a common routine.
svn path=/trunk/; revision=37372
2011-05-24 00:07:56 +00:00
Chris Maynard 1914330274 Don't bother to strcpy() an empty string; just set buf[0] = '\0': Coverity 626
svn path=/trunk/; revision=36601
2011-04-12 18:43:44 +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
Gerald Combs 3bc1fc3802 On Windows, convert all of our command-line arguments from UTF-16 to
UTF-8 where we don't already do so. In Wireshark use g_utf16_to_utf8
instead of utf_16to8. This should fix bug 5520.

svn path=/trunk/; revision=35411
2011-01-06 23:28:58 +00:00
Bill Meier 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Chris Maynard 5db818390b Attempt to fix warnings not previously seen with VS2008EE.
svn path=/trunk/; revision=35024
2010-11-24 17:10:48 +00:00
Chris Maynard 5519715365 When listing encapsulation types with -T or file types with -F, sort them.
svn path=/trunk/; revision=35022
2010-11-24 16:24:44 +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
Jeff Morriss 1ad1bab262 From Jose Pedro Oliveira via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5353 :
editcap -h sends 9 lines to stderr and the rest to stdout.  This problem
affects editcap 1.4.x (branch 1.4) and devel (trunk).

How to duplicate:
 1) run "editcap -h"
 2) run "editcap -h > /dev/null"

The attached patch replaces 9 ocurrences of "stderr" by "output" in the usage
function.

svn path=/trunk/; revision=34742
2010-11-01 14:33:14 +00:00
Gerald Combs a87bdf9660 Turn on ASLR via /DYNAMICBASE and DEP via SetProcessDEPPolicy().
svn path=/trunk/; revision=34137
2010-09-16 19:20:06 +00:00
Bill Meier 5a307bb6d1 Fix a gcc -Wshadow warning
svn path=/trunk/; revision=33077
2010-06-03 19:14:18 +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
Jeff Morriss 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Bill Meier e4d6610bd5 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31729
2010-01-29 16:09:25 +00:00
Stephen Fisher 7c125a357b Make edticap behave like the rest of the Wireshark programs where it will
send normal -h output to stdout so it can be paginated and the usage output
to stderr when there was an error in the command arguments.


svn path=/trunk/; revision=31388
2009-12-29 21:04:40 +00:00
Gerald Combs 5ba1582dda From Jim Young via bug 4162:
This patch limits the number of fractional digits used to calculate the
fractional component of editcap's -t and -w options.

Specifically this patch truncates the fractional component (if any) of the -t
and -w options to 6 and 9 respectively.

svn path=/trunk/; revision=30698
2009-10-25 20:18:24 +00:00
Stig Bjørlykke 98024a007f Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.

svn path=/trunk/; revision=30370
2009-10-06 16:01:18 +00:00
Gerald Combs 1e93d53b56 Use "svn info" to fetch the version by default. Fetch the repository path as
well. Add the repository path to the version strings.

svn path=/trunk/; revision=29171
2009-07-22 23:59:15 +00:00
Guy Harris 7595bc232a Clean up the "available XXX type" messages a bit.
svn path=/trunk/; revision=28793
2009-06-21 18:55:32 +00:00
Stig Bjørlykke 9a8e93d88b If no valid packages was found in the input file we write an empty
header in the output file.  This way we at least create a file.

svn path=/trunk/; revision=28617
2009-06-02 23:14:19 +00:00
Stig Bjørlykke fa71489b83 Only call wtap_dump_close() if we have an open file.
We can have a situation where a file only contains a valid file header
without any packages, so this will avoid a crash.

svn path=/trunk/; revision=28602
2009-06-02 17:22:40 +00:00
Guy Harris 5e8e10cfa3 Have fileset_extract_prefix_suffix() print an error message if it fails,
so we don't just exit silently.  Don't bother checking the validity of
arguments - it shouldn't be passed NULL fprefix or fsuffix arguments in
the first place, and isn't passed them.

Exit with an exit status of 1 for command-line syntax errors and 2 for
file open/close/IO errors.

svn path=/trunk/; revision=28458
2009-05-23 20:29:12 +00:00
Guy Harris dc3b1136cc Fix indentation.
svn path=/trunk/; revision=28457
2009-05-23 20:22:42 +00:00
Sake Blok 67bd294b03 Initialize pdh...
svn path=/trunk/; revision=28455
2009-05-23 08:57:20 +00:00
Sake Blok a8eb860103 From Kovarththanan Rajaratnam <krj@rajaratnam.dk> in bug 2683
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2683):

Editcap should split file according to fileset pattern


svn path=/trunk/; revision=28454
2009-05-23 07:59:23 +00:00
Bill Meier fa920e48ed Minor cleanup of "-h" output text.
svn path=/trunk/; revision=28334
2009-05-12 16:06:14 +00:00
Gerald Combs c8f44535fe Fix Win64 compilation.
svn path=/trunk/; revision=28076
2009-04-17 16:21:33 +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
Gerald Combs e648060f0f Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
2009-04-16 04:05:39 +00:00
Guy Harris c73ab7dff7 Change the signature of init_progfile_dir() so the casting of the
function pointer (to main) to an argument to dladdr() is done in
init_progfile_dir() rather than its callers.

svn path=/trunk/; revision=27814
2009-03-22 06:53:17 +00:00
Guy Harris 6f059e8cb7 In Solaris, the second argument to dladdr() is just a void *, not a
const void *.

svn path=/trunk/; revision=27813
2009-03-22 06:38:02 +00:00
Guy Harris 7c6e2155cc Attempt to use dladdr() to get the pathname of the executable image if
it's available and works.

svn path=/trunk/; revision=27812
2009-03-22 00:42:33 +00:00
Guy Harris ace4af44fc Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c.

Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to
copy_file_binary_mode() (to clarify that it *can* copy text files;
arguably, *all* files are "binary" unless you're on, say, an IBM 1401
:-)).  Have it use the report_err.c routines, so it works in
console-mode programs.

Clean up some comments while we're at it.

svn path=/trunk/; revision=27456
2009-02-15 21:47:57 +00:00
Jeff Morriss a7b7e98cb1 Only declare failure_message() if we HAVE_PLUGINS (since it's only used when that's the case).
svn path=/trunk/; revision=27051
2008-12-18 19:24:34 +00:00
Bill Meier 8afa208ffb Windows build: #include winsock2.h only when needed.
#include winsock2.h pulls in about 90 distinct .h files
and about 140 total .h files. 
Currently winsock2.h is (mostly unnecessarily) included
for each dissector via packet.h/wtap.h.
This patch removes #include winsock2.h from wtap.h and 
then includes winsock2.h (or windows.h) in the 
few specific places required. 
With this patch, my Windows Wireshark build takes 
about 30% less time.


svn path=/trunk/; revision=26535
2008-10-24 00:42:09 +00:00
Jeff Morriss 83f9ecf96f Move privileges.c and unicode-utils.c from epan to wsutil (so things like
capinfos and dumpcap don't need to depend on libwireshark nor directly pull
in those modules).  Because capinfos and editcap were only being linked with
privileges.c if we had plugins, this allows those programs to be linked when
someone is compiling --without-plugins.

svn path=/trunk/; revision=25640
2008-06-30 17:16:29 +00:00
Sake Blok 70ec244f8f From Ken Smith (bug 2574): Allow editcap to parse files into even time intervals
A few changes from me:
- make use of nstime_set_unset and nstime_is_unset i.s.o. extra variable first_pass
- change 'if' to 'while' to allow intervals with no packets
- remove 'unused' variable current_pkt_ts



svn path=/trunk/; revision=25499
2008-06-21 09:45:21 +00:00
Guy Harris be161ba460 Free up the err_info string returned by wtap_read() and
wtap_seek_read().

Clean up indentation.

svn path=/trunk/; revision=25400
2008-05-30 02:44:02 +00:00
Luis Ontanon bf9a9b83a5 Long time ago, I added these to troubleshoot a problem a user was seeing but I could not reproduce, as I had no feedback I forgot about removing these prints.
This must be copied over to the release branch.


svn path=/trunk/; revision=24727
2008-03-25 21:07:52 +00:00
Jeff Morriss b59322ecc1 Don't link plugins against libwireshark: any program that loads the dissector
plugins should already be linked against libwireshark.

Don't link capinfos and editcap against libwireshark: they only needed to be
because the plugins were linked against libwireshark (see rev 24123 and the
ensuing discussion on -dev).

capinfos and editcap: don't complain if plugins fail to load: dissector
plugins should fail to load because they need libwireshark.  I am assuming
here that wiretap plugins don't need libwireshark (I've never seen such a
plugin but LEGO's code and comments suggest this is the case).

(The goal of this checkin is to stop linking capinfos and editcap against
libwireshark while still allowing wiretap plugins.  Since we don't have any
such plugins in the tree I do somewhat doubt the need for all this but I don't
want to be the one to remove the functionality.)

svn path=/trunk/; revision=24650
2008-03-16 00:58:15 +00:00
Jeff Morriss ddca4dd583 Include epan/priveleges.h for get_credential_info()
svn path=/trunk/; revision=24649
2008-03-16 00:41:10 +00:00
Jeff Morriss d951728e6b Have started_with_special_privs() assert out if get_credential_info() was not
previously called.  This prevents the function from always returning TRUE in
programs that hadn't called get_credential_info().

Call get_credential_info() in the programs that should have been.

svn path=/trunk/; revision=24648
2008-03-16 00:32:12 +00:00
Martin Mathieson d7f43bd1b1 When doing random error mutation, protect DCT2000
meta information that is found at the beginning of
the data - this lets me fuzztest my .out files
properly.

Also make some whitespace more consistent.

svn path=/trunk/; revision=24401
2008-02-20 14:13:15 +00:00
Stig Bjørlykke e88b6111a1 Initialize filenamelen to avoid a warning.
svn path=/trunk/; revision=24275
2008-02-06 12:01:48 +00:00
Stig Bjørlykke d856658e6e snprintf -> g_snprintf
svn path=/trunk/; revision=24260
2008-02-03 16:03:33 +00:00
Stig Bjørlykke 47d744b59d More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
2008-02-03 15:38:20 +00:00
Stig Bjørlykke 2df21cb1b7 Fixed some strcpy -> strncpy/g_snprintf cleanups.
Removed a debug printout in t38.

svn path=/trunk/; revision=24188
2008-01-24 23:01:37 +00:00
Stig Bjørlykke 11a9f57c1a Fixed some malloc -> g_malloc, free -> g_free, strdup -> g_strdup.
svn path=/trunk/; revision=24179
2008-01-24 19:09:30 +00:00
Martin Mathieson f16a563466 Replace a handful of tabs with spaces.
svn path=/trunk/; revision=24176
2008-01-24 17:14:01 +00:00
Bill Meier 83888f9c01 From RD Thrush: Fix for 'editcap relies on gnu extension to strptime(3)'
svn path=/trunk/; revision=24124
2008-01-17 21:04:48 +00:00
Sake Blok da42105f77 Clean up the usage information of editcap and change the text
of the -t option to fit its current behaviour

('fixes' bug 2101)


svn path=/trunk/; revision=24072
2008-01-12 18:31:07 +00:00
Gerald Combs 1c9158a00e Add a newline.
svn path=/trunk/; revision=23416
2007-11-09 20:05:44 +00:00
Guy Harris 58585ac5c5 Clean up indentation.
"time_t" is not guaranteed to be an "unsigned long"; when printing it
with %lu, cast it to "unsigned long".

The "secs" field of a wtap_nstime, however, *is* defined to be a time_t;
there's no need to cast it to time_t.

svn path=/trunk/; revision=23036
2007-09-30 22:13:38 +00:00
Sake Blok 27efb95042 This patch fixes the following two errors that appear when
configure is run with "--without-plugins"

cc1: warnings being treated as errors
about_dlg.c: In function ‘about_wireshark_cb’:
about_dlg.c:426: warning: unused variable ‘plugins_page’
make[2]: *** [about_dlg.o] Error 1

editcap.c: In function ‘main’:
editcap.c:663: error: ‘check_ts’ undeclared (first use in this function)
editcap.c:663: error: (Each undeclared identifier is reported only once
editcap.c:663: error: for each function it appears in.)
make[2]: *** [editcap.o] Error 1


svn path=/trunk/; revision=22761
2007-08-31 14:14:17 +00:00
Luis Ontanon d8e818e9da Make sure that wiretap plugins are loaded before dissectors are (if a new encap type is registered the plugin probably needs it before reg_handoff)
svn path=/trunk/; revision=22461
2007-08-07 20:07:43 +00:00
Luis Ontanon c1c9e0bb90 nononono.... print one on 250 not every line
svn path=/trunk/; revision=22426
2007-07-30 21:17:03 +00:00
Luis Ontanon f43578e8f4 for bug 1158 have editcap print the value of the timestamps while running so I can get feedback from the user.
svn path=/trunk/; revision=22425
2007-07-30 21:10:12 +00:00
Jeff Morriss 301432dc5c Increase the maximum number of packet selections to 512 (from 100). More importantly, give the user feedback if we run out of room for packet selections. As mentioned on the list, this could be made completely dynamic if someone actually goes over the (new) limit. OK for 0.99.6 but not necessary.
svn path=/trunk/; revision=22145
2007-06-20 20:02:52 +00:00
Luis Ontanon 162382dcb1 Have editcap and capinfos compile --without-plugins
Should go in 0.99.6


svn path=/trunk/; revision=22116
2007-06-17 04:58:16 +00:00
Luis Ontanon 11f06217ce Have editcap and capinfos loading the wiretap plugins.
epan/filesystem.c
   have get_plugin_dir() calling init_plugin_dir() if necessary

epan/epan.c and epan/report_err.c
   move the report_failure family into the new report_err.c file, have epan_init() calling the initializer

epan/plugins.h and epan/proto.c
   do not have init_plugins() calling the proto_reg functions instead do it in init_proto()

gtk/main.c and tshark.c
   init_plugin_dir() has become suprefluous

capinfos.c and editcap.c
   load the wiretap plugins

Makefiles
   do what's needed to build withe the above changes.




svn path=/trunk/; revision=21935
2007-05-25 17:22:32 +00:00
Jörg Mayer b16106f89f Only #deinfe __USE_XOPEN if not already defined. On my Suse 10.2 it was
already #defined to 1, so this would create a warning/error.


svn path=/trunk/; revision=21508
2007-04-22 20:04:34 +00:00
Ulf Lamping 45c8c7a843 fix MSVC warnings of / and set CFLAGS to block new warnings
svn path=/trunk/; revision=21098
2007-03-21 23:14:23 +00:00
Jaap Keuter 849fafe7f7 From Sebastien Tandeil:
a patch to avoid the warning "implicit declaration of function
'strptime'" in editcap.c
glib.h is included just after the define __USE_XOPEN and include <time.h>

svn path=/trunk/; revision=20455
2007-01-16 19:13:09 +00:00
Gerald Combs 53689800e6 Move epan/crypt-md5.[ch] to epan/crypt. Remove
epan/crypt/airpdcap_md5.[ch].  Fix up whitespace.

svn path=/trunk/; revision=20277
2007-01-02 22:49:57 +00:00
Jörg Mayer dd26a7021b nikai@nikai.net:
Remaining fixes from:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1225

svn path=/trunk/; revision=19895
2006-11-14 20:32:29 +00:00
Ulf Lamping 59d6c8ea33 change all file offsets from long to gint64 so we can - theoretically - handle files > 2GB correct.
Please distclean Win32 builds!

svn path=/trunk/; revision=19814
2006-11-05 22:46:44 +00:00
Luis Ontanon b09b3c5f46 As proposed by Tim Furlong:
set starttm.tm_isdst to -1 to have mktime() propperly interpret DST.
Might fix Bug 1158

svn path=/trunk/; revision=19662
2006-10-23 14:57:54 +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
Anders Broman f68d6e4c8c Ethereal->Wireshark
svn path=/trunk/; revision=18235
2006-05-28 20:28:20 +00:00
Luis Ontanon e57aefead5 - Have strptime prototype being included.
- clear struct tm s before passing them to strptime.
- make sure stopttime is a valid value on every plattform.


svn path=/trunk/; revision=17647
2006-03-16 19:45:02 +00:00
Luis Ontanon ecae4ddd06 use time_t instead of an unsigned integer to sstore the time.
svn path=/trunk/; revision=17638
2006-03-15 20:52:37 +00:00
Luis Ontanon fb41328889 Add -A <start time> and -B <stop time> options to editcap
svn path=/trunk/; revision=17614
2006-03-13 22:20:07 +00:00