aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
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
2005-12-04move the complete functionality of the capture info dialog from ↵ulfl1-1/+15
capture_loop.c to capture_info.c and call it from capture.c (instead of capture_loop.c). This way, the capture child don't need to now any of the packet_counter things (no epan/packet.h and all alike). Currently the capture_info code will always open another wiretap file instance to build it's own counter values. This isn't optimized for now (next step: use data from cf_continue_tail() somehow). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16669 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03clarify a commentulfl1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16667 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03add missing functions (to complete/cleanup of interface):ulfl1-3/+30
capture_input_drops capture_input_error_message and move the functionality from capture_sync.c to capture.c (just where it belongs) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16663 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-25add some more help text to the "no packets captured" error dialog:ulfl1-5/+29
link to CaptureSetup wiki page Win32 only: wireless: "try switch off promicuous mode" This way we might get less user questions on the users-mailing list ... Especially the second one hopefully could save us from a lot of support mails :-) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16591 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵ulfl1-5/+2
necessary for the switch to GTK 2.6 (at least on WIN32). to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place. deleted related things from config.h.win32 As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16403 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-07minor fix: fix the sequence while finishing a live capture, so the statusbar ↵ulfl1-4/+10
information about the file size is correct git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16148 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-20add two new callbacks:ulfl1-0/+3
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ... If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here. cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15891 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-26changed the loglevel of "capture kill" from message to info (it's no action ↵ulfl1-1/+1
that the user directly triggered) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14446 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-26use the log features of the GLib to have verbose output of the capturing ↵ulfl1-1/+15
engine, e.g. GLib provides different domains for different submodules. Output more verbose than warning level will be disabled by default (just like before). use the console_log_handler in main.c for win32 AND unix now Currently use the log for the capturing engine (only), as I desperately needed a log output for debugging. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14438 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-25the capture child might not respond shortly after bringing it up (especially ↵ulfl1-0/+7
it will block, if no input coming from an input capture pipe (e.g. mkfifo) is coming in) to prevent problems, bring the main GUI into "capture mode" right after successfully spawn/exec the capture child, without waiting for any response from it git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14436 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-30removed various gcc warningsulfl1-0/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14246 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-30(hopefully) removed various gcc warningsulfl1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14241 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-27add a state member to the capture_opts, and set it according to the capture ↵ulfl1-2/+13
engine git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14205 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-18statusbar changes:ulfl1-4/+2
-show the current capture file size, if capturing in real time mode. -move the packet "Drops" count (if available) from file to packets statusbar part git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14130 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-17bugfix: show the right filesize after a live capture finishedulfl1-1/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14118 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-16rename capture_clear() to capture_restart()ulfl1-1/+13
statusbar update should work now even in capture error case git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14105 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-16bugfix: don't crash on error in normal mode captureulfl1-3/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14104 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-12don't display "No packets captured" dialog, when using the new clear featureulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14060 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-12capture engine: ulfl1-2/+26
add a new feature to clear the currently captured packets and restart the capture with the previous parameters various code cleanup and minor bugfixes Win32: use millisecond resolution in capture_loop, to smooth screen update a bit (500ms instead of 1000ms) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14059 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-12it should now be possible to use "Update packets in real time" even if used ↵ulfl1-3/+4
with one of the "Multiple files" option. If this is used together with an option where input files changes too fast (e.g. new file every second), capturing will be (hopefully) stopped. I've replaced the former capture pipe message format into a somewhat more general format to remove a lot of confusion. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14054 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-11various capture code cleanup and fixes: ulfl1-25/+25
display filename in statusbar while capturing print_usage banner fixed cf_cb_live_capture_prepare no longer needed rename sync_pipe_do_capture -> sync_pipe_start bugfix: sync_pipe_input_wait_for_start replaced by former implementation fix cleanup of old file in capture_input_new_file fix a tempfile detection bug (named file showed up as tempfile after capture) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14053 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10bugfix: call to cf_cb_live_capture_..._started with correct parameterulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14045 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10fix statusbar messages by splitting into update and fixed messages between ↵ulfl1-7/+10
capture and main git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14044 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10bugfix: hide panes if a non "Update" capture had no packets captured ↵ulfl1-5/+5
(hopefully it's working correct now...) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14043 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10bugfix: call cf_cb_live_capture_finished *if* some packets were capturedulfl1-0/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14042 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10bugfix: when no packets were captured, don't call ↵ulfl1-2/+4
cf_cb_live_capture_finished after closing the capture file git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14039 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10Clean up indentation.guy1-119/+119
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14036 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28some minor changesulfl1-5/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13962 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28bugfixes: bring non real-time captures back to former behaviour, other minor ↵ulfl1-0/+6
fixes git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13961 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28various (minor) capture code cleanupulfl1-48/+21
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13957 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28fix Solaris build (I've removed O_BINARY)ulfl1-4/+4
rename sync_mode to real_time_mode, as we using sync_mode all the time now, so the name is misleading git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13956 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28remove capture_child flag from capture_opts as it's no longer requiredulfl1-8/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13954 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28a lot more capture engine code cleanupulfl1-153/+133
most notably: - moved opening of safe_file to the capture child (capture_loop.c) - removed save_file_fd from capture_opts (no longer need to have it global) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13953 f5534014-38df-0310-8fa8-9805f1628bb7