Commit Graph

266 Commits

Author SHA1 Message Date
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 e28df4e29d bugfix: button in capture info dialog has to stop capturing
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12506 f5534014-38df-0310-8fa8-9805f1628bb7
2004-11-10 17:58:16 +00:00
guy 427630f6d4 Move some #defines and #includes around, and add some other #includes,
to make it compile on UN*X.  Get rid of some #includes that don't appear
to be needed, at least on OS X 10.3 (they might be needed on other
platforms).


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12453 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30 23:26:47 +00:00
guy 3e3ae44476 Get rid of forward declarations of functions not defined in this file.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12452 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30 23:05:48 +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
ulfl f3cc4dc4e1 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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12445 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30 11:44:06 +00:00
guy 1f8aba07a5 Move prefs.c and prefs.h into the epan subdirectory.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12115 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-27 22:55:15 +00:00
guy 1960ddba83 If we have "pcap_datalink_val_to_name()", use it when we construct a
"-y" argument for the capture subprocess - the capture subprocess will
expect a symbolic value, not a numeric value, if we have
"pcap_datalink_name_to_val()".  (We assume that if one is present the
other will be present as well.)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12064 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-22 09:42:57 +00:00
gram 35a6e092c3 Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11410 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18 18:06:47 +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
guy e78ed754f2 On at least some platforms, a #define of O_BINARY is needed even if
<fcntl.h> is included, as <fcntl.h> doesn't define it.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11276 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-30 06:58:59 +00:00
ulfl fb8d9e5a06 define of O_BINARY not needed, if fcntl.h is included
other #include related cleanups


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11272 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-29 20:51:26 +00:00
ulfl fccbfb5d2f 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.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11194 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-20 13:39:44 +00:00
guy 7b627e9908 From Lars Roland: add support for building a libethereal.dll with MSVC:
add a config.nmake option to control whether to build
	libethereal.dll or not;

	remove "./wiretap" from PATH to prevent problems due to
	wrongly-loaded files;

	build dissector.lib with MSVC;

	move "print.c" and "ps.c" to the dissector helpers, as "print.c"
	imports variables from packet-frame.c and packet-data.c, which
	are in libethereal;

	move "g711.c" out of the dissector helpers, as they're used only
	by Ethereal in a tap, not in Tethereal or in any dissector;

	add a .def file for libethereal;

	arrange to declare global variables exported from libethereal
	with "__declspec(dllimport)" when building programs that import
	those variables;

	update the NSIS installer.

Make the "configure" script define ETH_VAR_IMPORT as "extern".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10834 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-09 10:03:41 +00:00
guy d26f9c3f98 Failures when capturing should be reported as errors.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10620 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-17 01:07:47 +00:00
tuexen 10ee8946d3 From Jon Oberheide: Add interface name to the capture and ethereal window
while capturing.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10594 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-13 18:01:40 +00:00
guy 3965ce4a8c Include "packet-ap1394.h" to declare "capture_ap1394()".
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10451 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-23 06:48:31 +00:00
guy 0b06407eae Add support for DLT_APPLE_IP_OVER_IEEE_1394.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10446 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-23 01:02:41 +00:00
ulfl 91b4aaa1e8 experimental: make usage of pcap_setbuff to increase the kernel buffer size
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10377 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-13 22:49:30 +00:00
ulfl abd9f14c88 capture dialog limits now with units.
no gint "wrap around" tests implemented yet


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10304 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-04 21:27:55 +00:00
ulfl 938551c55f fixed differences between capture GUI frontend and backend
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10303 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-04 19:31:21 +00:00
ulfl 404a0ba81d implemented capture dialog 3rd (+x) proposal
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10279 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-02 22:07:23 +00:00
ulfl 8d0ac6884f Capturing: "Number of files" switches between normal and multiple mode,
"Use ring buffer" switches between multiple single run and real ring buffer


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10257 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-28 16:21:11 +00:00
ulfl 99f9461702 bugfix from previous check in
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10170 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21 14:04:17 +00:00
ulfl 2190d6a213 quit_after_cap should be a gboolean, not an int, and it should be initialized
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10169 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21 13:40:06 +00:00
ulfl 5eaba9c866 rework of capture.c: better seperation of sync and capture pipe by using
explicit names and seperated functionality of do_capture(),
but no functional change!


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10168 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21 12:58:42 +00:00
guy ae4b48d961 Add an "open_failure_alert_box()" routine to pop up an alert box for a
failed attempt to open/create a file.

Fix one call to pass the right value for the "for_writing" flag.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10026 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-11 01:23:25 +00:00
ulfl 40aaa5d5a9 bugfix: close capture file again, if empty after capturing
(bug appears only, if "update list of packets ..." not used)


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10017 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-09 19:19:19 +00:00
guy 1a0918da92 Tweak the error messages for bad capture filters.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9974 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03 20:48:50 +00:00
ulfl b01fdbc615 ups, moved previously missing %s to the right place
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9970 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03 19:54:08 +00:00
guy 81b91d5dff Add a missing "%s" to the format string.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9967 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03 18:39:52 +00:00
ulfl ac8360827f enhanced some dialog messages,
close capture file when user told so


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9965 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03 17:59:01 +00:00
guy 5343810389 Pass ESD_BTN_OK rather than NULL as a second argument to
"simple_dialog()"; NULL might be #defined to be a pointer expression on
some platforms, causing compiler warnings (and, on platforms where a
null pointer doesn't have all its bits 0, possibly causing misbehavior,
although I don't think there are any such platforms on which Ethereal
runs).

Don't allow 0 as button mask argument to "simple_dialog()".

Squelch a compiler warning.

Report fatal problems as errors, not warnings.

Report file I/O errors with "file_open_error_message()".

Report file write errors (including those reported by "close()", e.g.
some errors writing to an NFS server) when saving raw packet data to a
file.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9915 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31 03:22:42 +00:00
guy 30991713e6 Add some more information to the error message for invalid capture
filters that look like display filters.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9914 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31 02:29:19 +00:00
ulfl bb63aff30b renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR to
better reflect the real error text


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9913 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31 02:25:46 +00:00
guy dcf4e1a5c9 If "pcap_compile()" fails to compile an empty filter string (because,
for example, the libpcap code generator doesn't support the link-layer
type for the capture), "dfilter_compile()" will succeed but return a
null rfcode pointer.

In that case, instead of telling people that it looks like a valid
display filter (which it does, but it also looks like a complete list of
all the Basque words likely to be known by Hammurabi :-)), and then
crashing when we try to "free" that non-existent dfilter code, we just
report it as a "sorry, couldn't compile that capture filter.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9912 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31 01:32:51 +00:00
guy eafb6f1a62 Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for
WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and
WTAP_ERR_BAD_RECORD errors.  Replace the error messages logged with
"g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed
strings returned as the error info string, and change the callers of
those routines to, for those errors, put the info string into the
printed message or alert box for the error.

Add messages for cases where those errors were returned without printing
an additional message.

Nobody uses the error code from "cf_read()" - "cf_read()" puts up the
alert box itself for failures; get rid of the error code, so it just
returns a success/failure indication.

Rename "file_read_error_message()" to "cf_read_error_message()", as it
handles read errors from Wiretap, and have it take an error info string
as an argument.  (That handles a lot of the work of putting the info
string into the error message.)

Make some variables in "ascend-grammar.y" static.

Check the return value of "erf_read_header()" in "erf_seek_read()".

Get rid of an unused #define in "i4btrace.c".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25 21:55:17 +00:00
guy 152d9aec3f Add a new "file_open_error_message()" routine in "epan/filesystem.c", to
translate UNIX errno values to a somewhat friendly message format
string.

Rename "file_open_error_message()" in "file.c" to
"cf_open_error_message()", make "cf_open_error_message()" use the new
"file_open_error_message()" for UNIX errno values, have "do_capture()"
in "capture.c" use "file_open_error_message()" to report errors from
"open()", and make "cf_open_error_message()" static as nothing outside
"file.c" uses it.

Do similar stuff in "tethereal.c".


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9821 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-24 01:44:29 +00:00
guy dcaaf24e3a Use "fork_child" rather than "child_process" - on Win32, "child_process"
tracks "fork_child", and, on UNIX, "child_process" doesn't exist.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9783 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-22 20:45:49 +00:00
ulfl 3091522b1f bugfix: wrong parameter name
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9778 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-22 19:25:36 +00:00
ulfl b575db2902 moved GTK specific parts from capture.c to ui_util.c,
implemented Win32 "Capture Stop" when using
"update list of packets in realtime" while capturing


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9777 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-22 18:13:57 +00:00
ulfl ae3b2fb715 a.) saving GTK1 and GTK2 fontnames in different preference setting, to prevent problems when switching between GTK1 and GTK2 ethereal versions
b.) added new feature "Edit->Go To First Packet" "Edit->Go To Last Packet" with corresponding menu and toolbar items
c.) added new feature "View->Zoom In" / "View->Zoom Out" / View->Normal Size" with corresponding menu and toolbar items
This feature will act as a "size offset" to the current fontsize, so that the packet list/tree view/... will have a larger/smaller font size.
The value is stored inside the recent file.
d.) Win32 only: Try to get the win32 system font and fontsize at program startup and show the menus/dialogs and such with the same font and fontsize like other win32 windows.
This makes the program make a *lot* more feel like a normal win32 program.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9753 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-20 18:47:25 +00:00
guy 1ef354f00b Update the Win32 information given when we fail to open a capture device
to note that the 3.0 and later versions of WinPcap don't support PPP/WAN
captures even on Windows OT.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9709 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-18 04:13:44 +00:00
ulfl 1f68a9e965 removed some MSVC warnings (level 3)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9561 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-05 19:31:44 +00:00
ulfl e6a2ccb342 removed some MSVC warnings (moved pcap.h before glib.h)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9393 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-21 12:19:39 +00:00
guy 700ca8cbbf Top-of-tree and top-of-0.8-branch libpcap support limited filtering on
DLT_LINUX_IRDA (empty expression and "link[M:N]" expressions), so don't
special-case IRDA adapters.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9349 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-18 21:18:34 +00:00
guy e0b7af3932 From Jan Kiszka: IrDA support.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9345 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-18 19:07:14 +00:00
guy 370b7079dc Fix a typo.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8983 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-17 19:40:09 +00:00