Commit Graph

188 Commits

Author SHA1 Message Date
Michael Tüxen 3a2a342fc4 Move the debug output for the generated command line arguments to the correct place.
svn path=/trunk/; revision=37276
2011-05-19 04:30:05 +00:00
Martin Mathieson 2baa82a136 Only declare a variable if its going to be used.
svn path=/trunk/; revision=37273
2011-05-19 01:09:05 +00:00
Guy Harris d391f403da We don't have the ability to set the capture buffer size on all platforms.
svn path=/trunk/; revision=37255
2011-05-18 19:29:47 +00:00
Michael Tüxen b031b9643a Use the interface specific parameter array.
This enables the capturing from mulitple interfaces using 
tshark and wireshark (at the command line).
(tshark -i lo0 -i en0) or (wireshark -k -i lo0 -i en0)
works. You can capture from multiple remote and local
interfaces.

Based on work from Irene Ruengeler.

svn path=/trunk/; revision=37248
2011-05-18 18:02:30 +00:00
Guy Harris fb3f152076 Back out Jeff Morris's change to make the autostop file size 64-bit - it
didn't change the GUI code for setting the autostop file size, and that
broke the build.

svn path=/trunk/; revision=36552
2011-04-11 01:30:36 +00:00
Guy Harris 4ad4d3e678 Jeff Morris's change to make the autostop file size 64-bit. Fixes bug
5691.

svn path=/trunk/; revision=36551
2011-04-11 00:01:08 +00:00
Guy Harris 1b9e4d5c00 STATUS_UNWIND_CONSOLIDATE "should not happen", so don't include it -
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-02 08:52:35 +00:00
Guy Harris 949b2a2dc8 Include <Winbase.h> to get error statuses.
svn path=/trunk/; revision=33412
2010-07-02 08:41:19 +00:00
Guy Harris 01b72bb5d1 Attempt to detect when dumpcap dies due to an exception and report that
appropriately.

svn path=/trunk/; revision=33411
2010-07-02 08:39:08 +00:00
Guy Harris f2e12f5fb3 Have sync_pipe_wait_for_child() return the child's exit status on
Windows, just as we do on UN*X.

svn path=/trunk/; revision=33410
2010-07-02 04:11:04 +00:00
Guy Harris b0b7697dea From Petr Lautrbach: when capturing, return the exit status of dumpcap,
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-07-01 00:12:16 +00:00
Guy Harris 391b5127d6 Clean up the error reporting. An EOF from the sync pipe when capturing
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-27 00:48:08 +00:00
Stig Bjørlykke b9bf692c3e Untabify.
svn path=/trunk/; revision=32970
2010-05-26 07:19:42 +00:00
Guy Harris 5c27494bd6 Don't report EINTR - it might be from a ^C.
Do report the error string for other read errors, though.

svn path=/trunk/; revision=32969
2010-05-26 05:33:57 +00:00
Guy Harris 26bf53f0b1 Use the right system call name.
svn path=/trunk/; revision=32965
2010-05-26 02:34:12 +00:00
Guy Harris d0ac88186d If dumpcap exits abnormally, report the error.
svn path=/trunk/; revision=32964
2010-05-26 02:32:19 +00:00
Guy Harris bcba2a44e3 Fix comments.
svn path=/trunk/; revision=32885
2010-05-19 03:49:52 +00:00
Guy Harris 414399b572 Fix some errors. Use FormatMessageA(), as we need the string in ASCII.
svn path=/trunk/; revision=32857
2010-05-18 05:32:29 +00:00
Guy Harris 964383bf1c Add a routine to convert Win32 error statuses into strings, and use it
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-18 03:29:45 +00:00
Guy Harris 14c40a21aa Make -Z always generate machine-readable output, and don't bother
supplying -M along with -Z.  (We keep -M around for debugging use; it's
documented, unlike -Z.)

svn path=/trunk/; revision=32850
2010-05-17 23:56:00 +00:00
Guy Harris 03d408abcb Update a comment.
svn path=/trunk/; revision=32844
2010-05-17 18:41:48 +00:00
Guy Harris 991c5e9898 When dumpcap is run to get an interface list, interface capabilities, or
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-17 18:40:23 +00:00
Guy Harris 1c18115bd3 Fetch an indication of whether the interface supports capturing in
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-13 17:37:39 +00:00
Guy Harris 6ace737ae4 Add monitor mode support to TShark.
svn path=/trunk/; revision=32704
2010-05-07 01:46:38 +00:00
Guy Harris 7dbbb8c572 Just check for pcap_create(); it first appeared in libpcap 1.0.0, and
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-06 23:33:41 +00:00
Anders Broman f9981411f1 Checking in Stigs changes from
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-05-06 18:34:30 +00:00
Guy Harris 167ab3a98c In Wireshark and TShark, run dumpcap to get interface lists and lists of
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-04 01:12:04 +00:00
Guy Harris 0bd0d5939a Fix a typo.
svn path=/trunk/; revision=32080
2010-03-02 00:39:41 +00:00
Bill Meier e4d6610bd5 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31729
2010-01-29 16:09:25 +00:00
Jeff Morriss af6fca176d Don't use SIGUSR1 to tell dumpcap to exit, use SIGINT: SIGINT is traditionally
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-09-13 17:46:10 +00:00
Stig Bjørlykke a61e285004 Added a preference to capture in Pcap-NG from GUI.
svn path=/trunk/; revision=28740
2009-06-15 16:36:02 +00:00
Guy Harris 44f8cae6ab If we don't have any of the pcap_datalink_XXX_to_YYY routines,
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-12-21 23:22:12 +00:00
Stig Bjørlykke 32d411be1d Do not set buffer size for remote interfaces or when using default value.
Do not get link-layer for remote interfaces.

svn path=/trunk/; revision=26683
2008-11-03 21:38:53 +00:00
Guy Harris e8ba2515de The packet counts and drop counts reported by libpcap are unsigned.
Clean up indentation a bit.

svn path=/trunk/; revision=26037
2008-08-19 05:10:16 +00:00
Jeff Morriss 83f9ecf96f Move privileges.c and unicode-utils.c from epan to wsutil (so things like
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-30 17:16:29 +00:00
Guy Harris 3d2c418ba7 Rename an argument to avoid colliding with pipe().
svn path=/trunk/; revision=25556
2008-06-23 21:27:37 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
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-05-22 15:46:27 +00:00
Guy Harris a12bdc612a Use report_failure() to report failures in capture_sync.c; that will do
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-04-30 07:58:57 +00:00
Bill Meier e4f89044bd Emit warning message to log if attempt to send signal to child process fails...
svn path=/trunk/; revision=24707
2008-03-21 02:27:58 +00:00
Bill Meier 2c07da3195 Fix for handling dumpcap errmsgs when wireshark does 'dumpcap -D -M', etc
svn path=/trunk/; revision=24507
2008-02-29 18:48:29 +00:00
Bill Meier 8d4f01eea7 Ensure tshark/wireshark always get good err msgs from dumpcap:
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-23 19:59:38 +00:00
Guy Harris b7c2ead26a Constify some arguments.
svn path=/trunk/; revision=24407
2008-02-21 12:30:26 +00:00
Guy Harris 0146bbda09 Exit with 1, not 2, if exec fails, so we don't report an additional
error for the exit status, over and above the one for the exec failure.

svn path=/trunk/; revision=24041
2008-01-09 11:50:22 +00:00
Guy Harris 0a6424f732 Use dup2() rather than eth_close() followed by dup() to ensure that a
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
2008-01-09 11:40:38 +00:00
Tomas Kukosa 08bbd29c71 Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)
- 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-12-04 11:19:29 +00:00
Gerald Combs e8fd375630 Fixes from Sam Leffler:
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-27 19:57:35 +00:00
Gerald Combs 060834df82 If a child doesn't quit 500ms after sending a QUIT signal, force it to exit.
svn path=/trunk/; revision=23591
2007-11-25 21:33:34 +00:00
Gerald Combs 1b76321135 Fix a log message.
svn path=/trunk/; revision=23518
2007-11-20 20:25:07 +00:00
Gerald Combs 8f05294027 For the Wireshark/TShark -> dumpcap signal pipe on Windows, use a named
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-26 16:32:28 +00:00
Gerald Combs 300503cdcb Fix a typo.
svn path=/trunk/; revision=23272
2007-10-25 20:37:12 +00:00
Guy Harris e8ea45d6ed Make the sync pipe the standard error, not the standard output, of
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-10-10 01:31:36 +00:00
Guy Harris 322d44d416 Make the "-Z" argument to dumpcap take an argument that's the file
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-29 01:36:03 +00:00
Guy Harris 343fa12c82 The fork_child argument to sync_interface_stats_close is unused on UN*X.
svn path=/trunk/; revision=23023
2007-09-29 01:14:16 +00:00
Gerald Combs 89a2966ced Add a "-S" flag to dumpcap, which prints out interface statistics. Use
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-08-02 21:45:27 +00:00
Gerald Combs fa67b9959c Fix Windows Buildbot breakage. Remove an unneeded function and fix a
couple of memory leaks.

svn path=/trunk/; revision=22368
2007-07-21 00:31:55 +00:00
Gerald Combs c02e0c7b4a Remove the "-I" flag from dumpcap, and add a "-M" flag used to specify
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-07-20 21:43:07 +00:00
Gerald Combs e9f1a0b692 One more step in privilege separation.
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-06-11 03:58:58 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 2896811274 Fix about 150 warnings new to gcc 4.0 in the error on warning directories.
Comment out -Werror in plugins/asn1/ until warnings can be fixed.


svn path=/trunk/; revision=21158
2007-03-23 22:49:23 +00:00
Stephen Fisher cdf47e536b Add -Werror when using GCC only to the Makefile.am of the base
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
2007-03-22 23:03:39 +00:00
Ulf Lamping a04b0fa6d9 use unicode-utils.h instead of strutil.h
svn path=/trunk/; revision=19301
2006-09-23 00:38:56 +00:00
Anders Broman 65eea307fa From Richard van der Hoff:
This patch fixes a couple of comments in capture_sync.c.

svn path=/trunk/; revision=18826
2006-08-02 19:58:36 +00:00
Anders Broman f68d6e4c8c Ethereal->Wireshark
svn path=/trunk/; revision=18235
2006-05-28 20:28:20 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 0dfbc73cbe Handle the case where we *can't* determine the pathname in which to find
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-05-01 06:51:14 +00:00
Guy Harris 813af87c83 Clean up if CreateProcess() fails.
svn path=/trunk/; revision=17790
2006-04-03 01:58:43 +00:00
Guy Harris d260003026 Put the low-level sync routines into a common file so they can be shared
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-04-03 01:56:53 +00:00
Ulf Lamping de0981f611 disable the call to sync_pipe_errmsg_to_parent for now, if execv failed (so at least the *NIX versions compile again)
svn path=/trunk/; revision=17719
2006-03-24 11:05:46 +00:00
Guy Harris ad7ed41f04 Dumpcap probably has *no* windows.
svn path=/trunk/; revision=17716
2006-03-24 05:05:14 +00:00
Ulf Lamping fe3c3029aa Various code cleanup in the capture pipe stuff
svn path=/trunk/; revision=17714
2006-03-24 02:23:48 +00:00
Guy Harris 624db0dc41 Fix pipe_read_bytes() to return the total number of bytes read, not just
the number of bytes read in the last read() call done.

svn path=/trunk/; revision=17675
2006-03-19 20:39:49 +00:00
Ulf Lamping 069b26b2d9 fix bug #803: sync pipe on Win32 wasn't set to binary mode, so error message 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-13 00:30:51 +00:00
Ulf Lamping 209af8f5f0 debugging helper: if (for whatever reason) the message from dumpcap was 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-09 22:13:51 +00:00
Gerald Combs 742493acd5 Take care of one last UTF-8 <-> UTF-16 conversion (assuming there aren't any
hiding behind casts).  Fixes bug 798.

Clean up whitespace.

svn path=/trunk/; revision=17550
2006-03-09 14:39:44 +00:00
Guy Harris cbe69401cc Pass two strings in capture child messages, so the child can send
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-03-05 03:14:16 +00:00
Ulf Lamping 86cf71c5a0 fix some bugs introduced with command line encapsulation
svn path=/trunk/; revision=17341
2006-02-17 22:39:32 +00:00
Guy Harris 9124329ee2 We now quote args as necessary on Windows when constructing the command
line, so there's no need to quote them when adding the arguments.

svn path=/trunk/; revision=17332
2006-02-17 11:53:11 +00:00
Guy Harris bb3d513158 On Windows. quote arguments as necessary before sticking them into the
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-17 09:45:52 +00:00
Ulf Lamping 79053183c5 remove dependencies to pcap.h, so getting an idea what needs to be done by 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-17 02:18:48 +00:00
Guy Harris 4d94f994b5 At least on UN*X, the first argument - argv[0] - is supposed to be the
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-12 20:55:11 +00:00
Guy Harris 3607862994 Distinguish between pipe_read_block() returning 0 (EOF) or a negative
value (error reading).

svn path=/trunk/; revision=17276
2006-02-12 20:41:28 +00:00
Guy Harris 6009f7c549 Instead of using (commented-out) g_warning() calls to log errors reading
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-12 20:35:15 +00:00
Ulf Lamping d595d6a8da add a minor comment
svn path=/trunk/; revision=17270
2006-02-12 12:04:17 +00:00
Guy Harris b8136fbfa9 Add a routine to attempt to get the absolute pathname of the executable
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-12 03:15:29 +00:00
Guy Harris 9077412e85 Fix up indentation.
svn path=/trunk/; revision=17262
2006-02-12 00:59:34 +00:00
Ulf Lamping 2af7f6b948 we still need sync_pipe_errmsg_to_parent() for the *NIX build
svn path=/trunk/; revision=17260
2006-02-12 00:03:10 +00:00
Ulf Lamping cf94760fa4 the point of no return ...
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
2006-02-11 23:25:11 +00:00
Ulf Lamping 0d9c276e90 only a backup, nothing changed for now.
second try to bring dumpcap to life. Currently it's working, but the child (dumpcap) will show an annoying Win32 console window while running. 

svn path=/trunk/; revision=17239
2006-02-10 01:27:23 +00:00
Ulf Lamping 3b36e59113 remove the setting of no longer required command line options:
-H (Hide capture info dialog)
-m (font to use)

svn path=/trunk/; revision=16807
2005-12-15 00:48:59 +00:00
Ulf Lamping 459c0b07b2 we don't use the command line option -W any longer, remove it from a comment
svn path=/trunk/; revision=16786
2005-12-13 22:35:28 +00:00
Ulf Lamping e829856c0c move the complete functionality of the capture info dialog from 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).

svn path=/trunk/; revision=16669
2005-12-04 02:04:18 +00:00
Ulf Lamping 0a2188eed6 add missing functions (to complete/cleanup of interface):
capture_input_drops
capture_input_error_message

and move the functionality from capture_sync.c to capture.c (just where it belongs)

svn path=/trunk/; revision=16663
2005-12-03 18:15:02 +00:00
Ulf Lamping 97d5241c60 precise some pipe message comments
svn path=/trunk/; revision=16660
2005-12-03 12:32:41 +00:00
Guy Harris 6753da5403 Make the message length in the sync pipe message header 3 bytes of
binary data, so the maximum message length can be up to 2^24-1.

Add a #define for that message size, and have it be 4096, for now, as
that was the size of the buffer used to read sync pipe messages.

Clean up white space.

When displaying an error message from the capture child, don't use it as
a format string - it could conceivably contain "%"s.  Instead, format it
with "%s".

svn path=/trunk/; revision=16541
2005-11-18 00:34:11 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is 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.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Ulf Lamping 4443681a9e fix Ethereal so command line capture parameter will work with kilobytes (again)
remove Byte(s) from the dropdown list of filesizes, this doesn't make sense
replace 1000 with 1024, as all (modern?) file managers are based on 1024 bytes for a kilobyte (the old KB vs. KiB controversy)

svn path=/trunk/; revision=16149
2005-10-07 03:34:27 +00:00
Ulf Lamping cf3b9f23e5 capture_sync.c(290) : warning C4090: 'function' : different 'const' qualifiers
capture_sync.c(290) : warning C4022: 'g_realloc' : pointer mismatch for actual parameter 1
capture_sync.c(431) : warning C4090: 'function' : different 'const' qualifiers
capture_sync.c(431) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1
capture_sync.c(442) : warning C4090: 'function' : different 'const' qualifiers
capture_sync.c(442) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1
capture_sync.c(549) : warning C4090: 'function' : different 'const' qualifiers
capture_sync.c(549) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1

svn path=/trunk/; revision=15487
2005-08-20 22:16:12 +00:00
Jörg Mayer 956eee946f Some 'no previous declararion' warning fixes
svn path=/trunk/; revision=15355
2005-08-14 23:25:20 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Jörg Mayer 62b7cc3043 Last set of char -> const char trivial warning fixes.
svn path=/trunk/; revision=15244
2005-08-06 14:03:14 +00:00