Commit Graph

98 Commits

Author SHA1 Message Date
tuexen 91534e24e7 Third try. This time pipes and stdin are supported and the
test scripts are passed.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40715 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-25 13:04:32 +00:00
tuexen 04136a0930 We need a 3rd try. (After learning how to run the testuite on Windows locally).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40695 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-24 17:12:56 +00:00
tuexen a928cebce6 Second try. This time pipes and stdin are supported.
Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.



git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40693 f5534014-38df-0310-8fa8-9805f1628bb7
2012-01-24 16:05:26 +00:00
gerald 54a21b335e Add 'extern "C"' wrappers and #include guards to various header files.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40321 f5534014-38df-0310-8fa8-9805f1628bb7
2011-12-29 00:08:47 +00:00
tuexen cf44654c19 Back out infrastructure change. We missed supporting
stdin and pipes.





git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39498 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-20 19:44:40 +00:00
tuexen bb1cb16df4 Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39495 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-20 18:17:54 +00:00
tuexen 9d78645e53 Get rid of old non-interface specific settings which are now interface
specifc. This finalizes the change of the infrastructure.
This patch is based on work by Irene Ruengeler.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37794 f5534014-38df-0310-8fa8-9805f1628bb7
2011-06-27 00:09:03 +00:00
etxrab b5531a6051 Doxygen fixes.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33942 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-26 20:31:09 +00:00
guy 9a1ac92738 If dumpcap exits abnormally, report the error.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32964 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-26 02:32:19 +00:00
guy cf9d5c67c1 If something is only supposed to be included if we have libpcap, don't
put #ifdef HAVE_LIBPCAP in it.

Add multiple-inclusion protection to capture_errs.h.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32803 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-14 02:47:13 +00:00
guy 58a3f1328d 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32104 f5534014-38df-0310-8fa8-9805f1628bb7
2010-03-04 01:12:04 +00:00
guy b1fab725f7 The packet counts and drop counts reported by libpcap are unsigned.
Clean up indentation a bit.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26037 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-19 05:10:16 +00:00
guy 65f8211d4f Have separate callback mechanisms in file.c and capture.c; pass the
capture callbacks the capture_options * as its second argument in all
cases.  This makes it a bit clearer what arguments callbacks take, and
means we can get rid of all global_capture_opts references in
gtk/main_statusbar.c.

Put the interface between gtk/main.c and gtk/main_statusbar.c into a
private header.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25576 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-24 08:05:45 +00:00
guy a616134cc8 Constify some arguments.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24407 f5534014-38df-0310-8fa8-9805f1628bb7
2008-02-21 12:30:26 +00:00
gerald e5997f6643 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22443 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-02 21:45:27 +00:00
gerald e6bc685f19 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22367 f5534014-38df-0310-8fa8-9805f1628bb7
2007-07-20 21:43:07 +00:00
gerald 5e9ae70b73 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22071 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11 03:58:58 +00:00
sahlberg 33270db64f name change
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21 05:12:17 +00:00
ulfl 7b15f1077d 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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17608 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-13 00:30:51 +00:00
guy fe3a732e82 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!).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17465 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-05 03:14:16 +00:00
ulfl 1fc9924a5b split capture.h into capture.h, capture_loop.h and capture_opts.h and place the parts into the corresponding files
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16664 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03 19:32:54 +00:00
ulfl 6ca6706904 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)

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16663 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03 18:15:02 +00:00
guy e7ba0884e5 Handle "-G" only in Tethereal - it doesn't work in Ethereal, and isn't
necessary there.

Add a "cmdarg_err()" routine to report command-line option errors; it
creates a console if necessary, and prints the command name and the
trailing newline.  Also add "cmdarg_err_cont()", which also creates a
console if necessary, and prints a trailing newline but no command name;
it's used to continue the message.  Use those, rather than
"g_warning()", for errors.

That means that we no longer need to pass the command name to various
command-line argument parsing routines.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16526 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-17 05:59:21 +00:00
ulfl ab467a63ad use the log features of the GLib to have verbose output of the capturing 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-26 17:50:27 +00:00
ulfl 3ba8ab8df4 add a state member to the capture_opts, and set it according to the capture engine
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14205 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-27 19:43:02 +00:00
ulfl 2c0f301cfa rename capture_clear() to capture_restart()
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-16 20:08:00 +00:00
ulfl c5d19cf8ae 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)

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14059 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-12 21:44:55 +00:00
ulfl f4a9ff05f3 Win32 only bugfix: as using TerminateProcess is the brute force way and sometimes clipped packets in the middle, now using a pipe called signal_pipe from the parent to the child for this.
On unix we're using kill() for this, which simply signals the child, but this isn't available on win32.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14040 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10 16:43:22 +00:00
ulfl f73cc9d410 various (minor) capture code cleanup
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13957 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28 18:04:09 +00:00
ulfl 2d8b793fb2 fix Solaris build (I've removed O_BINARY)
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-28 16:14:34 +00:00
ulfl c26e192062 remove capture_child flag from capture_opts as it's no longer required
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13954 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28 15:31:13 +00:00
ulfl bfa4f715fd a lot more capture engine code cleanup
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
2005-03-28 14:39:31 +00:00
jmayer 190fb3ee1c - pcap.h needs to be included before capture.h
- As capture.h is empty without libpcap defined, only include it in that
  case and don't protect the file internally against libpcap any more.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13648 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-07 10:19:33 +00:00
ulfl 7cce55aea3 Another step towards using the parent/child mode for ALL captures.
This is currently still disabled, as we cannot pass all required capture flags to the child process (lack of command line parameters).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13558 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-28 22:46:49 +00:00
ulfl 8f64a7eede some clarification of the capture child thing
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13535 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-27 17:30:33 +00:00
ulfl 68e1040a4b minor comment additions
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13533 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-27 16:54:52 +00:00
ulfl f7d612e60f CHILD_NAME is only used #ifdef HAVE_LIBPCAP
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13481 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-23 21:04:19 +00:00
ulfl c7d1ca0f26 use the applications name (currently "ethereal" or "tethereal") in capture_opts, instead of hardcoded "ethereal" for both.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13476 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-23 08:34:12 +00:00
guy cac1f678f1 Clean up indentation.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13323 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06 22:06:31 +00:00
ulfl 96fabeeccd another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts

also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. 
It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13320 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06 21:20:35 +00:00
ulfl 529050379b instead of initializing the capture_options in main.c, use the new function capture_opts_init
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13315 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06 00:13:00 +00:00
ulfl dc7cc4aba8 rename kill_capture_child to capture_kill_child to have a common prefix
split drag and drop support out of main.c into new file drag_and_drop.c, to reduce the size of main.c a bit.

Hopefully this won't break unix builds because of missing #include's, I will keep an eye on the buildbot

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13308 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05 15:35:25 +00:00
ulfl d1b6034729 updated some comments
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13301 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05 11:37:56 +00:00
ulfl 8dc7615c1e (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

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13276 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04 01:29:29 +00:00
ulfl 281710f10d move capture_file_fd field from capture_file to capture_opts type, as this is the place where it should be
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13268 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-03 22:48:20 +00:00
ulfl 86eea3ad3f move global capture_child flag into capture_options
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12855 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29 12:37:06 +00:00
ulfl 2e48f1639a 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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12853 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29 09:09:35 +00:00
ulfl 61ac2622e4 split capture_loop from capture.c, some more code cleanup
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12451 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30 17:50:51 +00:00
ulfl abfa590fe5 move quit_after_cap into capture_opts
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12449 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30 14:30:52 +00:00
guy 0f43797234 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18 00:24:25 +00:00