Commit Graph

94 Commits

Author SHA1 Message Date
Michael Tüxen c219f2eea5 Back out infrastructure change. We missed supporting
stdin and pipes.




svn path=/trunk/; revision=39498
2011-10-20 19:44:40 +00:00
Michael Tüxen 95ae2fe13a 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.

svn path=/trunk/; revision=39495
2011-10-20 18:17:54 +00:00
Michael Tüxen 421dafd2de 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.

svn path=/trunk/; revision=37794
2011-06-27 00:09:03 +00:00
Anders Broman d4e0b348cf Doxygen fixes.
svn path=/trunk/; revision=33942
2010-08-26 20:31:09 +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 e36628d2aa 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.

svn path=/trunk/; revision=32803
2010-05-14 02:47:13 +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 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
Guy Harris c4932893e3 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.

svn path=/trunk/; revision=25576
2008-06-24 08:05:45 +00:00
Guy Harris b7c2ead26a Constify some arguments.
svn path=/trunk/; revision=24407
2008-02-21 12:30:26 +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
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +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
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 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 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
Guy Harris 2f7fd680e2 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.

svn path=/trunk/; revision=16526
2005-11-17 05:59:21 +00:00
Ulf Lamping 5d404864f2 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.


svn path=/trunk/; revision=14438
2005-05-26 17:50:27 +00:00
Ulf Lamping 4852c618d8 add a state member to the capture_opts, and set it according to the capture engine
svn path=/trunk/; revision=14205
2005-04-27 19:43:02 +00:00
Ulf Lamping 83dc83abd8 rename capture_clear() to capture_restart()
statusbar update should work now even in capture error case

svn path=/trunk/; revision=14105
2005-04-16 20:08:00 +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 7b7f7e7f9a 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.

svn path=/trunk/; revision=14040
2005-04-10 16:43:22 +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 b64ebb05c2 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

svn path=/trunk/; revision=13956
2005-03-28 16:14:34 +00:00
Ulf Lamping 9d6ac60cef remove capture_child flag from capture_opts as it's no longer required
svn path=/trunk/; revision=13954
2005-03-28 15:31:13 +00:00
Ulf Lamping daa67c79ba 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)

svn path=/trunk/; revision=13953
2005-03-28 14:39:31 +00:00
Jörg Mayer 58d8f2f652 - 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.

svn path=/trunk/; revision=13648
2005-03-07 10:19:33 +00:00
Ulf Lamping 399c821254 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).

svn path=/trunk/; revision=13558
2005-02-28 22:46:49 +00:00
Ulf Lamping e7fafa28c6 some clarification of the capture child thing
svn path=/trunk/; revision=13535
2005-02-27 17:30:33 +00:00
Ulf Lamping f2375c3127 minor comment additions
svn path=/trunk/; revision=13533
2005-02-27 16:54:52 +00:00
Ulf Lamping 0c03b4b002 CHILD_NAME is only used #ifdef HAVE_LIBPCAP
svn path=/trunk/; revision=13481
2005-02-23 21:04:19 +00:00
Ulf Lamping 72547c8d02 use the applications name (currently "ethereal" or "tethereal") in capture_opts, instead of hardcoded "ethereal" for both.
svn path=/trunk/; revision=13476
2005-02-23 08:34:12 +00:00
Guy Harris d83f7865ff Clean up indentation.
svn path=/trunk/; revision=13323
2005-02-06 22:06:31 +00:00
Ulf Lamping 3a63719e38 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.

svn path=/trunk/; revision=13320
2005-02-06 21:20:35 +00:00
Ulf Lamping 97866a968b instead of initializing the capture_options in main.c, use the new function capture_opts_init
svn path=/trunk/; revision=13315
2005-02-06 00:13:00 +00:00
Ulf Lamping a1a2ae3180 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

svn path=/trunk/; revision=13308
2005-02-05 15:35:25 +00:00
Ulf Lamping 49b4e57a10 updated some comments
svn path=/trunk/; revision=13301
2005-02-05 11:37:56 +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 9ff19a4c94 move capture_file_fd field from capture_file to capture_opts type, as this is the place where it should be
svn path=/trunk/; revision=13268
2005-02-03 22:48:20 +00:00
Ulf Lamping d9be4670a7 move global capture_child flag into capture_options
svn path=/trunk/; revision=12855
2004-12-29 12:37:06 +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 7445ecfd05 split capture_loop from capture.c, some more code cleanup
svn path=/trunk/; revision=12451
2004-10-30 17:50:51 +00:00
Ulf Lamping bdfe1d7fc8 move quit_after_cap into capture_opts
svn path=/trunk/; revision=12449
2004-10-30 14:30:52 +00:00
Guy Harris 8a8b883450 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.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Gerald Combs 04d996b183 Make sure child processes don't create a splash screen. Make the verbs in
the splash screen messages present participles.

svn path=/trunk/; revision=11321
2004-07-06 19:16:04 +00:00
Ulf Lamping 7e8187df20 added an option to "avoid" the capture info dialog completely.
This matters for "update of list in real time" (sync_mode) only,
as in normal mode you wouldn't otherwise have the possibility
to stop the capture.

svn path=/trunk/; revision=11194
2004-06-20 13:39:44 +00:00
Ulf Lamping fa7a022db3 add more details for doxygen
svn path=/trunk/; revision=11107
2004-06-04 17:19:01 +00:00
Michael Tüxen 254aba8282 From Jon Oberheide: Add interface name to the capture and ethereal window
while capturing.

svn path=/trunk/; revision=10594
2004-04-13 18:01:40 +00:00