Commit Graph

362 Commits

Author SHA1 Message Date
sfisher 462bd0732c Add "break;" to end of last case statement.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35522 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-13 17:54:30 +00:00
guy 8a4eda70f1 Clean up white space.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35047 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-28 00:19:49 +00:00
etxrab 13bbc818e0 From Gregor Beck:
ERROR:capture.c:141:capture_start: assertion failed: (capture_opts->state == CAPTURE_STOPPED)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5126

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33906 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-24 06:15:40 +00:00
gerald 4690fede98 Add cf_fake_continue_tail() which is called when real-time capture
updates are off and which sets the capture file state to a value that
won't cause an assertion when the user stops capturing. Fixes bug 4035.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33005 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-27 23:55:04 +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 7940a64ea9 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32843 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-17 18:40:23 +00:00
gerald 734b51599e Keep a copy of the interface description and capture filter around so that
we can use it in the main window title during and after capture. Add a
"-X" option for providing a description for stdin.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32357 f5534014-38df-0310-8fa8-9805f1628bb7
2010-04-01 21:55:01 +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
gerald 0cc9471af8 Behave more gracefully if WinPcap isn't installed. Don't assert if
we call pcap_open or pcap_open_live when WinPcap isn't loaded - just
return NULL. Don't display the "NPF driver isn't running" dialog if
we're capturing from stdin or a file.

Fix a cut-and-paste error in capture_pcap_linktype_list.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31275 f5534014-38df-0310-8fa8-9805f1628bb7
2009-12-15 19:29:21 +00:00
jake f524afe612 From Valerio Messina:
As now, when Wireshark save capture files, it show "Loading" in status bar and
in the dialog box, warning many users of lost them packets. Saving work as expected.
Is simply a GUI use interaction problem.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31269 f5534014-38df-0310-8fa8-9805f1628bb7
2009-12-14 22:05:29 +00:00
wmeier d46bc40324 (FWIW) One step towards including stdio.h & stdlib.h only when req'd.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29568 f5534014-38df-0310-8fa8-9805f1628bb7
2009-08-26 19:27:49 +00:00
wmeier 4c57aa5837 (Minor) #include "alert_box.h" not req'd
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28707 f5534014-38df-0310-8fa8-9805f1628bb7
2009-06-11 16:41:38 +00:00
wmeier 0082370dd3 Minor rewording of a few comments; fix a few typos.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27151 f5534014-38df-0310-8fa8-9805f1628bb7
2009-01-04 14:21:54 +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
wmeier f52f7cba6a Fix some incorrect code (found by valgrind).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26032 f5534014-38df-0310-8fa8-9805f1628bb7
2008-08-15 13:05:20 +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 9a0024836d Have capture_info_ui_create() and capture_info_open() take a pointer to
the capture_opts structure as an argument, rather than just a pointer to
the interface name.

Don't declare a global "capture_opts" pointer, as we don't define it any
more.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25570 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-24 01:23:33 +00:00
stig 07288ab10c Don't include \r in linktype on win32, it looks weird in the combo box.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25410 f5534014-38df-0310-8fa8-9805f1628bb7
2008-06-02 17:17:24 +00:00
morriss 440ebe03d7 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_*.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25354 f5534014-38df-0310-8fa8-9805f1628bb7
2008-05-22 15:46:27 +00:00
sfisher c3af6aae8a - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds



git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24829 f5534014-38df-0310-8fa8-9805f1628bb7
2008-04-07 05:22:54 +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
stig d617b35486 Removed some more "statement not reached" warnings.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24283 f5534014-38df-0310-8fa8-9805f1628bb7
2008-02-07 12:52:08 +00:00
ulfl 43920c7974 as "advertised" some days ago:
rewrite the tshark capture code almost completely, to use dumpcap instead of it's own pcap functionality.

This works on Win32 and should work on unix/linux (but I'm not sure here). Some stuff needs to be cleaned up, some more may need to be rewritten to specifically work with unix/win32. Futher work needs to be done at:

1. read filters (simply document current behaviour?)
2. event loop polling
3. privileges
4. code cleanup (e.g. in capture_loop.c)

Be prepared that tshark might not work as before / expected at least in the next days!

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22969 f5534014-38df-0310-8fa8-9805f1628bb7
2007-09-25 21:55:06 +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 aca3bdda2f Fix compilation under VS6 (hopefully without breaking compilation
anywhere else).  Instead of using getaddrinfo() and getnameinfo(),
promote inet_pton.c and inet_ntop.c to the top level and use those
routines instead.

(It's 2007, for crying out loud.  Why is this even an issue?)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22075 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11 18:26:09 +00:00
jake 1bb7367062 Fix segmentation fault when NULL err_msg pointer passed to capture_interface_list() and sync_list_interface_open() fails.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22073 f5534014-38df-0310-8fa8-9805f1628bb7
2007-06-11 06:40:56 +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
wmeier acb2307257 Minor fix: For "wireshark -Q ..." show "no packets captured" popup only when valid.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21810 f5534014-38df-0310-8fa8-9805f1628bb7
2007-05-17 01:41:47 +00:00
etxrab 88547059e5 Ethereal->Wireshark
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18235 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-28 20:28:20 +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
guy b303599e70 Clean up indentation a bit.
In "capture_input_new_file()", don't call the callbacks unless we
succeed in opening the new file.  Have "capture_info_new_file()" return
a success/failure indication.

Improve the message logged when we fail to open the new file if we're
only opening it for the quick packet counts.  We really should put up an
alert box and give up on the capture at that point.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17437 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-01 01:46:52 +00:00
ulfl 24500cc663 add a log message, if capture start failed
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17340 f5534014-38df-0310-8fa8-9805f1628bb7
2006-02-17 22:36:59 +00:00
ulfl 4af29c9503 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

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17327 f5534014-38df-0310-8fa8-9805f1628bb7
2006-02-17 02:18:48 +00:00
ulfl e09e2c27ab show the number of packets captured, if "Update list of packets ..." isn't used
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17071 f5534014-38df-0310-8fa8-9805f1628bb7
2006-01-22 16:26:41 +00:00
ulfl 58c72b2655 we can even get error messages while we are capturing (e.g. when a network cable is unplugged)
problem found by Joerg Mayer

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16704 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-06 19:41:45 +00:00
ulfl 91e56221f5 rename pcap-....c/.h files to capture-pcap-....c/.h
this way, the capture prefix will "logically" group the files together and file browsers will also group them

we may want to move the files into a subdir capture later

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16691 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-06 00:07:13 +00:00
ulfl a6dcf17ade 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).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16669 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-04 02:04:18 +00:00
ulfl 74fa79dd14 clarify a comment
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16667 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03 21:12:59 +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
ulfl 5cb8ffbe44 add some more help text to the "no packets captured" error dialog:
link to CaptureSetup wiki page
Win32 only: wireless: "try switch off promicuous mode"

This way we might get less user questions on the users-mailing list ...

Especially the second one hopefully could save us from a lot of support mails :-)

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16591 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-25 22:27:27 +00:00
ulfl 0180a288fa 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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16403 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-06 22:43:25 +00:00
ulfl 00161c47c7 minor fix: fix the sequence while finishing a live capture, so the statusbar information about the file size is correct
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16148 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-07 03:24:14 +00:00
ulfl cb52f7da0a add two new callbacks:
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ...

If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here.

cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15891 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-20 08:42:35 +00:00
ulfl 0dc84b9da9 changed the loglevel of "capture kill" from message to info (it's no action that the user directly triggered)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14446 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-26 21:45:58 +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 07c641f21e the capture child might not respond shortly after bringing it up (especially it will block, if no input coming from an input capture pipe (e.g. mkfifo) is coming in)
to prevent problems, bring the main GUI into "capture mode" right after successfully spawn/exec the capture child, without waiting for any response from it

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14436 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-25 23:28:59 +00:00
ulfl d2908746c0 removed various gcc warnings
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14246 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-30 17:23:33 +00:00