Commit Graph

675 Commits

Author SHA1 Message Date
Guy Harris 6cbf6ce16c Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code.  Have it also supply a err_info string, and
report it.  Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.

svn path=/trunk/; revision=36748
2011-04-21 09:41:52 +00:00
Guy Harris 92c974f2f7 Now that wtap_read() checks for delayed errors on EOF, there's no need
to check for it on close.

svn path=/trunk/; revision=36593
2011-04-12 17:37:05 +00:00
Guy Harris e5fe0128d7 Allow wtap_sequential_close() and wtap_close() to return an error; this
may happen if, when reading a compressed file, we find an error in the
file's contents past the last packet (e.g., the file being cut short so
that we can't get a full buffer worth of compressed data), and that
reporting of that error is delayed (so that you can get all of the
packets that we *can* decompress).  Check for those errors, at least on
the sequential read pass (the only errors we should see when closing the
random stream are errors we've already seen in the sequential stream).

svn path=/trunk/; revision=36576
2011-04-12 01:36:12 +00:00
Gerald Combs fcf51fc73b Add initial pcapng name resolution record support. Wireshark has read
support; TShark has read+write support. Additionally TShark can read a
"hosts" file and write those records to a capture file.

This uses "struct addrinfo" in many places and probably won't compile on
some platforms.

svn path=/trunk/; revision=36318
2011-03-24 22:47:57 +00:00
Gerald Combs 6e7d652034 Clarify a comment.
svn path=/trunk/; revision=36270
2011-03-22 21:07:00 +00:00
Stig Bjørlykke ed3d478fb9 Allocate correct size of fdata col_text and col_text_len.
Coverity 711 & 716.

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

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

Fix indentation.

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


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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

Clean up indentation.

svn path=/trunk/; revision=33791
2010-08-13 07:39:46 +00:00
Gerald Combs cfa9982492 Make sure we call wtap_cleareof() before each read.
svn path=/trunk/; revision=33555
2010-07-16 18:20:32 +00:00
Anders Broman 5356785ede Reverting
http://anonsvn.wireshark.org/viewvc?view=rev&revision=29861
seems to fix the scrolling in live captures issue.

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

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

This fixes bug 4896.

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

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

Remove an unused variable. Add whitespace & comment fixups.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This fixes bug 4058.

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

svn path=/trunk/; revision=30074
2009-09-22 18:51:33 +00:00
Kovarththanan Rajaratnam 07cb929d6b dfilter_free() can handle a NULL pointer so don't guard against that before calling it
svn path=/trunk/; revision=30072
2009-09-22 16:49:26 +00:00
Kovarththanan Rajaratnam 9398b679e8 Introduce cap_file_add_fdata() and start using it
svn path=/trunk/; revision=30071
2009-09-22 16:39:48 +00:00
Kovarththanan Rajaratnam 627a7c1f47 Switch Wireshark GUI (file.c) over to using frame_data.c
svn path=/trunk/; revision=30067
2009-09-22 14:41:30 +00:00
Kovarththanan Rajaratnam 054ef7aa0f Make sure that the old packet list works with the changes introduced in r30047
svn path=/trunk/; revision=30060
2009-09-22 05:23:45 +00:00