aboutsummaryrefslogtreecommitdiffstats
path: root/proto.h
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-08-26 07:01:44 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-08-26 07:01:44 +0000
commit8b2e03eea6229b300b3de3322f14c446d0c303e9 (patch)
tree67b0e784b1fe92f69ccda200009be6c647ab1028 /proto.h
parentae356ef145c26c64b1fd5594d8159376c963e6a0 (diff)
downloadwireshark-8b2e03eea6229b300b3de3322f14c446d0c303e9.tar.gz
wireshark-8b2e03eea6229b300b3de3322f14c446d0c303e9.tar.bz2
wireshark-8b2e03eea6229b300b3de3322f14c446d0c303e9.zip
Introduces a new global gboolean variable: proto_tree_is_visible.
This is set before calling dissect_packet() to let the proto_tree routines whether or not it needs to go through the trouble of formatting strings. The use of this dramatically decreases the number of calls to vsnprintf. svn path=/trunk/; revision=583
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/proto.h b/proto.h
index 6383cae914..5a124f7449 100644
--- a/proto.h
+++ b/proto.h
@@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
- * $Id: proto.h,v 1.7 1999/08/26 06:20:50 gram Exp $
+ * $Id: proto.h,v 1.8 1999/08/26 07:01:44 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -157,12 +157,22 @@ proto_tree_add_text(proto_tree *tree, gint start, gint length, ...);
void
proto_item_fill_label(field_info *fi, gchar *label_str);
-/* useful functions for external routines to get info about registered protos and fields */
+/* Returns number of items (protocols or header fields) registered. */
int proto_registrar_n(void);
+
+/* Returns char* to abbrev for item # n (0-indexed) */
char* proto_registrar_get_abbrev(int n);
+
+/* Returns enum ftenum for item # n */
int proto_registrar_get_ftype(int n);
+
+/* Returns parent protocol for item # n.
+ * Returns -1 if item _is_ a protocol */
int proto_registrar_get_parent(int n);
+
+/* Is item #n a protocol? */
gboolean proto_registrar_is_protocol(int n);
+
proto_item* proto_find_field(proto_tree* tree, int id);
proto_item* proto_find_protocol(proto_tree* tree, int protocol_id);
void proto_get_field_values(proto_tree* subtree, GNodeTraverseFunc fill_array_func,
@@ -171,4 +181,10 @@ void proto_get_field_values(proto_tree* subtree, GNodeTraverseFunc fill_array_fu
/* Dumps a glossary of the protocol and field registrations to STDOUT */
void proto_registrar_dump(void);
+/* Is the parsing being done for a visible proto_tree or an invisible one?
+ * By setting this correctly, the proto_tree creation is sped up by not
+ * having to call vsnprintf and copy strings around.
+ */
+extern gboolean proto_tree_is_visible;
+
#endif /* proto.h */