Commit Graph

797 Commits

Author SHA1 Message Date
Evan Huus d935a280e3 From Hadriel Kaplan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223
Add a 2-pass display-filter flag to tshark so that reassembly and other forward-
looking dissections can be used with filters.

It's a bit of a hack, but this entire area of 2-pass analysis etc. is a giant
pile of hacks to begin with and needs cleaning up. For now just having this
feature is a big enough win.

svn path=/trunk/; revision=48589
2013-03-27 17:14:42 +00:00
Anders Broman ef07303c20 Make internal functions static.
svn path=/trunk/; revision=48465
2013-03-21 21:58:47 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Evan Huus 32799db42c Fix the leaking of packet comments, i.e. the rest of
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7530

The frame_data_cleanup function was ambiguous; it was being used for two
different purposes, and did neither of them quite properly. Split it instead
into frame_data_reset and frame_data_destroy, and call the correct one depending
on why we were originally calling frame_data_cleanup.

svn path=/trunk/; revision=48324
2013-03-15 18:04:50 +00:00
Anders Broman 7990a0e4d0 Use explicit casts.
svn path=/trunk/; revision=48137
2013-03-06 17:35:11 +00:00
Michael Tüxen 6af6ce5ee0 Add support for writing the packet block flags for pcapng.
While there, do some minor cleanup.

svn path=/trunk/; revision=46699
2012-12-22 20:38:08 +00:00
Gerald Combs 5c2c5aed87 Rename the search type menu items to more accurately reflect what we're
actually doing and what users are likely to want to do.  Rename the
search enum values and functions to reflect what we're actually doing
and add a comment explaining why making searches more correct might make
searching worse.  Add a search bar to the Qt main window, thus
continuing the War On Gratuitous Dialogs.

Clear out any previous temporary label stack items before adding a new one.

svn path=/trunk/; revision=46541
2012-12-15 01:04:39 +00:00
Bill Meier 552323e7fb Fix a number of [-Wshadow] warnings;
Also: Do some minor whitespace changes

svn path=/trunk/; revision=46182
2012-11-25 18:35:41 +00:00
Evan Huus 13f8a0466c Make a few variables volatile to satisfy gcc.
svn path=/trunk/; revision=45886
2012-11-03 23:41:59 +00:00
Jakub Zawadzki bdcdec560c Manually revert r45669
svn path=/trunk/; revision=45884
2012-11-03 20:51:19 +00:00
Jakub Zawadzki d127d974f5 volatile fixes.
svn path=/trunk/; revision=45729
2012-10-22 21:22:35 +00:00
Jakub Zawadzki 9e52b48cc6 Move some variables inside TRY { } block.
svn path=/trunk/; revision=45724
2012-10-22 19:44:51 +00:00
Guy Harris 3c93cdbddc Make progbar_quantum volatile to suppress setjmp/longjmp warnings.
svn path=/trunk/; revision=45723
2012-10-22 19:34:09 +00:00
Jakub Zawadzki d26925c9cf Move TRY CATCH outside reading packet loops.
svn path=/trunk/; revision=45722
2012-10-22 19:14:43 +00:00
Chris Maynard 573dd5b3dc 1) Allow for the possibility for both packet summary and packet details to be
printed when either -T is not specified or "-T text" or "-T ps" is selected.

2) Allow for packet hex/ascii to be printed without necessarily requiring that
either packet summary or packet details also be printed.  This just means that
if you want packet summary information, use "-Px" instead of just "-x".

3) Fix bug with order of evaluation of -V and "-T psml".

4) If a packet separator is specified, always use it regardless of the -PVx
options chosen.

5) Don't print 2 lines of separation between packets when only printing
hex/ascii.  Print 1 line of separation as in all other cases.

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7782 plus other misc. enhancements.

svn path=/trunk/; revision=45715
2012-10-22 15:56:59 +00:00
Jakub Zawadzki 2fd81fdaf9 Move ep_free_all() *AFTER* packet dissection.
Use glib allocator for data_source.

Thread on wireshark-dev: http://www.wireshark.org/lists/wireshark-dev/201210/msg00116.html

svn path=/trunk/; revision=45673
2012-10-20 20:04:40 +00:00
Jakub Zawadzki 33b064cd81 I don't understand how this variable might be clobbered, but mark it volatile to silent gcc warning.
svn path=/trunk/; revision=45671
2012-10-20 19:52:23 +00:00
Jakub Zawadzki 77368c3668 Introduce epan_dissect_run_with_taps() which run dissection with taps.
unexport tap_queue_init, tap_push_tapped_queue

svn path=/trunk/; revision=45670
2012-10-20 19:27:24 +00:00
Jakub Zawadzki 6dc977b7d2 - Allow reseting edt with new function epan_dissect_reset(),
- initialize edt once in few places, and later reset it after dissecting
  (add_packet_to_packet_list),
- revert r45667, probably no longer needed.

svn path=/trunk/; revision=45669
2012-10-20 16:44:55 +00:00
Evan Huus eb4e26e1b7 Make a few variables volatile to fix longjmp warnings.
svn path=/trunk/; revision=45667
2012-10-20 13:16:10 +00:00
Jakub Zawadzki 88ac0dbea2 Pass create_proto_tree, cinfo directly to add_packet_to_packet_list
svn path=/trunk/; revision=45666
2012-10-20 12:51:34 +00:00
Jakub Zawadzki ea31ff66a0 Remove always TRUE refilter argument from rescan_packets, add_packet_to_packet_list
svn path=/trunk/; revision=45665
2012-10-20 12:51:05 +00:00
Jakub Zawadzki 98e6481be8 Only cap_len (not pkt_len) bytes of buffer are valid.
svn path=/trunk/; revision=45621
2012-10-17 21:14:14 +00:00
Jakub Zawadzki 59e2c7fd96 Fix a copy/paste error
svn path=/trunk/; revision=45620
2012-10-17 21:11:58 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Gerald Combs 4f1eb84444 Log the time we spend waiting for the capture child to exit.
Add breadcrumbs so that we can switch from g_get_current_time to
g_get_real_time when our minimum GLib version is >= 2.28.

svn path=/trunk/; revision=45399
2012-10-08 18:11:30 +00:00
Gerald Combs 71ed773862 Add a capture_file * element to packet_range_t and pass it explicitly in
packet_range_init(). Get rid of global cfile references in
packet-range.c. C++-ize packet-range.h. Shuffle some includes around.

svn path=/trunk/; revision=45333
2012-10-05 18:52:42 +00:00
Jakub Zawadzki 99e665dcd4 Revert r45183:r45184
r45182 was good fix, but updae frames_count when redissecting.

svn path=/trunk/; revision=45189
2012-09-28 10:08:17 +00:00
Jakub Zawadzki 91db653dca Revert r45182, add better fix for bug #6208: Status bar count of displayed packets wrong
cf_read() is already checking for cf->redissecting variable and if set it don't add packets to packet_list.
Rename it to cf->rescanning and set it always in rescan_packets() [not only when redissecting].

svn path=/trunk/; revision=45183
2012-09-27 21:17:50 +00:00
Jakub Zawadzki 90c5d4e61b Try to fix bug #6208: Status bar count of displayed packets wrong
When refiltering we process gtk/glib events, so it's possible that cf_continue_tail()
will fire-up, reading new packets and incrementing cf->count.

It's also possible that this packet(s) will pass display filter,
incrementing cf->displayed_count.

But when refiltering we use cf->count as number of packets to process, so
new packets are also processed, incrementing cf->displayed_count second time.

Fix bug by saving cf->count before starting refilter loop.

svn path=/trunk/; revision=45182
2012-09-27 20:59:54 +00:00
Gerald Combs 3994ddc357 Call fileset_file_closed from cf_cb_file_closed.
svn path=/trunk/; revision=45163
2012-09-26 23:40:56 +00:00
Gerald Combs 998da54456 Add a cf_cb_file_opened callback and use it instead of calling
fileset_file_opened directly from file.c. This makes the code a bit more
consistenent and makes it easier to port the File Set dialog to Qt.

svn path=/trunk/; revision=45162
2012-09-26 23:33:11 +00:00
Jakub Zawadzki 72ca9d0e61 Store pointers to previously displayed and captured packet, not nstime_t deltas.
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure.

Part of bug 5821: Reduce per-packet memory requirements.

svn path=/trunk/; revision=45071
2012-09-23 16:25:28 +00:00
Jeff Morriss 93b1a4d511 (Try to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5808 :
Use and free err_info in cf_continue_tail() and cf_finish_tail().

(Untested because I'm not sure how to corrupt a file to exercise this code path...)

svn path=/trunk/; revision=45032
2012-09-20 21:16:26 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Evan Huus 471b4d94ef Remove string constants from g_assert() calls, as per thread on wireshark-dev:
http://www.wireshark.org/lists/wireshark-dev/201209/msg00030.html

svn path=/trunk/; revision=44774
2012-09-05 01:44:09 +00:00
Jörg Mayer 12a0aa4849 - Replace packet_list_recreate_visible_rows -> packet_list_recreate_visible_rows_list
- Replace new_packet_list_ -> packet_list_


svn path=/trunk/; revision=44765
2012-09-04 02:35:25 +00:00
Bill Meier e211327f65 Fix indentation to match editor mode-lines (no tabs, correct indentation, etc);
Reformat some whitespace;
Remove unneeded variable initialization.

svn path=/trunk/; revision=44461
2012-08-12 22:21:02 +00:00
Anders Broman ae5a2f3b6d Make it possible to merge libpcap files with different encapsulation types by making the output file a pcapng file and construkting SHB and IDB
svn path=/trunk/; revision=44338
2012-08-08 14:06:29 +00:00
Guy Harris c0506eda4a simple_message_box() does not expect Pango markup, so escaping is
not necessary, and just messes up the display.

Fixes bug 7489.

#BACKPORT

svn path=/trunk/; revision=43875
2012-07-21 00:12:21 +00:00
Guy Harris 633de5c7d1 Add a routine that, given a set of packet encapsulation types, returns
the per-file encapsulation type needed to write out a set of packets
with all those encapsulation types.  If there's only one such
encapsulation type, that's the type, otherwise WTAP_ENCAP_PER_PACKET is
needed.  Use that in wtap_dump_can_write_encaps().

Also use it in cf_save_packets() and cf_export_specified_packets(), so
that we can write out files with WTAP_ENCAP_PER_PACKET as the file
encapsulation type and only one actual per-packet encapsulation type in
some cases where that failed before.  This fixes the case that showed up
in bug 7505, although there are other cases where we *could* write out a
capture in a given file format but won't be able to do so; fixing those
will take more work.

#BACKPORT

(Note: this adds a routine to libwiretap, so, when backported, the
*minor* version of the library should be increased.  Code that worked
with the version of the library prior to this change will continue to
work, so there's no need to change the *major* version of the library.)

svn path=/trunk/; revision=43847
2012-07-20 04:00:29 +00:00
Gerald Combs 0da59a0058 Pass {delayed_}create_progress_dlg a pointer the top level window
so that we can properly associate a widget with create, update, and
destroy events. Only used by Qt so far but it should be easy enough to
add to GTK+.

Rename ui/qt/progress_dialog.{h,cpp} to progress_bar.{h,cpp}. Show a
progress bar in the status bar of the main window instead of creating
a separate dialog. Note that we still need to add a "cancel" mechanism
and display the task and item titles somewhere.

Thus began the War Against Gratuitous Dialogs.

svn path=/trunk/; revision=43833
2012-07-19 21:49:52 +00:00
Chris Maynard 83c83a0c05 From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7356:
Print only visible columns.

svn path=/trunk/; revision=43722
2012-07-15 14:56:40 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris f272aaeb80 Only allow "Save" if
the file has unsaved changes, and we can save it in some format
	through Wiretap

or

	the file is a temporary file and has no unsaved changes (so that
	"saving" it just means copying it).

Only allow "Save As" if

	we can save it in some format through Wiretap

or

	the file is a temporary file and has no unsaved changes (so that
	"saving" it just means copying it).

This means that we don't support using "Save As" for just copying the
file unless we can do that with Wiretap; copying the file byte-for-byte
only works as "saving" if there are no unsaved changes *and* we're
saving it in the same format that it's in *and* we're saving it with the
same form of compression (if any) that it has.

Rename cf_can_save_as() to cf_can_write_with_wiretap() to better reflect
what it really does.

svn path=/trunk/; revision=43477
2012-06-25 18:37:52 +00:00
Anders Broman cb801710ba From Evan Huus:
Size wrong in "File Set List" for just-finished captures.

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

svn path=/trunk/; revision=43455
2012-06-24 15:08:41 +00:00
Guy Harris 750d666e73 Handle the case where the user has added comments to a file that's not
in a format that supports comments and they do a "Save" by popping up a
similar question to the one we pop up in the "Save As" case and, if they
say "choose another format", pop up a "Save As" dialog box.

svn path=/trunk/; revision=43395
2012-06-20 04:44:14 +00:00
Guy Harris 06474b4330 If the file has an SHB comment or any packet comments, and the user
tries to do "Save As" in a format for which we don't support comments
(currently, we only support them for pcap-ng), ask whether they want to
discard the comments and save anyway or, *if* the file can be saved in a
format for which we *do* support comments, they want to save the file in
some other format.

Keep a count of packet comments so that we don't have to scan all the
frame_data structures to determine whether we have any comments.

svn path=/trunk/; revision=43392
2012-06-20 01:11:01 +00:00
Guy Harris 29e4e24184 Add "simple dialog" routines to pop up modal message boxes. Use them in
file.c and routines called from it; non-modal dialogs end up, in some
cases, either hidden, devoid of the input focus and not dismissable, or
both.

svn path=/trunk/; revision=43321
2012-06-17 22:32:03 +00:00
Guy Harris 2bd813507a Export a wtap_dump_can_write_encaps() routine from Wiretap; it takes a
file type and a GArray of encapsulation types and returns TRUE if a
capture with all those encapsulation types can be written to a file in
that file type and FALSE otherwise.  Use it where appropriate.

svn path=/trunk/; revision=43315
2012-06-17 16:44:09 +00:00