aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
AgeCommit message (Collapse)AuthorFilesLines
2010-07-02STATUS_UNWIND_CONSOLIDATE "should not happen", so don't include it -Guy Harris1-2/+0
we'd have to include some other headers to get it defined. Get rid of the include of Winbase.h - it doesn't define STATUS_UNWIND_CONSOLIDATE, and it's not necessary. svn path=/trunk/; revision=33413
2010-07-02Include <Winbase.h> to get error statuses.Guy Harris1-0/+1
svn path=/trunk/; revision=33412
2010-07-02Attempt to detect when dumpcap dies due to an exception and report thatGuy Harris1-4/+54
appropriately. svn path=/trunk/; revision=33411
2010-07-02Have sync_pipe_wait_for_child() return the child's exit status onGuy Harris1-0/+9
Windows, just as we do on UN*X. svn path=/trunk/; revision=33410
2010-07-01From Petr Lautrbach: when capturing, return the exit status of dumpcap,Guy Harris1-0/+3
so we give a non-zero exit status for invalid interfaces or capture filters. From me: don't exit immediately if dumpcap failed, print out information from taps and the like. svn path=/trunk/; revision=33393
2010-05-27Clean up the error reporting. An EOF from the sync pipe when capturingGuy Harris1-73/+116
is just an indication that the capture child exited; don't treat it as an error, unless the child process exits with an abnormal status. As tshark sends a "stop capture" indication to the child when it's ^C'ed, the child will exit and we'll get an EOF from the capture pipe; don't make SIGINT etc. interrupt system calls, so they don't cause reads from the capture pipe to get EINTR errors. svn path=/trunk/; revision=32986
2010-05-26Untabify.Stig Bjørlykke1-35/+35
svn path=/trunk/; revision=32970
2010-05-26Don't report EINTR - it might be from a ^C.Guy Harris1-6/+24
Do report the error string for other read errors, though. svn path=/trunk/; revision=32969
2010-05-26Use the right system call name.Guy Harris1-2/+2
svn path=/trunk/; revision=32965
2010-05-26If dumpcap exits abnormally, report the error.Guy Harris1-2/+2
svn path=/trunk/; revision=32964
2010-05-19Fix comments.Guy Harris1-2/+2
svn path=/trunk/; revision=32885
2010-05-18Fix some errors. Use FormatMessageA(), as we need the string in ASCII.Guy Harris1-5/+4
svn path=/trunk/; revision=32857
2010-05-18Add a routine to convert Win32 error statuses into strings, and use itGuy Harris1-27/+60
when generating error messages. The error code from CreatePipe() is gotten by calling GetLastError(); it's not in errno. Clean up indentation a bit. svn path=/trunk/; revision=32855
2010-05-17Make -Z always generate machine-readable output, and don't botherGuy Harris1-3/+0
supplying -M along with -Z. (We keep -M around for debugging use; it's documented, unlike -Z.) svn path=/trunk/; revision=32850
2010-05-17Update a comment.Guy Harris1-3/+0
svn path=/trunk/; revision=32844
2010-05-17When dumpcap is run to get an interface list, interface capabilities, orGuy Harris1-249/+477
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-05-13Fetch an indication of whether the interface supports capturing inGuy Harris1-3/+7
monitor mode at the same time that we fetch its list of link-layer types. Support fetching that list in monitor mode, as the list may be different in regular and monitor mode. If the interface supports monitor mode, when printing the list of link-layer types, indicate whether they're fetched in monitor mode or not, as tcpdump 4.1.x does. svn path=/trunk/; revision=32789
2010-05-07Add monitor mode support to TShark.Guy Harris1-0/+4
svn path=/trunk/; revision=32704
2010-05-06Just check for pcap_create(); it first appeared in libpcap 1.0.0, andGuy Harris1-2/+2
pcap_set_buffer_size() did as well, so there aren't any libpcap releases with pcap_create() but not pcap_set_buffer_size(). Only do one check for pcap_create. svn path=/trunk/; revision=32695
2010-05-06Checking in Stigs changes fromAnders Broman1-2/+4
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=475 BUT not activating the check for pcap_create() pcap_set_buffer_size() This should make it possible to build with support for setting the buffersize if not capturing 802.11 traffic. The code for handling the 'B' option should be OK in any case. svn path=/trunk/; revision=32688
2010-03-04In Wireshark and TShark, run dumpcap to get interface lists and lists ofGuy Harris1-33/+40
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
2010-03-02Fix a typo.Guy Harris1-1/+1
svn path=/trunk/; revision=32080
2010-01-29Fix various gcc -Wshadow warnings.Bill Meier1-16/+16
svn path=/trunk/; revision=31729
2009-09-13Don't use SIGUSR1 to tell dumpcap to exit, use SIGINT: SIGINT is traditionallyJeff Morriss1-3/+3
used for this purpose and using it also prevents the 2 signals the child gets: - the user's Ctrl-C (which is sent as a SIGINT to both *shark and its child dumpcap) - the signal *shark generates to shut down the child from colliding (and running 2 signal handlers in the child). It might be possible for tshark to not send the signal at all when it gets SIGINT, but it doesn't do any harm now. Also, do not call g_log() within the signal handler: doing so can cause aborts (if g_log is being called by the process when the signal comes, the 2nd entrance into g_log is detected as a recursion). This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2767 svn path=/trunk/; revision=29881
2009-06-15Added a preference to capture in Pcap-NG from GUI.Stig Bjørlykke1-0/+2
svn path=/trunk/; revision=28740
2008-12-21If we don't have any of the pcap_datalink_XXX_to_YYY routines,Guy Harris1-5/+0
substitute our own (I wrote them all, so I can steal them from the BSD-licensed libpcap if I want :-)). This means that linktype_name_to_val() and linktype_val_to_name() are always available, and we don't need to #ifdef use of them. Use pcap_datalink_val_to_description() to get the description for a particular DLT_ value, rather than mapping the DLT_ value to a WTAP_ENCAP_ value and getting the description for the latter. svn path=/trunk/; revision=27074
2008-11-03Do not set buffer size for remote interfaces or when using default value.Stig Bjørlykke1-0/+6
Do not get link-layer for remote interfaces. svn path=/trunk/; revision=26683
2008-08-19The packet counts and drop counts reported by libpcap are unsigned.Guy Harris1-1/+1
Clean up indentation a bit. svn path=/trunk/; revision=26037
2008-06-30Move privileges.c and unicode-utils.c from epan to wsutil (so things likeJeff Morriss1-1/+1
capinfos and dumpcap don't need to depend on libwireshark nor directly pull in those modules). Because capinfos and editcap were only being linked with privileges.c if we had plugins, this allows those programs to be linked when someone is compiling --without-plugins. svn path=/trunk/; revision=25640
2008-06-23Rename an argument to avoid colliding with pipe().Guy Harris1-4/+4
svn path=/trunk/; revision=25556
2008-05-22Move the file utility functions from wiretap to libwsutil so thatJeff Morriss1-16/+16
libwireshark (and the plugins using those functions) do not depend on wiretap on Windows. While doing that, rename the eth_* functions to ws_*. svn path=/trunk/; revision=25354
2008-04-30Use report_failure() to report failures in capture_sync.c; that will doGuy Harris1-27/+18
the right thing in Wireshark and TShark, as both of them call epan_init() to set the appropriate "report an error" function. That obviates the need to have TShark have its own private version of simple_dialog(). Have cmdarg_err() just call failure_message() instead of duplicating the code in failure_message(). svn path=/trunk/; revision=25201
2008-03-21Emit warning message to log if attempt to send signal to child process fails...Bill Meier1-5/+13
svn path=/trunk/; revision=24707
2008-02-29Fix for handling dumpcap errmsgs when wireshark does 'dumpcap -D -M', etc Bill Meier1-7/+41
svn path=/trunk/; revision=24507
2008-02-23Ensure tshark/wireshark always get good err msgs from dumpcap:Bill Meier1-0/+3
1. Clean up dumpcap 'as a child' err msg handling so that: - all err msgs are properly formatted when being sent back to the parent. - any log Critical, Warning, etc messages are sent back to parent and are properly formatted. 2. Change handling of -w <...> slightly in capture_opts.c so that wireshark provides a good error message if there is a 'write permissions' issue on the file. (Previously the error popup said only "Child exited with status 2"). This fixes bug #2288. Add some conditionalized DEBUG_CHILD_DUMPCAP code for dumpcap debug logging to a file. svn path=/trunk/; revision=24446
2008-02-21Constify some arguments.Guy Harris1-1/+1
svn path=/trunk/; revision=24407
2008-01-09Exit with 1, not 2, if exec fails, so we don't report an additionalGuy Harris1-4/+10
error for the exit status, over and above the one for the exec failure. svn path=/trunk/; revision=24041
2008-01-09Use dup2() rather than eth_close() followed by dup() to ensure that aGuy Harris1-8/+13
given file descriptor get duped to another descriptor. Handle exec errors in sync_pipe_open_command() the same way they're handled in sync_pipe_start(); that fixes bug 2177. svn path=/trunk/; revision=24040
2007-12-04Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)Tomas Kukosa1-0/+33
- retrieving the list of remote PCAP interfaces - password authentication support - UDP data fransfer - packet sampling (available in WinPcap 4.x) etc. fix problem if non-default rpcap port is used svn path=/trunk/; revision=23750
2007-11-27Fixes from Sam Leffler:Gerald Combs1-3/+4
In capture_sync.c: Don't clobber the DLT value. In packet-cops.c (modified by me): Instead of adding an item as a static, mis-cast FT_UINT16 to the tree, add it as an FT_NONE. In packet-802.11.c: Add the right address to the tree. svn path=/trunk/; revision=23624
2007-11-25If a child doesn't quit 500ms after sending a QUIT signal, force it to exit.Gerald Combs1-2/+28
svn path=/trunk/; revision=23591
2007-11-20Fix a log message.Gerald Combs1-1/+1
svn path=/trunk/; revision=23518
2007-10-26For the Wireshark/TShark -> dumpcap signal pipe on Windows, use a namedGerald Combs1-10/+21
pipe instead of stdin. Add an argument (currently the parent PID) back to the "-Z" flag and use it to construct the pipe name. This lets us pass the parent's stdin handle to dumpcap, which lets us capture from stdin on Windows. Add a comment about checking for the parent process. In capture_loop.c, remove the wait_forever argument from cap_pipe_select() since it was always FALSE. Set the timeout under Windows to 250 ms instead of 250000 ms. svn path=/trunk/; revision=23279
2007-10-25Fix a typo.Gerald Combs1-1/+1
svn path=/trunk/; revision=23272
2007-10-10Make the sync pipe the standard error, not the standard output, ofGuy Harris1-6/+2
dumpcap, when using it as a capture child; leave the standard output alone, in case tshark was told to write the capture to the standard error. Get rid of the argument to the "-Z" option to dumpcap; it might not work on Windows. svn path=/trunk/; revision=23124
2007-09-29Make the "-Z" argument to dumpcap take an argument that's the fileGuy Harris1-0/+4
descriptor to use as the sync pipe. For now, always pass 1, so the sync pipe is the standard output of dumpcap. svn path=/trunk/; revision=23025
2007-09-29The fork_child argument to sync_interface_stats_close is unused on UN*X.Guy Harris1-2/+6
svn path=/trunk/; revision=23023
2007-08-02Add a "-S" flag to dumpcap, which prints out interface statistics. UseGerald Combs1-31/+181
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. svn path=/trunk/; revision=22443
2007-07-21Fix Windows Buildbot breakage. Remove an unneeded function and fix aGerald Combs1-50/+9
couple of memory leaks. svn path=/trunk/; revision=22368
2007-07-20Remove the "-I" flag from dumpcap, and add a "-M" flag used to specifyGerald Combs1-65/+165
that "-D" and "-L" should produce machine-readable output. Use this to move an indirect get_pcap_linktype() call from the GUI to dumpcap. svn path=/trunk/; revision=22367