Commit Graph

24 Commits

Author SHA1 Message Date
Guy Harris 3d2c418ba7 Rename an argument to avoid colliding with pipe().
svn path=/trunk/; revision=25556
2008-06-23 21:27:37 +00:00
Guy Harris b7c2ead26a Constify some arguments.
svn path=/trunk/; revision=24407
2008-02-21 12:30:26 +00:00
Guy Harris 4aac1e2c0b Pull capture_loop.c into dumpcap.c, as dumpcap is the only program that
does capturing any more.  (We will be inserting a call to give up
privileges after the pcap_open_live(), which should fix 2273; we're
currently only giving up privileges on platforms with libcap.)

svn path=/trunk/; revision=24345
2008-02-16 02:39:58 +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 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 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
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 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 fe3c3029aa Various code cleanup in the capture pipe stuff
svn path=/trunk/; revision=17714
2006-03-24 02:23:48 +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 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
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 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 d2a024af60 split capture.h into capture.h, capture_loop.h and capture_opts.h and place the parts into the corresponding files
svn path=/trunk/; revision=16664
2005-12-03 19:32:54 +00:00
Ulf Lamping be9bdd1fee (hopefully) removed various gcc warnings
svn path=/trunk/; revision=14241
2005-04-30 15:39:40 +00:00
Ulf Lamping 7e9cedfed8 capture engine:
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)

svn path=/trunk/; revision=14059
2005-04-12 21:44:55 +00:00
Ulf Lamping 61ccc8baf1 various capture code cleanup and fixes:
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)

svn path=/trunk/; revision=14053
2005-04-11 18:57:19 +00:00
Ulf Lamping 2d1981f08b various (minor) capture code cleanup
svn path=/trunk/; revision=13957
2005-03-28 18:04:09 +00:00
Ulf Lamping b6ab688e0a pass child capture filename to parent process (name currently unused) and some fork_child cleanup
svn path=/trunk/; revision=13482
2005-02-23 22:04:31 +00:00
Ulf Lamping dd71ad695f (some) redesign of capture data structures.
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c
move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it

svn path=/trunk/; revision=13276
2005-02-04 01:29:29 +00:00
Ulf Lamping 2ed93e96bd Don't use a global capture_opts in the capturing engine (this isn't a good idea). Do some more "housekeeping" in the capturing part.
Hopefully the unspecified forward declaration of capture_options_t in main.h is portable, but buildbot will tell me. This way I need the internals of that struct only at the places I really use it.

svn path=/trunk/; revision=12853
2004-12-29 09:09:35 +00:00
Ulf Lamping 3e5ac87520 code cleanup: split capture_sync from capture.c into it's own file.
That's the part used, when "Update list of packets in real time" is used while capturing.

svn path=/trunk/; revision=12445
2004-10-30 11:44:06 +00:00