aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-30Move capture.[ch] to libui.Guy Harris1-799/+0
Change-Id: I86e7e781cc9e14abab0374a18b95438529b046f0 Reviewed-on: https://code.wireshark.org/review/2711 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30Move capture_ui_utils.[ch] to libui.Guy Harris1-1/+1
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a Reviewed-on: https://code.wireshark.org/review/2708 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24For capchild headers, include <capchild/XXX.h>.Guy Harris1-2/+2
Change-Id: I780c69ee637dcd9846756a2e2d6a35baf02d826d Reviewed-on: https://code.wireshark.org/review/2594 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-12Don't check "&(device.if_info)" to see if it's null.Guy Harris1-1/+1
It would be null only with a horribly buggy C implementation. Change-Id: I880747e9993a8b087d2b177ee0bed63644ecd646 Reviewed-on: https://code.wireshark.org/review/2179 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."Guy Harris1-3/+3
This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4. A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress. Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6 Reviewed-on: https://code.wireshark.org/review/1741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Allow wtap_read() and wtap_seek_read() to return non-packet records.Guy Harris1-3/+3
This is the first step towards implementing the mechanisms requestd in bug 8590; currently, we don't return any records other than packet records from libwiretap, and just ignore non-packet records in the rest of Wireshark, but this at least gets the ball rolling. Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574 Reviewed-on: https://code.wireshark.org/review/1736 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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>
2014-02-25Wireshark: Add option to choose format type of capture fileMichal Labedzki1-2/+2
The best heuristic can fail, so add possibility to manually choose capture file format type, so not correctly recognize file format can be loaded in Wireshark. On the other side now it is possible to open capture file as file format to be dissected. Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a Reviewed-on: https://code.wireshark.org/review/16 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2013-12-03When including <epan/prefs.h> don't force inclusion of <epan/uat.h>Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53769
2013-10-23Bugfix "Restart the running live capture" when using multiple files makes a ↵Michael Mann1-0/+7
long filename. Bug 2274 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2274) Yes this solution leaks memory, but I think the handful of bytes leaked is worth fixing this nuisance. Won't backport until leak is fixed though. svn path=/trunk/; revision=52793
2013-10-11cf_start_tail() is (now) just a wrapper around cf_open(). Get rid of it and ↵Jeff Morriss1-1/+1
just call cf_open(). svn path=/trunk/; revision=52553
2013-06-27get main_window_update out of the way... pass an update_cb to the ↵Luis Ontanon1-4/+4
capture_sync stuff ... as per the XXX comment removed from tshark.c this was a mess to keep the linker happy... I couldn't! I did this without even understanding whether calling main_window_update was realy necessary in most cases. I guess nothing or more specific update cbs would be best. svn path=/trunk/; revision=50188
2013-05-22Pull the capture-session state information out of capture_opts and putGuy Harris1-80/+83
it into a separate capture_session structure. capture_opts should contain only user-specified option information (and stuff directly derived from it, such as the "capturing from a pipe" flag). svn path=/trunk/; revision=49493
2013-03-07From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :Pascal Quantin1-37/+37
Remove C++ incompatibilities from capture.c svn path=/trunk/; revision=48173
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-08-06Don't call main_window_update() from capture_input_new_packets()Gerald Combs1-0/+3
on Windows. Otherwise we end up looping forever on a NULL event in main_window_update(). svn path=/trunk/; revision=44283
2012-07-28Add handling of ringbuffer support when packets are not updatedMichael Tüxen1-3/+9
in realtime. This should fix: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7423 svn path=/trunk/; revision=44089
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-16Fix a bunch of uninitialized variables found by Coverity Scan. CIDsGerald Combs1-3/+3
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411, and 702412. svn path=/trunk/; revision=42658
2012-03-13Add an explicit capture_cb_capture_failed indication for the case whereGuy Harris1-63/+61
we weren't even able to start a capture, rather than delivering a fake "capture start" indication and relying on a later "capture file closed" indication - for a capture that was never opened in the first place - to handle GUI cleanups. Don't deliver any GUI indications in cf_close() if we didn't have a capture file open in the first place. Clear the status bar and welcome header if that indication is delivered. If we start a capture from the command line with the -k flag, don't show the captured packet information unless the capture actually starts. svn path=/trunk/; revision=41521
2012-03-11Don't close the currently loaded capture file in capture_start(), do soGuy Harris1-6/+4
in its callers; when starting a capture with "wireshark -k", there's no capture file to close, and closing it might be provoking some UI actions that cause crashes on Windows. Don't copy the list of selected interfaces to the list of capture interfaces in capture_start(), either, do that in the callers; we were already doing that in one place and, in one of the remaining cases, namely "wireshark -k", we should do so only if no capture interfaces were supplied on the command line. (I.e., the set of interfaces on which we want to capture depends on where in the UI the capture is being started.) svn path=/trunk/; revision=41491
2012-02-21From Irene Ruengeler:Michael Tüxen1-1/+1
* Add support in the GUI for pipes. * Allow the local interfaces to be rescanned via the GUI. * Allow remote interfaces to be added and deleted. The GUI can be extended to support other ways of capturing. svn path=/trunk/; revision=41105
2012-02-17Start moving files to ui/ and ui/cli/Jörg Mayer1-1/+1
svn path=/trunk/; revision=41047
2012-01-25Third try. This time pipes and stdin are supported and theMichael Tüxen1-221/+222
test scripts are passed. Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40715
2012-01-24We need a 3rd try. (After learning how to run the testuite on Windows locally).Michael Tüxen1-222/+220
svn path=/trunk/; revision=40695
2012-01-24Second try. This time pipes and stdin are supported.Michael Tüxen1-220/+222
Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40693
2012-01-16Move some headers for UI stuff, and the alert_box.c UI-specific file, toGuy Harris1-2/+4
the ui directory. (Perhaps some other files that would be used by all flavors of Wireshark, for any GUI toolkit or for someting such as ncurses, and not for any command-line tool such as TShark, should be moved there as well.) Shuffle some #includes to put the "ui/XXX.h" includes together. svn path=/trunk/; revision=40529
2011-10-20Back out infrastructure change. We missed supportingMichael Tüxen1-11/+7
stdin and pipes. svn path=/trunk/; revision=39498
2011-10-20Use a global list containing all interfaces and only changeMichael Tüxen1-7/+11
properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=39495
2011-08-05Add support for multiple interfaces to the capture options dialog.Michael Tüxen1-3/+5
Obtained from Irene Ruengeler. svn path=/trunk/; revision=38350
2011-06-27Improve the report of illegal capture filters. Also show the interface ↵Michael Tüxen1-4/+7
description. svn path=/trunk/; revision=37802
2011-06-27Get rid of old non-interface specific settings which are now interfaceMichael Tüxen1-12/+12
specifc. This finalizes the change of the infrastructure. This patch is based on work by Irene Ruengeler. svn path=/trunk/; revision=37794
2011-05-19In case we have no interface information in the array, use the global value.Michael Tüxen1-2/+7
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5935. svn path=/trunk/; revision=37307
2011-05-19When capturing from multiple interfaces, indicate this in the windowMichael Tüxen1-3/+27
title of the wireshark main window. svn path=/trunk/; revision=37289
2011-01-13Add "break;" to end of last case statement.Stephen Fisher1-0/+1
svn path=/trunk/; revision=35522
2010-11-28Clean up white space.Guy Harris1-9/+9
svn path=/trunk/; revision=35047
2010-08-24From Gregor Beck:Anders Broman1-3/+4
ERROR:capture.c:141:capture_start: assertion failed: (capture_opts->state == CAPTURE_STOPPED) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5126 svn path=/trunk/; revision=33906
2010-05-27Add cf_fake_continue_tail() which is called when real-time captureGerald Combs1-0/+1
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-26If dumpcap exits abnormally, report the error.Guy Harris1-1/+4
svn path=/trunk/; revision=32964
2010-05-17When dumpcap is run to get an interface list, interface capabilities, orGuy Harris1-1/+6
interface statistics, have its error messages come out as sync-pipe errors, have it send a sync-pipe "success" message on success, and have the callers get that message and display it. svn path=/trunk/; revision=32843
2010-04-01Keep a copy of the interface description and capture filter around so thatGerald Combs1-4/+9
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-03-04In Wireshark and TShark, run dumpcap to get interface lists and lists ofGuy Harris1-194/+1
link-layer header types for interfaces; if special privileges are necessary to open capture devices, Wireshark and TShark shouldn't have those privileges, but dumpcap should. svn path=/trunk/; revision=32104
2009-12-15Behave more gracefully if WinPcap isn't installed. Don't assert ifGerald Combs1-2/+2
we call pcap_open or pcap_open_live when WinPcap isn't loaded - just return NULL. Don't display the "NPF driver isn't running" dialog if we're capturing from stdin or a file. Fix a cut-and-paste error in capture_pcap_linktype_list. svn path=/trunk/; revision=31275
2009-12-14From Valerio Messina:Jaap Keuter1-1/+1
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-08-26(FWIW) One step towards including stdio.h & stdlib.h only when req'd.Bill Meier1-0/+1
svn path=/trunk/; revision=29568
2009-06-11(Minor) #include "alert_box.h" not req'dBill Meier1-1/+0
svn path=/trunk/; revision=28707
2009-01-04Minor rewording of a few comments; fix a few typos.Bill Meier1-17/+16
svn path=/trunk/; revision=27151
2008-08-19The packet counts and drop counts reported by libpcap are unsigned.Guy Harris1-2/+2
Clean up indentation a bit. svn path=/trunk/; revision=26037
2008-08-15Fix some incorrect code (found by valgrind).Bill Meier1-7/+5
svn path=/trunk/; revision=26032
2008-06-24Have separate callback mechanisms in file.c and capture.c; pass theGuy Harris1-11/+67
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