diff options
-rw-r--r-- | gtk/about_dlg.h | 13 | ||||
-rw-r--r-- | gtk/capture_combo_utils.h | 16 | ||||
-rw-r--r-- | gtk/capture_prefs.h | 31 | ||||
-rw-r--r-- | gtk/color_dlg.h | 30 | ||||
-rw-r--r-- | gtk/color_filters.h | 44 | ||||
-rw-r--r-- | gtk/color_utils.h | 22 | ||||
-rw-r--r-- | gtk/colors.h | 16 | ||||
-rw-r--r-- | gtk/column_prefs.h | 31 | ||||
-rw-r--r-- | gtk/decode_as_dlg.h | 27 | ||||
-rw-r--r-- | gtk/dfilter_expr_dlg.h | 12 | ||||
-rw-r--r-- | gtk/dlg_utils.h | 4 | ||||
-rw-r--r-- | gtk/endpoint_talkers_table.c | 11 | ||||
-rw-r--r-- | gtk/endpoint_talkers_table.h | 94 | ||||
-rw-r--r-- | gtk/ethclist.h | 7 | ||||
-rw-r--r-- | gtk/ui_util.h | 4 |
15 files changed, 299 insertions, 63 deletions
diff --git a/gtk/about_dlg.h b/gtk/about_dlg.h index 2bf7480baf..46398d6acd 100644 --- a/gtk/about_dlg.h +++ b/gtk/about_dlg.h @@ -1,7 +1,7 @@ /* about_dlg.h * Declarations of routines for the "About" dialog * - * $Id: about_dlg.h,v 1.1 2004/05/21 08:44:45 guy Exp $ + * $Id: about_dlg.h,v 1.2 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -25,6 +25,15 @@ #ifndef __ABOUT_DLG_H__ #define __ABOUT_DLG_H__ -void about_ethereal_cb( GtkWidget *, gpointer); +/** @file + * "About" dialog box. + */ + +/** User requested the "About" dialog box by menu or toolbar. + * + * @param widget parent widget (unused) + * @param data unused + */ +void about_ethereal_cb( GtkWidget *widget, gpointer data); #endif /* __ABOUT_DLG_H__ */ diff --git a/gtk/capture_combo_utils.h b/gtk/capture_combo_utils.h index 87c4ba4fbb..337db59861 100644 --- a/gtk/capture_combo_utils.h +++ b/gtk/capture_combo_utils.h @@ -1,7 +1,7 @@ /* capture_combo_utils.c * Declarations of tilities for combo box of interface names * - * $Id: capture_combo_utils.h,v 1.1 2003/09/10 05:35:25 guy Exp $ + * $Id: capture_combo_utils.h,v 1.2 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -25,7 +25,21 @@ #ifndef __CAPTURE_COMBO_UTILS_H__ #define __CAPTURE_COMBO_UTILS_H__ +/** @file + * GList of available capture interfaces. + */ + +/** Build the GList of available capture interfaces. + * + * @param if_list the interface list from get_interface_list() + * @param do_hide hide the "hidden" interfaces + */ GList *build_capture_combo_list(GList *if_list, gboolean do_hide); + +/** Free the GList from build_capture_combo_list(). + * + * @param combo_list the interface list from build_capture_combo_list() + */ void free_capture_combo_list(GList *combo_list); #endif diff --git a/gtk/capture_prefs.h b/gtk/capture_prefs.h index b6f7a70dc3..1f5e06052c 100644 --- a/gtk/capture_prefs.h +++ b/gtk/capture_prefs.h @@ -1,7 +1,7 @@ /* capture_prefs.h * Definitions for capture preferences window * - * $Id: capture_prefs.h,v 1.2 2002/08/28 21:03:46 jmayer Exp $ + * $Id: capture_prefs.h,v 1.3 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -25,9 +25,32 @@ #ifndef __CAPTURE_PREFS_H__ #define __CAPTURE_PREFS_H__ +/** @file + * Capture preferences page. + */ + +/** Build a capture preferences page. + * + * @return the new capture preferences page + */ GtkWidget *capture_prefs_show(void); -void capture_prefs_fetch(GtkWidget *w); -void capture_prefs_apply(GtkWidget *w); -void capture_prefs_destroy(GtkWidget *w); + +/** Fetch preference values from page. + * + * @param widget widget from capture_prefs_show() + */ +void capture_prefs_fetch(GtkWidget *widget); + +/** Apply preference values from page. + * + * @param widget widget from capture_prefs_show() + */ +void capture_prefs_apply(GtkWidget *widget); + +/** Destroy preference values from page. + * + * @param widget widget from capture_prefs_show() + */ +void capture_prefs_destroy(GtkWidget *widget); #endif diff --git a/gtk/color_dlg.h b/gtk/color_dlg.h index bd772e5fd6..b67c1a2924 100644 --- a/gtk/color_dlg.h +++ b/gtk/color_dlg.h @@ -1,7 +1,7 @@ /* color_dlg.h * Definitions for dialog boxes for color filters * - * $Id: color_dlg.h,v 1.4 2003/10/07 10:07:47 sahlberg Exp $ + * $Id: color_dlg.h,v 1.5 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,8 +26,34 @@ #ifndef __COLOR_DLG_H__ #define __COLOR_DLG_H__ +/** @file + * "Colorize Display" dialog box. + */ + +/** User requested the "Colorize Display" dialog box by menu or toolbar. + * + * @param widget parent widget (unused) + * @param data unused + */ +void color_display_cb(GtkWidget *widget, gpointer data); + +/** Open the colorize dialogue and presets the filter string. + * + * @param filter the preset filter string + */ void color_display_with_filter(char *filter); -void color_display_cb(GtkWidget *w, gpointer d); + +/** Count the number of color filters. + * + * @return the number of color filters + */ int color_marked_count(void); + +/** Add a color filter. + * + * @param colorf the new color filter + * @param arg the color filter widget + */ void color_add_filter_cb (color_filter_t *colorf, gpointer arg); + #endif /* color_dlg.h */ diff --git a/gtk/color_filters.h b/gtk/color_filters.h index dc941a2a40..8c5d2bd573 100644 --- a/gtk/color_filters.h +++ b/gtk/color_filters.h @@ -1,7 +1,7 @@ /* color_filters.h * Definitions for color filters * - * $Id: color_filters.h,v 1.6 2004/04/16 19:36:36 guy Exp $ + * $Id: color_filters.h,v 1.7 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -24,18 +24,56 @@ #ifndef __COLOR_FILTERS_H__ #define __COLOR_FILTERS_H__ -#define CFILTERS_CONTAINS_FILTER(filter) \ - ((filter)->num_of_filters != 0) +/** @file + * Color filters. + */ +/** Init the color filters. */ void colfilter_init(void); +/** Save filters in users filter file. + * + * @return TRUE if write succeeded + */ gboolean write_filters(void); + +/** Delete users filter file and reload global filters. + * + * @return TRUE if write succeeded + */ gboolean revert_filters(void); +/** Create a new color filter. + * + * @param name the name of the filter + * @param filter_string the filter string + * @param bg_color background color + * @param fg_color foreground color + * @return the new color filter + */ color_filter_t *new_color_filter(gchar *name, gchar *filter_string, GdkColor *bg_color, GdkColor *fg_color); + +/** Remove the color filter. + * + * @param colorf the color filter to be removed + */ void remove_color_filter(color_filter_t *colorf); + +/** Load filters from some other filter file. + * + * @param path the path to the filter file + * @param arg the color filter widget + * @return TRUE, if read succeeded + */ gboolean read_other_filters(gchar *path, gpointer arg); + +/** Save filters to some other filter file. + * + * @param path the path to the filter file + * @param only_marked TRUE if only the marked filters should be saved + * @return TRUE, if write succeeded + */ gboolean write_other_filters(gchar *path, gboolean only_marked); #endif diff --git a/gtk/color_utils.h b/gtk/color_utils.h index 7d4ed44dfa..836595b425 100644 --- a/gtk/color_utils.h +++ b/gtk/color_utils.h @@ -2,7 +2,7 @@ * Declarations of utilities for converting between "toolkit-independent" * and GDK notions of color * - * $Id: color_utils.h,v 1.2 2002/08/28 21:03:46 jmayer Exp $ + * $Id: color_utils.h,v 1.3 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -27,7 +27,23 @@ #ifndef __COLOR_UTILS_H__ #define __COLOR_UTILS_H__ -void color_t_to_gdkcolor(GdkColor *, color_t *); -void gdkcolor_to_color_t(color_t *, GdkColor *); +/** @file + * Utilities for converting between "toolkit-independent" + * and GDK notions of color. + */ + +/** Convert color_t to GdkColor. + * + * @param target the GdkColor to be filled + * @param source the source color_t + */ +void color_t_to_gdkcolor(GdkColor *target, color_t *source); + +/** Convert GdkColor to color_t. + * + * @param target the source color_t + * @param source the GdkColor to be filled + */ +void gdkcolor_to_color_t(color_t *target, GdkColor *source); #endif diff --git a/gtk/colors.h b/gtk/colors.h index de7e117c30..f66a522eaf 100644 --- a/gtk/colors.h +++ b/gtk/colors.h @@ -1,7 +1,7 @@ /* colors.h * Definitions for color structures and routines * - * $Id: colors.h,v 1.11 2003/01/08 01:59:42 guy Exp $ + * $Id: colors.h,v 1.12 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -24,10 +24,24 @@ #ifndef __COLORS_H__ #define __COLORS_H__ +/** @file + * Definitions for color structures and routines + */ + +/** The color white. */ extern GdkColor WHITE; + +/** The color black. */ extern GdkColor BLACK; +/** Initialize the colors. */ void colors_init(void); + +/** Allocate a color from the color map. + * + * @param new_color the new color + * @return TRUE if the allocation succeeded + */ gboolean get_color(GdkColor *new_color); #endif diff --git a/gtk/column_prefs.h b/gtk/column_prefs.h index 7aa4860115..768de5e427 100644 --- a/gtk/column_prefs.h +++ b/gtk/column_prefs.h @@ -1,7 +1,7 @@ /* column_prefs.h * Definitions for column preferences window * - * $Id: column_prefs.h,v 1.4 2002/09/05 18:47:45 jmayer Exp $ + * $Id: column_prefs.h,v 1.5 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,9 +26,32 @@ #ifndef __COLUMN_PREFS_H__ #define __COLUMN_PREFS_H__ +/** @file + * Column preferences page. + */ + +/** Build a column preferences page. + * + * @return the new column preferences page + */ GtkWidget *column_prefs_show(void); -void column_prefs_fetch(GtkWidget *); -void column_prefs_apply(GtkWidget *); -void column_prefs_destroy(GtkWidget *); + +/** Fetch preference values from page. + * + * @param widget widget from column_prefs_show() + */ +void column_prefs_fetch(GtkWidget *widget); + +/** Apply preference values from page. + * + * @param widget widget from column_prefs_show() + */ +void column_prefs_apply(GtkWidget *widget); + +/** Destroy preference values from page. + * + * @param widget widget from column_prefs_show() + */ +void column_prefs_destroy(GtkWidget *widget); #endif diff --git a/gtk/decode_as_dlg.h b/gtk/decode_as_dlg.h index bb4c07f155..0f1e547722 100644 --- a/gtk/decode_as_dlg.h +++ b/gtk/decode_as_dlg.h @@ -1,6 +1,6 @@ /* decode_as_dlg.h * - * $Id: decode_as_dlg.h,v 1.4 2002/09/05 18:47:45 jmayer Exp $ + * $Id: decode_as_dlg.h,v 1.5 2004/06/01 20:28:04 ulfl Exp $ * * Routines to modify dissector tables on the fly. * @@ -26,8 +26,29 @@ #ifndef __DECODE_AS_DLG_H__ #define __DECODE_AS_DLG_H__ -void decode_as_cb(GtkWidget *, gpointer); -void decode_show_cb(GtkWidget *, gpointer); +/** @file + * "Decode As" / "User Specified Decodes" dialog box. + */ + +/** User requested the "Decode As" dialog box by menu or toolbar. + * + * @param widget parent widget (unused) + * @param data unused + */ +void decode_as_cb(GtkWidget *widget, gpointer data); + +/** User requested the "User Specified Decodes" dialog box by menu or toolbar. + * + * @param widget parent widget (unused) + * @param data unused + */ +void decode_show_cb(GtkWidget *widget, gpointer data); + +/** Have any pages in the notebook in a "Decode As" dialog box? If there + * wouldn't be, we inactivate the menu item for "Decode As". + * + * @return TRUE, if we have at least one notebook page in "Decode As" + */ gboolean decode_as_ok(void); #endif diff --git a/gtk/dfilter_expr_dlg.h b/gtk/dfilter_expr_dlg.h index 047e8160f8..fd9d02c986 100644 --- a/gtk/dfilter_expr_dlg.h +++ b/gtk/dfilter_expr_dlg.h @@ -1,7 +1,7 @@ /* dfilter_expr_dlg.h * Definitions for dialog boxes for display filter expression construction * - * $Id: dfilter_expr_dlg.h,v 1.2 2002/08/28 21:03:46 jmayer Exp $ + * $Id: dfilter_expr_dlg.h,v 1.3 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,6 +26,14 @@ #ifndef __DFILTER_EXPR_DLG_H__ #define __DFILTER_EXPR_DLG_H__ -void dfilter_expr_dlg_new(GtkWidget *); +/** @file + * "Add Expression" dialog box. + */ + +/** User requested the "Add Expression" dialog box by menu or toolbar. + * + * @param widget corresponding text entry widget + */ +void dfilter_expr_dlg_new(GtkWidget *widget); #endif /* dfilter_expr_dlg.h */ diff --git a/gtk/dlg_utils.h b/gtk/dlg_utils.h index 3bf2458b7b..8516a57346 100644 --- a/gtk/dlg_utils.h +++ b/gtk/dlg_utils.h @@ -1,7 +1,7 @@ /* dlg_utils.h * Declarations of utilities to use when constructing dialogs * - * $Id: dlg_utils.h,v 1.18 2004/06/01 17:33:36 ulfl Exp $ + * $Id: dlg_utils.h,v 1.19 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -23,7 +23,7 @@ */ /** @file - * Utility functions for dialog boxes, depending on the window functions in + * Utilities for dialog boxes, depending on the window functions in * ui_util.h. These dialog box windows will be related to Ethereal's main * window. See window_new() and others in ui_util.h for further explanation * of dialogs and windows in Ethereal. diff --git a/gtk/endpoint_talkers_table.c b/gtk/endpoint_talkers_table.c index 6b2e7756c3..5518dac659 100644 --- a/gtk/endpoint_talkers_table.c +++ b/gtk/endpoint_talkers_table.c @@ -4,7 +4,7 @@ * endpoint_talkers_table 2003 Ronnie Sahlberg * Helper routines common to all endpoint talkers tap. * - * $Id: endpoint_talkers_table.c,v 1.40 2004/05/23 23:24:05 ulfl Exp $ + * $Id: endpoint_talkers_table.c,v 1.41 2004/06/01 20:28:04 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -922,11 +922,13 @@ static GtkItemFactoryEntry ett_list_menu_items[] = static void ett_create_popup_menu(endpoints_table *et) { - et->item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL); + GtkItemFactory *item_factory; - gtk_item_factory_create_items_ac(et->item_factory, sizeof(ett_list_menu_items)/sizeof(ett_list_menu_items[0]), ett_list_menu_items, et, 2); + item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL); - et->menu = gtk_item_factory_get_widget(et->item_factory, "<main>"); + gtk_item_factory_create_items_ac(item_factory, sizeof(ett_list_menu_items)/sizeof(ett_list_menu_items[0]), ett_list_menu_items, et, 2); + + et->menu = gtk_item_factory_get_widget(item_factory, "<main>"); SIGNAL_CONNECT(et->table, "button_press_event", ett_show_popup_menu_cb, et); } @@ -1066,6 +1068,7 @@ init_ett_table_page(endpoints_table *talkers, GtkWidget *vbox, gboolean hide_por GtkWidget *label; char title[256]; char *default_titles[] = { "Address A", "Port A", "Address B", "Port B", "Packets", "Bytes", "-> Packets", "-> Bytes", "<- Packets", "<- Bytes" }; + GtkWidget *scrolled_window; g_snprintf(title, 255, "%s Conversations", table_name); diff --git a/gtk/endpoint_talkers_table.h b/gtk/endpoint_talkers_table.h index b4119e6f8d..6dad98ca42 100644 --- a/gtk/endpoint_talkers_table.h +++ b/gtk/endpoint_talkers_table.h @@ -2,7 +2,7 @@ * endpoint_talkers_table 2003 Ronnie Sahlberg * Helper routines common to all endpoint talkers taps. * - * $Id: endpoint_talkers_table.h,v 1.10 2004/05/03 22:15:21 ulfl Exp $ + * $Id: endpoint_talkers_table.h,v 1.11 2004/06/01 20:28:05 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -23,43 +23,79 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/** @file + * Conversation definitions. + */ + +/** Address type */ +typedef enum { + SAT_NONE, /**< no address type */ + SAT_ETHER, /**< ethernet */ + SAT_FDDI, /**< fddi */ + SAT_TOKENRING /**< token ring */ +} SAT_E; + +/** Conversation information */ typedef struct _endpoint_talker_t { - address src_address; - address dst_address; - guint32 sat; - guint32 port_type; - guint32 src_port; - guint32 dst_port; + address src_address; /**< source address */ + address dst_address; /**< destination address */ + SAT_E sat; /**< address type */ + guint32 port_type; /**< port_type (e.g. PT_TCP) */ + guint32 src_port; /**< source port */ + guint32 dst_port; /**< destination port */ - guint32 rx_frames; - guint32 tx_frames; - guint32 rx_bytes; - guint32 tx_bytes; + guint32 rx_frames; /**< number of received packets */ + guint32 tx_frames; /**< number of transmitted packets */ + guint32 rx_bytes; /**< number of received bytes */ + guint32 tx_bytes; /**< number of transmitted bytes */ } endpoint_talker_t; +/** Conversation widget */ typedef struct _endpoints_table { - char *name; - GtkWidget *win; - GtkWidget *page_lb; - GtkWidget *scrolled_window; - GtkCList *table; - GtkItemFactory *item_factory; - GtkWidget *menu; - gboolean has_ports; - guint32 num_endpoints; - endpoint_talker_t *endpoints; - gboolean resolve_names; + char *name; /**< the name of the table */ + GtkWidget *win; /**< GTK window */ + GtkWidget *page_lb; /**< label */ + GtkCList *table; /**< the GTK table */ + GtkWidget *menu; /**< context menu */ + gboolean has_ports; /**< table has ports */ + guint32 num_endpoints; /**< number of endpoints (0 or 1) */ + endpoint_talker_t *endpoints; /**< array of conversation values */ + gboolean resolve_names; /**< resolve address names? */ } endpoints_table; - +/** Register the conversation table for the multiple conversation window. + * + * @param hide_ports hide the port columns + * @param table_name the table name to be displayed + * @param tap_name the registered tap name + * @param filter the optional filter name or NULL + * @param packet_func the function to be called for each incoming packet + */ extern void register_ett_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func); +/** Init the conversation table for the single conversation window. + * + * @param hide_ports hide the port columns + * @param table_name the table name to be displayed + * @param tap_name the registered tap name + * @param filter the optional filter name or NULL + * @param packet_func the function to be called for each incoming packet + * @todo get values from register_ett_table() instead of own parameters + */ extern void init_ett_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func); - -#define SAT_NONE 0 -#define SAT_ETHER 1 -#define SAT_FDDI 2 -#define SAT_TOKENRING 3 -void add_ett_table_data(endpoints_table *et, address *src, address *dst, guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, int sat, int port_type); +/** Add some data to the table. + * + * @param et the table to add the data to + * @param src source address + * @param dst destination address + * @param src_port source port + * @param dst_port destination port + * @param num_frames number of packets + * @param num_bytes number of bytes + * @param sat address type + * @param port_type the port type (e.g. PT_TCP) + */ +extern void add_ett_table_data(endpoints_table *et, address *src, address *dst, + guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type); diff --git a/gtk/ethclist.h b/gtk/ethclist.h index 80e63fffdd..21432480ae 100644 --- a/gtk/ethclist.h +++ b/gtk/ethclist.h @@ -2,7 +2,7 @@ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald * Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org> * - * $Id: ethclist.h,v 1.2 2004/02/20 22:37:50 guy Exp $ + * $Id: ethclist.h,v 1.3 2004/06/01 20:28:05 ulfl Exp $ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,6 +27,11 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** @file + * GtkCList for GTK1.2 libs, copied from GTK sources. + * @todo is this correct? + */ + #ifndef __ETH_CLIST_H__ #define __ETH_CLIST_H__ diff --git a/gtk/ui_util.h b/gtk/ui_util.h index 06ca936673..fc2e876582 100644 --- a/gtk/ui_util.h +++ b/gtk/ui_util.h @@ -1,7 +1,7 @@ /* ui_util.h * Definitions for UI utility routines * - * $Id: ui_util.h,v 1.12 2004/05/31 15:47:34 ulfl Exp $ + * $Id: ui_util.h,v 1.13 2004/06/01 20:28:05 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -27,7 +27,7 @@ /** @file - * Windows and other user interface related utility functions. + * Utilities for Windows and other user interface functions. * * Some words about windows / dialogs. * |