aboutsummaryrefslogtreecommitdiffstats
path: root/cfile.h
AgeCommit message (Collapse)AuthorFilesLines
2016-06-11Line up comments.Guy Harris1-54/+54
Change-Id: Ifda0499e00dfa38c936f7e054ab4d5b3a0fd627f Reviewed-on: https://code.wireshark.org/review/15830 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-23Qt: Select matching tree item and bytes in Find PacketStig Bjørlykke1-0/+1
Highlight the matching tree item and matching packet bytes when doing a Find Packet. Added cf->search_len to correctly highlight the matching bytes when doing a regex search. Bug: 12157 Change-Id: I84fbdb9b43be4355e24aff3cf5f8850f1119e2bf Reviewed-on: https://code.wireshark.org/review/14086 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-18Qt: Add regex support in Find PacketStig Bjørlykke1-0/+1
Add support for using regular expressions in the Search Frame when searching in packet list, packet details and packet bytes. This search is in many cases faster than plain string search. Change-Id: I2d8a709046f90d7b278fb39547fc4e2e420623bc Reviewed-on: https://code.wireshark.org/review/13981 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-06-23Morph ProgressBar into CaptureProgressFrame.Gerald Combs1-0/+2
Switch from a plain QProgressBar to a QFrame with a QProgressBar and a stop button. Add a stop_flag boolean to the capture_file struct. To do: - Start adding the progress bar to dialogs. - Don't complain so loudly when the user stops a capture. Change-Id: Iedd1d7d79f2044f1a53e4fb22186d25930a3ef03 Reviewed-on: https://code.wireshark.org/review/9029 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-24Qt: Apply recent settings.Gerald Combs1-1/+1
Add PacketList::applyRecentColumnWidths which set the packet list column widths from our recent settings. Make sure it gets called at startup and when we change profiles. Save the packet list header state so that we can restore it when we reset the model (i.e. freezing and thawing) and load a new capture file. Save the state when the user resizes a column. As a side effect this works around a weird bug that adjusts the width of column 1 at an inopportune time. Add a profileChanging signal so that we can save the main window geometry in each profile. Get rid of MainWindow::configurationProfileChanged. It was unused. Apply saved pane widths and heights. Note that we might want to add a separate pair of recent settings for the Qt panes. Use the last opened directory in the capture file dialog. Git rid of some unneeded Q_UNUSEDs while we're here. Bug: 10953 Change-Id: I812aff59818cf0b4d1598b580627d32728d2e9d7 Reviewed-on: https://code.wireshark.org/review/7247 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-14Always put editor-modelines at the end of the file ...Bill Meier1-3/+3
... to ensure that there are no potential issues with respect to editors limiting the number of lines scanned at the end of the file when checking for editor modelines. Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4 Reviewed-on: https://code.wireshark.org/review/4688 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12Add editor modelines; Adjust whitespace as needed.Bill Meier1-3/+16
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad Reviewed-on: https://code.wireshark.org/review/4626 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-09Revert "Refactor Wiretap"Guy Harris1-7/+3
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. This isn't building, and looks as if it requires significant work to fix. Change-Id: I622b1bb243e353e874883a302ab419532b7601f2 Reviewed-on: https://code.wireshark.org/review/1568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Refactor WiretapMichael Mann1-3/+7
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality. The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes. bug:9607 Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae Reviewed-on: https://code.wireshark.org/review/1485 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-21Fix Bug 9903: 'Clicking reload-file ignores selected file format reader'Hadriel Kaplan1-0/+1
There's a relatively new feature in 1.11.3 to select a specific file format reader, instead of relying on magics or heuristics. If you select a file reader and open a file, open it, and then click the reload-file button or go to View->Reload or press the ctrl-R keymap, the file is reloaded but using the magic/heuristics again instead of the file format reader you previously chose. Likewise, the Lua relaod() function has the same issue (which is how I found this problem). I have tested this change by hand, using a Lua script, but I didn't add it to the testsuite because I need another change for my test script to work correctly. (an enhancement rather than a bug fix, which I'll submit separately) Change-Id: I48c2d9ea443e37fd9d41be43d6b6cd5a866d5b01 Reviewed-on: https://code.wireshark.org/review/764 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20Revert "Allow pcapng interface options to be available to dissectors."Anders Broman1-2/+0
This patch causes Wireshark/tshark to segfault if the file is reread(open a file and press reload). The test suite also fails on 2.1.1 Step: Exit status for existing file: "/home/wireshark/builders/trunk/sol10sparc/build/test/captures/dhcp.pcap" must be 0/home/wireshark/builders/trunk/sol10sparc/build/test/suite-clopts.sh: line 149: 6646 Segmentation Fault (core dumped) $TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1 OSX build bot chokes on pcapng.c: In function 'pcapng_destroy_option_value': pcapng.c:377: warning: implicit declaration of function 'g_byte_array_unref' pcapng.c:379: warning: implicit declaration of function 'g_array_unref' pcapng.c: In function 'pcapng_collect_block_option': pcapng.c:419: warning: implicit declaration of function 'g_byte_array_new_take' pcapng.c:419: warning: initialization makes pointer from integer without a cast these functions are glib 2.22 This reverts commit 7b13a3b0f6a5617e0e352f87cc5a20afea226aa8. Change-Id: Ia82fdb2d08287bc2cd2841e1e941ae68cbc2e009 Reviewed-on: https://code.wireshark.org/review/749 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20Allow pcapng interface options to be available to dissectors.Christopher Kilgour1-0/+2
Interface options[1], and more generally pcapng options[2], are useful information that can provide improved dissector output. Prior to this change, only certain pcapng interface options were interpreted and made available to dissectors, e.g. the interface name or description. This change augments the situation by providing epan_get_interface_option( ), which returns an array of byte arrays if the option code exists (otherwise NULL). Each element of the array is a byte buffer containing the raw data of the option. An array-of-buffers is used because pcapng allows for multiple instances of the same option to be present in the file. All interface options found in a pcapng file are thus made available to the dissector. The implementation also provides infrastructure to collect options from other pcapng blocks such as the section header. Currently these options are discarded, but could be retained in the future to support more features. [1] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionidb [2] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionopt Change-Id: I944b6f0f03dde9b8e7d1348b76acde6f9d312f37 Reviewed-on: https://code.wireshark.org/review/331 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-22Avoid including definition of column_info structure in dissectors.Jakub Zawadzki1-0/+1
Move COL_* enum to <epan/column-utils.h> XXX Later we can rename epan/column-info.h to column-int.h (or smth like this) svn path=/trunk/; revision=54352
2013-12-03Avoid including <epan/epan.h> in dissectors.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53774
2013-11-29Avoid including <wiretap/wtap.h> in dissectors.Jakub Zawadzki1-0/+9
svn path=/trunk/; revision=53655
2013-11-15Remove comment & defines for frame_data_sequence from cfile.hJakub Zawadzki1-13/+0
It's already in epan/frame_data_sequence.c and no-one else should use it. svn path=/trunk/; revision=53341
2013-08-14Global variables considered harmful.Guy Harris1-0/+6
svn path=/trunk/; revision=51352
2013-08-01Remove fdata->opt_comment, add pkt_comment to pinfoJakub Zawadzki1-0/+1
Original (read from file) comments can be accessed by pkthdr->opt_comment Keep user comments in seperated BST, add new method for epan session to get it. svn path=/trunk/; revision=51090
2013-07-22Abuse epan_t more: add callback to get interface name.Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=50794
2013-07-21Some work on multi file dissectionJakub Zawadzki1-0/+1
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-11Move some more modules into epan.Jeff Morriss1-1/+1
svn path=/trunk/; revision=50517
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-1/+1
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-03-30Update -2, -R and -Y to behave consistently as per the concensus reached onEvan Huus1-1/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223 Mention the new -Y flag and associated changes in the release notes. svn path=/trunk/; revision=48654
2012-12-15Rename the search type menu items to more accurately reflect what we'reGerald Combs1-3/+3
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-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-1/+1
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-05Add a capture_file * element to packet_range_t and pass it explicitly inGerald Combs1-0/+2
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-1/+1
r45182 was good fix, but updae frames_count when redissecting. svn path=/trunk/; revision=45189
2012-09-27Missing part of r45183Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=45184
2012-09-03cinfo.columns_changed is only used by ui/gtk, move it to cfile structure.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=44750
2012-07-19Pass {delayed_}create_progress_dlg a pointer the top level windowGerald Combs1-0/+1
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-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-20If the file has an SHB comment or any packet comments, and the userGuy Harris1-0/+1
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-15For a capture file, keep an array of all encapsulation types seen.Guy Harris1-1/+2
Show all of them in the summary dialog; we will be using it in the future to figure out what capture file formats we can write to (just because a capture file format supports per-packet encapsulations, that doesn't mean that it supports *all possible* encapsulations). svn path=/trunk/; revision=43278
2012-05-24Keep track, in Wiretap, of whether the file is compressed, and provideGuy Harris1-0/+1
an API to fetch that. When doing "Save" on a compressed file, write it out compressed. In the Statistics -> Summary dialog and in capinfos, report whether the file is gzip-compressed. svn path=/trunk/; revision=42818
2012-05-20Change the "user_saved" member of a capture_file structure toGuy Harris1-1/+1
"unsaved_changes", and have it be TRUE iff changes have been made to the file since it was read - *not* if it's a temporary file from a live capture. Check the "is_tempfile" member, and the "unsaved_changes" member, when appropriate. Just have a set_toolbar_for_capture_file() routine that updates the "save", "close", and "reload" toolbar as appropriate, given a capture_file structure - absorb the function of set_toolbar_for_unsaved_capture_file() into it. svn path=/trunk/; revision=42721
2012-03-02Update comment - now that we support adding comments to files, a captureGuy Harris1-1/+1
that we've saved to a particular path, or that we've read in, could still be unsaved if we add comments to it. svn path=/trunk/; revision=41321
2011-12-29Add 'extern "C"' wrappers and #include guards to various header files.Gerald Combs1-0/+8
svn path=/trunk/; revision=40321
2011-05-12Packet editor: support for saving changed frames.Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=37099
2011-04-27Create a new frame_data_sequence data type; it represents a denseGuy Harris1-15/+3
sequence of frame_data structures, indexed by the frame number. Extract the relevant bits of the capture_file data structure and move them to the frame_data_sequence, and move the relevant code from cfile.c and tweak it to handle frame_data_sequence structures. Have a possibly-null pointer to a frame_data_sequence structure in the capture_file structure; if it's null, we aren't keeping a sequence of frame_data structures (we don't keep that sequence when we're doing one-pass processing in TShark). Nothing in libwireshark should care about a capture_file structure; get rid of some unnecessary includes of cfile.h. svn path=/trunk/; revision=36881
2011-04-25Store the frame_data structures in a tree, rather than a linked list. Guy Harris1-17/+24
This lets us get rid of the per-frame_data-structure prev and next pointers, saving memory (at least according to Activity Monitor's report of the virtual address space size on my Snow Leopard machine, it's a noticeable saving), and lets us look up frame_data structures by frame number in O(log2(number of frames)) time rather than O(number of frames) time. It seems to take more CPU time when reading in the file, but seems to go from "finished reading in all the packets" to "displaying the packets" faster and seems to free up the frame_data structures faster when closing the file. It *is* doing more copying, currently, as we now don't allocate the frame_data structure until after the packet has passed the read filter, so that might account for the additional CPU time. (Oh, and, for what it's worth, on an LP64 platform, a frame_data structure is exactly 128 bytes long. However, there's more stuff to remove, so the power-of-2 size is not guaranteed to remain, and it's not a power-of-2 size on an ILP32 platform.) It also means we don't need GLib 2.10 or later for the two-pass mode in TShark. It also means some code in the TCP dissector that was checking pinfo->fd->next to see if it's NULL, in order to see if this is the last packet in the file, no longer works, but that wasn't guaranteed to work anyway: we might be doing a one-pass read through the capture in TShark; we might be dissecting the frame while we're reading in the packets for the first time in Wireshark; we might be doing a live capture in Wireshark; in which case packets might be prematurely considered "the last packet". #if 0 the no-longer-working tests, pending figuring out a better way of doing it. svn path=/trunk/; revision=36849
2011-04-25Make the packet count an unsigned value, as frame numbers are unsigned.Guy Harris1-5/+15
Make the loops that scan through all the packets do so by frame number, to abstract away the "next" and "previous" pointers in the frame_data structure. Add a routine to cfile.c to map frame numbers to frame_data structures, and put in some special case handling so scanning forward or backward through the packets is O(N) rather than O(N^2). svn path=/trunk/; revision=36846
2011-01-31From Cal Turney:Anders Broman1-8/+9
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-19From Cal Turney via enhancement bug #5587: In hex or string searches of theStephen Fisher1-0/+1
packet data highlight the target rather than the entire field. svn path=/trunk/; revision=35584
2010-08-16From Cal Turney:Anders Broman1-0/+1
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-13Instead of using a Boolean for the search direction, use an enum, soGuy Harris1-1/+6
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-04-01Keep a copy of the interface description and capture filter around so thatGerald Combs1-0/+1
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
2009-12-17Introduce "Ignore Packet" in the packet list.Stig Bjørlykke1-0/+1
This will remove the package from the dissection functions without removing it from the capture file. svn path=/trunk/; revision=31287
2009-09-22Rename init_cap_file() to cap_file_init()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=30073
2009-09-22Introduce cap_file_add_fdata() and start using itKovarththanan Rajaratnam1-0/+2
svn path=/trunk/; revision=30071