Commit Graph

853 Commits

Author SHA1 Message Date
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
Ulf Lamping 801e9dd35e from Stefano Pettini: add CSV export function, similar to PSML export
svn path=/trunk/; revision=13724
2005-03-11 20:56:31 +00:00
Ulf Lamping 1be3391a94 bugfix in PSML export output: the epan API slightly changed, epan_dissect_fill_in_columns must be called now to fill in column data. This resulted in missing values in PSML output.
svn path=/trunk/; revision=13674
2005-03-09 07:51:07 +00:00
Ulf Lamping 399c821254 Another step towards using the parent/child mode for ALL captures.
This is currently still disabled, as we cannot pass all required capture flags to the child process (lack of command line parameters).

svn path=/trunk/; revision=13558
2005-02-28 22:46:49 +00:00
Guy Harris 9105b04e4b Have "cf_merge_files()" take a pointer-to-pointer-to-char as the output
file name argument; if the pointed-to pointer is null, it opens a
temporary file, and sets that pointer to a mallocated copy of the
pathname of the temporary file.  It no longer needs a file descriptor as
an argument.

svn path=/trunk/; revision=13419
2005-02-17 03:05:54 +00:00
Guy Harris ea7ef54b0d Have "cf_merge_files()" always close "out_fd" before returning; it does
so if "wtap_dump_fdopen()" succeeds (as a side-effect of calling
"wtap_dump_close()"), even if "cf_merge_fails()" after that, so it
should do so if it fails.

That means we don't need to close it in the callers of "cf_merge_files()".

svn path=/trunk/; revision=13407
2005-02-15 20:01:24 +00:00
Lars Roland f3294ee49a change nmake makefiles in /trunk and /trunk/epan so that
object code for libethereal.dll isn't generated by the
makefile in /trunk.

Having no code in /trunk linked into libethereal.dll
anymore, the definition of the macro _NEED_VAR_IMPORT_
can be moved from various source files in /trunk to /trunk/Makefile.nmake .
So do that, too.

svn path=/trunk/; revision=13389
2005-02-13 00:10:15 +00:00
Ulf Lamping 6d3d4bb708 bugfix for sync_mode captures, wasn't started correctly (cf_callback_invoke(cf_cb_live_capture_started); was never called)
svn path=/trunk/; revision=13369
2005-02-10 01:55:36 +00:00
Guy Harris 79a39eddbc Move the code to set the title on a window when a capture is in progress
to the "start live capture" callback, and call that from "do_capture()".

When opening a capture file, don't pop up the "What do you want to do?"
pane when closing any existing file you have open, as we're just going
to put the regular view up right after that.

svn path=/trunk/; revision=13332
2005-02-07 02:09:30 +00:00
Guy Harris 641106f21d Declare "cf_callback_t" before using it in a further declaration.
Mark the "func" argument to "cf_callback_remove()" as unused.

Get rid of the "iface" argument to "cf_start_tail()", as it's no longer
used.

svn path=/trunk/; revision=13331
2005-02-07 01:32:53 +00:00
Ulf Lamping 1c6b2cf0e3 Instead of calling each single thing when doing/finish a file operation, file.c shouldn't call all the GUI related functions itself, instead throwing some kind of Events to it's caller(s).
I've implemented a very simple callback mechanism which provides exactly this. I've tried GHook from GLib before, but this doesn't seem to be the right thing, as it's too inflexible for the purpose here.

So I've implemented a callback function in main.c which receives all "events" and spreads them to menu, statusbar and itself.

I would see this implementation as a prototype which may need  improvements. Please comment the changes.

svn path=/trunk/; revision=13330
2005-02-07 00:54:46 +00:00
Guy Harris 1041ccdbe5 Don't have "set_menus_for_captured_packets()" call
"main_set_for_capture_file()"; it should only deal with menus, not
anything else - and it gets called while the menus are being set up,
which is before the main window has been completely created, so
"main_widgets_show_or_hide()", which is called by
"main_set_for_capture_file()", gets errors trying to show or hide
widgets the pointers to which are null.

svn path=/trunk/; revision=13328
2005-02-06 23:16:05 +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 244c060b45 use the interfaces descriptive name to be shown in the statusbar as it's, well, more descriptive
svn path=/trunk/; revision=13307
2005-02-05 14:37:56 +00:00
Ulf Lamping 9d18adec33 minor enhancements to Guy's last update
svn path=/trunk/; revision=13304
2005-02-05 13:44:27 +00:00
Guy Harris fa3e5609ab Put "cf_status_t" back.
svn path=/trunk/; revision=13303
2005-02-05 12:50:47 +00:00
Ulf Lamping 9bf11427f4 make some string parameters const, as they are not changed inside
svn path=/trunk/; revision=13298
2005-02-05 11:00:04 +00:00
Guy Harris 2c89242aac Instead of having a single enumerated type for status return values from
cf_ functions, have separate ones for different classes of routines, and
use gboolean when the return value is just "success" or "failure" - that
way you don't get compiler warnings if a case statement isn't handling a
particular status value if the routine in question won't return it.

svn path=/trunk/; revision=13293
2005-02-04 20:54:12 +00:00
Guy Harris d3e4fe620c Properly define "cf_start_tail()".
svn path=/trunk/; revision=13292
2005-02-04 20:32:32 +00:00
Ulf Lamping 0861927ce3 huge cleanup of capture file API (functions in file.c/file.h).
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions.

Hopefully, I didn't introduced any new bugs, as I had to change a lot of files...

svn path=/trunk/; revision=13289
2005-02-04 18:44:44 +00:00
Ulf Lamping 10ee9093c8 remove #include "globals.h" and access to global cfile, use access functions and capture_opts instead
svn path=/trunk/; revision=13284
2005-02-04 08:42:39 +00:00
Ulf Lamping 9f171b0485 remove #include "globals.h" and access to global cfile, use access functions and capture_opts instead
svn path=/trunk/; revision=13283
2005-02-04 08:27:41 +00:00
Ulf Lamping dd71ad695f (some) redesign of capture data structures.
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c
move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it

svn path=/trunk/; revision=13276
2005-02-04 01:29:29 +00:00
Guy Harris 6e622fd24e "gtk_entry_get_text()" returns a "const char *" - assign the result to
one.

"get_basename()" doesn't modify its argument, and its callers don't
modify the substring pointed to by the result, so make it take a "const
char *" as an argument and return a "const char *". 

"find_last_pathname_separator()" doesn't modify its argument, so make it
a "const char *" - but some of its callers pass a non-"const" "char *"
and modify the result, so don't make its return value a "const char *".
And, as none of its callers are outside "filesystem.c", make it static.

In "about_folders_page_new()", have separate variables for pathnames
returned as "const char *" (which are cached by the routine that returns
them, so you can't modify them - and can't free them, so get rid of the
commented-out "g_free()" calls for them) and pathnames returned as "char
*" (which are allocated anew for each call, and can be modified, but
have to be freed).

Clean up white space.

svn path=/trunk/; revision=12881
2004-12-31 00:26:36 +00:00
Guy Harris f1deabed56 Make the tone of the error messages a bit less formal, by using
contractions.  (Safari does, at least when you're trying to open a file
to which you don't have read access.)

svn path=/trunk/; revision=12852
2004-12-29 01:08:20 +00:00
Guy Harris e09e12621a The common merge code merely needs to offer the abstraction of routines
that return the next packet from a set of {chronologically sorted,
sequential-by-file} packets; it doesn't need to have a loop over all
those packets, or any code to write packets.

Supply those abstractions, change the code that merges packets to do its
own writing, and have the Ethereal version manage a progress bar and
have the mergecap version print packet numbers in verbose mode, as the
common merge code used to do.

svn path=/trunk/; revision=12427
2004-10-29 00:36:52 +00:00
Guy Harris 66e85e4e43 Make "merge_files()" and "merge_append_files()" return a tri-state
indication - success, read failure, write failure - and have their
callers handle read failures by looking for the file that got the read
failure and reporting the failure in question.

Free up the err_info string returned by "wtap_read()" after using it.

svn path=/trunk/; revision=12423
2004-10-28 01:52:05 +00:00
Guy Harris dc2280bc1e Remove all the verbose-mode code from merge.c, and put most of it in
mergecap.c (get rid of the verbose printing of information for each
packet).

Have "merge_append_files()" return FALSE only on a write error, as
"merge_files()" does.

Sort the routines in "merge.c" in the order from "merge.h".

svn path=/trunk/; revision=12422
2004-10-28 01:06:11 +00:00
Guy Harris d9bdadc4dd Get rid of merge_n_files() - it's only called in one place now, and
absorbing its logic into "cf_merge_files()" simplifies things a bit.

svn path=/trunk/; revision=12421
2004-10-27 23:45:10 +00:00
Guy Harris b48b8847b1 Change some of the merge.c APIs to return more information on failure,
and use that information to provide better error messages.

Have "merge_open_outfile()" do all the work of filling in the
merge_out_file_t structure, with the values to use passed as arguments. 
Get rid of some structure members that used to be used solely to pass
information to "merge_open_outfile()".

Add a "cf_merge_files()" routine to do the merging and reporting of errors.

svn path=/trunk/; revision=12420
2004-10-27 23:28:37 +00:00
Guy Harris 7f5b234c5c Move the column preferences stuff to epan (the rest of the preferences
stuff is already there).

Update Gerald's e-mail address in column.h.

svn path=/trunk/; revision=12131
2004-09-29 02:54:22 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00