Commit Graph

64 Commits

Author SHA1 Message Date
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
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
Guy Harris d1128f6433 For a capture file, keep an array of all encapsulation types seen.
Show all of them in the summary dialog; we will be using it in the
future to figure out what capture file formats we can write to (just
because a capture file format supports per-packet encapsulations, that
doesn't mean that it supports *all possible* encapsulations).

svn path=/trunk/; revision=43278
2012-06-15 23:54:05 +00:00
Guy Harris ee57847596 That doesn't work correctly if we read in a file with no interface
information, as it'll fill in whatever stuff happens to be in the
capture info.  We should somehow figure uot whether this is a capture we
just did (note: cf->is_tempfile does *NOT* necessarily tell us that, as
it's set for the result of a merge, and is cleared if we save the
capture) and fill in the interface information only if that's the case.

Put in a comment to note that we need to do that.

svn path=/trunk/; revision=42874
2012-05-28 01:23:28 +00:00
Guy Harris 88fb10b8a3 Correctly implement what was my intent when removing the HAVE_LIBPCAP
stuff - arrange that the interface summary list is set, if we've read a
capture file that has interface information, *regardless* of whether we
have libpcap/WinPcap or not.

That means that summary_fill_in() should fill in the interface
information for the summary if there's interface information from the
capture file, and summary_fill_in_capture() - which is called only if
HAVE_LIBPCAP is defined, and can exist only if HAVE_LIBPCAP is defined
(as it takes an argument of a type that's defined only if HAVE_LIBPCAP
is defined) - just fills in interface information from the capture
options and does so only if there's none from the file.

svn path=/trunk/; revision=42873
2012-05-28 01:17:48 +00:00
Guy Harris 53375198ec Don't use pcap LINKTYPE_ values in the iface_options structure, use
Wiretap encapsulation values; rename the field in question encap_type to
emphasize that.  (Code that looks at that field already assumes it's a
Wiretap encapsulation value.)

For live captures, map the LINKTYPE_ value to a Wiretap encapsulation
value.

wtap_encap_string() never returns NULL, so don't check for a null return
value.

svn path=/trunk/; revision=42871
2012-05-28 00:31:27 +00:00
Guy Harris bd7c59b254 Clean up indentation (use spaces, not tabs).
svn path=/trunk/; revision=42868
2012-05-27 23:32:12 +00:00
Jeff Morriss a4bbd97979 Use cf_update_capture_comment() to save the capture comment (instead of
summary_update_comment() which is no longer necessary).
cf_update_capture_comment() has the advantage that it doesn't mark the file
as unsaved unless the comment actually changed.

svn path=/trunk/; revision=42832
2012-05-24 18:59:39 +00:00
Guy Harris cf6d9841e3 Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Bill Meier f21d6f1dfa Actually remove #include <sys/types.h> ....
svn path=/trunk/; revision=42444
2012-05-05 21:00:32 +00:00
Bill Meier a703450659 AFAICT '#include sys/types.h' is not needed for these files.
svn path=/trunk/; revision=42443
2012-05-05 20:51:14 +00:00
Chris Maynard f7980fd037 Delete a duplicate line of code. Fixes Coverity CID 1393: UNUSED VALUE.
svn path=/trunk/; revision=41700
2012-03-21 02:39:39 +00:00
Anders Broman fb0fec7c1c If we have one ISB, display the droped count from it.
svn path=/trunk/; revision=41561
2012-03-15 14:33:04 +00:00
Anders Broman 971cb84877 if_filter isn't a string per se,The first byte of the Option Data keeps a code of the filter used
svn path=/trunk/; revision=41339
2012-03-04 19:01:14 +00:00
Anders Broman d24fad6371 - Add a LED in the statusbar to indicate that capture comments exists,
clickable to open an edit window.
- Add checks for NULL pointers.

Help with a different color LED possibly with Jeff's (c) in it apreceated.
Should the LED be placed elsewhere or the whole thing done differently?

svn path=/trunk/; revision=41242
2012-02-29 16:51:32 +00:00
Anders Broman 38c69c8431 Make it possible to edit capture comments
svn path=/trunk/; revision=41193
2012-02-26 17:04:28 +00:00
Guy Harris 30b86b7817 Suppress invalid or non-meaningful statistics - for example, without
time stamps on all packets in a set, you can't determine the start and
end time of the packets in the set (even one timestampless packet throws
the determination off - was that packet before the first time-stamped or
after the last time-stamped packet, or between them?).

svn path=/trunk/; revision=41187
2012-02-26 08:02:02 +00:00
Michael Tüxen 7194766584 From Irene Ruengeler: Fix a bug where the interface
names are not shown during capturing.

svn path=/trunk/; revision=41175
2012-02-24 13:05:33 +00:00
Anders Broman b5a2ba98be Add SHB info to Summary
svn path=/trunk/; revision=41167
2012-02-23 21:29:13 +00:00
Michael Tüxen dddfe189a1 Fix the handling of snaplen.
While there fix some whitespace issues.

svn path=/trunk/; revision=41164
2012-02-23 19:14:14 +00:00
Anders Broman 286f3425e7 Have the used interfaces show up if number of interfaces > 0.
(pcapng file).

svn path=/trunk/; revision=41163
2012-02-23 15:40:31 +00:00
Michael Tüxen b30c60d29f Don't show interface info when loading a capture file.
svn path=/trunk/; revision=38051
2011-07-15 20:45:28 +00:00
Michael Tüxen cb90aa7904 Add initial support for multiple interfaces. More to come after
the capture options dialog box supports also multiple interfaces.

This patch has been developed by Irene Ruengeler.

svn path=/trunk/; revision=37904
2011-07-05 20:34:03 +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
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 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 678be392f1 Make the packet count an unsigned value, as frame numbers are unsigned.
Make the loops that scan through all the packets do so by frame number,
to abstract away the "next" and "previous" pointers in the frame_data
structure.  Add a routine to cfile.c to map frame numbers to frame_data
structures, and put in some special case handling so scanning forward or
backward through the packets is O(N) rather than O(N^2).

svn path=/trunk/; revision=36846
2011-04-25 05:33:07 +00:00
Stig Bjørlykke ef92b4ec11 Added "Ignore Packet" menu items to the main menu.
Show ignored packages in the summary dialog.

svn path=/trunk/; revision=31289
2009-12-17 12:05:13 +00:00
Kovarththanan Rajaratnam 7ca137e294 Rename capture_file.plist to capture_file.plist_start to make it consistent with capture_file.plist_end
svn path=/trunk/; revision=30047
2009-09-21 18:09:19 +00:00
Gerald Combs c99312dae0 Use a more accurate variable name for the wiretap file type. Add the file
encapsulation to the summary display.

svn path=/trunk/; revision=26459
2008-10-14 22:55:16 +00:00
Stig Bjørlykke 6e39bc94d1 Summary enhancements:
- Added traffic statistics for marked packages.
- Do not show Displayed column unless using it.
- Removed Marked packets line, as this info is in the marked packets column.

Will add documentation changes if keeping this feature.

svn path=/trunk/; revision=23633
2007-11-28 01:09:02 +00:00
Stig Bjørlykke 482e3f7820 Fixed a bug when adjusting summary marked start time.
svn path=/trunk/; revision=23632
2007-11-28 01:04:11 +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 8043464c24 gcc 4 doesn't like my macro for getting the interface description: it says there's an invalid lvalue in it. I don't see what's wrong with it, but replace the macro with a function. Also: don't include the .xpm files in gtk/main.c if we're building without PCAP (as they're not used in that configuration).
svn path=/trunk/; revision=22588
2007-08-22 18:56:20 +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
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris e67b202e2c Have "f_datalen" keep track of the number of bytes of uncompressed file
data, so that "f_len" still keeps the size of the underlying file (which
is necessary in order to make the progress bar when files are being read
work correctly).

svn path=/trunk/; revision=15415
2005-08-19 01:17:24 +00:00
Ulf Lamping 3a63719e38 another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts

also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. 
It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this.

svn path=/trunk/; revision=13320
2005-02-06 21:20:35 +00:00
Ulf Lamping 69e94faff8 remove #include "globals.h" from summary.c, as it's a bad idea for multiple capture files.
If a summary user would like to get a summary, it should know the file of *which* it needs the summary.

svn path=/trunk/; revision=13291
2005-02-04 19:29:27 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris 71034c5a3f From Jean-Michel Fayard: show in Tools:Summary window statistics about
packets that passed the current display filter, as well as about the
entire capture.

Document the Tools:Summary item in the man page.

Update Gerald's e-mail address.

svn path=/trunk/; revision=8344
2003-09-02 22:10:32 +00:00
Guy Harris 89a4acb438 Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file.  Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).

If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.

Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").

Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping.  Also add units to the capture count option.

Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.

Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.

svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris bf0a3a32d1 In Ethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, display the packet drops count as the "Drops"
value in the status line and as the "Dropped packets" statistics in the
summary dialog box, otherwise don't display it at all.

In Tethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, and if there were any dropped packets, print
out the count of dropped packets when the capture finishes.

svn path=/trunk/; revision=3016
2001-02-11 09:28:17 +00:00
Laurent Deniel 05984d233d Add the number of marked packets in the summary window.
svn path=/trunk/; revision=2323
2000-08-21 18:20:19 +00:00
Guy Harris 7fbf320b8a Patch from Ben Fowler to rename the global variable "cf" to "cfile", to
make it easier to use grep to find all references to it without getting
a lot of false hits and to check, after allocating the memory chunk for
"frame_data" structures, that the allocation succeeded.

svn path=/trunk/; revision=2092
2000-06-27 04:36:03 +00:00
Gilbert Ramirez b218a8f550 Consolidate flags in struct frame_data, and add "visited" flag. Use
it in SOCKS dissector.

(Okay, how many times am I going to modify packet.h today, forcing you
to re-compile everything? :-)

svn path=/trunk/; revision=1850
2000-04-13 20:39:38 +00:00
Guy Harris c3e2626f7a If there aren't any packets in the capture (which could be the case if,
for example, you're doing a live capture with "Update list of packets in
real time" and none have arrived yet, or if you've read in a capture
file where there aren't actually any packets), don't look for the start
or stop time, and don't accumulate the number of captured bytes or the
number of packets that passed the display filter.

svn path=/trunk/; revision=1394
1999-12-29 21:30:28 +00:00
Gilbert Ramirez 71b7cd5031 Move GTK code out of summary.c and into gtk/summary_dlg.c
summary.c now provides a struct of info (see summary.h)

Changed the name of the summary dialogue callback (hence the change
in menu.c), and added a close button to the dialogue.

Moved #include <gtk/gtk.h> out of print.c and into prefs.h where it
was needed for GdkColor.

svn path=/trunk/; revision=1273
1999-12-10 04:21:04 +00:00