Commit Graph

202 Commits

Author SHA1 Message Date
Guy Harris 8f53a5655c Make some routines static that aren't used outside the source file in
which they're defined.

Include some header files that declare functions in the source files
that define the functions.

Declare packet_list_get_type() in gtk/packet_list_store.h, as it defines
a macro that uses that function.

svn path=/trunk/; revision=37223
2011-05-17 23:33:23 +00:00
Guy Harris da1403c6dd This ain't C++; you have to put "void" in as the argument list of
functions that take no arguments, otherwise the function is treated as a
crufty old C function with undeclared arguments.

svn path=/trunk/; revision=37211
2011-05-17 21:26:25 +00:00
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
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
Jakub Zawadzki 06ad060901 Initial support for editing packets inside wireshark.
svn path=/trunk/; revision=36841
2011-04-24 21:19:41 +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
Stephen Fisher 9246c41703 Change ws_strdup_escape_underscore() function to be more general, by
accepting any character as the escaped character.  Change existing
uses to use '_' for the underscore escaping.


svn path=/trunk/; revision=36627
2011-04-13 16:56:24 +00:00
Stephen Fisher 321149bcd7 Fix Coverity 331, 332, 333: Wrap the three remaining
gtk_tree_selection_get_selected() calls with if(!..) return;
like the rest of them.  These functions shouldn't be called
unless a packet was selected, so this call should always return
TRUE for success.


svn path=/trunk/; revision=36339
2011-03-25 22:35:29 +00:00
Bill Meier a37493fe16 Fix bug #5189: Wireshark crashes when cancelling a large sort operation.
Essentially: Don't try to sort if the pre-requisite "columnization" step is stopped
             via the progressbar dialog window before the step completes.
Also: Fix a (very) minor bug wherein the sort-indicator not always cleared on the
      "previous column" when "No Sorting" was selected from a column context menu.
Also: Do minor code, comments & whitespace cleanup.

svn path=/trunk/; revision=36180
2011-03-12 19:02:24 +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
Stephen Fisher 1b2f2426e0 Remove #ifndef GSEAL_ENABLE hack to work-around the lack of an accessor
for a GSEALed variable since GTK 3.0 is out, which has the accessor.


svn path=/trunk/; revision=35917
2011-02-11 18:28:55 +00:00
Stephen Fisher 09c49ac78c More -DGSEAL_ENABLE cleanup (hopefully without breaking anything)...
svn path=/trunk/; revision=35870
2011-02-08 00:56:22 +00:00
Anders Broman c9b96a9bfb Try to fix previous commit.
- menu.h commited by mistake
- new_packet_list.c missing

svn path=/trunk/; revision=35719
2011-01-31 13:52:32 +00:00
Stig Bjørlykke 502ddd6cdb Added filter autocomplete to "Edit Column Details".
svn path=/trunk/; revision=35717
2011-01-31 07:42:13 +00:00
Sake Blok 516bfe3363 Fix marking functionality (bug 5279)
svn path=/trunk/; revision=35244
2010-12-22 17:25:06 +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
Stig Bjørlykke 4ce3021a07 Prefix window title with "Wireshark".
svn path=/trunk/; revision=34445
2010-10-09 18:37:31 +00:00
Stig Bjørlykke ccfe41300c Added "Edit Column Details" functions to the packet list heading popup.
Removed "Rename Column Title" as this is moved to "Edit Column Details".

svn path=/trunk/; revision=34444
2010-10-09 15:22:53 +00:00
Stig Bjørlykke 06a60e48c3 Show custom column occurrence in the packet list heading tooltips.
svn path=/trunk/; revision=34434
2010-10-08 11:08:36 +00:00
Stig Bjørlykke 2e560e12a9 Ensure we always show the selected frame when changing sort order.
svn path=/trunk/; revision=34337
2010-10-02 16:41:20 +00:00
Stig Bjørlykke f5ab6c1930 Store "Show Resolved" setting for custom columns.
svn path=/trunk/; revision=34220
2010-09-23 19:41:55 +00:00
Stig Bjørlykke a1b2b3cbcb Do not set custom occurrence in recent file, this is used for column width.
svn path=/trunk/; revision=34219
2010-09-23 19:36:09 +00:00
Stig Bjørlykke 3061558a4c Disable sorting while capturing.
svn path=/trunk/; revision=34216
2010-09-23 18:07:49 +00:00
Sake Blok 7364bef1b3 When using a custom column, make it possible to select which occurrence to show if the field has multiple occurrences.
svn path=/trunk/; revision=34186
2010-09-22 20:56:14 +00:00
Bill Meier 8b7784d08e Remove what appear to be two redundant lines of code (AFAIKT).
svn path=/trunk/; revision=34090
2010-09-09 17:30:35 +00:00
Anders Broman 0042c07d2a Doxygen changes.
svn path=/trunk/; revision=33993
2010-08-29 15:14:38 +00:00
Bill Meier 254135d807 (Trivial) Whitespace cleanup.
svn path=/trunk/; revision=33889
2010-08-23 14:36:01 +00:00
Bill Meier 539712c5ad new_packet_list_column_button_pressed_cb(): return gboolean (not void): it's an event callback;
Note:
 the original code:
   static void new_packet_list_column_button_pressed_cb() {
     ...
     packet_list_popup(...);
     }
 the revised code:
   static gboolean new_packet_list_column_button_pressed_cb() {
     ...
     return packet_list_popup(...);
     }

 My guess is that the original code happened to work 
 on some?/all? supported platforms depending upon the actual
 details of the generated calling_sequence/return code.
---------------
Also: 
- new_packet_list_column_button_pressed_cb(): 'path' arg is unused;
- new_packet_list_double_click_cb(): user_data arg is unused so 
  don't supply same in the g_signal_connect.

svn path=/trunk/; revision=33888
2010-08-23 14:08:35 +00:00
Anders Broman d5460f420d From Cal Turney:
Restores Mark All Displayed item when all packets are displayed.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5115

svn path=/trunk/; revision=33836
2010-08-18 07:48:37 +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
Stig Bjørlykke 7b64be6a80 Revert COL_DSCP_VALUE back to value set in packet-ip.c.
Right justify COL_DSCP_VALUE (and COL_DCE_CALL as in the old packet list).

svn path=/trunk/; revision=33430
2010-07-05 09:05:27 +00:00
Stig Bjørlykke 0c2e3652e6 Recreate the packet list on DND columns.
This is a quick'n'dirty fix and not optimal, but it fixes the problems we
have with DND columns.  We have to rewrite new_packet_list_recreate() to
handle both new, delete and reorder columns.

svn path=/trunk/; revision=33400
2010-07-01 14:33:36 +00:00
Stig Bjørlykke 6b5a031808 Fetch filter and copy summary from correct column after DND columns.
This does not recreate the internal structures, but we we fix the problem
with fetching wrong data.  Printing still uses the configured column order.

svn path=/trunk/; revision=33399
2010-07-01 12:21:29 +00:00
Stig Bjørlykke 9877a63dc7 Remove some double GTK_TREE_VIEW casts.
svn path=/trunk/; revision=33398
2010-07-01 11:31:24 +00:00
Stig Bjørlykke 2ae635a51a Cleanup some whitespace.
svn path=/trunk/; revision=33333
2010-06-26 21:42:12 +00:00
Stig Bjørlykke 5a69e41f6e Enable "Show Resolved" for custom OID columns.
svn path=/trunk/; revision=33320
2010-06-25 10:44:12 +00:00
Stig Bjørlykke beb4314276 Introduce "Show Resolved" as an option in custom columns. This will determine
if we show the value or the string representing the value.

This setting is not stored in the preferences file yet, and the option is
not available in the columns preferences window.

svn path=/trunk/; revision=33317
2010-06-25 06:42:34 +00:00
Stig Bjørlykke d3e1e2df1e Added "Hide Column" functionality.
svn path=/trunk/; revision=33266
2010-06-20 16:23:43 +00:00
Gerald Combs 074b9660b6 Have new_packet_list_queue_draw() redraw the packet detail as well. Call
new_packet_list_queue_draw() whenever we mark/unmark frames. Fixes bug
4669.

svn path=/trunk/; revision=32981
2010-05-26 19:44:40 +00:00
Anders Broman 6c10366a1d Try to get the status bar to update the "Displayed:" field when if and when a display filter is applied.
svn path=/trunk/; revision=31752
2010-02-01 12:55:45 +00:00
Anders Broman cb1f3e6986 - Back out the change to restore the selection after freeze/thaw.
- Move packets_bar_update(); to new_packet_list_append() as
 we may not freeze/thaw the list.

svn path=/trunk/; revision=31747
2010-02-01 06:27:24 +00:00
Bill Meier 538dd47d5d Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31731
2010-01-29 19:09:01 +00:00
Stig Bjørlykke ff9123acbe Cleanup the escape/unescape underscore in Packet List column headers.
We only have to do this when actually set or get the title from the widget.

svn path=/trunk/; revision=31689
2010-01-26 23:05:40 +00:00
Gerasimos Dimitriadis c08fa6f3cf Move underscore escaping/unscaping function to strutil.c;
Update decoding of IS-801 Request GPS Acquisition Assistance

svn path=/trunk/; revision=31685
2010-01-26 18:21:17 +00:00
Gerasimos Dimitriadis 065546cdcb Change the prefix of the underscore escaping/unescaping
functions from g_ to ws_; Insert function names in
libwireshark.def

svn path=/trunk/; revision=31662
2010-01-25 18:14:01 +00:00
Gerasimos Dimitriadis 11e340038f Handle underscore escaping/unescaping of the column titles
under the new packet list

svn path=/trunk/; revision=31649
2010-01-24 22:25:40 +00:00
Stig Bjørlykke a8a225d1f2 Use get_column_custom_field() to get unknown custom column field.
svn path=/trunk/; revision=31490
2010-01-11 08:27:10 +00:00
Stig Bjørlykke 5c771d6e5f Fixed the tooltip for unknown custom column field.
Apply the correction fix for the old packet list.

svn path=/trunk/; revision=31489
2010-01-11 08:16:14 +00:00