aboutsummaryrefslogtreecommitdiffstats
path: root/xdlc.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-12 04:48:32 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-12 04:48:32 +0000
commit929f70ac0b14506508e6de9dc357608b91667120 (patch)
tree0b5f52ee7613baacc77f73697eb895592aa6a137 /xdlc.c
parent45942c1c41dfad28ac1aeca038e69c888d9a95c4 (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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1713 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'xdlc.c')
-rw-r--r--xdlc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xdlc.c b/xdlc.c
index 3b0e97f37c..d6a99c9bb5 100644
--- a/xdlc.c
+++ b/xdlc.c
@@ -2,7 +2,7 @@
* Routines for use by various SDLC-derived protocols, such as HDLC
* and its derivatives LAPB, IEEE 802.2 LLC, etc..
*
- * $Id: xdlc.c,v 1.11 2000/01/07 22:05:43 guy Exp $
+ * $Id: xdlc.c,v 1.12 2000/03/12 04:47:55 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -249,7 +249,7 @@ dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
col_add_str(fd, COL_INFO, info);
if (xdlc_tree) {
if (is_extended) {
- tc = proto_tree_add_item_format(xdlc_tree, hf_xdlc_control,
+ tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control,
offset, 2,
frame_type,
"Control field: %s (0x%04X)", info, control);
@@ -270,7 +270,7 @@ dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
decode_boolean_bitfield(control, 0x03, 2*8,
"Supervisory frame", NULL));
} else {
- tc = proto_tree_add_item_format(xdlc_tree, hf_xdlc_control,
+ tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control,
offset, 1,
frame_type,
"Control field: %s (0x%02X)", info, control);
@@ -323,7 +323,7 @@ dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
if (check_col(fd, COL_INFO))
col_add_str(fd, COL_INFO, info);
if (xdlc_tree) {
- tc = proto_tree_add_item_format(xdlc_tree, hf_xdlc_control,
+ tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control,
offset, 1,
frame_type,
"Control field: %s (0x%02X)", info, control);
@@ -366,7 +366,7 @@ dissect_xdlc_control(const u_char *pd, int offset, frame_data *fd,
if (check_col(fd, COL_INFO))
col_add_str(fd, COL_INFO, info);
if (xdlc_tree) {
- tc = proto_tree_add_item_format(xdlc_tree, hf_xdlc_control,
+ tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control,
offset, (is_extended) ? 2 : 1,
frame_type,
(is_extended) ? "Control field: %s (0x%04X)"