diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
commit | f6e92a9e939a28327eea49b5931715ba97a62970 (patch) | |
tree | 0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-vtp.c | |
parent | 3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (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-vtp.c')
-rw-r--r-- | packet-vtp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-vtp.c b/packet-vtp.c index d53fb13a6e..3374e047e1 100644 --- a/packet-vtp.c +++ b/packet-vtp.c @@ -1,7 +1,7 @@ /* packet-vtp.c * Routines for the disassembly of Cisco's Virtual Trunking Protocol * - * $Id: packet-vtp.c,v 1.1 2000/02/05 09:19:04 guy Exp $ + * $Id: packet-vtp.c,v 1.2 2000/03/12 04:47:51 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -131,7 +131,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) 1, md_len); offset += 1; - proto_tree_add_item_format(vtp_tree, hf_vtp_md, offset, + proto_tree_add_string_format(vtp_tree, hf_vtp_md, offset, 32, &pd[offset], "Management Domain: %.32s", &pd[offset]); offset += 32; @@ -144,7 +144,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) offset, 4, &pd[offset]); offset += 4; - proto_tree_add_item_format(vtp_tree, hf_vtp_upd_ts, + proto_tree_add_string_format(vtp_tree, hf_vtp_upd_ts, offset, 12, &pd[offset], "Update Timestamp: %.2s-%.2s-%.2s %.2s:%.2s:%.2s", &pd[offset], &pd[offset+2], &pd[offset+4], @@ -165,7 +165,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) 1, md_len); offset += 1; - proto_tree_add_item_format(vtp_tree, hf_vtp_md, offset, + proto_tree_add_string_format(vtp_tree, hf_vtp_md, offset, 32, &pd[offset], "Management Domain: %.32s", &pd[offset]); offset += 32; @@ -207,7 +207,7 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) 1, md_len); offset += 1; - proto_tree_add_item_format(vtp_tree, hf_vtp_md, offset, + proto_tree_add_string_format(vtp_tree, hf_vtp_md, offset, 32, &pd[offset], "Management Domain: %.32s", &pd[offset]); offset += 32; @@ -341,7 +341,7 @@ dissect_vlan_info(const u_char *pd, int offset, proto_tree *tree) if (!BYTES_ARE_IN_FRAME(offset, vlan_name_len) || vlan_info_left < vlan_name_len) return -1; - proto_tree_add_item_format(vlan_info_tree, hf_vtp_vlan_name, offset, + proto_tree_add_string_format(vlan_info_tree, hf_vtp_vlan_name, offset, vlan_name_len, &pd[offset], "VLAN Name: %.*s", vlan_name_len, &pd[offset]); offset += vlan_name_len; |