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-lapb.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-lapb.c')
-rw-r--r-- | packet-lapb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-lapb.c b/packet-lapb.c index 011b5366af..8690c88b7c 100644 --- a/packet-lapb.c +++ b/packet-lapb.c @@ -2,7 +2,7 @@ * Routines for lapb frame disassembly * Olivier Abad <abad@daba.dhis.net> * - * $Id: packet-lapb.c,v 1.10 2000/02/15 21:02:29 gram Exp $ + * $Id: packet-lapb.c,v 1.11 2000/03/12 04:47:42 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -64,8 +64,8 @@ dissect_lapb(const u_char *pd, frame_data *fd, proto_tree *tree) if (check_col(fd, COL_INFO)) col_add_str(fd, COL_INFO, "Invalid LAPB frame"); if (tree) - ti = proto_tree_add_item_format(tree, proto_lapb, 0, fd->cap_len, - NULL, "Invalid LAPB frame"); + ti = proto_tree_add_protocol_format(tree, proto_lapb, 0, fd->cap_len, + "Invalid LAPB frame"); return; } @@ -89,10 +89,10 @@ dissect_lapb(const u_char *pd, frame_data *fd, proto_tree *tree) is_response = FALSE; if (tree) { - ti = proto_tree_add_item_format(tree, proto_lapb, 0, 2, NULL, + ti = proto_tree_add_protocol_format(tree, proto_lapb, 0, 2, "LAPB"); lapb_tree = proto_item_add_subtree(ti, ett_lapb); - proto_tree_add_item_format(lapb_tree, hf_lapb_address, 0, 1, pd[0], + proto_tree_add_uint_format(lapb_tree, hf_lapb_address, 0, 1, pd[0], "Address: 0x%02X", pd[0]); } else @@ -109,7 +109,7 @@ proto_register_lapb(void) { static hf_register_info hf[] = { { &hf_lapb_address, - { "Address Field", "lapb.address", FT_UINT8, BASE_DEC, NULL, 0x0, + { "Address Field", "lapb.address", FT_UINT8, BASE_HEX, NULL, 0x0, "" }}, { &hf_lapb_control, |