diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-01-22 04:59:55 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-01-22 04:59:55 +0000 |
commit | 0b41709f86e069cb8b94a9fadec050eb6a0514dd (patch) | |
tree | 502a5ad1571c24b090b3258cdac69594997058f2 /proto.h | |
parent | 5b5f2271cd73724314f49be784c4b56672722b43 (diff) | |
download | wireshark-0b41709f86e069cb8b94a9fadec050eb6a0514dd.tar.gz wireshark-0b41709f86e069cb8b94a9fadec050eb6a0514dd.tar.bz2 wireshark-0b41709f86e069cb8b94a9fadec050eb6a0514dd.zip |
Add "proto_item_set_text()", which sets the "representation" field of an
existing protocol tree item.
Add "proto_tree_add_notext()"; it's just like "proto_tree_add_text()",
but without the text, and it sets the "representation" field to NULL;
that field would be set later with "proto_item_set_text()".
Those routines let you construct, for example, an interior node of the
protocol tree whose text can't be determined until all the nodes under
it have been dissected - it's similar to "proto_item_set_len()" in that
fashion.
Use that when dissecting address TLVs in the CDP dissector - create the
item for an address in an "Addresses" TLV with no text, and then fill in
the items under it one at a time; if we get cut off before we get to the
actual address, set the text to "Truncated address", otherwise set it to
a description of the address.
Also, set the length of the item for the entire address TLV correctly.
svn path=/trunk/; revision=1520
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.20 1999/11/16 11:43:07 guy Exp $ + * $Id: proto.h,v 1.21 2000/01/22 04:59:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -151,6 +151,9 @@ void proto_init(void); /* Frees memory used by proto routines. Called at program shutdown */ void proto_cleanup(void); +/* Set text of proto_item after having already been created. */ +void proto_item_set_text(proto_item *ti, ...); + /* Set length of proto_item after having already been created. */ void proto_item_set_len(proto_item *ti, gint length); @@ -189,6 +192,9 @@ proto_tree_add_item_format(proto_tree *tree, int hfindex, gint start, gint length, ...); proto_item * +proto_tree_add_notext(proto_tree *tree, gint start, gint length, ...); + +proto_item * proto_tree_add_text(proto_tree *tree, gint start, gint length, ...); void |