aboutsummaryrefslogtreecommitdiffstats
path: root/packet-isis-hello.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-03-12 04:48:32 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-03-12 04:48:32 +0000
commitf6e92a9e939a28327eea49b5931715ba97a62970 (patch)
tree0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-isis-hello.c
parent3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (diff)
Break proto_tree_add_item_format() into multiple functions:
proto_tree_add_protocol_format() proto_tree_add_uint_format() proto_tree_add_ipxnet_format() proto_tree_add_ipv4_format() proto_tree_add_ipv6_format() proto_tree_add_bytes_format() proto_tree_add_string_format() proto_tree_add_ether_format() proto_tree_add_time_format() proto_tree_add_double_format() proto_tree_add_boolean_format() If using GCC 2.x, we can check the print-format against the variable args passed in. Regardless of compiler, we can now check at run-time that the field type passed into the function corresponds to what that function expects (FT_UINT, FT_BOOLEAN, etc.) Note that proto_tree_add_protocol_format() does not require a value field, since the value of a protocol is always NULL. It's more intuitive w/o the vestigial argument. Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*) Checked in Guy's fix for the function declearation for proto_tree_add_text() and proto_tree_add_notext(). svn path=/trunk/; revision=1713
Diffstat (limited to 'packet-isis-hello.c')
-rw-r--r--packet-isis-hello.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-isis-hello.c b/packet-isis-hello.c
index 1710e05a7f..4e6606c84d 100644
--- a/packet-isis-hello.c
+++ b/packet-isis-hello.c
@@ -1,7 +1,7 @@
/* packet-isis-hello.c
* Routines for decoding isis hello packets and their CLVs
*
- * $Id: packet-isis-hello.c,v 1.2 2000/01/24 03:33:33 guy Exp $
+ * $Id: packet-isis-hello.c,v 1.3 2000/03/12 04:47:41 gram Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@@ -440,7 +440,7 @@ isis_dissect_isis_hello(int hello_type, int header_length,
ti = proto_tree_add_item(tree, proto_isis_hello,
offset, END_OF_FRAME, NULL);
hello_tree = proto_item_add_subtree(ti, ett_isis_hello);
- proto_tree_add_item_format(hello_tree,
+ proto_tree_add_uint_format(hello_tree,
hf_isis_hello_circuit_reserved,
offset, 1, ihp->isis_hello_circuit_reserved,
"Circuit type: %s, reserved(0x%02x == 0)",
@@ -450,7 +450,7 @@ isis_dissect_isis_hello(int hello_type, int header_length,
ihp->isis_hello_creserved
);
- proto_tree_add_item_format(hello_tree, hf_isis_hello_lan_id,
+ proto_tree_add_string_format(hello_tree, hf_isis_hello_lan_id,
offset + 1, 6, ihp->isis_hello_source_id,
"Lan ID: %02x%02x.%02x%02x.%02x%02x",
ihp->isis_hello_lan_id[0],
@@ -463,18 +463,18 @@ isis_dissect_isis_hello(int hello_type, int header_length,
offset + 7, 2,pntohs(&ihp->isis_hello_holding_timer[0]));
proto_tree_add_item(hello_tree, hf_isis_hello_pdu_length,
offset + 9, 2,pntohs(&ihp->isis_hello_pdu_length[0]));
- proto_tree_add_item_format(hello_tree,
+ proto_tree_add_uint_format(hello_tree,
hf_isis_hello_priority_reserved,
offset + 11, 1, ihp->isis_hello_priority_reserved,
"Priority: %d, reserved(0x%02x == 0)",
ihp->isis_hello_priority,
ihp->isis_hello_preserved );
if (hello_type == ISIS_TYPE_PTP_HELLO) {
- proto_tree_add_item_format(hello_tree,
+ proto_tree_add_item(hello_tree,
hf_isis_hello_local_circuit_id,
offset + 12, 1, ihp->isis_hello_lan_id[0] );
} else {
- proto_tree_add_item_format(hello_tree,
+ proto_tree_add_string_format(hello_tree,
hf_isis_hello_lan_id, offset + 12, 7,
ihp->isis_hello_lan_id,
"Lan ID: %02x%02x.%02x%02x.%02x%02x-%02d",