aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
2005-01-16Rename capture_combo_utils.{c,h} to capture_ui_utils.{c,h}, as the codeguy1-1/+1
in there is for UI functions including, but not limited to, the combo box in capture dialogs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13061 f5534014-38df-0310-8fa8-9805f1628bb7
2005-01-16Use a more descriptive name, if available, for the network interface inguy1-3/+7
window titles even on UN*X, and if the user's specified a description for an interface, use that rather than the description supplied by libpcap. Put the interface name into the main window title when doing a live capture. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13060 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29move global capture_child flag into capture_optionsulfl1-6/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12855 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29Don't use a global capture_opts in the capturing engine (this isn't a good ↵ulfl1-32/+52
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-11-10bugfix: button in capture info dialog has to stop capturingulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12506 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30Move some #defines and #includes around, and add some other #includes,guy1-57/+6
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-30Get rid of forward declarations of functions not defined in this file.guy1-12/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12452 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30split capture_loop from capture.c, some more code cleanupulfl1-1285/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12451 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30move quit_after_cap into capture_optsulfl1-2/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12449 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30code cleanup: split capture_sync from capture.c into it's own file. ulfl1-717/+8
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-09-27Move prefs.c and prefs.h into the epan subdirectory.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12115 f5534014-38df-0310-8fa8-9805f1628bb7
2004-09-22If we have "pcap_datalink_val_to_name()", use it when we construct aguy1-0/+5
"-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-07-18Move dissectors to epan/dissectors directory.gram1-16/+16
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-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
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-06-30On at least some platforms, a #define of O_BINARY is needed even ifguy1-1/+5
<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-29define of O_BINARY not needed, if fcntl.h is includedulfl1-6/+1
other #include related cleanups git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11272 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-20added an option to "avoid" the capture info dialog completely.ulfl1-13/+30
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-05-09From Lars Roland: add support for building a libethereal.dll with MSVC:guy1-1/+5
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-04-17Failures when capturing should be reported as errors.guy1-11/+11
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10620 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-13From Jon Oberheide: Add interface name to the capture and ethereal windowtuexen1-2/+2
while capturing. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10594 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-23Include "packet-ap1394.h" to declare "capture_ap1394()".guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10451 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-23Add support for DLT_APPLE_IP_OVER_IEEE_1394.guy1-1/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10446 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-13experimental: make usage of pcap_setbuff to increase the kernel buffer sizeulfl1-1/+15
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10377 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-04capture dialog limits now with units.ulfl1-2/+2
no gint "wrap around" tests implemented yet git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10304 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-04fixed differences between capture GUI frontend and backendulfl1-51/+76
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10303 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-02implemented capture dialog 3rd (+x) proposalulfl1-15/+15
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10279 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-28Capturing: "Number of files" switches between normal and multiple mode,ulfl1-27/+40
"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-21bugfix from previous check inulfl1-23/+23
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10170 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21quit_after_cap should be a gboolean, not an int, and it should be initializedulfl1-6/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10169 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21rework of capture.c: better seperation of sync and capture pipe by usingulfl1-279/+352
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-11Add an "open_failure_alert_box()" routine to pop up an alert box for aguy1-4/+3
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-09bugfix: close capture file again, if empty after capturingulfl1-1/+11
(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-03Tweak the error messages for bad capture filters.guy1-5/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9974 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03ups, moved previously missing %s to the right placeulfl1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9970 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03Add a missing "%s" to the format string.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9967 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-03enhanced some dialog messages,ulfl1-9/+17
close capture file when user told so git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9965 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31Pass ESD_BTN_OK rather than NULL as a second argument toguy1-20/+21
"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-31Add some more information to the error message for invalid captureguy1-3/+5
filters that look like display filters. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9914 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR toulfl1-9/+9
better reflect the real error text git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9913 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-31If "pcap_compile()" fails to compile an empty filter string (because,guy1-2/+2
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-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-2/+2
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-24Add a new "file_open_error_message()" routine in "epan/filesystem.c", toguy1-2/+3
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-22Use "fork_child" rather than "child_process" - on Win32, "child_process"guy1-12/+6
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-22bugfix: wrong parameter nameulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9778 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-22moved GTK specific parts from capture.c to ui_util.c,ulfl1-103/+38
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-20a.) saving GTK1 and GTK2 fontnames in different preference setting, to ↵ulfl1-3/+3
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-18Update the Win32 information given when we fail to open a capture deviceguy1-3/+5
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-05removed some MSVC warnings (level 3)ulfl1-3/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9561 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-21removed some MSVC warnings (moved pcap.h before glib.h)ulfl1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9393 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-18Top-of-tree and top-of-0.8-branch libpcap support limited filtering onguy1-3/+3
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