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-osi.c | |
parent | 3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (diff) | |
download | wireshark-f6e92a9e939a28327eea49b5931715ba97a62970.tar.gz wireshark-f6e92a9e939a28327eea49b5931715ba97a62970.tar.bz2 wireshark-f6e92a9e939a28327eea49b5931715ba97a62970.zip |
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-osi.c')
-rw-r--r-- | packet-osi.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet-osi.c b/packet-osi.c index a831b5b00e..1359d249a8 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -1,7 +1,7 @@ /* packet-osi.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-osi.c,v 1.22 2000/03/02 07:27:05 guy Exp $ + * $Id: packet-osi.c,v 1.23 2000/03/12 04:47:45 gram Exp $ * Laurent Deniel <deniel@worldnet.fr> * * Ethereal - Network traffic analyzer @@ -1499,7 +1499,7 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, if (tree) { ti = proto_tree_add_item(tree, proto_clnp, offset, 1, NULL); clnp_tree = proto_item_add_subtree(ti, ett_clnp); - proto_tree_add_item_format(clnp_tree, hf_clnp_id, offset, 1, + proto_tree_add_uint_format(clnp_tree, hf_clnp_id, offset, 1, clnp.cnf_proto_id, "Inactive subset"); } @@ -1529,11 +1529,11 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, clnp.cnf_hdr_len); proto_tree_add_item(clnp_tree, hf_clnp_version, offset + 2, 1, clnp.cnf_vers); - proto_tree_add_item_format(clnp_tree, hf_clnp_ttl, offset + 3, 1, + proto_tree_add_uint_format(clnp_tree, hf_clnp_ttl, offset + 3, 1, clnp.cnf_ttl, "TTL: %d (%d secs)", clnp.cnf_ttl, clnp.cnf_ttl / 2); - proto_tree_add_item_format(clnp_tree, hf_clnp_type, offset + 4, 1, + proto_tree_add_uint_format(clnp_tree, hf_clnp_type, offset + 4, 1, clnp.cnf_type, "Type code: 0x%02x (%s%s%s%s)", clnp.cnf_type, @@ -1544,7 +1544,7 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, "DT" : "ER"); proto_tree_add_item(clnp_tree, hf_clnp_pdu_length, offset + 5, 2, EXTRACT_SHORT(&clnp.cnf_seglen_msb)); - proto_tree_add_item_format(clnp_tree, hf_clnp_checksum, offset + 7, 2, + proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, offset + 7, 2, EXTRACT_SHORT(&clnp.cnf_cksum_msb), "Checksum: 0x%04x", EXTRACT_SHORT(&clnp.cnf_cksum_msb)); @@ -1567,13 +1567,13 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, if (tree) { proto_tree_add_item(clnp_tree, hf_clnp_dest_length, offset, 1, dst_len); - proto_tree_add_item_format(clnp_tree, hf_clnp_dest, offset + 1 , dst_len, + proto_tree_add_bytes_format(clnp_tree, hf_clnp_dest, offset + 1 , dst_len, &pd[offset + 1], "Destination address: %s", print_nsap(&pd[offset + 1], dst_len)); proto_tree_add_item(clnp_tree, hf_clnp_src_length, offset + 1 + dst_len, 1, src_len); - proto_tree_add_item_format(clnp_tree, hf_clnp_src, + proto_tree_add_bytes_format(clnp_tree, hf_clnp_src, offset + dst_len + 2, src_len, &pd[offset + dst_len + 2], "Source address: %s", |