aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_dlg.c
AgeCommit message (Collapse)AuthorFilesLines
2001-11-09Wrap calls to "pcap_datalink()" in a routine that attempts to compensateGuy Harris1-2/+2
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't return DLT_ values, it returns RFC 1573 ifType values. Put that wrapper, and the routine to get the interface list, in a separate file, for packet-capture utility routines, so not everybody who includes "util.h" needs to include <pcap.h>. Fix up the Wiretap hack for dealing with said incompatibility to use the correct ifType value for Token Ring. svn path=/trunk/; revision=4184
2001-10-31Add the Ethereal Web site's mirror of WinPcap to the dialog popped up ifGuy Harris1-2/+5
you try to capture on Windows without having WinPcap installed. svn path=/trunk/; revision=4113
2001-09-29The Wiretapped.net mirror is OK again (it was a problem with theGuy Harris1-3/+6
mirroring procedure, due to the Politecnico di Torino site's IIS not being configured to allow the relevant "virtual directories" to be listed, thus keeping Wiretapped.net from figuring out what files were there and whether they've changed), so put back the references to it. svn path=/trunk/; revision=3976
2001-09-28Sigh. The wiretapped.net site appears to have an old version ofGuy Harris1-3/+4
WinPcap's installer (it dates back to May, meaning it may be a beta of 2.2 or may even be 2.1), so don't suggest that people go there. svn path=/trunk/; revision=3964
2001-09-26Make the message popped up if you try to do a capture on a Win32 machineGuy Harris1-6/+9
when wpcap.dll couldn't be loaded more detailed, in the hopes that it'll reduce the chances that somebody will see that message and not know what to do. Also, mention the Wiretapped.net mirror of the WinPcap site, as the WinPcap site is all-too-often down due to networking glitches. svn path=/trunk/; revision=3955
2001-05-31Support for "-N" flag enabling selected forms of name resolution, fromGuy Harris1-12/+37
Joerg Meyer. Support for saving to the preferences file the settings for all types of name resolution. Do a case-insensitive check for "true" and "false" in Boolean preference settings. svn path=/trunk/; revision=3489
2001-05-31Free the string you "g_strdup()"ed, rather than handing "g_free()" theGuy Harris1-2/+2
null pointer that provoked you to free the string. svn path=/trunk/; revision=3485
2001-04-15There's no "enable name resolution in captures" preference in Ethereal,Guy Harris1-3/+3
and never was - there's only an Ethereal-wide "enable name resolution" preference. Name it just "name_resolve". Replace all tests of "g_resolving_actif" with tests of "prefs.name_resolv", and replace all code that sets "g_resolving_actif" with code that sets "prefs.name_resolv", so that the setting of "prefs.name_resolv" actually affects whether names are resolved or not. svn path=/trunk/; revision=3300
2001-04-13Added the ethereal capture preferences to the preference file.Jeff Foster1-9/+10
svn path=/trunk/; revision=3298
2001-04-05Win32 build fix, show "0.5.2 (WinPcap 2.1)" as the libpcap versionGilbert Ramirez1-3/+3
for Win32, and show a slightly more informative (i.e., geared to the user) help message when trying to capture without having WinPcap installed. svn path=/trunk/; revision=3261
2001-04-03Now that WinPcap is a DLL, I can load it at run-time rather than load-time.Gilbert Ramirez1-1/+17
That means that I no longer need to distribute capture and non-capture versions of Ethereal for Win32; one version (compiled with WinPcap headers) can run on systems with or without WinPcap. For systems that don't have WinPcap, instead of disabling the Capture menu, Capture|Start brings up a dialogue informing the user that wpcap.dll was not loadable, and gives a URL to the WinPcap home page. svn path=/trunk/; revision=3249
2001-01-28There's no need for a member of a "capture_file" structure holding aGuy Harris1-1/+3
compiled capture filter program, so remove it, and remove the include of <pcap.h> from "file.h"; instead, have local "struct bpf_program" structures where needed, and have those files that need stuff from <pcap.h> include it. This cleans stuff up a bit, and should eliminate a pile of compile warnings with Visual C++ due to <pcap.h> and some GTK+/GLib header file (or files they include) both defining "inline". svn path=/trunk/; revision=2954
2001-01-02Add a dialog box for constructing expressions that test a field in theGuy Harris1-2/+2
display tree, based on Jeff Foster's dialog box for selecting fields. Make the dialog box for browsing filters into a dialog box for constructing filters; make the "Apply" button and the "OK" button apply the filter in the text entry box in the dialog, not the currently selected filter (selecting a filter puts it in that text entry box, but the user may edit it afterwards, or may use the aforementioned dialog box to construct a filter not in the list). Get rid of extra declarations of "m_r_font" and "m_b_font" in "proto_draw.c"; they're declared in "gtk/gtkglobals.h", which it includes. svn path=/trunk/; revision=2805
2000-10-19Move the declaration of "g_resolving_actif" from the top-levelGuy Harris1-1/+2
"globals.h" file to "epan/resolv.h", as it's exported by "epan/resolv.c", have files that use "g_resolving_actif" include "resolv.h", and don't have "epan/resolv.c" include "globals.h" so that it doesn't drag in, for example, headers that, in turn, drag in GTK+ headers. svn path=/trunk/; revision=2517
2000-10-11Santeri Paavolainen's patch to add a "Capture->Stop" menu item to letGuy Harris1-1/+7
you stop an "Update list of packets in real time" capture from the main window as well as from the capture statistics dialog. svn path=/trunk/; revision=2487
2000-09-15Add a "-p" command-line option, and a checkbox in the "CaptureGuy Harris1-4/+15
Preferences" dialog box, to control whether to put the interface in promiscuous mode or not; Debian bug #34376 asked for this. svn path=/trunk/; revision=2439
2000-08-23Cosmetic changes.Laurent Deniel1-26/+20
Add a table so that the first 4 rows of the capture dialog are correctly aligned. Remove the unneeded hboxes. svn path=/trunk/; revision=2353
2000-08-23Bleah. What was I thinking? "dlg_window_new()" should take the titleGuy Harris1-3/+2
for the dialog window as an argument (as various dialog creators in GTK+ do), not oblige every caller of it to cut-and-paste a "gtk_window_set_title()" call after it. svn path=/trunk/; revision=2345
2000-08-11Miscellaneous code cleaningLaurent Deniel1-6/+1
- add <stdarg.h> or <varargs.h> in snprintf.h and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes - remove the check of multiple inclusions in source (.c) code (there is a bit loss of _cpp_ performance, but I prefer the gain of code reading and maintenance; and nowadays, disk caches and VM are correctly optimized ;-). - protect all (well almost) header files against multiple inclusions - add header (i.e. GPL license) in some include files - reorganize a bit the way header files are included: First: #include <system_include_files> #include <external_package_include_files (e.g. gtk, glib etc.)> Then #include "ethereal_include_files" with the correct HAVE_XXX or NEED_XXX protections. - add some HAVE_XXX checks before including some system header files - add the same HAVE_XXX in wiretap as in ethereal Please forgive me, if I break something (I've only compiled and regression tested on Linux). svn path=/trunk/; revision=2254
2000-07-20Use ESD_TYPE_CRIT for most errors (the model used by various GUIs seemsGuy Harris1-2/+2
to use "warning" dialog boxes only to warn the user "if you do that, bad things may happen" *and* to offer them the option either to drive on or quit, so perhaps ESD_TYPE_CRIT should be used for all errors). However, put "Ethereal: Error" rather than "Ethereal: Critical" in the title bar, in the hopes that it'll make it clearer that Something Bad Happened. If the user specifies that captures should be saved to a user-specified file rather than a temporary file, report errors trying to create that file with "file_open_error_message()". Make the "for_writing" argument to "file_open_error_message()" a "gboolean", as it's either TRUE (if the file is being opened for writing) or FALSE (if it's being opened for reading). Report EISDIR as "XXX is a directory (folder), not a file.". svn path=/trunk/; revision=2143
2000-07-05Add a "dlg_window_new()" routine, which creates a GTK_WINDOW_DIALOGGuy Harris1-2/+2
window and makes it transient for the top-level window; the transient-for at least provides a hint to X window managers to minimize the dialog if the main window is minimized; keep the dialog on top of the main window in the Z order for windows; perhaps (if there are any window managers that actually *do* this) even put it atop the main window in the X-Y plane (KWM doesn't and I seem to remember that the Exceed X server for Windows doesn't). It's generally considered the Right Thing To Do for dialog boxes. Use that routine to create dialog boxes, rather than doing it directly in the code for that dialog box. svn path=/trunk/; revision=2112
2000-06-27Patch from Ben Fowler to rename the global variable "cf" to "cfile", toGuy Harris1-20/+20
make it easier to use grep to find all references to it without getting a lot of false hits and to check, after allocating the memory chunk for "frame_data" structures, that the allocation succeeded. svn path=/trunk/; revision=2092
2000-06-15Changes from Graham Bloice to support "Update list of packets in realGuy Harris1-7/+1
time" during captures on Win32. svn path=/trunk/; revision=2074
2000-05-08Catch the ESC key in the file selection dialog boxes popped up forGuy Harris1-1/+6
"File->Open", "File->Save As", and the "File:" buttons in the Capture Preferences and Print dialog boxes, and make it cancel the file selection dialog box. svn path=/trunk/; revision=1921
2000-05-08Set up the buttons in the "Capture Preferences" dialog box to useGuy Harris1-4/+14
mnemonics. Give the button, in the "Display Options" dialog box, that controls whether name resolution is enabled or not the same label ("Enable name resolution") as the equivalent button in the "Capture Preferencs" dialog box. svn path=/trunk/; revision=1920
2000-05-08Connect the capture preferences dialog box and any file selection dialogGuy Harris1-1/+57
box it has open, so that: if the capture preferences dialog box goes away, so does the file selection dialog box (as it no longer has a text widget into which it can stuff the selected file name); if the "File:" button is clicked when there's already a file selection dialog box open, we just reactivate that existing dialog box rather than popping up a new one. svn path=/trunk/; revision=1919
2000-05-03Make the "Capture Preferences" dialog box use the new utilities to makeGuy Harris1-1/+37
the Return key start the capture and make the Esc key cancel the dialog box. svn path=/trunk/; revision=1904
2000-04-07Disable "Update list of packets in real tiem" andGilbert Ramirez1-1/+7
"Automatic scrolling in live capture" for Win32. svn path=/trunk/; revision=1817
2000-04-01Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up aGuy Harris1-3/+41
"global" dialog box when "Edit:Filters" is selected, so that the list of filters can be edited, and "filter_browse_cb()", which pops up a dialog box associated with a "Filter:" button and a text entry widget attached to that button, so that a filter can be selected or saved (although it also supports the same editing that the "global" dialog box does). Have "filter_dialog_cb()" connect the window in which the "Filter:" button lives and the filter dialog box, so that: if the window in which the "Filter:" button lives goes away, so does the filter dialog box (as it no longer has a text widget into which it can stuff the selected filter); if the "Filter:" button is clicked when there's already a filter dialog box open, we just reactivate that existing dialog box rather than popping up a new one. Also keep a pointer to the "global" filter dialog box, so that we also arrange that there's only one of them (by reactivating the existing on if "Edit:Filters" is selected when there's already a "global" filter dialog box open). Keep around pointers to the dialog boxes that contain the "Filter:" buttons, so that we can arrange that there be only one of them (that was a side-effect of an earlier attempt at fixing the problems described above, but it's still useful for keeping multiple competing dialog boxes from being open - there's more of that to be done). Make the pointer to the "Open Capture File" dialog box widget static to "file_dlg.c" - nobody outside of "file_dlg.c cares about it. svn path=/trunk/; revision=1774
2000-02-12Make the routines internal to the filter-editing dialog box static.Guy Harris1-2/+2
Declare the one routine exported by "gtk/filter_prefs.c" in "gtk/filter_prefs.h" rather than in "gtk/main.h". Declare "E_FILT_TE_PTR_KEY" there, as well, rather than in "prefs_dlg.h", as the filter-editing dialog box is no longer a preference tab. Don't include "prefs_dlg.h" unless the stuff declared therein is of interest. Fix "gtk/find_dlg.c" to fire up the filter-editing dialog box, not the no-longer-extant preferences tab for filters, if the "Filter:" button is clicked. svn path=/trunk/; revision=1619
2000-01-18Put into the "Capture Preferences" dialog box a check box to controlGuy Harris1-10/+20
whether, in a live capture that updates the display as packets arrive, the packet list pane should scroll to show the most recently captured packets or not. svn path=/trunk/; revision=1506
2000-01-16Move the routine to get a list of the network interfaces on the systemGuy Harris1-181/+10
to "util.c", and provide a routine to free that list as well. When picking an interface on which to do a capture (if no "-i" flag was specified), use that routine, and pick the first interface on the list. svn path=/trunk/; revision=1495
2000-01-06Don't bother checking whether the filter string is empty - just use itGuy Harris1-6/+11
even if it's empty, rather than using an empty string instead of it if it's empty. Also, "gtk_entry_get_text()" appears, from the documentation, always to return a non-null pointer (and it returned a non-null pointer when I started a capture with an empty filter string); don't supply a null string if it's null, just do a "g_assert()" to make sure it's non-null. Put in a comment explaining why we aren't trying to be clever and detecting an empty filter string and setting "cf.filter" to NULL if it's empty. svn path=/trunk/; revision=1423
2000-01-05When initializing a capture filter, assign a pointer to an empty stringGerald Combs1-2/+3
instead of NULL. svn path=/trunk/; revision=1422
2000-01-03Take the "simple_dialog()" stuff out of "ui_util.h" and "gtk/ui_util.c",Guy Harris1-2/+2
and move it to "simple_dialog.h" and "gtk/simple_dialog.c". svn path=/trunk/; revision=1414
1999-12-23I thought I'd seen a problem with the combo box in the "Capture:Start"Guy Harris1-14/+16
dialog box if we hadn't found any interfaces on which we could capture, but perhaps the problem was that "gtk_combo_set_popdown_strings()" doesn't like it if you set the list of items to a NULL list - if you don't set it at all, you get a combo box with only one blank entry in the list, but you don't seem to get complaints from GTK+ 1.2.6, at least. Pop up the "Capture:Start" dialog box even if we don't find any interfaces on which we could capture; at least this way, they won't just get confronted with a There are no network interfaces that can be opened. Please check to make sure you have sufficient permission to capture packets. message box and no way to give us any more information other than "it said 'There are no network interfaces that can be opened...'" - they can at least try the interfaces that *should* work, and report the error messages they get, giving us a better chance at figuring out what the problem is. Trim white space from the entry in that combo box, and, if there isn't anything other than possibly white space, pop up a You didn't specify an interface on which to capture packets. message box and leave the dialog box up so that the user can supply an interface name. svn path=/trunk/; revision=1373
1999-12-10Jerry Talkington's patch to remove the filter stuff fromGuy Harris1-2/+2
"Edit:Preferences" and put it directly under "Edit:Filters", and to add an "Apply" button to it, which makes the currently selected filter the current filter and applies it to the current capture. svn path=/trunk/; revision=1275
1999-12-09Move the GTK+ implementations of various UI utilities out of "util.c"Guy Harris1-2/+2
into "gtk/ui_util.c", and move the declarations of those UI utilities out of "util.h" into "ui_util.h". (The header file is in the top-level directory, rather than the "gtk" directory, because it declares window-system-independent interfaces to routines with window-system-dependent implementations.) Add to "gtk/ui_util.c" a routine to set the window and icon title. Use that routine to make the title of an Ethereal top-level window be {filename} - Ethereal if there's a capture open, and have "{filename}" be "<capture>" if it's a temporary capture file. svn path=/trunk/; revision=1255
1999-12-07It appears that the IRIX SIOCSNOOPLEN "ioctl", as used by "libpcap" toGuy Harris1-2/+5
set the capture length on IRIX, may fail if the capture length supplied is too large, rather than just truncating it. Use MIN_PACKET_SIZE, rather than WTAP_MAX_PACKET_SIZE, in our sample open. Let's hope some *other* platform doesn't barf if the capture length is too *small*.... (Sigh. Would that "pcap_open_live()" accepted 0 as a capture size, meaning "give me the whole packet". Unfortunately, it doesn't, so IRIX users may have to crank the capture size back in the capture dialog box.) svn path=/trunk/; revision=1239
1999-11-06Get rid of an unused #define.Guy Harris1-4/+1
svn path=/trunk/; revision=980
1999-10-02Wrap stufff that's used only if we have "libpcap" in "#ifdefGuy Harris1-2/+4
HAVE_LIBPCAP"/"#endif". svn path=/trunk/; revision=754
1999-10-02Add a file name field to the "Capture/Start" dialog box; if it's blank,Guy Harris1-21/+92
the capture will be done to a temporary file, otherwise it'll be done to the specified file. svn path=/trunk/; revision=749
1999-10-02Have "do_capture()" take, as an argument, a pointer to the name of theGuy Harris1-2/+2
file to which to write the capture; if it's NULL, create a temporary file and use that. Have "-w" set a local variable, which starts out null, and, for "-k" captures, call "do_capture()" and pass it that local variable as an argument; this lets you do "-k" without "-w", which makes it use a temporary file for the capture. This means "run_capture()" no longer serves a useful purpose, as its only caller is "do_capture()"; swallow it into "do_capture()". svn path=/trunk/; revision=748
1999-09-26Added name resolution in GUI part:Laurent Deniel1-3/+12
- Capture->Start->"Active name resolution" Allows the user to turn on/off name resolution during a live capture. - Display->Options->"Name resolution" Turn on/off name resolution for the displayed data (or during the -S mode). E.g. clicking on a packet captured with resolution disabled will resolve names in the detailed list if this option is set. And applying or resetting a display filter allows the update of the packet list as well. svn path=/trunk/; revision=726
1999-09-23If we forcibly turn off "fork_mode" if the user doesn't enable "UpdateGuy Harris1-3/+1
list of packets in real time" in the "Capture/Start" dialog box, "ethereal -F" won't work - you get your choice of non-forked capture or "-S". Don't have "fork_mode" track "sync_mode"; instead, in those places where we check for "fork_mode", check for "sync_mode" as well. svn path=/trunk/; revision=711
1999-09-23Move the toolkit-independent code to create a temporary capture file,Guy Harris1-85/+28
and to fork off and run a separate copy of "ethereal" for "-S" and "-F" captures or just call "capture()" otherwise, out of "gtk/capture_dlg.c" and into a routine in "capture.c". If the attempt to create said temporary capture file fails, pop up a dialog box and don't do the capture. Have the child capture process send a message upstream after it either successfully starts the capture and syncs out the header of the capture file, or fails to start the capture; the message indicates whether it succeeded or failed, and, if it failed, includes a failure message. This: avoids the use of a signal, and thus means we don't have to worry about whether to capture the signal, or whether to start or stop capturing depending on whether this particular capture is in sync mode or not; lets us pop up the message box for the error in the parent process if we're in sync mode, rather than doing it in the child, which didn't work well. Add a check button to the Capture/Start dialog box, so that we can control, for each capture, whether it's to be done in sync mode or not. svn path=/trunk/; revision=708
1999-09-11"capture.c" doesn't do socket "ioctl"s any more - the code to do that isGuy Harris1-1/+14
now in "gtk/capture_dlg.c" - so it doesn't need to include <sys/sockio.h> on, for example, Solaris... ...but "gtk/capture_dlg.c" does need to include it. "gtk/capture_dlg.c" also may need to include "snprintf.h", as it uses "snprintf()". svn path=/trunk/; revision=655
1999-09-09More shuffling of GTK-related routines to gtk subdirectory.Gilbert Ramirez1-0/+494
svn path=/trunk/; revision=636