Commit Graph

884 Commits

Author SHA1 Message Date
Guy Harris b42fab3a61 TShark doesn't need column text attached to each frame; move col_text
and col_text_len from the frame_data structure to the PacketRecord
structure.

svn path=/trunk/; revision=36967
2011-05-03 01:19:55 +00:00
Jakub Zawadzki 192837a1f2 Restore updating packet bar while loading file (removed in r36851)
svn path=/trunk/; revision=36896
2011-04-27 09:20:02 +00:00
Guy Harris 59ef61f6da Don't free the frame_data_sequence unless we have one.
svn path=/trunk/; revision=36882
2011-04-27 03:13: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 280fcc497f Get rid of some code that's no longer relevant with the new tree
structure for frame_data items.

svn path=/trunk/; revision=36862
2011-04-26 02:51:10 +00:00
Anders Broman 96ebc30068 from Jakub Zawadzki:
Don't thaw the packet list during file loading to speed up file loading.

svn path=/trunk/; revision=36851
2011-04-25 19:36:13 +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
Guy Harris a39c3fab30 new_packet_list_find_row_from_data() is always used to select a packet,
so get rid of the select_flag argument, and rename it
new_packet_list_select_row_from_data().

It's also always passed a frame_data *, so make its argument a
frame_data *.

Its return value is used only to detect whether the packet was found in
the display or not, so make it a gboolean.  Check it in *all* cases
where it's called, and change the dialog message a bit (the most likely
cause is that the user cancelled a redissection of the packets, so not
all packets in the capture file are in the display.

Also, in the find case, pass it the new packet we found.

svn path=/trunk/; revision=36839
2011-04-24 21:02:55 +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
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
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
Gerald Combs 6e7d652034 Clarify a comment.
svn path=/trunk/; revision=36270
2011-03-22 21:07:00 +00:00
Stig Bjørlykke ed3d478fb9 Allocate correct size of fdata col_text and col_text_len.
Coverity 711 & 716.

svn path=/trunk/; revision=36266
2011-03-22 19:24:08 +00:00
Guy Harris 8ca97915c3 We have to initialize the elements of the fdata->col_text array to null
pointers, as there's code that assumes that if they're not set to null
pointers, they're set correctly, and doesn't bother setting them to the
right value.

svn path=/trunk/; revision=36252
2011-03-22 16:33:39 +00:00
Guy Harris 23e5eb42ba When we allocate the col_text array, initialize it to a bunch of
pointers to null strings, rather than a bunch of null pointers, so that
if an exception is thrown before we set any of the columns, or some
other problem occurs, we don't end up with null pointers that could
later cause a crash.

Fix indentation.

svn path=/trunk/; revision=36234
2011-03-22 03:56:39 +00:00
Sake Blok 307c0d70fb Removal of the old packet-list in favor of the new packet list.
It compiles with "./configure without options" on my Mac. Let's see what the buildbots have to say about it :-)


svn path=/trunk/; revision=36161
2011-03-08 01:52:25 +00:00
Gerald Combs a6bbdaa849 Fix some dead code and zero division issues found by Clang scan-build.
In convert_string_case() use g_utf8_strup() instead of converting each
character by hand. Hopefully this won't cause any unexpected changes in
behavior.

svn path=/trunk/; revision=36006
2011-02-18 22:43:48 +00:00
Guy Harris 45ba0a19c4 Clean up indentation.
svn path=/trunk/; revision=35813
2011-02-04 10:23:22 +00:00
Anders Broman b7527dd063 From Cal Turney:
Bug 5621 - With String in Packet details searches, highlight row in tree 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5621

svn path=/trunk/; revision=35718
2011-01-31 12:19:15 +00:00
Stephen Fisher 347d0a77bf From Cal Turney via enhancement bug #5587: In hex or string searches of the
packet data highlight the target rather than the entire field.


svn path=/trunk/; revision=35584
2011-01-19 18:21:21 +00:00
Guy Harris a4cc25f84d Move main_statusbar.h to the top-level directory; none of its routines
use GTK+ data types, so, at least in theory, it could be implemented
atop another toolkit.

Make statusbar_push_temporary_msg() take a format string and format
arguments.  Use it instead of simple_status(), and change one call to
just take a format string and arguments rather than to take the result
of using that format string and arguments with g_strdup_printf() and
passing the result to statusbar_push_temporary_msg().

svn path=/trunk/; revision=35041
2010-11-27 21:50:49 +00:00
Bill Meier dbd143d68a (Trivial) Fix a typo in a comment.
svn path=/trunk/; revision=34626
2010-10-23 15:45:12 +00:00
Jeff Morriss 83caffd358 Fix the win64 build
svn path=/trunk/; revision=34564
2010-10-18 21:36:41 +00:00
Jeff Morriss 94e072c92f Fix progress bar when loading compressed files.
Continue to use the data offset ((uncompressed) bytes read) as our progress
indicator, at least until we get a progress value greater than 1.0.  Then,
in addition to checking if the size of the file changed, check our position in
the file and use that as our progress indicator.

This optimizes uncompressed file accesses (avoiding an lseek()) at the "expense"
of switching progress measures (from data read to position in the file) while
loading a file.  Tests have shown that the progress bar never shows the data
offset number when loading a compressed file, so this should be okay.

svn path=/trunk/; revision=34563
2010-10-18 20:52:54 +00:00
Bill Meier ee7d36f1df (Trivial) Fix a typo
svn path=/trunk/; revision=33951
2010-08-27 15:01:28 +00:00
Anders Broman 46cd4a8507 From Cal Turney:
1. Restore the functionality of <Ctrl>A and <Ctrl>X to the filter textbox.  
2. Assign intuitive shortcuts without consuming any new shortcut letters.  
3. Add 'Un-Time Reference All Packets' to the menu.
4. Disallow the marking or ignoring of all packets in the capture.  
5. Make the Mark/Ignore/Time Reference-related menu items context sensitive. 
6. Add 'ref_time_count' to the capture_file structure
7. Utilize marked/ignored/ref_time_count vars to prevent needless looping thru
   the entire packet list by exiting the loop when it becomes zero.

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

svn path=/trunk/; revision=33817
2010-08-16 18:17:45 +00:00
Bill Meier 4871fd2412 Fix compilation error when compiling for "old packet list".
svn path=/trunk/; revision=33802
2010-08-15 15:17:48 +00:00
Guy Harris 2a328da4ef Instead of using a Boolean for the search direction, use an enum, so
that you can tell from examination whether the search is forward or
backward.

Make the cf_find_packet routines take the direction as an explicit
argument, rather than, in the cases where you don't want to permanently
set the direction, saving the direction in the capture_file structure,
changing it, doing the search, and restoring the saved direction.  Give
more information in the Doxygen comments for those routines.

Add a cf_find_packet_dfilter_string() routine, which takes a filter
string rather than a compiled filter as an argument.  Replace
find_previous_next_frame_with_filter() with it.

Have cf_read_frame_r() and cf_read_frame() pop up the error dialog if
the read fails, rather than leaving that up to its caller.  That lets us
eliminate cf_read_error_message(), by swallowing its code into
cf_read_frame_r().  Add Doxygen comments for cf_read_frame_r() and
cf_read_frame().

Don't have find_packet() read the packet before calling the callback
routine; leave that up to the callback routine.

Add cf_find_packet_marked(), to find the next or previous marked packet,
and cf_find_packet_time_reference(), to find the next or previous time
reference packet.  Those routines do *not* need to read the packet data
to see if it matches; that lets them run much faster.

Clean up indentation.

svn path=/trunk/; revision=33791
2010-08-13 07:39:46 +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
Anders Broman 5356785ede Reverting
http://anonsvn.wireshark.org/viewvc?view=rev&revision=29861
seems to fix the scrolling in live captures issue.

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

svn path=/trunk/; revision=33384
2010-06-30 19:38:26 +00:00
Stig Bjørlykke b444bd6eb2 Increase the displayed_count before we add the packet to the packet list,
because we update the the packets bar when adding the packet.

This fixes bug 4896.

svn path=/trunk/; revision=33331
2010-06-26 21:03:01 +00:00
Gerald Combs 69d7392467 Add cf_fake_continue_tail() which is called when real-time capture
updates are off and which sets the capture file state to a value that
won't cause an assertion when the user stops capturing. Fixes bug 4035.

svn path=/trunk/; revision=33005
2010-05-27 23:55:04 +00:00
Gerald Combs e2c8894947 Another attempt at bug 4669: Properly set the previous-displayed-packet
timestamp when we're recalculating reference times.

Remove an unused variable. Add whitespace & comment fixups.

svn path=/trunk/; revision=32985
2010-05-26 23:29:56 +00:00
Anders Broman 65ee4e797a From Jakub Zawadzki:
New functions: cf_read_frame_r, cf_read_frame

It's much easier to write:
 cf_read_frame (cf, fdata, &err, &err_info)
Than:
 wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd,
fdata->cap_len, &err, &err_info)

svn path=/trunk/; revision=32980
2010-05-26 19:11:23 +00:00
Gerald Combs 0a209d762e Zlib has an officially-sanctioned way of clearing EOF when we're tailing
a file.  Use it.

svn path=/trunk/; revision=32716
2010-05-07 21:15:24 +00:00
Bill Meier a509e11b85 Use consistent indentation;
Altho no tabs use tab-width=8 anyway.

svn path=/trunk/; revision=32590
2010-04-28 16:37:25 +00:00
Gerald Combs cc5d7670bd Keep a copy of the interface description and capture filter around so that
we can use it in the main window title during and after capture. Add a
"-X" option for providing a description for stdin.

svn path=/trunk/; revision=32357
2010-04-01 21:55:01 +00:00
Guy Harris 04eef8ab97 Squelch a compiler warning.
svn path=/trunk/; revision=32310
2010-03-27 18:17:19 +00:00
Anders Broman 9a97618f1c Measure the filtering time.
svn path=/trunk/; revision=32192
2010-03-15 06:28:01 +00:00
Stig Bjørlykke bae37cf3ac Uh, no need to check for having custom columns to call
col_custom_prime_edt().

svn path=/trunk/; revision=31991
2010-02-24 20:34:38 +00:00
Stig Bjørlykke 258c8363ec Fix for bug 4323 & 4511:
Call col_custom_prime_edt() when having custom columns on print and
export to csv and psml.

svn path=/trunk/; revision=31990
2010-02-24 20:24:05 +00:00
Gerald Combs d122243892 Another Laura bug: Don't reset the file load time in the status bar when
we apply a display filter. Display the load time as "Load time:
M:SS.SSS" instead of "Time: HH:MM:SS.SSS".

svn path=/trunk/; revision=31909
2010-02-17 23:03:41 +00:00
Anders Broman bc80677038 Don't freeze/thaw the list when stoping a live capture.
svn path=/trunk/; revision=31754
2010-02-01 14:55:47 +00:00
Anders Broman eca27931e0 Don't freeze/thaw the list when doing live captures.
svn path=/trunk/; revision=31748
2010-02-01 06:30:47 +00:00
Anders Broman eef24f0765 From Jim Young:
Wireshark GUI not reporting filename after save of new capture file.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4406

svn path=/trunk/; revision=31587
2010-01-20 06:44:03 +00:00
Stig Bjørlykke 47be3577a7 Introduce "Ignore Packet" in the packet list.
This will remove the package from the dissection functions without
removing it from the capture file.

svn path=/trunk/; revision=31287
2009-12-17 01:18:14 +00:00
Jaap Keuter 81b585cf8e From Valerio Messina:
As now, when Wireshark save capture files, it show "Loading" in status bar and
in the dialog box, warning many users of lost them packets. Saving work as expected.
Is simply a GUI use interaction problem.

svn path=/trunk/; revision=31269
2009-12-14 22:05:29 +00:00
Anders Broman cafad87fd9 From Stig:
Invalidate cfile.current_row instead(revert 30910).

svn path=/trunk/; revision=30925
2009-11-10 20:16:14 +00:00
Gerald Combs 5e34f21076 Add the ability to push temporary (and highlighted) messages onto the
statusbar. This lets us notify the user about something significant
without having to pop up an annoying window. Replace a few dialogs with
statusbar messages.

svn path=/trunk/; revision=30810
2009-11-04 00:02:52 +00:00
Stig Bjørlykke 1fc92dee03 Fixed 'Delta timestamp to previous captured frame' calculation in
old packet list.  This bug was introduced in r30052.

svn path=/trunk/; revision=30758
2009-10-29 13:27:05 +00:00
Stig Bjørlykke 2f199b9d96 Made some functions static.
svn path=/trunk/; revision=30616
2009-10-19 14:21:11 +00:00
Stig Bjørlykke e162470d6b Prime interesting fields when selecting a package, so Lua's ProtoField
can extract the field value correctly.

This fixes bug 4058.

svn path=/trunk/; revision=30252
2009-10-02 19:55:43 +00:00
Anders Broman ffcaf32074 Select the first packet when doing a live capture. In the old packet list this is automatically done as the clist emits a selct-row signal.
Seting focus in new_packet_list_moveto_end() seems also to be needed to make it work properly I'm not 100% sure if it should be done differently.

svn path=/trunk/; revision=30074
2009-09-22 18:51:33 +00:00
Kovarththanan Rajaratnam 07cb929d6b dfilter_free() can handle a NULL pointer so don't guard against that before calling it
svn path=/trunk/; revision=30072
2009-09-22 16:49:26 +00:00
Kovarththanan Rajaratnam 9398b679e8 Introduce cap_file_add_fdata() and start using it
svn path=/trunk/; revision=30071
2009-09-22 16:39:48 +00:00
Kovarththanan Rajaratnam 627a7c1f47 Switch Wireshark GUI (file.c) over to using frame_data.c
svn path=/trunk/; revision=30067
2009-09-22 14:41:30 +00:00
Kovarththanan Rajaratnam 054ef7aa0f Make sure that the old packet list works with the changes introduced in r30047
svn path=/trunk/; revision=30060
2009-09-22 05:23:45 +00:00
Kovarththanan Rajaratnam 1989aa700d Bring frame_data_init() and add_packet_to_packet_list() more in sync by adding 'ref_time' handling to frame_data_init(). For tshark/rawshark this is unused because they only do a single pass through the capture file
svn path=/trunk/; revision=30055
2009-09-21 20:17:59 +00:00
Kovarththanan Rajaratnam aa4af67e1b Only set cumulative bytes after passing the display filter test
svn path=/trunk/; revision=30053
2009-09-21 19:48:53 +00:00
Kovarththanan Rajaratnam c3647b4e3b Move 'Delta timestamp to previous captured frame' calculation inside add_packet_to_packet_list(). This is done in order to streamline add_packet_to_packet_list() with frame_data_init(). Hopefully we can switch to frame_data_init() soon
svn path=/trunk/; revision=30052
2009-09-21 19:30:06 +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
Kovarththanan Rajaratnam 109875c775 Remove second (redundant) assignment to fdata->cum_bytes
svn path=/trunk/; revision=30046
2009-09-21 17:38:10 +00:00
Kovarththanan Rajaratnam 9831d4c4e1 Reverse order of NEW_PACKET_LIST guard, i.e. #ifdef NEW_PACKET_LIST instead of #ifndef NEW_PACKET_LIST
svn path=/trunk/; revision=30045
2009-09-21 17:32:35 +00:00
Stephen Fisher d923139789 Fix typo in comment
svn path=/trunk/; revision=30043
2009-09-21 17:09:15 +00:00
Kovarththanan Rajaratnam 3c9afabfe0 (cosmetic change) - reset cumulative bytes together with 'first_ts' and 'prev_dis_ts'
svn path=/trunk/; revision=30042
2009-09-21 15:50:15 +00:00
Kovarththanan Rajaratnam 8527133db0 cf->dfilter is only set if it's valid so assert if that's not the case
svn path=/trunk/; revision=30041
2009-09-21 15:38:40 +00:00
Kovarththanan Rajaratnam 112a677484 Reset cumulative bytes when we open the file
svn path=/trunk/; revision=30040
2009-09-21 15:29:32 +00:00
Kovarththanan Rajaratnam 8dc906da00 Set fdata->num up front and roll back if necessary
svn path=/trunk/; revision=30039
2009-09-21 15:23:33 +00:00
Kovarththanan Rajaratnam 03a9cfe84c Shuffle NEW_PACKET_LIST guard
svn path=/trunk/; revision=30038
2009-09-21 14:13:46 +00:00
Kovarththanan Rajaratnam d86635a3d8 Introduce a NEW_PACKET_LIST specialized version of add_packet_to_packet_list(). The old one contained too many #ifdef NEW_PACKET_LIST which reduced readability
svn path=/trunk/; revision=30036
2009-09-21 12:14:11 +00:00
Anders Broman 546014cdaf cf_change_time_formats() is not needed with new packet list.
svn path=/trunk/; revision=30034
2009-09-21 11:58:36 +00:00
Kovarththanan Rajaratnam 3b7a12dda0 Add NEW_PACKET_LIST guard wrt fdata->col_text
svn path=/trunk/; revision=30030
2009-09-21 04:29:25 +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 ad7f82f9ce From Jakub Zawadzki:
Fix copy/paste error wrt. fdata->col_text_len

svn path=/trunk/; revision=29921
2009-09-15 14:01:40 +00:00
Anders Broman b0c3abfa79 Fix:
cleanup_dissection() calls se_free_all(); And after that fdata->col_text (which is allocated using se_alloc0()) no longer points to valid memory.

svn path=/trunk/; revision=29920
2009-09-15 13:18:13 +00:00
Stephen Fisher 5dfeb86fb7 Fix warning that variable may be unused and then declare volatile so it
survives the TRY/CATCH code.


svn path=/trunk/; revision=29863
2009-09-11 15:38:33 +00:00
Anders Broman 6edeb87ad7 Only move to last row if it's vissible.
svn path=/trunk/; revision=29861
2009-09-11 14:58:49 +00:00
Anders Broman 0772dd06b4 New_packet_list
Select the correct frame in packet details when filtering.

svn path=/trunk/; revision=29857
2009-09-11 11:58:00 +00:00
Anders Broman a65f72e8f0 Allocate col_text and col_text_len when the fdata struct is allocated.
(complete the checkin).

svn path=/trunk/; revision=29818
2009-09-09 08:51:33 +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 c6f96e4ec9 Make sure that reset the elapsed time to load a file before we reload/rescan the file
svn path=/trunk/; revision=29783
2009-09-07 21:07:51 +00:00
Kovarththanan Rajaratnam 8d909ba79e Rename new_packet_list_set_time_width() -> new_packet_list_resize_column() because it contains no time format specific code. Further this change also ensures that new_packet_list_resize_columns() uses the newly introduced new_packet_list_resize_column()
svn path=/trunk/; revision=29782
2009-09-07 20:45:32 +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
Stig Bjørlykke e55129063b Fixed arguments to new_packet_list_set_time_width().
svn path=/trunk/; revision=29761
2009-09-07 12:01:19 +00:00
Anders Broman 5cc8d3e71d col_fmt not needed.
svn path=/trunk/; revision=29760
2009-09-07 11:50:08 +00:00
Kovarththanan Rajaratnam cd8831c72d Track length of columns strings. We'll need this in order to resize columns quickly
svn path=/trunk/; revision=29759
2009-09-07 11:33:38 +00:00
Anders Broman 7473e1e04c Automatically adjust the time column width when time format changes.
svn path=/trunk/; revision=29758
2009-09-07 10:03:55 +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 95ddec4d07 Get rid off GtkTreeModelFilter because the time to sort becomes unbearable when combined with GtkTreeSortable. This means that we now track which frames are visible in the our own packet list store. To do so, we now distinguish between physical and visible rows. All frames are added as physical rows. Only those that passes the display filter are marked as visible.
svn path=/trunk/; revision=29705
2009-09-05 10:36:29 +00:00
Kovarththanan Rajaratnam 6be0e11906 Remove superfluous assignment
svn path=/trunk/; revision=29686
2009-09-03 14:41:09 +00:00
Kovarththanan Rajaratnam bd69669e1d Make sure that we stop auto scroll if we start scrolling manually.
Caveat: we jump to first frame when auto scroll is stopped

svn path=/trunk/; revision=29685
2009-09-03 14:32:11 +00:00
Kovarththanan Rajaratnam 47b766a998 Only try and select the last row if not already selected. This fix doesn't seem to work. Any suggestions?
svn path=/trunk/; revision=29677
2009-09-02 19:31:56 +00:00
Kovarththanan Rajaratnam bc36849a9e Add seperate new_packet_list_moveto_end() which scrolls to the end _without_ selecting the last packet.
svn path=/trunk/; revision=29670
2009-09-02 17:29:52 +00:00
Kovarththanan Rajaratnam 6149d4be35 Make sure that we select the last row if autoscroll is enabled. The scrolling is still very jumpy. It seems that we always select the first packet before moving to the end.
svn path=/trunk/; revision=29668
2009-09-02 17:15:20 +00:00
Martin Mathieson e256fed975 Add volatile to avoid clobbered by longjmp warning.
svn path=/trunk/; revision=29651
2009-09-01 11:15:24 +00:00
Anders Broman 2d001ec762 - Read a min number if packets before checking if the progress bar should be updated.
- Calculate the progess before checking if progress bar should be
created or not.
- Dont update the progress to often on small files.
- Use data_offset rather than reading file_pos.

svn path=/trunk/; revision=29648
2009-09-01 08:51:41 +00:00
Anders Broman 2cd2eecd0a Compute the loading time and show it in the main status bar.
(Modified code from Didier Gautheron).

svn path=/trunk/; revision=29592
2009-08-28 05:19:52 +00:00
Kovarththanan Rajaratnam 27f7d88c84 Also fake empty field_info's by gracefully handling NULL field_info pointer elsewhere.
svn path=/trunk/; revision=29490
2009-08-21 11:03:30 +00:00
Anders Broman 1108352f00 Use col_text in frame data.
- colum-utils needs more work, based on
 Didier Gautherons optimizations patch http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=29489
2009-08-21 10:12:47 +00:00
Kovarththanan Rajaratnam 82adb33a48 We shouldn't conditionalise on _filtering_ tap listerners to determine whether tapping should be performed or not. We also need to handle _normal_ tap listerners. This change backs out the regression introduced in r29435.
Thanks to Didier: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3916

svn path=/trunk/; revision=29475
2009-08-19 13:52:15 +00:00
Kovarththanan Rajaratnam d4ba2208ec Inline a few checks in the add_packet_to_packet_list() function since it's called in tight loop. This will help us to avoid calling functions that simply returns. This is especially the case when we're dealing with the new packet list due to its dissect-on-demand nature where colour/column construction is delayed until the row becomes visible.
svn path=/trunk/; revision=29435
2009-08-15 14:13:36 +00:00
Kovarththanan Rajaratnam 81c7e34905 Make display filtering work for NEW_PACKET_LIST. This didn't work previously because we would simply append the new filtered packets onto the existing ones.
svn path=/trunk/; revision=29409
2009-08-14 05:49:57 +00:00
Kovarththanan Rajaratnam 68e75a961b Always add packet to the new packet list regardless of whether the packet passed the display filter test or not. We do this because we do the filtering inside the new packet list.
svn path=/trunk/; revision=29408
2009-08-14 05:22:12 +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
Anders Broman ca335d25cb From Kovarththanan Rajaratnam:
- Compute and cache color/custom filters dynamically.
- Delay column construction.

svn path=/trunk/; revision=29370
2009-08-10 20:52:56 +00:00
Kovarththanan Rajaratnam 3512e485ca Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail.
svn path=/trunk/; revision=29354
2009-08-09 17:33:23 +00:00
Kovarththanan Rajaratnam d2b61c0297 Free frame data slice on file reset
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3813

svn path=/trunk/; revision=29322
2009-08-07 12:15:46 +00:00
Anders Broman 3ec8398f16 From Kovarththanan Rajaratnam:
This patch fixes the "Decode as" crash. We now freeze the packetlist before
attempting to clear it. This way we don't have to issue a row deleted signal
either.

svn path=/trunk/; revision=29238
2009-07-29 21:32:49 +00:00
Anders Broman 26d1dfcf4c Add pinfo to new_packet_list_append() this should give us the abillity
to store (most) of the underlying data rather than the strings in the store and render it when we need it, thuss saving storage space and loading time.

Idealy we should not store the complete fdata or pinfo structures
but rather just the data relevant to the currently selected/used columns. I'm not entierly sure how to accomplish that however.

Dynamically allocated array to hold pointers to the actual data?

svn path=/trunk/; revision=29237
2009-07-29 20:58:47 +00:00
Anders Broman d4caa4ec50 Pacify the build bot.
svn path=/trunk/; revision=29222
2009-07-28 18:29:15 +00:00
Anders Broman 09c6b577f9 Set reftime without recreating the packet list.
svn path=/trunk/; revision=29220
2009-07-28 16:20:05 +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 5fbc5d6f58 From Kovarththanan Rajaratnam:
Only clear packet list store if we need to redissect.

svn path=/trunk/; revision=29195
2009-07-26 10:34:07 +00:00
Stephen Fisher 53ded7dae6 Remove two unused variables and mark a function paramter as unused
svn path=/trunk/; revision=29193
2009-07-25 20:13:46 +00:00
Anders Broman be084ae799 From Kovarththanan Rajaratnam:
New packet list: enable goto first/last packet (Optimized)

svn path=/trunk/; revision=29190
2009-07-25 07:50:53 +00:00
Anders Broman 2e29868357 Use g_slice if glib >=2.10
svn path=/trunk/; revision=29187
2009-07-24 13:50:57 +00:00
Anders Broman 9bf46cd286 When using the new packet list select the first packet when the file read is complete. This should take care of the crash when closing WS.
svn path=/trunk/; revision=29186
2009-07-24 08:10:33 +00:00
Anders Broman 213a926bd9 From kovarththanan Rajaratnam:
Pass column_info as a pointer (new packet list).

svn path=/trunk/; revision=29169
2009-07-22 17:35:28 +00:00
Anders Broman 203fb3f25f Minor indentation fixes.
svn path=/trunk/; revision=29163
2009-07-22 06:00:53 +00:00
Stig Bjørlykke 8c4abdfb47 From didier gautheron via bug 3762:
This patch removes col_expr in frame_data structure,
it can be recomputed when needed.

svn path=/trunk/; revision=29159
2009-07-21 16:48:16 +00:00
Anders Broman 7c0fb707a5 Implement new_packet_list_find_row_from_data()
Goto frame should work now.

svn path=/trunk/; revision=29147
2009-07-20 16:09:50 +00:00
Stephen Fisher edc8ae64f1 Introduce packet list coloring for the NEW_PACKET_LIST. One caveat: when
enabling/disabling the coloring of the packet list from the menus, the user
has to drag the mouse cursor over each displayed row to take away/add the
coloring.  Dragging the scroll bar up or down will also take care of this as
only the displayed rows are colored.


svn path=/trunk/; revision=29142
2009-07-20 06:21:35 +00:00
Stig Bjørlykke 5afe405717 Removed an incorrect optimalization for invalidating packet in row 0.
svn path=/trunk/; revision=28950
2009-07-06 13:53:01 +00:00
Gerald Combs e0ebc32195 Updates to create_tempfile:
- Use g_get_tmp_dir, just like get_tempfile_path.
  - Don't make the caller worry about the path buffer length.

svn path=/trunk/; revision=28915
2009-07-01 23:36:51 +00:00
Anders Broman f0fbf120f2 Realy make the new packet list compile under Windows...
svn path=/trunk/; revision=28909
2009-07-01 17:39:19 +00:00
Anders Broman 3fe0c34110 Make the new packet list compile on Windows.
svn path=/trunk/; revision=28907
2009-07-01 14:37:02 +00:00
Stephen Fisher e6d0686f7b Introduce experimental new feature: GTK2 tree view based packet list
To use the GTK2 based packet list, define NEW_PACKET_LIST when compiling.
To do this with gcc, set the environment variable CPPFLAGS to
"-DNEW_PACKET_LIST" and re-run configure.

Many features do not yet work.  This work began with prototypes by Ulf
quite a while back.  I've put quite a bit of work into this so far and
as discussed with a few of the core team members at Sharkfest09 and it was
decided that it would be best to commit what I have so far to allow others to
help work on this.


svn path=/trunk/; revision=28892
2009-06-30 18:05:04 +00:00
Stig Bjørlykke 3f281d1280 Optimized criteria for invalidate packet in row 0.
svn path=/trunk/; revision=28698
2009-06-11 11:50:05 +00:00
Guy Harris 23a4f326b7 Clean up white space.
svn path=/trunk/; revision=28646
2009-06-06 00:12:43 +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
Stig Bjørlykke 09d8911d4a Popup a dialog in case we match a row outside the loaded frame area.
This adds some information for bug 3429.

svn path=/trunk/; revision=28556
2009-06-01 15:26:15 +00:00
Stig Bjørlykke 60dfa22754 From Kovarththanan Rajaratnam via bug 3429:
This patch downgrades the g_assert() to a proper if statement. This is needed
because we can end up with a match but _without_ any valid row attached to it.
This is the case when the user has aborted while dissecting.

svn path=/trunk/; revision=28555
2009-06-01 14:51:09 +00:00
Jaap Keuter 7f3d33513a Fix bug 3489:
Array overrun at copy of filter expression on GTK1 build.

svn path=/trunk/; revision=28538
2009-05-31 11:31:40 +00:00
Gerald Combs cde5843a5d Fix the build.
svn path=/trunk/; revision=28476
2009-05-26 00:30:08 +00:00
Gerald Combs ea115662fd From Didier Gautheron via bug 3391:
when loading files > 50 MB wireshark redraws the first pane on each
update_progress_dlg(). If auto_scroll_live is not set that's mean it redraws
the same rows again and again.

The patch attached only redraws it once or if cf->displayed_count < 1000, in
case you have a very big screen.

svn path=/trunk/; revision=28475
2009-05-25 23:48:29 +00:00
Guy Harris 54c159cb41 Turn on -Wshorten-64-to-32 by default, and fix some issues that turned
up (99 44/100% of which were assignments of double-precision
floating-point constants to floats).  Hopefully this will catch at least
some P64 issues on UN*X.

svn path=/trunk/; revision=28108
2009-04-21 16:57:52 +00:00
Gerald Combs e648060f0f Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
2009-04-16 04:05:39 +00:00
Bill Meier 63d7a7d712 Use wireshark (instead of ether) for temp file name prefix.
svn path=/trunk/; revision=27993
2009-04-08 12:43:51 +00:00
Bill Meier 1321c9981b sprintf --> g_snprintf
svn path=/trunk/; revision=27751
2009-03-17 01:47:20 +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
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
Jaap Keuter acdf91e263 Make "Copy as Filter" on the packet list actually work.
Up till now every packet in the packet list got a copy of the pointer to the filter expressions for
the last packets' columns. Hence any 'Copy as Filter" on a column got the expression of the last
packet in the packet list. Instead every packet needs to get a pointer to the filter expressions 
for its own columns. This requires making a copy of the filter expressions themselves.

Since this is a bug in 1.0 as well the GLIB1 code is provided for backporting, which can later be dropped from the development tree.

svn path=/trunk/; revision=27396
2009-02-09 07:10:46 +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
Stig Bjørlykke 82fd44f303 Moved invalidation of cf->current_row when rescan packet to catch more cases
where packet list and packet details should be updated for row 0.

svn path=/trunk/; revision=26959
2008-12-10 11:05:45 +00:00
Stig Bjørlykke 076349374b Invalidate cf->current_row when rescan packet and the new selected row 0
has changed, to force update of packet list and packet details.

This fixes bug 3099.

svn path=/trunk/; revision=26937
2008-12-08 21:30:21 +00:00
Stig Bjørlykke 5498ec1dce Optimized finding current row from cfile.current_frame.
svn path=/trunk/; revision=26804
2008-11-18 14:50:51 +00:00
Stig Bjørlykke 58e2d7a0d6 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26649
2008-10-31 15:47:47 +00:00
Stig Bjørlykke ee2b7fd393 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26642
2008-10-31 10:30:17 +00:00
Sake Blok 2ce22e6bca From jmmikkel@mit.edu (Bug 2895):
We might receive new packets while redissecting and don't want to
dissect those before the packet-list is fully rebuilt.


svn path=/trunk/; revision=26309
2008-09-30 15:45:20 +00:00
Bill Meier 224b638586 #include <emem.h> not req'd
svn path=/trunk/; revision=26093
2008-08-26 02:38:57 +00:00
Stig Bjørlykke 341fba51c5 Remove a few warnings.
svn path=/trunk/; revision=25899
2008-08-01 16:49:12 +00:00
Guy Harris c4932893e3 Have separate callback mechanisms in file.c and capture.c; pass the
capture callbacks the capture_options * as its second argument in all
cases.  This makes it a bit clearer what arguments callbacks take, and
means we can get rid of all global_capture_opts references in
gtk/main_statusbar.c.

Put the interface between gtk/main.c and gtk/main_statusbar.c into a
private header.

svn path=/trunk/; revision=25576
2008-06-24 08:05:45 +00:00
Stig Bjørlykke c64847fe16 Update all time columns when changing the time precision.
Not implemented for conversation relative and delta time yet, because this
will need a reload as they are set by the dissectors and does not exist in
the frame data.

svn path=/trunk/; revision=25452
2008-06-14 16:51:11 +00:00
Guy Harris fa2b419e60 Return the appropriate "everything OK" types.
svn path=/trunk/; revision=25405
2008-05-30 07:15:05 +00:00
Guy Harris ffcb641149 Again, the err_info returned from wtap_read() and wtap_seek_read() is a
g_mallocated string, so it's not const.

Fix a comment to reflect reality (err_info is some additional
information about the error returned by Wiretap, e.g. some gory details
about the error, mainly useful to developers and support people).

svn path=/trunk/; revision=25401
2008-05-30 04:03:32 +00:00
Guy Harris be161ba460 Free up the err_info string returned by wtap_read() and
wtap_seek_read().

Clean up indentation.

svn path=/trunk/; revision=25400
2008-05-30 02:44:02 +00:00
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
Ulf Lamping 006d13d416 we don't need stat_menu.h here
svn path=/trunk/; revision=25010
2008-04-14 01:12:29 +00:00
Ulf Lamping d91e0e350a move tap_dfilter_dlg.h from / to /gtk (and use the callback mechanism in main.c instead)
svn path=/trunk/; revision=24956
2008-04-12 20:31:18 +00:00
Stig Bjørlykke 034d64cd83 Fetch return from g_list_remove.
svn path=/trunk/; revision=24945
2008-04-12 18:15:10 +00:00
Ulf Lamping 875e4ed653 improve the "simple" callback mechanism, so more than one listener is possible
svn path=/trunk/; revision=24936
2008-04-12 15:16:52 +00:00
Stig Bjørlykke aecd4254c6 Do not add packet length twice to cum_bytes when having a TIME REF frame.
This fixes bug 2387.

svn path=/trunk/; revision=24730
2008-03-26 16:56:45 +00:00
Stig Bjørlykke 056c5b49e1 Allow custom columns in export as CSV and PSML.
svn path=/trunk/; revision=24683
2008-03-18 00:48:24 +00:00
Stig Bjørlykke d01a2ac072 Bah, committed the wrong file.
Second try on allow custom columns when printing.

svn path=/trunk/; revision=24682
2008-03-18 00:11:52 +00:00
Stig Bjørlykke aa20d2b34a Allow custom columns when printing.
svn path=/trunk/; revision=24679
2008-03-17 23:40:00 +00:00
Stig Bjørlykke 5800abad46 From Francesco Fondelli (bug 2349):
Attached is a patch to export packets data as "C Arrays".  I often have
the need to [re]send data captured with wireshark using a raw/pf_packet socket.
Output format is one char[] per packet, it looks like almost the same as
the one produced by "Follow TCP stream".

svn path=/trunk/; revision=24604
2008-03-11 18:23:16 +00:00
Stig Bjørlykke 0d9d45f467 Removed an unused variable.
svn path=/trunk/; revision=24597
2008-03-10 09:31:49 +00:00
Stephen Fisher b0c33bd25b Fix bug #2343: Huge increase in Wireshark runtime memory foot print ...
svn path=/trunk/; revision=24595
2008-03-10 07:37:14 +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
Stephen Fisher 8f3a1b0d16 Check in changes originally checked in as SVN revision 24308 (new column
type: Custom) that were backed out in SVN revision 24309.

Changes since that revision include a reworking of the handling of the
cfile/cinfo variables in epan/column-utils.c, addition of three new
functions to libwireshark.def and a bug fix to prevent a crash when no
custom columns were not in use.

Compilation verified locally on MacOS X, Linux and Windows.


svn path=/trunk/; revision=24317
2008-02-13 05:05:33 +00:00
Stephen Fisher 5e893a8b1c Revert commit 24308 until I can get it to compile on Windows/Linux/Solaris
(strangely, it compiled fine on my MacOS X machine).


svn path=/trunk/; revision=24309
2008-02-12 08:09:22 +00:00
Stephen Fisher 0a85a9e4c6 Introduce a new column type called custom, which lets you put any display
filter name in the description field and it will display that field in the
packet list if it occurs in that packet.  Note that the more common fields
are implemented, but a number of them remain to be implemented in
epan/proto.c.  I will work on these other fields as I have time.


svn path=/trunk/; revision=24308
2008-02-12 03:16:09 +00:00
Stig Bjørlykke 11a9f57c1a Fixed some malloc -> g_malloc, free -> g_free, strdup -> g_strdup.
svn path=/trunk/; revision=24179
2008-01-24 19:09:30 +00:00
Gerald Combs e66660cd84 Make sure the "auto scroll in live capture" toolbar button and menu item
correctly reflect the auto scroll state. Re-enable the ability to use
the auto scroll toolbar button and menu item during a live capture.

svn path=/trunk/; revision=23777
2007-12-05 23:50:28 +00:00
Sake Blok 42a968d407 Apply coloring rules also when a frame is marked so that when a frame
is un-marked *after* enabling coloring it is still colored.

Fixes bug 2038


svn path=/trunk/; revision=23648
2007-11-28 18:02:01 +00:00
Luis Ontanon 9865b6346f As per Ulf's request add ${proto.field} macros that will use the value of the given field has in the last selected packet.
svn path=/trunk/; revision=22427
2007-07-30 23:32:47 +00:00
Gerald Combs cc0f2c6efe From Dustin Johnson: If "Update list of packets in real time" and
"Automatic scrolling in live capture" are both enabled, make the scroll
bar behavior more natural.  If the packet list is scrolled to the
bottom, scroll automatically.  If the user scrolls back, keep the packet
list scrolled at that point instead of jumping back to the end.

svn path=/trunk/; revision=22277
2007-07-09 16:31:39 +00:00
Stephen Fisher d1d72fd232 Fix for bug #93: changes to the columns has no effect until restart
These changes allow the packet list clist to be destroyed and recreated
with the new column titles/values/order that the user changed in the
preferences without restarting Wireshark. 


svn path=/trunk/; revision=22038
2007-06-04 20:15:10 +00:00
Guy Harris 5a43799a17 Use G_GINT64_MODIFIER, rather than the PRI[douxX]64 macros, for GLib
routines and routines using those routines.  GLib might use different
modifiers for 64-bit quantities than the platform's C library does.

svn path=/trunk/; revision=21990
2007-05-29 18:52:42 +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
Stephen Fisher 6625e7503f Fix warnings on Linux/gcc 4.1.1
svn path=/trunk/; revision=21330
2007-04-03 21:17:13 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 2896811274 Fix about 150 warnings new to gcc 4.0 in the error on warning directories.
Comment out -Werror in plugins/asn1/ until warnings can be fixed.


svn path=/trunk/; revision=21158
2007-03-23 22:49:23 +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 cdf47e536b Add -Werror when using GCC only to the Makefile.am of the base
directory and most of the plugins to match the same command 
put in the Makefile.nmake files for Windows compliations.  Fix
a few warnings when compiling under gcc 3.4.4 on FreeBSD.  Create
new automake file variable called USING_GCC in configure.in and
wiretap/configure.in to acomplish the above -Werror addition. 


svn path=/trunk/; revision=21127
2007-03-22 23:03:39 +00:00
Guy Harris 082282b6f4 Don't enable "Save As" if you don't have an unsaved live capture file
and there are no formats in which the file can be saved by some means
other than copying the raw data; "Save As" isn't a very useful function
in that case, and that prevents us from having an empty list of formats
in which the file can be saved.

svn path=/trunk/; revision=21032
2007-03-14 19:30:19 +00:00
Jeff Morriss c39d342a40 Squelch some unused variable warnings
svn path=/trunk/; revision=20873
2007-02-20 14:00:53 +00:00
Ronnie Sahlberg b1a499190e we dont have auto_scroll_live if we dont have PCAP so ifdef this out unless PCAP is available
(to allow it to compile when pcap is not available)


svn path=/trunk/; revision=20662
2007-02-01 08:37:54 +00:00
Martin Mathieson 997e5415f9 Add separate union entries to fvalue.value for signed and unsigned
32-bit numbers.  Separate signed and unsigned accessors have been
added and used where appropriate.

Definitely not for 0.99.5.

svn path=/trunk/; revision=20472
2007-01-18 11:02:26 +00:00
Ulf Lamping e3330fd922 instead of simply doing an assert when running out of memory in emem, throw a new OutOfMemoryError Exception, so file.c can show at least a better explanation to the user before Wireshark terminates
XXX - to prevent a busy wait, I need a portable way to wait for a short time period, like Sleep() for Windows

svn path=/trunk/; revision=20437
2007-01-15 05:16:13 +00:00
Ulf Lamping 16ac7832b4 minor bugfix of file loading: don't update the packet list if loading a smaller file, the update takes longer than the file to load.
svn path=/trunk/; revision=20434
2007-01-15 00:17:32 +00:00
Graeme Lunt 2fd7d2c620 New "decode as ..." feature for BER-encoded files (WTAP_FILE_BER).
A BER-encoded file can be dissected as one of a number of registered syntaxes (registered using register_ber_syntax_dissector()). 
Syntaxes may also be associated with OIDs (or other strings) using register_ber_oid_syntax(). 

A default syntax with which to dissect a BER-encoded file is determined from its filename (extension). For example, ".cer" and ".crt" files will be dissected as "Certificate".


svn path=/trunk/; revision=20414
2007-01-13 12:59:27 +00:00
Stephen Fisher cbe42b8a24 Fix for bug #1140: Filtering messes up packet list sort order
svn path=/trunk/; revision=20394
2007-01-11 19:50:19 +00:00
Stephen Fisher 1f42c23012 Fix for bug #1196: packet detail & packet bytes windows not updated under
certain circumstances when applying a display filter that does not include
the currently selected packet.


svn path=/trunk/; revision=20389
2007-01-11 06:36:14 +00:00
Ronnie Sahlberg 1370d2f738 break out dfcode from the capture file structure and declare it locally where it is needed.
allocate and release the dfcode program as needed instead of having it hang around in the capture file structure.

this will ensure that dfcode will not have longer than se scope lifetime in case we need that property of it later


svn path=/trunk/; revision=20251
2007-01-01 10:23:37 +00:00
Ulf Lamping 0fb45e0bf1 while loading a huge capture file, enable the main window to show packets rushing into the packet list
svn path=/trunk/; revision=19943
2006-11-21 00:45:38 +00:00
Stephen Fisher 90303fb17f New feature to automatically highlight the field found when doing a find.
This works for both string and hex searches.  This resolves feature request
bug #776.


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

svn path=/trunk/; revision=19814
2006-11-05 22:46:44 +00:00
Ulf Lamping a977f17295 fix svn728: don't scroll down packet list while capturing, if no packets are newly displayed (happens when a display filter is active)
svn path=/trunk/; revision=19811
2006-11-05 13:47:17 +00:00
Ulf Lamping ffce5685f0 fix #1188: scroll the packet list to the bottom (in a running capture) *after* thawing the list - otherwise the scrolling won't be done correctly
this one should go into 0.99.4 IMHO

svn path=/trunk/; revision=19726
2006-10-29 12:51:15 +00:00
Ulf Lamping 7a7b422fa9 fix the memory leak problem mentioned lately by adding and using color_filters_cleanup()
svn path=/trunk/; revision=19422
2006-10-03 23:24:48 +00:00
Ulf Lamping 0da877169b changes of the coloring rules sometimes crashed as dissection keeps pointers to the color_filter for later reference -> simply deleting the filters leave the pointers invalid -> crash.
for now, don't delete the filters but keep them floating around in memory (leaking) -> at least better than crashing

svn path=/trunk/; revision=19421
2006-10-03 22:32:03 +00:00
Ulf Lamping 9e6c7b11ae Implement a real "Cancel" button for the coloring rules dialog - this was a hard one! It seems to be working without bugs and as designed now.
As this was a huge internal change, new bugs are very probable - please report.

The implementation isn't still perfect, a new dialog internal list could possibly be removed again. 

However, I want to check in at this condition, just in case I make things worse - again.

svn path=/trunk/; revision=19413
2006-10-03 18:39:36 +00:00
Ronnie Sahlberg 372ff9cad8 coverity 170
remove some dead code



svn path=/trunk/; revision=18575
2006-06-26 08:47:26 +00:00
Anders Broman f68d6e4c8c Ethereal->Wireshark
svn path=/trunk/; revision=18235
2006-05-28 20:28:20 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Gerald Combs 784334b322 Add an extra null pointer check. Fixes Coverity CID 154.
svn path=/trunk/; revision=18018
2006-04-27 18:46:05 +00:00
Anders Broman 0fc74ff335 From dider
file.c
time reference menu callback doesn't set  cf->filter, it dumps a core if 
you have a file big enough in find next/ find prev.

addr_resolv.c
leak memory, break list chain when snooping address.

svn path=/trunk/; revision=17419
2006-02-27 09:01:10 +00:00
Guy Harris 4d8d477018 Move create_tempfile() to tempfile.c out of util.c. This means dumpcap
no longer needs util.c, so it no longer includes routines that use
host_ip_af(), so it no longer needs to define its own host_ip_af().

That also means dumpcap.c no longer needs to include <sys/socket.h>.

svn path=/trunk/; revision=17278
2006-02-12 21:52:18 +00:00
Ulf Lamping 35dd233580 show the number of packets captured, if "Update list of packets ..." isn't used
svn path=/trunk/; revision=17071
2006-01-22 16:26:41 +00:00
Ulf Lamping 864edeb5ac add matched coloring rule name and string to the frame dissector output (or nothing if no coloring rule matched or none was set)
svn path=/trunk/; revision=17068
2006-01-21 17:49:00 +00:00
Guy Harris 0dbf17b690 Allow a progress dialog to have "Stop" or "Cancel" as the "terminate
button"; "Stop" should be used for operations that can only be stopped
(meaning that what it's already done isn't undone), not cancelled
(meaning that whatever it's already done *is* undone), for which
"Cancel" is used.

Allow the merging process to be cancelled.

Clean up indentation.

Update some comments.

svn path=/trunk/; revision=16489
2005-11-12 11:05:02 +00:00
Ulf Lamping a10a0d2636 from Jaap Keuter:
Anyone having objections to idea of stopping the load of a capture file
i.s.o. cancelling it? I'm refering to WishList Data I/O item #6.
It seems a very reasonable idea and easy to implement.

I've done some extensions:
-Improve the corresponding comment on the implications why this is useful
-added a new simple_dialog text to explain what's really going on (simply using the WTAP truncated packet message was a bit misleading)

svn path=/trunk/; revision=16441
2005-11-08 22:24:53 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Guy Harris eb7e8111c6 Fix uninitialized variable errors.
Rename some variables to make the names used in progress bars more
common.  (Should more of that functionality be moved into common
progress bar code?)

svn path=/trunk/; revision=16347
2005-10-27 20:18:50 +00:00
Guy Harris 0203c65739 Check on every iteration of a loop whether to pop up a dialog box,
rather than checking only on every progress bar update quantum, so that
if the update quantum is *very* large, we don't end up waiting longer
than the standard time for a dialog box before checking.

svn path=/trunk/; revision=16327
2005-10-27 06:45:37 +00:00
Ulf Lamping bb5e5d6ce1 fix a packet_list_freeze / thaw pair, if a return comes in it's way
add a g_warning() call if an error occured while reading from capture file (while doing a live update), usually shouldn't happen but is difficult to debug *if* it happens
add a new log domain LOG_DOMAIN_MAIN and the standard log handler for it
add some (partly commented out) g_log() calls, useful for GUI sequence debugging

svn path=/trunk/; revision=16136
2005-10-06 00:55:21 +00:00
Ulf Lamping cd64e4627b minor bugfix: call cf_callback_invoke() from cf_close() even if the file is already closed. Otherwise the GUI will remain in the wrong state if a capture couldn't be started (e.g. wrong interface).
svn path=/trunk/; revision=16024
2005-09-27 21:46:39 +00:00
Ulf Lamping 831c54c4f5 add two new callbacks:
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ...

If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here.

cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress.

svn path=/trunk/; revision=15891
2005-09-20 08:42:35 +00:00
Ulf Lamping 84cf7ce767 added compression support for capture file output. The Save/As dialog now has a checkbox "Compress with gzip"
currently limited to Ethereal and all the variants of libpcap filetypes only.

We might want to add output compression support to the other tools as well (tethereal, mergecap, ...).

We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek.

One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). 

Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ...

svn path=/trunk/; revision=15804
2005-09-14 21:57:30 +00:00
Guy Harris f34e1a97c6 Have cf_retap_packets() take an argument that indicates whether to
generate columns; use cf_retap_packets instead of cf_redissect_packets()
when running taps (the general flow graph stat uses the Info column).

svn path=/trunk/; revision=15793
2005-09-14 08:59:41 +00:00
Guy Harris d8873511a7 Frame numbers are unsigned, and they start at 1; 0 is what's used for
"unknown" for frame numbers.  Note that in epan/frame_data.h, and make
the frame number in experts unsigned, and use 0 for "unknown", and
display it as an unsigned number - and, if it's 0, don't display it at
all.

Fix the signature of "expert_dlg_draw()" to match what a tap's draw
routine's signature is expected to be.

svn path=/trunk/; revision=15760
2005-09-11 22:25:33 +00:00
Ulf Lamping 0b526d9703 start with fdata->num = -1, so we don't have an uninitialised value while doing read_filter style dissection
svn path=/trunk/; revision=15732
2005-09-08 21:36:40 +00:00
Ulf Lamping 723c80ea90 timestamp display precision:
- automatic adjustment depending on file format
- manual adjustment through menu items

save the setting in the recent file

svn path=/trunk/; revision=15534
2005-08-25 21:29:54 +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 a0e68da918 Add a "register_dfilter_stat()", to register stats that take a display
filter as an argument on the command line and have a dialog box to enter
the display filter through the GUI.  Use it for all stats using
"gtk_tap_dfilter_dlg_cb()".

Add a top-level "stat_menu.h" file to declare "REGISTER_STAT_GROUP_E"
for the benefit of the declaration of "register_dfilter_stat()" in the
top-level "tap_dfilter_dlg.h".  Rename the "stat_menu.h" in the gtk
directory to "gtk_stat_menu.h", so as not to have two headers with the
same name.

Get rid of headers not declaring any functions not being used in the
module.

svn path=/trunk/; revision=15493
2005-08-21 09:48:27 +00:00
Guy Harris 0ec73a5eff Widen some variables so the code in question can handle large files if,
as, and when Wiretap can handle them.

svn path=/trunk/; revision=15462
2005-08-20 09:08:24 +00:00
Guy Harris 53b54d11ed Get rid of f_len field in capture_file structure - we can just keep
the length locally. within cf_read().

svn path=/trunk/; revision=15454
2005-08-20 02:14:01 +00:00
Guy Harris 38ec1644e6 Add APIs to Wiretap to return the file of the size as supplied by the OS
(so if the file's gzipped, it's *NOT* the size of the file after
uncompressing), and an approximation of the amount of that data read
sequentially so far.

Use those for various progress bars and the like.

Make the fstat() in the Ascend trace reader directly use wth->fd, as
it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as
we're no longer directly using fstat() or lseek() in Ethereal), so get
rid of wtap_fd().

svn path=/trunk/; revision=15437
2005-08-19 19:40:00 +00:00
Ulf Lamping cc73e58f02 file.c(3079) : warning C4090: 'function' : different 'const' qualifiers
file.c(3079) : warning C4022: 'cf_callback_invoke' : pointer mismatch for actual parameter 2

svn path=/trunk/; revision=15418
2005-08-19 07:03:34 +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
Jörg Mayer 956eee946f Some 'no previous declararion' warning fixes
svn path=/trunk/; revision=15355
2005-08-14 23:25:20 +00:00
Ulf Lamping 3e137afdc5 more snprintf() -> g_snprintf() replacements
svn path=/trunk/; revision=15284
2005-08-10 19:37:29 +00:00
Guy Harris 23b2341a9b We no longer generate a "Loading" message ourselves, we just pass the
name of the file being loaded to "delayed_create_progress_dlg()".  Get
rid of the pointless "g_strdup_printf()" call (which amounted to a
more-expensive "g_strdup()", and the variables it used.

svn path=/trunk/; revision=15248
2005-08-06 18:40:03 +00:00
Jörg Mayer 62b7cc3043 Last set of char -> const char trivial warning fixes.
svn path=/trunk/; revision=15244
2005-08-06 14:03:14 +00:00
Ulf Lamping bd1442f452 convenience: if a "Go To Packet" didn't succeeded, add the requested packet number to the error message,
svn path=/trunk/; revision=14510
2005-05-31 21:17:54 +00:00
Ulf Lamping a48744a84b add a new feature: list the files of a "File Set" (set of files generated by capturing "Multiple Files"/ringbuffer) and jump from one file of it to the next/previous one
svn path=/trunk/; revision=14231
2005-04-29 14:51:52 +00:00
Ulf Lamping 7ee0db1080 statusbar changes:
-show the current capture file size, if capturing in real time mode.
-move the packet "Drops" count (if available) from file to packets statusbar part

svn path=/trunk/; revision=14130
2005-04-18 22:05:56 +00:00
Ulf Lamping 55e312bb41 bugfix: show the right filesize after a live capture finished
svn path=/trunk/; revision=14118
2005-04-17 22:44:13 +00:00
Ulf Lamping 6e38159c25 add functions file_exists and file_identical to filesystem.c (coming from file.c)
svn path=/trunk/; revision=14057
2005-04-12 21:12:19 +00:00
Ulf Lamping 06ef0a3b52 it should now be possible to use "Update packets in real time" even if used with one of the "Multiple files" option.
If this is used together with an option where input files changes too fast (e.g. new file every second), capturing will be (hopefully) stopped.

I've replaced the former capture pipe message format into a somewhat more general format to remove a lot of confusion.


svn path=/trunk/; revision=14054
2005-04-12 00:54:52 +00:00
Ulf Lamping 0b132c9b1d bugfixes: bring non real-time captures back to former behaviour, other minor fixes
svn path=/trunk/; revision=13961
2005-03-28 21:05:53 +00:00
Ulf Lamping daa67c79ba a lot more capture engine code cleanup
most notably:

- moved opening of safe_file to the capture child (capture_loop.c)
- removed save_file_fd from capture_opts (no longer need to have it global)

svn path=/trunk/; revision=13953
2005-03-28 14:39:31 +00:00
Ulf Lamping 2b8ac21d60 move some color_filter related things from file.c to color_filters.c
svn path=/trunk/; revision=13920
2005-03-26 11:32:43 +00:00
Ulf Lamping ccff84dbdf code cleanup: use common prefix for all functions in color_filters.h
svn path=/trunk/; revision=13910
2005-03-26 01:09:14 +00:00
Ulf Lamping 008d4b8106 code cleanup: the term filter_list was used with different meanings throughout the code, and the filter_list of the color_filters is "global".
use appropriate prefixes to avoid confusion and bugs

svn path=/trunk/; revision=13905
2005-03-25 22:52:45 +00:00
Guy Harris d53df176c1 Add a "cleanup_dissection()" routine, intended to free up data
structures allocated by a dissection.  Currently, it's the same as
"init_dissection()", but they should be split with "init_dissection()"
allocating the initial data structures and "cleanup_dissection()"
freeing them and *not* reallocating the initial data structures.

Use "cleanup_dissection()" in "cf_close()" to make it easier to find leaks.

svn path=/trunk/; revision=13881
2005-03-23 12:58:59 +00:00
Ronnie Sahlberg d0009bca14 from didier
small fix to file.c



svn path=/trunk/; revision=13807
2005-03-19 10:01:34 +00:00