diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
commit | 7bd2e232a9994756ba0f97d4d93ce64fe885e7df (patch) | |
tree | 564e732958fa7b21a0ce2aaf6f0123b674ea3a71 /gtk/dfilter_expr_dlg.c | |
parent | 21313199e4282797e5cbebb039c417cf8fca739f (diff) | |
download | wireshark-7bd2e232a9994756ba0f97d4d93ce64fe885e7df.tar.gz |
Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.
Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).
Change some direct dissector calls to go through handles.
svn path=/trunk/; revision=8979
Diffstat (limited to 'gtk/dfilter_expr_dlg.c')
-rw-r--r-- | gtk/dfilter_expr_dlg.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c index 7318583fbb..8eb655b578 100644 --- a/gtk/dfilter_expr_dlg.c +++ b/gtk/dfilter_expr_dlg.c @@ -7,7 +7,7 @@ * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> and * Guy Harris <guy@alum.mit.edu> * - * $Id: dfilter_expr_dlg.c,v 1.42 2003/10/29 23:15:35 guy Exp $ + * $Id: dfilter_expr_dlg.c,v 1.43 2003/11/16 23:17:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1093,6 +1093,7 @@ dfilter_expr_dlg_new(GtkWidget *filter_te) GtkWidget *list_bb, *alignment, *accept_bt, *close_bt; header_field_info *hfinfo; int i; + protocol_t *protocol; #if GTK_MAJOR_VERSION < 2 int len; void *cookie; @@ -1306,7 +1307,8 @@ dfilter_expr_dlg_new(GtkWidget *filter_te) hfinfo = proto_registrar_get_nth(i); /* Create a node for the protocol, and remember it for later use. */ - name = proto_get_protocol_short_name(i); /* name, short_name or filter name ? */ + protocol = find_protocol_by_id(i); + name = proto_get_protocol_short_name(protocol); /* name, short_name or filter name ? */ protocol_node = gtk_ctree_insert_node(GTK_CTREE(tree), NULL, NULL, &name, 5, @@ -1381,7 +1383,8 @@ dfilter_expr_dlg_new(GtkWidget *filter_te) char *strp, str[TAG_STRING_LEN+1]; hfinfo = proto_registrar_get_nth(i); - name = proto_get_protocol_short_name(i); /* name, short_name or filter name ? */ + protocol = find_protocol_by_id(i); + name = proto_get_protocol_short_name(protocol); /* name, short_name or filter name ? */ gtk_tree_store_append(store, &iter, NULL); gtk_tree_store_set(store, &iter, 0, name, 1, hfinfo, -1); |