Commit Graph

467 Commits

Author SHA1 Message Date
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
Evan Huus ec7d4f0cfd Run epan_cleanup after printing the version information in tshark,
as it makes the results of ./tools/valgrind-wireshark.sh -n
much more interesting and useful.

svn path=/trunk/; revision=47221
2013-01-23 02:30:15 +00:00
Guy Harris 05825b02cd Add some routines to wsutil to, at least on some platforms, add
information to crash dumps and the like.  (Currently, we only handle OS
X's CrashReporter, but we should do this on other platforms where this
information can be added and would be helpful.)

White space tweaks.

svn path=/trunk/; revision=47104
2013-01-15 21:54:41 +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
Michael Mann 0bdfbe97d4 Add -Q option to TShark to force only "true" errors to stderr. No "status" messages should be included if -Q option is specified. Bug 2881 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2881)
svn path=/trunk/; revision=46627
2012-12-20 01:22:42 +00:00
Jeff Morriss 20211340e5 Make the "-g" argument to tshark actually work (by passing it to dumpcap).
svn path=/trunk/; revision=46515
2012-12-12 03:25:35 +00:00
Jeff Morriss 05ee001d73 Document the "-g" option to dumpcap.
Add that option to tshark, too, and document it.

The option can't be given to Wireshark because the GUI already has a "-g"
(goto packet).

svn path=/trunk/; revision=46513
2012-12-12 02:07:08 +00:00
Michael Mann 40eca5f0de Allow TShark to specify columns as fields with -e option (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2892)
svn path=/trunk/; revision=46465
2012-12-08 02:42:40 +00:00
Gerald Combs bd19dcd8bf Add an add_hosts_file routine that adds a "hosts" path to an array and
use it in tshark.c instead of read_hosts_file. This lets us use "-H"
multiple times. Make read_hosts_file static.

svn path=/trunk/; revision=46273
2012-11-29 00:32:39 +00:00
Jeff Morriss 38b58bd671 Delay the reading of the hosts file ("-H") until after cf_open() has been
called.  (cf_open() calls init_dissection() which, since r45511,
re-initializes the name resolution database.)

Complain if the user gives an invalid argument to "-W".

Specify the invalid argument if we don't like a "-z" argument.

svn path=/trunk/; revision=46238
2012-11-27 23:05:03 +00:00
Bill Meier 552323e7fb Fix a number of [-Wshadow] warnings;
Also: Do some minor whitespace changes

svn path=/trunk/; revision=46182
2012-11-25 18:35:41 +00:00
Guy Harris d415d3d87c On error, have capture_opts_trim_iface() return the exit status that
should be used (on success, have it return 0).  Exit with that exit
status; if the problem is that we couldn't get the interface list or if
there are no interfaces in that list, return 2, as that's not a
command-line syntax error.

svn path=/trunk/; revision=46108
2012-11-21 17:14:54 +00:00
Anders Broman 28474fe8ef From Mike Garratt:
Friendly Names for interfaces on Windows

Notes on the changes the patch covers:
* if_info_t struct: addition of friendly_name
* Dumpcap Interface list format changes:
  + Win32: "dumpcap -D" shows friendly_name in place of descript if known
  + All: machine interface "dumpcap -D -Z none" includes friendly_name in the
list in addition to the existing parameters
* interface_options struct: addition of console_display_name
  + When an interface name is displayed in a console, it will typically be the
console_display_name (instead of name). 
  + console_display_name is used as the basis of the autogenerated temp
filenames
  + console_display_name is typically set to the friendly_name if known,
otherwise it is set to the interface name
* Enhancements to capture_opts_add_iface_opt() (the function which process -i
options).
  + Can now specify the interface using its name and friendly_name
  + Interface name matching is case insenstive
  + Name matching first attempts exact matching, then falls back to prefix
matching
    (e.g. dumpcap -i local)
  + Validates interface names, instead of blindly sending them off to
winpcap/libpcap
  + Interface specification by number is still supported.
* capture_opts_trim_iface() has been refactored:
  + Instead of repeating a decent chunk of the cost in
capture_opts_add_iface_opt(), it calls capture_opts_trim_iface() to specify the
interface.
* introduction of capture_win_ifnames.[ch] (windows only code)
  + Implements static function GetInterfaceFriendlyNameFromDeviceGuid() - a
windows version independant function to convert an interface guid into its
friendly name.  Uses published api functions on windows vista and higher, but
falls back to unpublished API functions on older windows releases.
  + void get_windows_interface_friendlyname(/* IN */ char
*interface_devicename, /* OUT */char **interface_friendlyname); - extracts the
GUID from the interface_devicename, then uses
GetInterfaceFriendlyNameFromDeviceGuid() to do the resolution
* Auto temp filename generation:
  + Now uses wireshark_pcapng_* or  wireshark_pcap_* depending on file format
  + Basis temp filename format on console_display_name
  + Win32: if console_display_name is a windows interface guid, extracts
numbers from GUID here (instead of in interface option processing) 

GUI CHANGES:
* Dialog that displays when you click the "Manage Interfaces" button (within
Capture Options dialog) has been renamed from "Add new interfaces" to
"Interface Management"
* ui/gtk/capture_dlg.c: new_interfaces_w variable renamed to
interface_management_w
* Win32: Local Interfaces tab on Interface Management dialog, shows includes
friendly name as far left column
* Interface Management dialog defaults to larger size on win32 - so it fits
without resizing local interfaces tab
* Interface Management dialog now saves preferences when you click the apply
button (local hidden interfaces was not persisting across restarts)
* Tweaks: "Interface Details" dialog (Interface list->Capture Interfaces ->
Details):
  + "Friendly Name" renamed to "NDIS Friendly Name"
  + Added "OS Friendly Name" to the top of the list
* Win32: The "Capture Interfaces" dialog now shows the friendly name instead of
device guid
* Welcome screen:
  + The height of the interface list scrollbox dynamically adjusts & updates to
the number visible interfaces.
    Up to 10 interfaces can be listed without a scroll bar, the minimum height
is for 2 interfaces. 
  + Win32: now shows just the Friendly Name if known - in place of
"Interfacename_Guid:(Description)"

svn path=/trunk/; revision=46083
2012-11-19 20:07:27 +00:00
Jakub Zawadzki 418f56d093 Don't use wtap_phdr() for getting pkthdr struct after wtap_seek_read().
svn path=/trunk/; revision=45808
2012-10-27 08:32:41 +00:00
Chris Maynard 26989e9d11 Inspired by http://www.wireshark.org/lists/wireshark-users/201206/msg00025.html, add support for being able to specify a numeric range as the <selector> part of tshark's -d <layer type>==<selector>,<decode-as protocol> option.
svn path=/trunk/; revision=45734
2012-10-23 00:58:38 +00:00
Chris Maynard 573dd5b3dc 1) Allow for the possibility for both packet summary and packet details to be
printed when either -T is not specified or "-T text" or "-T ps" is selected.

2) Allow for packet hex/ascii to be printed without necessarily requiring that
either packet summary or packet details also be printed.  This just means that
if you want packet summary information, use "-Px" instead of just "-x".

3) Fix bug with order of evaluation of -V and "-T psml".

4) If a packet separator is specified, always use it regardless of the -PVx
options chosen.

5) Don't print 2 lines of separation between packets when only printing
hex/ascii.  Print 1 line of separation as in all other cases.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7782 plus other misc. enhancements.

svn path=/trunk/; revision=45715
2012-10-22 15:56:59 +00:00
Jakub Zawadzki 77368c3668 Introduce epan_dissect_run_with_taps() which run dissection with taps.
unexport tap_queue_init, tap_push_tapped_queue

svn path=/trunk/; revision=45670
2012-10-20 19:27:24 +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
Evan Huus 9433de4c8a Unused variable
svn path=/trunk/; revision=45544
2012-10-14 19:48:22 +00:00
Gerald Combs 71ed773862 Add a capture_file * element to packet_range_t and pass it explicitly in
packet_range_init(). Get rid of global cfile references in
packet-range.c. C++-ize packet-range.h. Shuffle some includes around.

svn path=/trunk/; revision=45333
2012-10-05 18:52:42 +00:00
Guy Harris 73dd0321ea Get rid of the always-null and unused argument to
host_name_lookup_process().  If, in the future, we find that we need an
argument for changes we're making, we can add it then.

svn path=/trunk/; revision=45269
2012-10-02 21:13:59 +00:00
Guy Harris 692bd92699 Fix a comment, add another comment, and fix indentation.
svn path=/trunk/; revision=45268
2012-10-02 20:47:20 +00:00
Jakub Zawadzki 72ca9d0e61 Store pointers to previously displayed and captured packet, not nstime_t deltas.
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure.

Part of bug 5821: Reduce per-packet memory requirements.

svn path=/trunk/; revision=45071
2012-09-23 16:25:28 +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 baf111a23c Add casts to fix compilation with GCC.
Remove * from gconstpointers, they are already pointer types.
Add modelines to packet.c and clean up indentation a bit.

svn path=/trunk/; revision=44698
2012-08-29 22:19:29 +00:00
Michael Mann e5e09f7016 Fix Bug 7348 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7348)
svn path=/trunk/; revision=44696
2012-08-29 21:23:07 +00:00
Michael Mann e0e533d643 Have (almost) all preferences use the generic preferences API (per https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7402). This cleaned up a lot of hardcoded code and allows breaking up the prefs structure (or at least prevent it from growing too large) if desired.
Bugfixed problems mentioned in
http://www.wireshark.org/lists/wireshark-dev/201208/msg00001.html

Column preferences now support default '#' character

svn path=/trunk/; revision=44348
2012-08-08 16:54:02 +00:00
Irene Rüngeler 3a3b4a1fdc Add -A as command line option to wireshark and tshark.
svn path=/trunk/; revision=44339
2012-08-08 14:30:55 +00:00
Evan Huus 10c9e21812 Only initialize fields in the print_args that are actually used.
This prevents a memory leak where we were allocating for print_args.range
but never freeing.

svn path=/trunk/; revision=43921
2012-07-22 22:01:10 +00:00
Anders Broman c19583b72c From Michael Mann:
Generic preferences implementation - Printing and Name Resolution.

svn path=/trunk/; revision=43579
2012-07-06 04:48:36 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman 3814106d7e From Michael Mann:
generic preferences implementation

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

svn path=/trunk/; revision=43484
2012-06-25 21:05:36 +00:00
Gerald Combs 49849233c3 If we're making two passes and we have a display filter applied, create
a protocol tree in process_packet_first_pass(). Otherwise we crash with

ERROR:dfvm.c:434:dfvm_apply: assertion failed: (tree)

svn path=/trunk/; revision=43420
2012-06-20 20:44:05 +00:00
Guy Harris 4a9b825c49 Change the "user_saved" member of a capture_file structure to
"unsaved_changes", and have it be TRUE iff changes have been made to the
file since it was read - *not* if it's a temporary file from a live
capture.

Check the "is_tempfile" member, and the "unsaved_changes" member, when
appropriate.

Just have a set_toolbar_for_capture_file() routine that updates the
"save", "close", and "reload" toolbar as appropriate, given a
capture_file structure - absorb the function of
set_toolbar_for_unsaved_capture_file() into it.

svn path=/trunk/; revision=42721
2012-05-20 08:56:06 +00:00
Gerald Combs bdb614e264 Fix a bunch of uninitialized variables found by Coverity Scan. CIDs
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411,
and 702412.

svn path=/trunk/; revision=42658
2012-05-16 16:29:12 +00:00
Anders Broman fc41d4ad51 From Evan Huus:
Duplicate and misplaced 'break' statements.

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

svn path=/trunk/; revision=42091
2012-04-16 08:39:34 +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
Michael Tüxen 2764d9977b Use wtap_dump_open_ng() in tshark.
svn path=/trunk/; revision=41123
2012-02-21 17:19:45 +00:00
Michael Tüxen acb9414db9 This should fix the buildbots...
The problem was that when reading a .pcap file, we don't have any IDBs.
If reqested to write out an pcapng file, we (now) build a dummy IDB which
uses the file's encapsulation as the interface encapsulation. Therefore
it can't be per=packet.
We need to fix this by using wtap_dump_open_ng()...

svn path=/trunk/; revision=41122
2012-02-21 17:07:57 +00:00
Jörg Mayer 35508464b2 Start moving files to ui/ and ui/cli/
svn path=/trunk/; revision=41047
2012-02-17 12:30:27 +00:00
Guy Harris 55001ef198 With the WTAP_ERR_UNSUPPORTED error, Wiretap supplies a string giving
the details of what in particular is unsupported; report it in TShark
and Wireshark.

Handle WTAP_ERR_RANDOM_OPEN_PIPE in TShark.

Handle WTAP_ERR_COMPRESSION_NOT_SUPPORTED in TShark, and have its error
message in Wireshark not speak of gzip, in case we support compressed
output in other formats in the future.

If we see a second section header block in a pcap-NG file, don't report
it as "the file is corrupted", report it as "the file uses a feature we
don't support", as that's the case - and don't free up the interface
data array, as the file remains open, and Wireshark might still try to
access the packets we were able to read.

svn path=/trunk/; revision=41041
2012-02-16 18:58:40 +00:00
Guy Harris 31204e8406 It is a complete mistake to have *ANY* messages during packet capture
sent to the standard output if "-w" is specified because, when you
capture, you can capture with the output directed to the standard
output, and dumping some text crap to the standard output will corrupt
your capture file.

svn path=/trunk/; revision=40966
2012-02-11 03:57:49 +00:00
Anders Broman 3a812083a8 From Michael Mann:
Went through all stderr cases within tshark trying to make tshark "quieter".  I
basically ended up agreeing with the submitted in terms of what should be
switched to stdout from stderr.  The attached patch does that.

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

svn path=/trunk/; revision=40862
2012-02-05 13:05:15 +00:00
Michael Tüxen 14b1a44c0f Third try. This time pipes and stdin are supported and the
test scripts are passed.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.

svn path=/trunk/; revision=40715
2012-01-25 13:04:32 +00:00
Michael Tüxen 4fece25e7f We need a 3rd try. (After learning how to run the testuite on Windows locally).
svn path=/trunk/; revision=40695
2012-01-24 17:12:56 +00:00
Michael Tüxen 08d6785412 Second try. This time pipes and stdin are supported.
Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.


svn path=/trunk/; revision=40693
2012-01-24 16:05:26 +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
Guy Harris 53eb852fa7 Leave it up to dumpcap to determine whether WinPcap was loaded and, if
it wasn't, whether it matters; that way you can still capture from a
pipe (named or "-" for standard input) even if you don't have WinPcap.

svn path=/trunk/; revision=40336
2011-12-29 23:21:18 +00:00
Guy Harris 7e531049a0 Swallow cant_load_winpcap_err() up into capture-wpcap.c, so that
anything that uses WinPcap can use that message text in its error
messages.

svn path=/trunk/; revision=40335
2011-12-29 23:09:42 +00:00
Guy Harris 3864d5d19d Add an additional DONT_HAVE_PCAP return value from get_interface_list()
and capture_interface_list().  Return it if, on Windows, we ask for the
interface list but don't have WinPcap installed.  Handle it like
CANT_GET_INTERFACE_LIST.

svn path=/trunk/; revision=40334
2011-12-29 22:49:49 +00:00
Bill Meier ebe33ba92a Add tshark option '-G heuristic-decodes' to dump heuristic dissector tables.
svn path=/trunk/; revision=40309
2011-12-28 15:05:59 +00:00
Gerald Combs 3c1b8a6ca1 Add a "-G ftypes" option, which dumps our supprted FT_… names and
descriptions. Captitalize and fix up the descriptions. Use its output to
create the field type list in the wireshark-filter man page.

svn path=/trunk/; revision=40306
2011-12-27 20:35:41 +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
Chris Maynard 37bb6e88fd Add the -H and -W options to the "tshark -h" output. Ref: http://www.wireshark.org/lists/wireshark-users/201112/msg00044.html
svn path=/trunk/; revision=40172
2011-12-13 03:17:49 +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
Martin Mathieson e31d76c4cd Make exit_status volatile to avoid warning.
svn path=/trunk/; revision=39825
2011-11-14 11:36:53 +00:00
Guy Harris 640ad2b623 Catch the OutOfMemoryError exception and print a message.
svn path=/trunk/; revision=39798
2011-11-12 06:35:51 +00:00
Gerald Combs c657812a91 Initialize threads at program startup. Hopefully this will fix the
current build test failures.

svn path=/trunk/; revision=39790
2011-11-11 00:04:14 +00:00
Gerald Combs aa0c9c965c Try to fix the GLib thread API deprecations listed in bug 6552.
svn path=/trunk/; revision=39776
2011-11-09 23:43:50 +00:00
Chris Maynard aa1199d01f Rather than complain and quit if -V is missing when -O <protocols> is used, do the user a favor and continue as if -V had been specified. Add explicit documentation of the -O <protocols> option to the man page.
svn path=/trunk/; revision=39175
2011-09-28 14:50:07 +00:00
Guy Harris 2062d71c2c The separator between packets is an output option, not a capture option,
so it should be present even when building without libpcap.

svn path=/trunk/; revision=39171
2011-09-27 19:52:19 +00:00
Chris Maynard 311c5ef686 Add a new tshark option for being able to specify an alternate line separator between packets. The option chosen was "-S <separator>". The former -S option was renamed to -P, and the former -P option, which was previously undocumented, was renamed to -2. This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5342.
svn path=/trunk/; revision=39168
2011-09-27 18:32:59 +00:00
Stig Bjørlykke c66df8b030 From Yann via bug 6245:
Fixed crash in write_preamble().

svn path=/trunk/; revision=38562
2011-08-16 13:27:41 +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
Guy Harris 053c583fda Add some additional routine variants that handle string encodings, and
make FT_STRING and FT_UINT_STRING handle string encodings.

Get rid of FT_EBCDIC in favor of FT_STRING with ENC_EBCDIC.

Add some URLs for DRDA.

Clean up some stuff in TN3270 and TN5250, including using ENC_ values
for proto_tree_add_item().

svn path=/trunk/; revision=37909
2011-07-05 23:59:23 +00:00
Anders Broman 2f05cf4dcf From Michael Mann:
Added ability to display UTC time or UTC time with date.  I liked having the
difference between UTC and local time, not just setting local=UTC.

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

svn path=/trunk/; revision=37898
2011-07-04 21:43:34 +00:00
Stig Bjørlykke 8443bbbf75 Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812
2011-06-28 09:00:11 +00:00
Michael Tüxen 6c094f6775 Use the filter argument as the capture filter for all interfaces.
Signal an error if another capture filter is provided using the
-f option.

svn path=/trunk/; revision=37811
2011-06-28 08:00:14 +00:00
Michael Tüxen 741c973afe Put variable under the correct #ifdef.
svn path=/trunk/; revision=37807
2011-06-27 20:00:30 +00:00
Michael Tüxen df70b4c15c Fix the bug reported by Guy. Now
tshark -i en0 icmpp
returns a correct error message.


svn path=/trunk/; revision=37806
2011-06-27 19:07:36 +00:00
Michael Tüxen 2c8c178f71 Improve the report of illegal capture filters. Also show the interface description.
svn path=/trunk/; revision=37802
2011-06-27 11:30:39 +00:00
Michael Tüxen 65d8f7c4c0 Use the interface description instead of the interface name when
reporting an error.

svn path=/trunk/; revision=37799
2011-06-27 10:11:15 +00:00
Michael Tüxen 421dafd2de Get rid of old non-interface specific settings which are now interface
specifc. This finalizes the change of the infrastructure.
This patch is based on work by Irene Ruengeler.

svn path=/trunk/; revision=37794
2011-06-27 00:09:03 +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 cdd23c3bd0 See if this squelches some compiler warnings.
svn path=/trunk/; revision=37670
2011-06-15 19:27:01 +00:00
Gerald Combs 0272ec5dd3 Show the plugin paths in Help→About→Plugins. Add a "-G plugins" option
to TShark which dumps a list of plugins.

svn path=/trunk/; revision=37512
2011-06-01 21:48:17 +00:00
Michael Tüxen 8f8f0e9ad6 Get rid of has_cfilter to simplify the handling of multiple interfaces.
svn path=/trunk/; revision=37478
2011-05-31 14:49:21 +00:00
Guy Harris b44838bd2e Don't print hidden columns.
svn path=/trunk/; revision=37374
2011-05-24 16:17:43 +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
Gerald Combs 99d4de66e5 From Dirk Jagdmann via bug 5875:
My attachment adds a link to a XSLT file to the preamble of the PDML.
The XSLT will transform the PDML to a HTML page, and the HTML page
features a look similar to Wireshark. See
http://cubic.org/~doj/ebay/a.pdml for an example.

The patch also contains a small perl program which converts the
Wireshark colortable into javascript code which is used in the XSLT
file. If you want to use a different color scheme you would execute the
perl program and insert the generated javascript function into your XSLT
file.

To view the HTML you could either place the PDML and XSLT file on your
webserver and verify that your webserver sends the PDML file as
"text/xml".  Then your webbrowser will find the linked XSLT file,
download that as well and convert the PDML to HTML on the fly.

You could also use an XSLT processor like xsltproc to convert the PDML
and XSLT into a static HTML file.


From me:

Minor fixups.

svn path=/trunk/; revision=37298
2011-05-19 18:10:21 +00:00
Michael Tüxen 1d19739c9f Remove unused define.
svn path=/trunk/; revision=37288
2011-05-19 12:14:27 +00:00
Michael Tüxen 487f03612f Don't print too many interface names...
svn path=/trunk/; revision=37253
2011-05-18 18:35:57 +00:00
Michael Tüxen 985c2b78fd Support multiple interfaces when used with -L option.
Show multiple interfaces when capturing from them.

svn path=/trunk/; revision=37249
2011-05-18 18:03:58 +00:00
Michael Tüxen cfe3d2d0da Get -L and -d working with multiple interface. Internally get some functions
using the array of interface data.
Improve output of -L by printing the interface name.

svn path=/trunk/; revision=37120
2011-05-13 11:28:51 +00:00
Jeff Morriss 009156289f Fix the test.sh failures based on Guy's suggestion in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5445#c15 :
Add a new tap flag to indicate that a tap listener is just a "dissector helper",
that is, a tap which is used by a dissector to help it do its dissection but
does not, itself, require dissection.

Use this new flag in the dissectors which register taps.

Remove the (now-unused) have_tap_listeners() function.

svn path=/trunk/; revision=37069
2011-05-12 03:18:34 +00:00
Chris Maynard 5b0365d6c2 Wrap text of description for -O.
svn path=/trunk/; revision=36976
2011-05-03 15:38:22 +00:00
Stig Bjørlykke 6be87f6f90 Untabify
svn path=/trunk/; revision=36948
2011-04-29 06:55:49 +00:00
Stig Bjørlykke 65910b2479 From Edwin Groothuis via bug 5870:
The supplied patch adds a new option -O, which specifies a list of protocols
(names can be found with the "-G protocols" option) to be fully decoded while
the others only show the layer header.

svn path=/trunk/; revision=36947
2011-04-29 06:53:29 +00:00
Guy Harris c9b9dd690b Create a new frame_data_sequence data type; it represents a dense
sequence of frame_data structures, indexed by the frame number.  Extract
the relevant bits of the capture_file data structure and move them to
the frame_data_sequence, and move the relevant code from cfile.c and
tweak it to handle frame_data_sequence structures.

Have a possibly-null pointer to a frame_data_sequence structure in the
capture_file structure; if it's null, we aren't keeping a sequence of
frame_data structures (we don't keep that sequence when we're doing
one-pass processing in TShark).

Nothing in libwireshark should care about a capture_file structure; get
rid of some unnecessary includes of cfile.h.

svn path=/trunk/; revision=36881
2011-04-27 02:54:44 +00:00
Guy Harris 6c09e1cf95 Another hack to handle the one-pass case.
svn path=/trunk/; revision=36880
2011-04-27 00:43:31 +00:00
Guy Harris 71b31d92fc Store the frame_data structures in a tree, rather than a linked list.
This lets us get rid of the per-frame_data-structure prev and next
pointers, saving memory (at least according to Activity Monitor's report
of the virtual address space size on my Snow Leopard machine, it's a
noticeable saving), and lets us look up frame_data structures by frame
number in O(log2(number of frames)) time rather than O(number of frames)
time.  It seems to take more CPU time when reading in the file, but
seems to go from "finished reading in all the packets" to "displaying
the packets" faster and seems to free up the frame_data structures
faster when closing the file.

It *is* doing more copying, currently, as we now don't allocate the
frame_data structure until after the packet has passed the read filter,
so that might account for the additional CPU time.

(Oh, and, for what it's worth, on an LP64 platform, a frame_data
structure is exactly 128 bytes long.  However, there's more stuff to
remove, so the power-of-2 size is not guaranteed to remain, and it's not
a power-of-2 size on an ILP32 platform.)

It also means we don't need GLib 2.10 or later for the two-pass mode in
TShark.

It also means some code in the TCP dissector that was checking
pinfo->fd->next to see if it's NULL, in order to see if this is the last
packet in the file, no longer works, but that wasn't guaranteed to work
anyway:

	we might be doing a one-pass read through the capture in TShark;

	we might be dissecting the frame while we're reading in the
	packets for the first time in Wireshark;

	we might be doing a live capture in Wireshark;

in which case packets might be prematurely considered "the last packet".
#if 0 the no-longer-working tests, pending figuring out a better way of
doing it.

svn path=/trunk/; revision=36849
2011-04-25 19:01:05 +00:00
Guy Harris 6cbf6ce16c Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code.  Have it also supply a err_info string, and
report it.  Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.

svn path=/trunk/; revision=36748
2011-04-21 09:41:52 +00:00
Anders Broman efeaabdd9a Cast away size_t warnings on win64.
svn path=/trunk/; revision=36617
2011-04-13 04:53:02 +00:00
Chris Maynard 5773340023 Use g_snprintf instead of sprintf and g_strlcat instead of strcat: Coverity 698
svn path=/trunk/; revision=36597
2011-04-12 17:57:22 +00:00
Guy Harris 92c974f2f7 Now that wtap_read() checks for delayed errors on EOF, there's no need
to check for it on close.

svn path=/trunk/; revision=36593
2011-04-12 17:37:05 +00:00
Guy Harris e5fe0128d7 Allow wtap_sequential_close() and wtap_close() to return an error; this
may happen if, when reading a compressed file, we find an error in the
file's contents past the last packet (e.g., the file being cut short so
that we can't get a full buffer worth of compressed data), and that
reporting of that error is delayed (so that you can get all of the
packets that we *can* decompress).  Check for those errors, at least on
the sequential read pass (the only errors we should see when closing the
random stream are errors we've already seen in the sequential stream).

svn path=/trunk/; revision=36576
2011-04-12 01:36:12 +00:00
Bill Meier 18fc4872bc Rename local 'pipe_input' so it doesn't shadow global 'pipe_input';
Use consistent indentation and remove trailing whitespace.

svn path=/trunk/; revision=36428
2011-03-31 20:57:40 +00:00
Chris Maynard a3fe8fbd1a Fix a couple of typos.
svn path=/trunk/; revision=36410
2011-03-30 15:54:28 +00:00
Chris Maynard 9e55be72fc Wrap all text lines of help at column 80.
svn path=/trunk/; revision=36408
2011-03-30 14:44:18 +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
Stig Bjørlykke d188988e83 Added functionality for handling global profiles.
Global profiles can be installed in a "profiles" directory in the
Global configuration directory, and a global profile will be copied
to the users profiles on first time usage.

svn path=/trunk/; revision=36077
2011-02-26 17:23:24 +00:00
Chris Maynard 7180a53aff Sort capture file types listed by "-F" like editcap does.
svn path=/trunk/; revision=36008
2011-02-19 22:01:14 +00:00
Gerald Combs 0c9649929e From Huzaifa Sidhpurwala of the Red Hat Security Response Team: Don't
free uninitialized memory.

See also: bug 5652.

svn path=/trunk/; revision=35791
2011-02-03 22:50:49 +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
Jaap Keuter 8d6a5fba46 Avoid the need for cf_mark_frame stubs.
svn path=/trunk/; revision=35248
2010-12-22 23:09:31 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Anders Broman f5cf823e1a Bug fix: Running tshark with the following command will leave a temp file on the file system.
\tshark -f "port 53" -a duration:1 -z proto,col info,dns.qry.type,dns.qry.type

svn path=/trunk/; revision=34791
2010-11-05 15:01:05 +00:00
Stig Bjørlykke 2cedc69849 Fixed "Compiled with" information in the About box.
svn path=/trunk/; revision=34601
2010-10-21 07:13:43 +00:00
Bill Meier c78221d4ce Rename g_resolv_flags --> gbl_resolv_flags; Also: cleanup some whitespace & indentation.
svn path=/trunk/; revision=34487
2010-10-12 13:15:08 +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
Gerald Combs cfa9982492 Make sure we call wtap_cleareof() before each read.
svn path=/trunk/; revision=33555
2010-07-16 18:20:32 +00:00
Guy Harris cc3540b0fb Move the code to get version information for libraries used by
libwireshark into libwireshark, and call it only in programs linked with
libwireshark.  That way, programs that don't link with libwireshark
don't have to link with libgcrypt or libgnutls solely so that they can
say that they're linked with a particular version of libgcrypt or
libgnutls.

Don't link dumpcap with libgcrypt or libgnutls any more.

svn path=/trunk/; revision=33531
2010-07-15 02:07:16 +00:00
Sake Blok e10147fb73 Add an option to print the first, the last or all occurrences of each field
(when using tshark -T fields)


svn path=/trunk/; revision=33529
2010-07-14 21:53:57 +00:00
Sake Blok 717abac483 Make 'tshark -T fields' print all values for fields with multiple occurences.
svn path=/trunk/; revision=33527
2010-07-14 20:28:34 +00:00
Guy Harris 7d45ac7dd5 Get rid of no-longer-used variable.
svn path=/trunk/; revision=33511
2010-07-14 02:12:55 +00:00
Guy Harris b0b7697dea From Petr Lautrbach: when capturing, return the exit status of dumpcap,
so we give a non-zero exit status for invalid interfaces or capture
filters.

From me: don't exit immediately if dumpcap failed, print out information
from taps and the like.

svn path=/trunk/; revision=33393
2010-07-01 00:12:16 +00:00
Gerald Combs 0b9c5b9248 r32715 fixed bug 4708 (zlib-1.2.5 cause wireshark to stop live capture)
for Wireshark but not TShark. Apply the fix to TShark as well. Fixes bug
4916.

svn path=/trunk/; revision=33327
2010-06-25 22:24:26 +00:00
Anders Broman 4e220d29ff From Jim Young:
The attached patch simply documents a long supported but hidden tshark -G
option.

Tshark's print_usage() has been augmented as well as the tshark man page.

svn path=/trunk/; revision=33253
2010-06-18 17:18:00 +00:00
Guy Harris c731e7f921 Alas, the stuff to see whether the standard output and error are the
same works only on UN*X; note that, and don't bother compiling it on
Windows.

svn path=/trunk/; revision=33125
2010-06-07 09:43:32 +00:00
Guy Harris fc18b399fd If we get an error reading the capture file, don't give up - run the
taps, etc., so we at least print the statistics for the packets we
*could* read.

Also, if we're printing packet data, and the standard output and
standard error are going to the same place, before printing the error
message for that error, flush the standard output and print a newline to
the standard error, so the error appears after all the packet data, and
has a newline separating it from the packet data.

This fixes bug 4845.

svn path=/trunk/; revision=33124
2010-06-07 08:42:29 +00:00
Guy Harris cc574686ba Clarify an error message (and the corresponding comment).
Fix the no-libpcap build.

svn path=/trunk/; revision=33103
2010-06-05 01:55:06 +00:00
Guy Harris 71ada2c31b Catch some cases that don't currently work.
svn path=/trunk/; revision=33100
2010-06-05 00:08:37 +00:00
Guy Harris 7ecae442c5 capture() can, in some cases, return FALSE when the capture succeeds;
back out the change to check its return value until we fix that.

Also back out the test suite changes to look for an error exit for
invalid capture filters and interfaces.

svn path=/trunk/; revision=33029
2010-06-01 03:37:51 +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
Guy Harris 8d949600af Use return rather than exit in main().
Return 2 for a capture error - we mainly use 1 for command-line syntax
errors (rather than, say, filter syntax errors or an invalid interface).

Now that TShark exits with an error status when given an invalid capture
filter or invalid interface, check for "error" rather than "success" as
an exit status.

svn path=/trunk/; revision=33006
2010-05-28 01:09:28 +00:00
Bill Meier ece0ada557 Fix bug #4735: tshark returns 0 on non-valid filter and interface.
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4735

svn path=/trunk/; revision=33004
2010-05-27 23:46:01 +00:00
Guy Harris 80fda10f18 Make -q not a capture option again - it's used by tshark even when not
capturing, and thus even when we build without pcap.

svn path=/trunk/; revision=32988
2010-05-27 01:13:49 +00:00
Guy Harris 391b5127d6 Clean up the error reporting. An EOF from the sync pipe when capturing
is just an indication that the capture child exited; don't treat it as
an error, unless the child process exits with an abnormal status.
 
As tshark sends a "stop capture" indication to the child when it's
^C'ed, the child will exit and we'll get an EOF from the capture pipe;
don't make SIGINT etc. interrupt system calls, so they don't cause reads
from the capture pipe to get EINTR errors.

svn path=/trunk/; revision=32986
2010-05-27 00:48:08 +00:00
Guy Harris b0bfae2a85 Don't send ^T output to the standard error if we're a capture child.
Make SIGINFO a restart-the-system-call signal, so reads etc. don't
return an error.

svn path=/trunk/; revision=32968
2010-05-26 04:29:36 +00:00
Guy Harris d0ac88186d If dumpcap exits abnormally, report the error.
svn path=/trunk/; revision=32964
2010-05-26 02:32:19 +00:00
Guy Harris d3f8320039 Fix build without pcap.
svn path=/trunk/; revision=32959
2010-05-26 01:32:00 +00:00
Guy Harris 7a630c61a1 Add a -q flag to dumpcap, to squelch its reporting of the packet count,
and add support for SIGINFO, so, if your OS supports SIGINFO, you can
get the packet count by typing ^T.

svn path=/trunk/; revision=32958
2010-05-26 00:19:27 +00:00
Guy Harris b4f61dfe67 Fix indentation.
svn path=/trunk/; revision=32886
2010-05-19 03:50:09 +00:00
Guy Harris 991c5e9898 When dumpcap is run to get an interface list, interface capabilities, or
interface statistics, have its error messages come out as sync-pipe
errors, have it send a sync-pipe "success" message on success, and have
the callers get that message and display it.

svn path=/trunk/; revision=32843
2010-05-17 18:40:23 +00:00
Guy Harris 9307251bb8 Um, no, the problem with the Leopard x86 build is that we first do a
build without libpcap, to make sure that works, and then do a build with
libpcap, to put into a binary release.  It's the former that's failing;
I'll back out the previous change and then work on that.

svn path=/trunk/; revision=32801
2010-05-14 00:49:28 +00:00
Guy Harris 0e54136213 See whether the Leopard x86 buildbot is upset because of the name
if_capabilities_t - it doesn't fail on Snow Leopard, even if I undefine
HAVE_PCAP_CREATE, and doesn't fail on the Leopard PPC buildbot, either.

svn path=/trunk/; revision=32799
2010-05-14 00:10:15 +00:00
Guy Harris 1c18115bd3 Fetch an indication of whether the interface supports capturing in
monitor mode at the same time that we fetch its list of link-layer
types.  Support fetching that list in monitor mode, as the list may be
different in regular and monitor mode.  If the interface supports
monitor mode, when printing the list of link-layer types, indicate
whether they're fetched in monitor mode or not, as tcpdump 4.1.x does.

svn path=/trunk/; revision=32789
2010-05-13 17:37:39 +00:00
Bill Meier 4a1b069d3f Fix a gcc -Wshadow warning.
svn path=/trunk/; revision=32737
2010-05-10 16:51:09 +00:00
Guy Harris 547b9e48a2 The default capture buffer size is, in fact, *nominally* 1MB; however,
libpcap/WinPcap and the capture mechanism atop which they run might
either silently limit the buffer size to a smaller value or raise it to
a higher value - that's the part that's platform-dependent.

svn path=/trunk/; revision=32718
2010-05-08 00:39:07 +00:00
Guy Harris 077ff72ac1 As with the list of data link types, so with the list of interfaces; move
the code to print the machine-readable format into dumpcap, and have the
code in capture_opts.c just print the human-readable format.

svn path=/trunk/; revision=32714
2010-05-07 19:24:32 +00:00
Guy Harris 13bf4a0c55 Add routines vfprintf_stderr() and fprintf_stderr() to print to the
standard error and, in Wireshark on Windows, create a console if
necessary.  Have the cmdarg_err routines use them.

Use *fprintf_stderr() to print the output of -L, rather than using
cmdarg_err_cont(), so that we don't get extra newlines in the output (it
should look similar to the output of tcpdump).

svn path=/trunk/; revision=32711
2010-05-07 08:40:02 +00:00
Guy Harris cc05b9250d For TShark and Wireshark, get the list of link-layer types for an
interface by running dumpcap, so that if you need privileges to open an
interface, and dumpcap has those privileges, neither TShark nor
Wireshark need them.

svn path=/trunk/; revision=32710
2010-05-07 08:06:25 +00:00
Guy Harris 6ace737ae4 Add monitor mode support to TShark.
svn path=/trunk/; revision=32704
2010-05-07 01:46:38 +00:00
Guy Harris 4c5b8c5277 Instead, say that the default is platform-dependent.
svn path=/trunk/; revision=32701
2010-05-07 00:28:42 +00:00
Guy Harris 96f67d9517 Now that we support -B on various UN*X platforms as well as Windows, we
can no longer state what the default is (it's platform-dependent).

svn path=/trunk/; revision=32700
2010-05-07 00:16:52 +00:00
Gerald Combs 570a693a09 Set the timestamp seconds type to TS_SECONDS_DEFAULT at startup so we
don't abort.

svn path=/trunk/; revision=32697
2010-05-06 23:51:37 +00:00
Guy Harris 7dbbb8c572 Just check for pcap_create(); it first appeared in libpcap 1.0.0, and
pcap_set_buffer_size() did as well, so there aren't any libpcap releases
with pcap_create() but not pcap_set_buffer_size().

Only do one check for pcap_create.

svn path=/trunk/; revision=32695
2010-05-06 23:33:41 +00:00
Anders Broman f9981411f1 Checking in Stigs changes from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=475
BUT not activating the check for 
pcap_create()
pcap_set_buffer_size()
This should make it possible to build with support for setting the buffersize if not capturing 802.11 traffic.

The code for handling the 'B' option should be OK in any case.

svn path=/trunk/; revision=32688
2010-05-06 18:34:30 +00:00
Stig Bjørlykke 54101a8630 Moved command line option for seconds type to -u.
Added this option to tshark.

svn path=/trunk/; revision=32685
2010-05-06 12:31:24 +00:00
Jeff Morriss a61489c3a5 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2742 :
If the user specifies -V or -x, turn on print_packet_info (-S) so they actually
get some output in case we're also writing to a file.

svn path=/trunk/; revision=32486
2010-04-16 00:54:00 +00:00
Guy Harris 25d49313cc "capture-pcap-util.h" include <pcap.h>, and <pcap.h>, for better or
worse, has no include-once guards; include it only once.

svn path=/trunk/; revision=32110
2010-03-04 07:19:43 +00:00
Bill Meier e4d6610bd5 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31729
2010-01-29 16:09:25 +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
Kovarththanan Rajaratnam 29c7430fb6 Free capture filename on shutdown
svn path=/trunk/; revision=30165
2009-09-26 06:41:20 +00:00
Kovarththanan Rajaratnam 4c3ad6faa9 (Cosmetic) Reorder so that the failure message output handler appear in succession
svn path=/trunk/; revision=30162
2009-09-26 04:52:34 +00:00
Kovarththanan Rajaratnam cf8e2654b4 Remove unused 'offset' parameter
svn path=/trunk/; revision=30078
2009-09-22 20:02:51 +00:00
Kovarththanan Rajaratnam 760eb47fc1 Add initial support for "two pass analysis" in tshark. This allows tshark to arrive at the same protocol tree as the Wireshark GUI. Before this change tshark only supported a single scan over the file. This effectively means that packets cannot use data that are gathered from frames that appear after the current frame. By scanning twice we give the dissector the opportunity to make forward references.
svn path=/trunk/; revision=30076
2009-09-22 19:28:00 +00:00
Kovarththanan Rajaratnam 0ee2b7754d Rename init_cap_file() to cap_file_init()
svn path=/trunk/; revision=30073
2009-09-22 16:53:11 +00:00
Kovarththanan Rajaratnam e44cb94beb Always initialise fdata even when we don't dissect (we access some of fdatas variables)
svn path=/trunk/; revision=30070
2009-09-22 15:22:53 +00:00
Kovarththanan Rajaratnam a9a1866acf Simply some logic inside process_packet()
svn path=/trunk/; revision=30069
2009-09-22 15:06:52 +00:00
Kovarththanan Rajaratnam 1e8d9b4937 Make frame_data_set_after_dissect() callers do the necessary checks instead
svn path=/trunk/; revision=30068
2009-09-22 14:50:43 +00:00
Kovarththanan Rajaratnam 14d2f617c2 Refactor frame_data_init() into frame_data_set_before_dissect() and frame_data_set_after_dissect().
svn path=/trunk/; revision=30066
2009-09-22 14:23:20 +00:00
Kovarththanan Rajaratnam 46b7430557 Move frame_data_init() declaration to frame_data.h
svn path=/trunk/; revision=30033
2009-09-21 11:26:23 +00:00
Kovarththanan Rajaratnam 8791df65e1 Fix return type for frame_data_init()
svn path=/trunk/; revision=30024
2009-09-20 19:01:23 +00:00
Kovarththanan Rajaratnam 2e282e7567 Introduce frame_data_cleanup() and start using it
svn path=/trunk/; revision=30023
2009-09-20 18:18:29 +00:00
Kovarththanan Rajaratnam e56f27dc99 Introduce frame_data_init() and get rid of fill_in_fdata() in tshark.c
svn path=/trunk/; revision=30021
2009-09-20 17:51:16 +00:00
Kovarththanan Rajaratnam a896743c6f Make cf_mark_frame() an empty stub in tshark.c. We only need it to satisfy a linker dependency. Add a comment in tap-rtp-common.c indicating that is is wrong to refer to cf_mark_frame() which is only applicable for the GTK UI backend.
svn path=/trunk/; revision=30019
2009-09-20 16:48:52 +00:00
Kovarththanan Rajaratnam 66f528e9e4 Remove unused cf_unmark_frame() function
svn path=/trunk/; revision=30018
2009-09-20 16:30:12 +00:00
Kovarththanan Rajaratnam a7081629f0 Move verbose banner output to show_version() and tighten scope of some variables
svn path=/trunk/; revision=30017
2009-09-20 16:16:15 +00:00
Kovarththanan Rajaratnam de23d92163 Add an option to col_fill_in() to allow us to disable column expression processing. This is rarely needed. It's only needed when the user right clicks on the packet list view to generate a display filter.
svn path=/trunk/; revision=29806
2009-09-08 19:00:54 +00:00
Kovarththanan Rajaratnam b90a11bee3 Make tshark and rawshark use build_column_format_array() instead of duplicating the code
svn path=/trunk/; revision=29803
2009-09-08 17:29:57 +00:00
Kovarththanan Rajaratnam a65d590002 Store the packet encapsulation type as gint8. Saves 3 bytes per packet
svn path=/trunk/; revision=29767
2009-09-07 13:54:46 +00:00
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Kovarththanan Rajaratnam 80a6d3fbcf Introduce epan_dissect_init()/epan_dissect_cleanup(). These are used to initialise/cleanup stack allocated 'edt' structures. This should speed up dissection since we avoid some malloc traffic.
svn path=/trunk/; revision=29404
2009-08-13 19:42:46 +00:00
Guy Harris 6b34dad7f2 Note that the new behavior matches what Wireshark does.
svn path=/trunk/; revision=29333
2009-08-08 01:23:15 +00:00
Bill Meier 2a6163ec32 tshark: console_log_level preference now controls which log msgs are sent to stderr;
Note: This is a behavior change: 
      Given the default value for the console_log_level preference
       tshark will now show ERROR, CRITICAL and WARNING level log messages.
      Prior to this change tshark was hardwired to show only
       ERROR and CRITICAL level messages.
      Time will tell whether this change results in too much noise
       in tshark output.

svn path=/trunk/; revision=29328
2009-08-07 21:22:54 +00:00
Anders Broman cb771536df From Kovarththanan Rajaratnam:
Only fill in frame_data vals when needed.

svn path=/trunk/; revision=29203
2009-07-27 08:33:26 +00:00
Anders Broman ded297677f From Kovarththanan Rajaratnam:
Precompile custom columns filters.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3767

svn path=/trunk/; revision=29174
2009-07-23 05:48:39 +00:00
Guy Harris a3fda98056 Clarify that "-w" specifies a *pcap-format* file to be written to.
svn path=/trunk/; revision=29029
2009-07-08 19:19:06 +00:00
Guy Harris cf91fdf16b Have tap listeners specify whether the "packet" routine requires
a protocol tree;

	the column values.

This includes stats-tree listeners.

Have the routines to build the packet list, and to retap packets, honor
those requirements.  This means that cf_retap_packets() no longer needs
an argument to specify whether to construct the column values or not, so
get rid of that argument.

This also means that there's no need for a tap to have a fake filter
to ensure that the protocol tree will be built, so don't set up a fake
"frame" filter.

While we're at it, clean up some cases where "no filter" was represented
as a null string rather than a null pointer.

Have a routine to return an indication of the number of tap listeners
with filters; use that rather than the global num_tap_filters.

Clean up some indentation and some gboolean vs. gint items.

svn path=/trunk/; revision=28645
2009-06-05 22:42:47 +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
Stig Bjørlykke 0258be0b05 From Jakub Zawadzki:
More remove checking for NULL before g_free().

svn path=/trunk/; revision=27728
2009-03-15 18:08:46 +00:00
Bill Meier 5cb9fe859b For tshark -b -S -w: close files after reading them; fixes bug #3172;
Also: Do a bit of cleanup on related code.

svn path=/trunk/; revision=27458
2009-02-15 22:03:17 +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
Bill Meier ee908a7abd #include <epan/conversation.h> not req'd ...
svn path=/trunk/; revision=27392
2009-02-07 16:01:26 +00:00
Ronnie Sahlberg 24b76bdc14 add a -K command line option to provide the name of the kerberos keytab
file to use for decryption of Krb5 and GSS-KRB


svn path=/trunk/; revision=26343
2008-10-03 05:21:28 +00:00
Bill Meier 224b638586 #include <emem.h> not req'd
svn path=/trunk/; revision=26093
2008-08-26 02:38:57 +00:00
Guy Harris e8ba2515de The packet counts and drop counts reported by libpcap are unsigned.
Clean up indentation a bit.

svn path=/trunk/; revision=26037
2008-08-19 05:10:16 +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
Guy Harris 7b20f77bea Rename capture_opts to global_capture_opts - that's what it's called in
dumpcap, and calling it capture_opts collides with parameter names, as
noted by John Smith.

svn path=/trunk/; revision=25545
2008-06-23 20:25:17 +00:00
Guy Harris 07263e1a17 Free up the err_info string returned by wtap_read().
svn path=/trunk/; revision=25399
2008-05-30 02:37:36 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.

While doing that, rename the eth_* functions to ws_*.

svn path=/trunk/; revision=25354
2008-05-22 15:46:27 +00:00
Stig Bjørlykke 38f233cd99 Removed an unused break.
svn path=/trunk/; revision=25247
2008-05-06 15:12:45 +00:00
Guy Harris 7a0981e513 Get rid of extra blank lines at the end of the file.
svn path=/trunk/; revision=25202
2008-04-30 07:59:26 +00:00
Guy Harris a12bdc612a Use report_failure() to report failures in capture_sync.c; that will do
the right thing in Wireshark and TShark, as both of them call
epan_init() to set the appropriate "report an error" function.

That obviates the need to have TShark have its own private version of
simple_dialog().

Have cmdarg_err() just call failure_message() instead of duplicating the
code in failure_message().

svn path=/trunk/; revision=25201
2008-04-30 07:58:57 +00:00
Luis Ontanon 906d2f3cbb http://www.wireshark.org/lists/wireshark-dev/200803/msg00308.html
proto.[hc]
    define new APIs to allow delayed registration of protocol fields,
	so that dissectors with "flexible" fields  like xml, radius, diameter,
	snmp do not have to load their files at startup but can do so as late as possible.

gtk/dfilter_expr_dlg.c :
	have the expression dialog registering all prefixes so that all fileds appear in the dialog

tshark.c
	register all prefixes when called with -G

epan/radius_dict.l
epan/dissectors/packet-radius.c
epan/dissectors/packet-radius.h
	refactor registration to delay dictionary loading as long as possible



svn path=/trunk/; revision=24762
2008-04-03 22:13:52 +00:00
Sake Blok f17067c174 Make tshark and rawshark behave similar to wireshark when "frame.time_delta_displayed" is
used within a display filter.

(the usefullness of "frame.time_delta_displayed" in a display filter is very limited
 since it bites it's own tail. Still, wireshark and tshark should at least show the
 same behaviour)


svn path=/trunk/; revision=24708
2008-03-21 06:11:45 +00:00
Stig Bjørlykke 3c3c2224f9 Allow tshark to print custom columns.
svn path=/trunk/; revision=24678
2008-03-17 23:30:37 +00:00
Stephen Fisher 56226b49b8 Custom column updates:
- Change apply / prepare / ... as filter to use the field's value, which
   is now stored in fdata as well as cinfo.  Now we don't have to reprocess
   the entire packet list when using these features.  This also prevents
   the use of these features from overwriting custom column information.
   (custom columns can now be used in apply / prepare ... as filter)
 - Break col_expr and col_expr_val out into a struct that is included not only
   in cinfo, but now also fdata.
 - Have col_custom_set_fstr() quote FT_STRING & FT_STRINGZ when storing the
   col_expr_val value (for filter creation).


svn path=/trunk/; revision=24511
2008-03-01 05:16:45 +00:00
Sake Blok b38b10b516 Make -c work properly in tshark when a read filter is used.
svn path=/trunk/; revision=24335
2008-02-15 13:02:43 +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
Sake Blok c8276a5c91 From Balint Reczey (bug 2233):
The attached patch makes the Statistics -> RTP -> Show All Streams feature of
wireshark accessible via tshark.

I found it helpful in dealing with tons of RTP captures.


svn path=/trunk/; revision=24252
2008-02-03 10:31:55 +00:00
Stig Bjørlykke a2d1e9005d This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files.

This can be found in the "Configuration Profiles..." menu item from the Edit
menu, or by pressing Shift-Ctrl-A.  It's also possible to start wireshark
and tshark with a named profile by using the "-C ProfileName" option.
A new status pane in the main window will show the current profile.

The configuration files currently stored in the Profiles are:
- Preferences
- Capture Filters
- Display Filters
- Coloring Rules
- Disabled Protocols
- User Accessible Tables

The recent data are by design not added to the profile.

Planned future enhancements:
- make a more convenient function to switch between profiles
- add a "clone profile" button to copy an existing profile
- make the profiles list active and accept return as OK
- save users "Decode as" in the profile
- make new, clone and deletion of profiles more secure
- make some of the recent values available in the profile

This patch also fixes:
- setting default status pane sizes
- a bug setting status pane for packets when not having main lower pane.

svn path=/trunk/; revision=24089
2008-01-14 16:40:23 +00:00
Stig Bjørlykke 8b4e80384a Fixed a few "statement not reached" warnings and a "assignment type mismatch" warning.
svn path=/trunk/; revision=24085
2008-01-14 09:39:55 +00:00
Jörg Mayer 0c797861ba Warning fixes: function declaration isn’t a prototype
svn path=/trunk/; revision=23862
2007-12-14 15:14:40 +00:00
Guy Harris 33c1bf50bf If we only captured 1 packet, print "1 packet", not "1 packets".
svn path=/trunk/; revision=23543
2007-11-22 01:51:51 +00:00
Stephen Fisher 849e628334 Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.


svn path=/trunk/; revision=23503
2007-11-19 21:27:01 +00:00
Guy Harris a421b8f96f "sa_mask" in a "struct sigaction" is a sigset_t, which is not
necessarily an integral data type.  Use sigemptyset() to clear it.

svn path=/trunk/; revision=23257
2007-10-24 04:13:30 +00:00
Guy Harris 2ef0350a47 Use sigaction(), not signal(), so we know what its semantics are (and so
that we can find out what the signal action for SIGHUP is without
changing it).

That renders report_counts() safe to use at the end of a capture; do so.

Clean up indentation.

svn path=/trunk/; revision=23256
2007-10-24 03:33:35 +00:00
Bill Meier adce7d882d Add 'C' as a valid -N option in error message.
svn path=/trunk/; revision=23040
2007-10-01 00:22:39 +00:00
Guy Harris 53e74d7931 Get rid of a forward declaration of a routine that no longer exists.
svn path=/trunk/; revision=23030
2007-09-29 02:27:04 +00:00
Guy Harris 81db68f38f Clean up indentation a bit.
Count packets even if we're not dissecting them.

svn path=/trunk/; revision=23026
2007-09-29 02:05:09 +00:00
Jeff Morriss e55168c53d Specify that -l causes tshark to flush the *standard* output (from bug 1875). The man page already states this
svn path=/trunk/; revision=23014
2007-09-28 16:34:59 +00:00
Gerald Combs 69ddd8a773 Load wpcap.dll, since we still use it for some things. This should hopefully
fix Buildbot.

svn path=/trunk/; revision=23003
2007-09-27 23:49:05 +00:00
Jeff Morriss f563945bf8 (Try to) get tshark capturing working on *NIX (it works for me anyway):
We can simply block waiting for input from the child process because we are
in a CLI that does not need to worry about updating a GUI while we're waiting
for packets and so forth.

Before I realized that I wrote a working (for me) method using select() that
I've left in for now (#ifdef'd out).

svn path=/trunk/; revision=22999
2007-09-27 15:58:54 +00:00
Ulf Lamping c703e7e18c the Ubuntu / OS X buildbots don't seem to like G_STATIC_MUTEX_INIT (for whatever reason), try to use g_static_mutex_init() instead
svn path=/trunk/; revision=22977
2007-09-26 00:44:47 +00:00
Ulf Lamping a0adcc7e2c solve some more of the unix specific buildbot problems
svn path=/trunk/; revision=22975
2007-09-26 00:03:30 +00:00
Ulf Lamping 9194ddf399 add a dummy function, so unix/linux version should at least compile
svn path=/trunk/; revision=22974
2007-09-25 23:23:56 +00:00
Ulf Lamping 879d656537 as "advertised" some days ago:
rewrite the tshark capture code almost completely, to use dumpcap instead of it's own pcap functionality.

This works on Win32 and should work on unix/linux (but I'm not sure here). Some stuff needs to be cleaned up, some more may need to be rewritten to specifically work with unix/win32. Futher work needs to be done at:

1. read filters (simply document current behaviour?)
2. event loop polling
3. privileges
4. code cleanup (e.g. in capture_loop.c)

Be prepared that tshark might not work as before / expected at least in the next days!

svn path=/trunk/; revision=22969
2007-09-25 21:55:06 +00:00
Gerald Combs d2d4fcd903 Add routines under Windows to check if npf.sys is running, and to
fetch the major OS version.  If we're running Windows >= 6 (Vista)
_and_ npf.sys isn't running, warn the user in Wireshark and TShark.
Add a recent prefs item to disable the warning in Wireshark.

svn path=/trunk/; revision=22877
2007-09-15 00:18:17 +00:00
Gerald Combs 92802883a6 Change the "--enable-setuid-install" option to install dumpcap and TShark
setuid instead of Wireshark.  Remove the "DANGEROUS" notices, but leave it
disabled by default.  Whine if the user runs Wireshark or TShark as root.
Add a preference to disable the whining.  Add a "setuid-root" script that
can be used to switch dumpcap and TShark's setuid-ness on and off for
development and testing.  Update the release notes and README.packaging.

svn path=/trunk/; revision=22733
2007-08-30 00:24:40 +00:00
Jeff Morriss 2f77efce7d Fix bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1757 :
Try to call get_interface_descriptive_name() as little as possible (storing
the result in capture_opts) to avoid a performance hit during live capture
(especially if you have lots of interfaces) and to avoid leaking memory.

One issue with this is that capture_opts.c cannot (without adding significant
dependencies) set the iface_descr so readers of that field (only gtk/main.c
and tshark.c) use a macro to (set if not already set and) get the value of
that field.

svn path=/trunk/; revision=22587
2007-08-22 16:30:16 +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
Gerald Combs c02e0c7b4a Remove the "-I" flag from dumpcap, and add a "-M" flag used to specify
that "-D" and "-L" should produce machine-readable output.  Use this to
move an indirect get_pcap_linktype() call from the GUI to dumpcap.

svn path=/trunk/; revision=22367
2007-07-20 21:43:07 +00:00
Gerald Combs e9f1a0b692 One more step in privilege separation.
Add a capture_interface_list(), which works similar to
get_interface_list() except that it forks dumpcap instead of calling
the pcap routines directly.  Use it in the GUI.

Add a "-I" flag to dumpcap, which prints out verbose interface
information.

Tested under Windows and Linux.

svn path=/trunk/; revision=22071
2007-06-11 03:58:58 +00:00
Guy Harris 4e008159c8 The libpcap callback "user" argument *should* have been a "void *", as
it's a pointer to an arbitrary object, assumed to be correctly aligned,
not a pointer to a not-necessarily-properly-aligned array of bytes. 
Cast it, so we won't get alignment warnings.

svn path=/trunk/; revision=21940
2007-05-25 19:31:13 +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
Jaap Keuter 7ecc588029 Fix for bug 1614:
Output preamble and finale on live capture.

svn path=/trunk/; revision=21930
2007-05-25 06:46:47 +00:00
Luis Ontanon 869732d121 Prepare wireshark and tshark for wiretap plugins
svn path=/trunk/; revision=21928
2007-05-24 22:26:51 +00:00
Stephen Fisher 0fc9e207d2 From Sake Blok:
Fix for bug #1056


svn path=/trunk/; revision=21867
2007-05-21 20:41:05 +00:00
Guy Harris a3d3282e64 Have init_progfile_dir() also check whether
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set and, if so and we weren't run
with special privileges, set the running_in_build_directory_flag.  Have
it do the same if it finds ".libs" in the pathname of the program and we
weren't run with special privileges, as that means it was probably run
from the libtool wrapper script and presumably thus isn't an installed
binary.

This means that get_credential_info() has to be called before
init_progfile_dir().

Clean up some indentation.

svn path=/trunk/; revision=21866
2007-05-21 20:31:45 +00:00
Graeme Lunt cf56e76be9 Updated splash screen for Wireshark that shows the initialisation progress.
The splash screen shows a progress bar and a percentage complete - like the progress dialog.
As dissectors are initialised and handed off the name is shown. However, the names of plugin dissectors are not shown.
The update to the make-dissector-reg shell script has been tested, though I think generally the python version is used.


svn path=/trunk/; revision=21716
2007-05-07 17:55:42 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Stephen Fisher 6625e7503f Fix warnings on Linux/gcc 4.1.1
svn path=/trunk/; revision=21330
2007-04-03 21:17:13 +00:00
Ronnie Sahlberg 910299acb1 The signature for load_cap_file changed in 21211
Update also the code path for when not compiling with pcap  so that code path also
uses the new signature.


svn path=/trunk/; revision=21219
2007-03-26 23:16:53 +00:00
Stephen Fisher 509883e3e9 From Doug Pratley:
The purpose of the patch is to provide a new output format (so it is
independent of -V): single line record per-packet with the fields chosen by the
user, with configuration options to control separator, quoting and whether a
header line is printed. It also extends some existing options behaviour (-c and
-a:filesize) so that they affect reading a file as well as writing one, so that
only the first <n> packets or bytes are read).


svn path=/trunk/; revision=21211
2007-03-26 20:17:05 +00:00
Stephen Fisher 6d8d2854c8 From Sake Blok:
Fix for bug #491: Unexpected frame.time_delta behavior

This patch ... fixes bug 491. It does this by changing the
behaviour of the frame.time_delta field so it reflects the delta
time between captured packets (tshark already did this).  To keep
the delta time between displayed packets, the field 
frame.time_delta_displayed is created.


svn path=/trunk/; revision=21154
2007-03-23 18:08:17 +00:00
Stephen Fisher 793e70956e Fix problem where specifying -b duration:xx on tshark wasn't working by
testing for the "duration specified" variable along with the "maximum
file size" variable.
 

svn path=/trunk/; revision=20950
2007-02-28 22:45:18 +00:00
Jeff Morriss 0787b688cc Squelch a few unused parameter warnings.
svn path=/trunk/; revision=20863
2007-02-19 15:30:06 +00:00
Jeff Morriss 0c17bfd3a8 From Eric Hall to fix bug 1289:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1289

Rename 'svnversion' to 'wireshark_svnversion' to resolve a symbol conflict with
GTK 2.10.6 (hmm, shouldn't GTK not be exporting that symbol or at least naming
it so as to prevent such collisions? Well, so should we, so...)

From Andreas Fink: change #ifdef for size_t in airdcap_interop.h to fix
compile on MacOS X.


svn path=/trunk/; revision=20726
2007-02-06 02:27:59 +00:00
Ronnie Sahlberg 57389a0c69 make tshark compile and work also when pcap is not available
svn path=/trunk/; revision=20664
2007-02-01 09:04:46 +00:00
Jeff Morriss fcff412ab6 Don't send G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL|G_LOG_FLAG_FATAL|G_LOG_FLAG_RECURSION to log_func_ignore() so that error messages from g_assert() get printed (by glib's default handler). Without this change developers only get a message saying the program aborted and maybe (if they're lucky^H^H^H^H^Hconfigured correctly) a core file. The latter would allow them to find out what went wrong but it would be much easier to just see the error message.
svn path=/trunk/; revision=20647
2007-01-31 06:01:14 +00:00
Guy Harris 44c0624bd9 Add a WIRESHARK_RUN_FROM_BUILD_DIRECTORY environment variable on UN*X;
if set, and if the program isn't running with additional privileges,
it'll treat the directory in which the program is found as the data
directory.

If, on Windows, the version-number subdirectory of {data
directory}\plugins doesn't exist (which is assumed to mean that the
program is being run from the build directory), or if, on UN*X,
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set, the plugin directory is the
"plugins" subdirectory of the data directory, and all subdirectories of
that directory are scanned for plugins, as the "plugins" subdirectory of
the build directory contains subdirectories for the plugins; this means
that if we're running from the build directory, we'll find the plugins
we built in the build tree.

When generating the wireshark-filter man page, run tshark with
WIRESHARK_RUN_FROM_BUILD_DIRECTORY set, so it uses the plugins from the
build to generate the list of filters.

svn path=/trunk/; revision=20261
2007-01-02 06:49:40 +00:00
Luis Ontanon 91e2c565bd Have -X options defined before epan_init() gets called.
svn path=/trunk/; revision=20207
2006-12-23 03:52:38 +00:00
Stephen Fisher 75acf34518 From Douglas Pratley with trivial changes and documentation changes
by myself:

Corrected patch; epan/column.c and epan/column_utils.c were not included. This
one has now been properly tested against a clean checkout of today's code.

- New menu option available under view\time display format
- New sub-option (e) to -t switch for both wireshark and tshark
- Extended recent settings code to handle new value
- Did NOT add new explicit epoch time column


svn path=/trunk/; revision=20040
2006-12-05 03:19:51 +00:00