aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-29Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+0
svn path=/trunk/; revision=50232
2013-06-26Move tempfile.{h,c} into wsutil.Jeff Morriss1-1/+1
svn path=/trunk/; revision=50163
2013-06-25Fix build with packet editor enabled. (Fix a typo while we're at it.)Guy Harris1-1/+2
svn path=/trunk/; revision=50153
2013-06-20inform expert info layer about the current number of packet commentsMartin Kaiser1-0/+3
when the last comment is removed and we have no other expert info, the maximum severity is changed from comment to none svn path=/trunk/; revision=50091
2013-06-19Allow for column headers not to be printed in order to make it possible to ↵Chris Maynard1-3/+7
export packets as plain text in a format that could then have a chance of being imported again (assuming other factors such as packet bytes were printed, etc.) in order to recover the original pcap file. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1636 svn path=/trunk/; revision=50036
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-19/+39
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
2013-04-13Don't take the shortcut of moving/copying the existing file if we have a nameEvan Huus1-14/+44
resolution block to write (which isn't necessarily in the existing file). Fixes at least part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8317 svn path=/trunk/; revision=48842
2013-04-02Rename cf_not_saved() to cf_has_unsaved_data() to clarify what itGuy Harris1-1/+1
indicates. (Note: "unsaved data" is more than just "unsaved changes"; it could also mean "temporary file that hasn't been saved anywhere".) svn path=/trunk/; revision=48709
2013-04-01Add routines to file.c to indicate whether:Guy Harris1-5/+93
a save can be done ("can" in the sense of "there's something to save" and in the sense of "we can write that something out"); a "save as" can be done (in the sense of "we can write what we have out"); there's unsaved data to save (which might be unsaved changes or might be a temporary file full of packets); and use them as appropriate. This means that the "unsaved data" indicator in the UI will be turned on for temporary files full of packets as well as for files with unsaved changes; that's what we want. svn path=/trunk/; revision=48693
2013-04-01Add a wtap_dump_can_write() routine that indicates whether WiretapGuy Harris1-14/+8
supports writing files with a given set of encapsulations and comment types. Use it, rather than asking for a list of file formats that support the given set of encapsulation and comment types and checking whether we got back such a list, or duplicating its logic. Having file.c use it means that nobody's using wtap_dump_can_write_encaps() any more; get rid of it. Instead, have a private routine that checks whether a given file format supports a given set of encapsulations *and* comment types, and use that internally. svn path=/trunk/; revision=48690
2013-04-01Define a collection of bits for different types of capture file comments.Guy Harris1-4/+10
For each capture file type, have a bitset of comment types supported by that capture file type. Add a Wiretap routine that, for a given file type, returns the bitset of comment types it supports. Have wtap_get_savable_file_types() take a bitset of comment types that need to be supported by the file types it returns. Replace cf_has_comments() with a routine that returns a bitset of capture file comment types in the capture file. Use those routines in the capture file dialogs; don't wire in the notion that pcap-NG supports all comment types and no other file formats support any comment types. (That's currently true, but we don't want to wire that in as being forever true.) svn path=/trunk/; revision=48689
2013-03-27From Hadriel Kaplan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223Evan Huus1-12/+1
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-21Make internal functions static.Anders Broman1-1/+1
svn path=/trunk/; revision=48465
2013-03-20 From beroset:Bill Meier1-4/+4
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2013-03-15Fix the leaking of packet comments, i.e. the rest ofEvan Huus1-4/+2
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-06Use explicit casts.Anders Broman1-17/+17
svn path=/trunk/; revision=48137
2012-12-22Add support for writing the packet block flags for pcapng.Michael Tüxen1-0/+3
While there, do some minor cleanup. svn path=/trunk/; revision=46699
2012-12-15Rename the search type menu items to more accurately reflect what we'reGerald Combs1-14/+25
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-11-25Fix a number of [-Wshadow] warnings;Bill Meier1-51/+50
Also: Do some minor whitespace changes svn path=/trunk/; revision=46182
2012-11-03Make a few variables volatile to satisfy gcc.Evan Huus1-7/+7
svn path=/trunk/; revision=45886
2012-11-03Manually revert r45669Jakub Zawadzki1-41/+22
svn path=/trunk/; revision=45884
2012-10-22volatile fixes.Jakub Zawadzki1-6/+9
svn path=/trunk/; revision=45729
2012-10-22Move some variables inside TRY { } block.Jakub Zawadzki1-89/+95
svn path=/trunk/; revision=45724
2012-10-22Make progbar_quantum volatile to suppress setjmp/longjmp warnings.Guy Harris1-1/+1
svn path=/trunk/; revision=45723
2012-10-22Move TRY CATCH outside reading packet loops.Jakub Zawadzki1-49/+45
svn path=/trunk/; revision=45722
2012-10-221) Allow for the possibility for both packet summary and packet details to beChris Maynard1-0/+4
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-20Move ep_free_all() *AFTER* packet dissection.Jakub Zawadzki1-1/+1
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-20I don't understand how this variable might be clobbered, but mark it ↵Jakub Zawadzki1-1/+1
volatile to silent gcc warning. svn path=/trunk/; revision=45671
2012-10-20Introduce epan_dissect_run_with_taps() which run dissection with taps.Jakub Zawadzki1-6/+2
unexport tap_queue_init, tap_push_tapped_queue svn path=/trunk/; revision=45670
2012-10-20- Allow reseting edt with new function epan_dissect_reset(),Jakub Zawadzki1-33/+52
- 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-20Make a few variables volatile to fix longjmp warnings.Evan Huus1-9/+9
svn path=/trunk/; revision=45667
2012-10-20Pass create_proto_tree, cinfo directly to add_packet_to_packet_listJakub Zawadzki1-41/+29
svn path=/trunk/; revision=45666
2012-10-20Remove always TRUE refilter argument from rescan_packets, ↵Jakub Zawadzki1-34/+18
add_packet_to_packet_list svn path=/trunk/; revision=45665
2012-10-17Only cap_len (not pkt_len) bytes of buffer are valid.Jakub Zawadzki1-4/+4
svn path=/trunk/; revision=45621
2012-10-17Fix a copy/paste errorJakub Zawadzki1-1/+1
svn path=/trunk/; revision=45620
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-36/+37
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-08Log the time we spend waiting for the capture child to exit.Gerald Combs1-0/+4
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-05Add a capture_file * element to packet_range_t and pass it explicitly inGerald Combs1-1/+1
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-09-28Revert r45183:r45184Jakub Zawadzki1-11/+14
r45182 was good fix, but updae frames_count when redissecting. svn path=/trunk/; revision=45189
2012-09-27Revert r45182, add better fix for bug #6208: Status bar count of displayed ↵Jakub Zawadzki1-12/+11
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-27Try to fix bug #6208: Status bar count of displayed packets wrongJakub Zawadzki1-4/+6
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-26Call fileset_file_closed from cf_cb_file_closed.Gerald Combs1-2/+0
svn path=/trunk/; revision=45163
2012-09-26Add a cf_cb_file_opened callback and use it instead of callingGerald Combs1-1/+1
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-23Store pointers to previously displayed and captured packet, not nstime_t deltas.Jakub Zawadzki1-13/+15
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-20(Try to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5808 :Jeff Morriss1-2/+7
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-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45015
2012-09-05Remove string constants from g_assert() calls, as per thread on wireshark-dev:Evan Huus1-1/+2
http://www.wireshark.org/lists/wireshark-dev/201209/msg00030.html svn path=/trunk/; revision=44774
2012-09-04- Replace packet_list_recreate_visible_rows -> ↵Jörg Mayer1-29/+29
packet_list_recreate_visible_rows_list - Replace new_packet_list_ -> packet_list_ svn path=/trunk/; revision=44765
2012-08-12Fix indentation to match editor mode-lines (no tabs, correct indentation, etc);Bill Meier1-326/+329
Reformat some whitespace; Remove unneeded variable initialization. svn path=/trunk/; revision=44461
2012-08-08Make it possible to merge libpcap files with different encapsulation types ↵Anders Broman1-11/+112
by making the output file a pcapng file and construkting SHB and IDB svn path=/trunk/; revision=44338