aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-25Third try. This time pipes and stdin are supported and thetuexen1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40715 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-24We need a 3rd try. (After learning how to run the testuite on Windows locally).tuexen1-222/+220
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40695 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-24Second try. This time pipes and stdin are supported.tuexen1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40693 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-16Move some headers for UI stuff, and the alert_box.c UI-specific file, toguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40529 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-20Back out infrastructure change. We missed supportingtuexen1-11/+7
stdin and pipes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39498 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-20Use a global list containing all interfaces and only changetuexen1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39495 f5534014-38df-0310-8fa8-9805f1628bb7
2011-08-05Add support for multiple interfaces to the capture options dialog.tuexen1-3/+5
Obtained from Irene Ruengeler. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38350 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-27Improve the report of illegal capture filters. Also show the interface ↵tuexen1-4/+7
description. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37802 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-27Get rid of old non-interface specific settings which are now interfacetuexen1-12/+12
specifc. This finalizes the change of the infrastructure. This patch is based on work by Irene Ruengeler. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37794 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-19In case we have no interface information in the array, use the global value.tuexen1-2/+7
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5935. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37307 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-19When capturing from multiple interfaces, indicate this in the windowtuexen1-3/+27
title of the wireshark main window. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37289 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-13Add "break;" to end of last case statement.sfisher1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35522 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-28Clean up white space.guy1-9/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35047 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-24From Gregor Beck:etxrab1-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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33906 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-27Add cf_fake_continue_tail() which is called when real-time capturegerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33005 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-26If dumpcap exits abnormally, report the error.guy1-1/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32964 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-17When dumpcap is run to get an interface list, interface capabilities, orguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32843 f5534014-38df-0310-8fa8-9805f1628bb7
2010-04-01Keep a copy of the interface description and capture filter around so thatgerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32357 f5534014-38df-0310-8fa8-9805f1628bb7
2010-03-04In Wireshark and TShark, run dumpcap to get interface lists and lists ofguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32104 f5534014-38df-0310-8fa8-9805f1628bb7
2009-12-15Behave more gracefully if WinPcap isn't installed. Don't assert ifgerald1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31275 f5534014-38df-0310-8fa8-9805f1628bb7
2009-12-14From Valerio Messina:jake1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31269 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-26(FWIW) One step towards including stdio.h & stdlib.h only when req'd.wmeier1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29568 f5534014-38df-0310-8fa8-9805f1628bb7
2009-06-11(Minor) #include "alert_box.h" not req'dwmeier1-1/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28707 f5534014-38df-0310-8fa8-9805f1628bb7
2009-01-04Minor rewording of a few comments; fix a few typos.wmeier1-17/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27151 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-19The packet counts and drop counts reported by libpcap are unsigned.guy1-2/+2
Clean up indentation a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26037 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-15Fix some incorrect code (found by valgrind).wmeier1-7/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26032 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-24Have separate callback mechanisms in file.c and capture.c; pass theguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25576 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-24Have capture_info_ui_create() and capture_info_open() take a pointer toguy1-1/+1
the capture_opts structure as an argument, rather than just a pointer to the interface name. Don't declare a global "capture_opts" pointer, as we don't define it any more. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25570 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-02Don't include \r in linktype on win32, it looks weird in the combo box.stig1-0/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25410 f5534014-38df-0310-8fa8-9805f1628bb7
2008-05-22Move the file utility functions from wiretap to libwsutil so thatmorriss1-2/+2
libwireshark (and the plugins using those functions) do not depend on wiretap on Windows. While doing that, rename the eth_* functions to ws_*. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25354 f5534014-38df-0310-8fa8-9805f1628bb7
2008-04-07- Remove GLIB1 codesfisher1-1/+0
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION - Remove ws_strsplit files because we no longer need to borrow GLIB2's g_strsplit code for the no longer supported GLIB1 builds git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24829 f5534014-38df-0310-8fa8-9805f1628bb7
2008-02-21Constify some arguments.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24407 f5534014-38df-0310-8fa8-9805f1628bb7
2008-02-07Removed some more "statement not reached" warnings.stig1-1/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24283 f5534014-38df-0310-8fa8-9805f1628bb7
2007-09-25as "advertised" some days ago:ulfl1-2/+0
rewrite the tshark capture code almost completely, to use dumpcap instead of it's own pcap functionality. This works on Win32 and should work on unix/linux (but I'm not sure here). Some stuff needs to be cleaned up, some more may need to be rewritten to specifically work with unix/win32. Futher work needs to be done at: 1. read filters (simply document current behaviour?) 2. event loop polling 3. privileges 4. code cleanup (e.g. in capture_loop.c) Be prepared that tshark might not work as before / expected at least in the next days! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22969 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-02Add a "-S" flag to dumpcap, which prints out interface statistics. Usegerald1-6/+133
this in the GUI rather than calling pcap_stats() directly. This gets rid of the last pcap_open_live() call in the GUI code. Update README.packaging. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22443 f5534014-38df-0310-8fa8-9805f1628bb7
2007-07-20Remove the "-I" flag from dumpcap, and add a "-M" flag used to specifygerald1-0/+57
that "-D" and "-L" should produce machine-readable output. Use this to move an indirect get_pcap_linktype() call from the GUI to dumpcap. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22367 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11Fix compilation under VS6 (hopefully without breaking compilationgerald1-25/+25
anywhere else). Instead of using getaddrinfo() and getnameinfo(), promote inet_pton.c and inet_ntop.c to the top level and use those routines instead. (It's 2007, for crying out loud. Why is this even an issue?) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22075 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11Fix segmentation fault when NULL err_msg pointer passed to ↵jake1-4/+8
capture_interface_list() and sync_list_interface_open() fails. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22073 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11One more step in privilege separation.gerald1-10/+125
Add a capture_interface_list(), which works similar to get_interface_list() except that it forks dumpcap instead of calling the pcap routines directly. Use it in the GUI. Add a "-I" flag to dumpcap, which prints out verbose interface information. Tested under Windows and Linux. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22071 f5534014-38df-0310-8fa8-9805f1628bb7
2007-05-17Minor fix: For "wireshark -Q ..." show "no packets captured" popup only when ↵wmeier1-3/+5
valid. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21810 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-28Ethereal->Wiresharketxrab1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18235 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21name changesahlberg1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-13fix bug #803: sync pipe on Win32 wasn't set to binary mode, so error message ↵ulfl1-2/+1
transport failed between Ethereal and dumpcap. I've also changed the way the secondary error message is transported from former "header message 0 secondary 0" to "header header message 0 header secondary 0" as that might be a bit more clearer, and I'll need it for further development anyway. I was using this while debugging and not recognizing the real problem - for about four hours :-(. I'll need this feature when doing the interface (and link layer type) browsing later (transferring this data from dumpcap to Ethereal) to get a full blown privilege seperation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17608 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-05Pass two strings in capture child messages, so the child can sendguy1-8/+78
primary and secondary error messages and let the parent worry about how to display them. This means dumpcap doesn't need stub routines for generating the formatting tags for the primary and secondary messages. Have a separate message for capture filter errors, so that the parent can check whether the capture filter looks like a display filter and report the appropriate message. This means that dumpcap doesn't need a stub routine for compiling display filters (a stub routine also means that Ethereal won't do the check for capture filters that look like display filters!). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17465 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-01Clean up indentation a bit.guy1-5/+8
In "capture_input_new_file()", don't call the callbacks unless we succeed in opening the new file. Have "capture_info_new_file()" return a success/failure indication. Improve the message logged when we fail to open the new file if we're only opening it for the quick packet counts. We really should put up an alert box and give up on the capture at that point. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17437 f5534014-38df-0310-8fa8-9805f1628bb7
2006-02-17add a log message, if capture start failedulfl1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17340 f5534014-38df-0310-8fa8-9805f1628bb7
2006-02-17remove dependencies to pcap.h, so getting an idea what needs to be done by ↵ulfl1-2/+0
dumpcap in addition to the things already done now various dumpcap related code cleanup: mainly #include's and capture engine related stuff git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17327 f5534014-38df-0310-8fa8-9805f1628bb7
2006-01-22show the number of packets captured, if "Update list of packets ..." isn't usedulfl1-5/+11
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17071 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-06we can even get error messages while we are capturing (e.g. when a network ↵ulfl1-3/+3
cable is unplugged) problem found by Joerg Mayer git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16704 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-06rename pcap-....c/.h files to capture-pcap-....c/.hulfl1-1/+1
this way, the capture prefix will "logically" group the files together and file browsers will also group them we may want to move the files into a subdir capture later git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16691 f5534014-38df-0310-8fa8-9805f1628bb7