Commit Graph

196 Commits

Author SHA1 Message Date
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