aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main.c
AgeCommit message (Collapse)AuthorFilesLines
2001-11-20Allow the tvbuff pointer to various "proto_tree_add" routines to be nullGuy Harris1-2/+3
if (and only if) the length of the item being added is 0 (so that it has no data backing it). This means the data stream name pointer for the item in question is null; make sure we handle that. Use that for some "uses the value from the matching request" fields in the SMB Pipe protocol. svn path=/trunk/; revision=4231
2001-11-09Wrap calls to "pcap_datalink()" in a routine that attempts to compensateGuy Harris1-2/+4
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-11-04Allow a dissector to register preferences that it no longer supports asGuy Harris1-1/+2
obsolete; we silently ignore attempts to set those in a preferences file, so that we don't spam the user with error messages caused by them having saved preferences in an earlier release that contained those preferences. Make the Diameter and iSCSI dissectors register obsolete preferences. Crash if some code tries to register a preferences module with a name that contains something other than lower-case ASCII letters, numbers, or underscores, or that has already been registered, or if some code tries to register a preference with a name that contains something other than lower-case ASCII letters, numbers, underscores, or periods, or that has already been registered, so that we don't put code like that in a release and have to shovel code into "prefs.c" to fix it up later. (The problem with multiple modules or preferences with the same name should be obvious; the problem with names with blanks, or upper-case letters, or punctuation, is that they're a pain to type on the command line.) svn path=/trunk/; revision=4148
2001-10-24Have a routine that takes a file name for a personal configuration fileGuy Harris1-5/+2
and generates the path name; have it, if the file is to be opened for reading on Win32, check whether it exists and, if not, check for it in the old home directory-based configuration directory and, if so, return that path instead, so that files saved with earlier versions of Ethereal will be seen. svn path=/trunk/; revision=4072
2001-10-22Add a routine to get the directory in which personal configuration filesGuy Harris1-4/+7
reside. Use it, rather than concatenating the user's home directory and ".ethereal" in a number of files. Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname separator. svn path=/trunk/; revision=4061
2001-10-21Add little arrows to the column titles to indicate which column we'reGerald Combs1-6/+63
using to sort as well as the sort direction. svn path=/trunk/; revision=4050
2001-07-27Fix AC_ETHEREAL_PCAP_CHECK so that, if a directory was specified withGuy Harris1-13/+10
"--with-pcap", it adds the "include" subdirectory of that directory to the list of directories to search for include files, rather than adding the directory itself. Check whether libpcap defines "pcap_version", and define HAVE_PCAP_VERSION if it does. Use "pcap_version" iff HAVE_PCAP_VERSION is defined, rather than special-casing MacOS X. Don't #define a string for the WinPcap version; just leave HAVE_PCAP_VERSION undefined on Windows, as WinPcap 2.2beta is out, so we can no longer assume that the Windows version of Ethereal is using WinPcap 2.1. svn path=/trunk/; revision=3792
2001-07-26MacOS support changes, from Michael Tuexen (with some modifications):Guy Harris1-1/+5
replace "--with-plugindir" with "--with-plugins", and have the plugin directory optional - this allows plugins to be disabled; add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler requires it, for some annoying reason, even though it is, as far as I know, GCC-based, and other GCC's don't require it); on MacOS X, don't use "pcap_version[]", as, for some annoying reason, libpcap on MacOS X doesn't define it. Clean up some whitespace in the help messages for the configure script. Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which "enable_setuid_install" is set, as it tests "enable_setuid_install". svn path=/trunk/; revision=3788
2001-07-05"open_cap_file()" in Ethereal and Tethereal don't use the FILE_T theyGuy Harris1-1/+5
get from calling "wtap_file()", so get rid of the call and the (otherwise unused) variable to which its result gets assigned. That lets us get rid of "wtap_file()" in Wiretap. It also lets us get rid of the include of "zlib.h" in "file.h"; the #defines of "file_open()", "filed_open()", and "file_close()" are also unnecessary, so we get rid of those as well. However, that means we need to include <zlib.h> in "gtk/main.c" and "tethereal.c", so that the version number of libz is defined and can show up in the version string. svn path=/trunk/; revision=3652
2001-06-27Fix a problem that shows up if you build without libpcap.Guy Harris1-3/+3
svn path=/trunk/; revision=3612
2001-06-19In a capture child process, *completely ignore* the preference settingGuy Harris1-2/+12
for promiscuous mode; just do what the parent process told you, i.e. do a non-promiscuous capture iff a "-p" flag was specified. svn path=/trunk/; revision=3575
2001-06-05Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris1-23/+59
a "Match Selected" on it - we can't do a "Match Selected" if the field has no value (e.g., FT_NULL) and has a length of 0. If we unselect the current packet, we don't have a protocol tree, so we don't have a currently selected field - clear the "Match Selected" menu item and the display in the status line of information about the currently selected field. Move the low-level statusbar manipulation into "gtk/main.c", in routines whose API doesn't expose anything GTK+-ish. "close_cap_file()" calls one of those routines to clear out the status bar, so it doesn't need to take a pointer to the statusbar widget as an argument. "clear_tree_and_hex_views()" is purely a display-manipulating routine; move it to "gtk/proto_draw.c". Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine to do all the work that needs to be done if the currently selected protocol tree row is unselected, and call it if the currently selected packet list row is unselected (if it's unselected, there *is* no protocol tree, so no row can be selected), as well as from "tree_view_unselect_row_cb()". Before pushing a new field-description message onto the statusbar, pop the old one off. Get rid of an unused variable (set, but not used). svn path=/trunk/; revision=3513
2001-05-31Support for "-N" flag enabling selected forms of name resolution, fromGuy Harris1-15/+28
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-01"-l" command-line option to turn on automatic scrolling in "Update listGuy Harris1-3/+6
of captures in real time" captures, from Christian Lacunza. svn path=/trunk/; revision=3389
2001-05-01"prefs.capture_real_time", not "prefs.capture_auto_scroll", shouldGuy Harris1-2/+2
control whether we have a child process do the capturing; a user might want the packet list to be updated as packets arrive but *not* want it to scroll so that the most recently arrived packets are shown. "prefs.capture_auto_scroll", not "auto_scroll_live", should control whether we scroll a real-time-update capture's packet list; "auto_scroll_live" isn't set by the capture dialog box, "prefs_capture_auto_scroll" is. svn path=/trunk/; revision=3388
2001-04-24Signed vs. unsigned fixes from Joerg Mayer.Guy Harris1-2/+2
svn path=/trunk/; revision=3373
2001-04-19Patch from Ronnie Sahlberg to cause the field description section of theGuy Harris1-9/+28
status bar to display nothing, rather than "Text (text)", when a "proto_tree_add_text()" field is selected. While we're at it, use a similar test to eliminate the text pseudo-field from the output of "{ethereal,tethereal} -G", as well. svn path=/trunk/; revision=3335
2001-04-18Check the validity of numbers specified in command-line options.Guy Harris1-6/+31
svn path=/trunk/; revision=3326
2001-04-15There's no "enable name resolution in captures" preference in Ethereal,Guy Harris1-5/+5
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-7/+8
svn path=/trunk/; revision=3298
2001-04-10Check in isprint() hack for Win32 so that Ethereal is usably whileGilbert Ramirez1-3/+4
we figure out what the real bug is. Fix set_last_open_dir() to use G_DIR_SEPARATOR and G_DIR_SEPARATOR_S for cross-platform compatibility. svn path=/trunk/; revision=3281
2001-04-09last_open_dir needs a trailing slash in order for the GTK+Gilbert Ramirez1-3/+22
file-selection dialogue to open the directory and show its contents, otherwise it opens the parent directory and shows *its* contents. svn path=/trunk/; revision=3279
2001-04-05Win32 build fix, show "0.5.2 (WinPcap 2.1)" as the libpcap versionGilbert Ramirez1-2/+2
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/+9
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-04-02"get_home_dir()", in "epan/filesystem.c", usesGuy Harris1-1/+2
"find_last_pathname_separator()" on Win32; move the other pathname manipulation routines from "util.c" into "epan/filesystem.c". Remove from "util.h" the declarations of routines not defined in "util.c", and put them into "epan/filesystem.h" if they're not already there. Adjust #includes to make the above work. svn path=/trunk/; revision=3241
2001-04-02Added two new arguments to epan_init() and proto_init() toEd Warnicke1-2/+3
allow the passing of register_all_protocols() and register_all_protocol_handoffs() through epan_init() to proto_init(). This allows the removal of the compile time dependence of proto.c on register.h. Modified dftest.c, tethereal.c, and gtk/main.c to use the new style epan_init() and depend on register.h. svn path=/trunk/; revision=3237
2001-03-27Make "comp_info_str" static in Ethereal - there's no need for it outsideGuy Harris1-22/+37
"gtk/main.c" in Ethereal. Add the GLib version to it in Ethereal, and put in the GLib version rather than the GTK+ version in Tethereal (which isn't linked with GTK+...). Make it a GString; this makes the code to construct it slightly less ugly, especially now that we're putting the GLib version in. Fix the code for the "-D" flag in Tethereal to compile in a no-libpcap version (in a no-libpcap version, it just says that this version of Tethereal wasn't compiled with capture support). svn path=/trunk/; revision=3196
2001-03-27There's no "-D" option to Ethereal - remove the "D" from the getopt flagGuy Harris1-2/+2
list argument. svn path=/trunk/; revision=3195
2001-03-23Changes required to support multiple named data sources.Jeff Foster1-9/+42
Tvbuffers changed to added the data source name, GUI and printing code changed to support these changes and display the multiple hex views. svn path=/trunk/; revision=3165
2001-03-02Calculate the height and width of m_r_font globally, since variousGilbert Ramirez1-4/+21
routines need it. When a user clicks on a hex digit or on the corresponding character (the "text dump" portion) in the hex dump, find the field in the proto_tree that the byte corresponds to, expand the GtkCTree so that the field is viewable, select the field, and center it vertically. LanAlyzer has this feature, and I've missed it in Ethereal. svn path=/trunk/; revision=3096
2001-03-02create_main_window() does not need to be called by the capture childGilbert Ramirez1-3/+4
process. svn path=/trunk/; revision=3094
2001-02-20On Win32, if Ethereal started as a GUI rather than a consoleGuy Harris1-2/+115
application, catch what GLib message-logging calls we can, and create a console and make it the standard input, output, and error if such a call is made, so those messages show up in a console window. Create the console for the output of "ethereal -v" as well. svn path=/trunk/; revision=3052
2001-02-11In Ethereal, attempt to get the packet statistics from libpcap whenGuy Harris1-2/+5
capturing; if we succeed, display the packet drops count as the "Drops" value in the status line and as the "Dropped packets" statistics in the summary dialog box, otherwise don't display it at all. In Tethereal, attempt to get the packet statistics from libpcap when capturing; if we succeed, and if there were any dropped packets, print out the count of dropped packets when the capture finishes. svn path=/trunk/; revision=3016
2001-02-08If we failed to open a capture file specified by the "-r" flag, don'tGuy Harris1-2/+3
attempt to free the read filter if we don't have a read filter. svn path=/trunk/; revision=2999
2001-02-01Create a more modular type system for the FT_* types. Put themGilbert Ramirez1-182/+8
into epan/ftypes. Re-write display filter routines using Lemon parser instead of yacc. Besides using a different tool, the new grammar is much simpler, while the display filter engine itself is more powerful and more easily extended. Add dftest executable, to test display filter "bytecode" generation. Add option to "configure" to build dftest or randpkt, both of which are not built by default. Implement Ed Warnicke's ideas about dranges in the new display filter and ftype code. Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree, while FT_PROTOCOL is used for protocols. This was necessary for being able to make byte slices (ranges) out of protocols, like "frame[0:3]" Win32 Makefile.nmake's will be added tonight. svn path=/trunk/; revision=2967
2001-01-28There's no need for a member of a "capture_file" structure holding aGuy Harris1-1/+5
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-28Have separate capture and display filter lists; some filter dialog boxesGuy Harris1-5/+28
use the capture filter lists, and others use the display filter list, as appropriate. Have separate menu items for editing the capture and display filter lists. Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files for the two lists; if either of those files isn't found, we try "~/.ethereal/filters", which means that you will start out with two identical lists holding all your filters - if certain filters belong only in one list, you'll have to delete them by hand from the other list. Do I/O error checking when reading and writing filter lists; when writing a filter list, write it to a new file, and then rename the new file on top of the old file, so that you don't lose your old filter list if, for example, you run out of disk space or disk quota. svn path=/trunk/; revision=2948
2001-01-28Call "get_filter_list()" when Ethereal starts up.Guy Harris1-1/+6
Have it free up any list of filters we already have before reading in new filters. svn path=/trunk/; revision=2947
2001-01-21Give various filter constructing/editing dialog boxes titles to reflectGuy Harris1-2/+6
what they were popped up for. svn path=/trunk/; revision=2923
2001-01-21In the process of destroying a filter editing dialog box, we get aGuy Harris1-4/+6
selection change event on the list of filters. Unfortunately, this can happen after some other widgets in that dialog box have already been destroyed - including some of the widgets that such a selection change event can change. This sometimes happened when "filter_prefs_delete()" hadn't been called, so the mechanism we had been using, with a Boolean datum attached to the dialog box, set in "filter_prefs_delete()" before we actually destroy the dialog box, wasn't sufficient to keep that from happening. Attach to the top-level window data items containing pointers to the widgets changed when a filter is selected from the list, give each of those widgets their own destroy callbacks, clear the pointer attached to the top-level widget when the widget is destroyed, and don't do anything to the widget when a filter is selected from the list if the pointer for that widget is null, as that means the widget's been destroyed and we *can't* do anything to it. Not all filter editing dialogs created on behalf of a "Filter:" button next to a text entry box should, when you click "OK", activate the text entry box; if the text entry box is part of a dialog box with multiple widgets, the user might not have filled in all of the items in that dialog box, so you shouldn't activate it for them. Add a mechanism by which, when creating a filter editing dialog box, you can specify whether the "OK" button should just fill in the text entry box or should fill it in and also activate it. svn path=/trunk/; revision=2922
2001-01-10Fix up Gerald's e-mail address to be his "ethereal.com" address.Guy Harris1-3/+3
svn path=/trunk/; revision=2859
2001-01-02Add a dialog box for constructing expressions that test a field in theGuy Harris1-3/+3
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-12-22Enable FT_BYTES dfiltering, from Ed Warnicke.Gilbert Ramirez1-1/+10
svn path=/trunk/; revision=2768
2000-12-15Match Selected works better with FT_STRING variables.Gilbert Ramirez1-6/+11
From Ed Warnicke <hagbard@physics.rutgers.edu> svn path=/trunk/; revision=2763
2000-12-03Pull the code to set the fields in the "cfile.cinfo" structure into aGuy Harris1-8/+2
common routine to initialize a "column_info()" structure, shared by Ethereal and Tethereal. svn path=/trunk/; revision=2739
2000-11-22Change Ethereal homepage URL from etheral.zing.org to www.ethereal.com.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=2696
2000-11-21Add a "color.h" file that declares a nominally-toolkit-independentGuy Harris1-5/+14
"color_t" structure to store color values (although currently it has all the same fields that a GdkColor has; its currently advantage is that you don't have to include any GTK/GDK stuff to declare it). Add routines in the "gtk" directory to convert between "color_t" and GdkColor values. Define, in "prefs.h", all colors as "color_t" values rather than GdkColor values. "prefs.h" now no longer needs to include <gtk/gtk.h>, so don't include it. svn path=/trunk/; revision=2692
2000-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-9/+11
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
2000-11-01Add a fourth choice of time format in the packet list display, whichGuy Harris1-2/+4
shows the date (in YYYY-MM-DD format) as well as the time of day when the packet arrived. svn path=/trunk/; revision=2547
2000-10-27Move declaration of wsaData (for Win32) out of HAVE_LIBPCAP #ifdef block.Gilbert Ramirez1-2/+7
It's needed for both capture and non-capture variants of Win32 builds. svn path=/trunk/; revision=2542