aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
AgeCommit message (Collapse)AuthorFilesLines
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
2007-06-11One more step in privilege separation.Gerald Combs1-9/+245
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. svn path=/trunk/; revision=22071
2007-03-28Remove almost all of the casts I committed recently and in place ofStephen Fisher1-3/+3
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it. svn path=/trunk/; revision=21253
2007-03-23Fix about 150 warnings new to gcc 4.0 in the error on warning directories.Stephen Fisher1-3/+3
Comment out -Werror in plugins/asn1/ until warnings can be fixed. svn path=/trunk/; revision=21158
2007-03-22Add -Werror when using GCC only to the Makefile.am of the baseStephen Fisher1-1/+1
directory and most of the plugins to match the same command put in the Makefile.nmake files for Windows compliations. Fix a few warnings when compiling under gcc 3.4.4 on FreeBSD. Create new automake file variable called USING_GCC in configure.in and wiretap/configure.in to acomplish the above -Werror addition. svn path=/trunk/; revision=21127
2006-09-23use unicode-utils.h instead of strutil.hUlf Lamping1-1/+1
svn path=/trunk/; revision=19301
2006-08-02From Richard van der Hoff:Anders Broman1-4/+3
This patch fixes a couple of comments in capture_sync.c. svn path=/trunk/; revision=18826
2006-05-28Ethereal->WiresharkAnders Broman1-4/+4
svn path=/trunk/; revision=18235
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-01Handle the case where we *can't* determine the pathname in which to findGuy Harris1-2/+9
programs, by reporting it with a dialog box that at least attempts to indicate what the problem is, and by giving up early on running dumpcap. svn path=/trunk/; revision=18051
2006-04-03Clean up if CreateProcess() fails. Guy Harris1-0/+3
svn path=/trunk/; revision=17790
2006-04-03Put the low-level sync routines into a common file so they can be sharedGuy Harris1-7/+9
by dumpcap and Ethereal (so that, on UN*X, the child process can report a detailed "can't exec dumpcap" error). Rename most of the "sync_pipe_XXX_to_parent()" routines, as they're also in Tethereal, which doesn't have a sync pipe. svn path=/trunk/; revision=17789
2006-03-24disable the call to sync_pipe_errmsg_to_parent for now, if execv failed (so ↵Ulf Lamping1-2/+3
at least the *NIX versions compile again) svn path=/trunk/; revision=17719
2006-03-24Dumpcap probably has *no* windows.Guy Harris1-1/+3
svn path=/trunk/; revision=17716
2006-03-24Various code cleanup in the capture pipe stuffUlf Lamping1-223/+140
svn path=/trunk/; revision=17714
2006-03-19Fix pipe_read_bytes() to return the total number of bytes read, not justGuy Harris1-2/+2
the number of bytes read in the last read() call done. svn path=/trunk/; revision=17675
2006-03-13fix bug #803: sync pipe on Win32 wasn't set to binary mode, so error message ↵Ulf Lamping1-33/+58
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. svn path=/trunk/; revision=17608
2006-03-09debugging helper: if (for whatever reason) the message from dumpcap was ↵Ulf Lamping1-0/+5
invalid, try to print it. This was already helpful e.g. as a GLib warning was confusing the pipe handling svn path=/trunk/; revision=17559
2006-03-09Take care of one last UTF-8 <-> UTF-16 conversion (assuming there aren't anyGerald Combs1-13/+14
hiding behind casts). Fixes bug 798. Clean up whitespace. svn path=/trunk/; revision=17550
2006-03-05Pass two strings in capture child messages, so the child can sendGuy Harris1-30/+59
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!). svn path=/trunk/; revision=17465
2006-02-17fix some bugs introduced with command line encapsulationUlf Lamping1-25/+12
svn path=/trunk/; revision=17341
2006-02-17We now quote args as necessary on Windows when constructing the commandGuy Harris1-19/+5
line, so there's no need to quote them when adding the arguments. svn path=/trunk/; revision=17332
2006-02-17On Windows. quote arguments as necessary before sticking them into theGuy Harris1-3/+81
command line passed to Create_Process(). On UN*X, use "execv()", not "execvp()", as we now construct the absolute pathname of "dumpcap". svn path=/trunk/; revision=17330
2006-02-17remove dependencies to pcap.h, so getting an idea what needs to be done by ↵Ulf Lamping1-3/+8
dumpcap in addition to the things already done now various dumpcap related code cleanup: mainly #include's and capture engine related stuff svn path=/trunk/; revision=17327
2006-02-12At least on UN*X, the first argument - argv[0] - is supposed to be theGuy Harris1-4/+7
name of the program as used to run it (command name/path name). Pass that - otherwise, we pass "-i" as argv[0], and dumpcap ignores it and treats the capture device as the first argument and doesn't handle it correctly (i.e., it doesn't capture on that device). svn path=/trunk/; revision=17277
2006-02-12Distinguish between pipe_read_block() returning 0 (EOF) or a negativeGuy Harris1-2/+10
value (error reading). svn path=/trunk/; revision=17276
2006-02-12Instead of using (commented-out) g_warning() calls to log errors readingGuy Harris1-9/+26
and writing the sync pipe, using g_log() calls at the G_LOG_LEVEL_DEBUG or G_LOG_LEVEL_WARNING levels, so we can get at them if necessary. Add some messages for errors for which we had no logging. svn path=/trunk/; revision=17275
2006-02-12add a minor commentUlf Lamping1-0/+1
svn path=/trunk/; revision=17270
2006-02-12Add a routine to attempt to get the absolute pathname of the executableGuy Harris1-4/+2
file, strip off the last component to get the pathname of the directory containing the executable file, and save it for future use. On Windows, you can get that from the OS, but, on UN*X, you have to look at argv[0] and derive the absolute path from that (argv[0] is not guaranteed to be an absolute path, or even a path at all). (In addition, if you're running from the build directory, you might have to strip off a ".libs/" added to argv[0] as an artifact of the libtoolizing script.) Use that in the About dialog, and use it to construct the path of dumpcap. Don't put quotes into the path of dumpcap; you don't have to quote strings with spaces in them when handing them to execvp and, in fact, you *mustn't* quote them, as the quotes will be treated as part of the pathname. svn path=/trunk/; revision=17267
2006-02-12Fix up indentation.Guy Harris1-6/+2
svn path=/trunk/; revision=17262
2006-02-12we still need sync_pipe_errmsg_to_parent() for the *NIX buildUlf Lamping1-0/+12
svn path=/trunk/; revision=17260
2006-02-11the point of no return ...Ulf Lamping1-164/+117
using dumpcap as the capture child for Ethereal. dumpcap is a plain console application now, even for Win32 (so no WinMain, create_console and special piping stuff reguired). The undocumented command line option -Z will switch dumpcap into "child mode", using binary instead of plain text output messages to communicate with a parent Ethereal. Ethereal's main.c no longer needs to distinguish between child mode or not, so some simplifying here. capture_sync.c has to call dumpcap in a "hidden window" mode using CreateProcess instead of spawnvp, otherwise an uggly console window would appear. The handles created by _pipe doesn't seem to be inheritable for this function, using CreatePipe instead. The file capture_loop.c is only needed by dumpcap, removed from Ethereal link objects. Some debugging aid added and other minor cleanup done. svn path=/trunk/; revision=17256