aboutsummaryrefslogtreecommitdiffstats
path: root/packet-mip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
commit283ce59938ad2be252a6232e40a958e177a40e1a (patch)
treeb451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-mip.c
parentaa553f63ecc7b9e310a05b743502c50f6dffb800 (diff)
Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031
Diffstat (limited to 'packet-mip.c')
-rw-r--r--packet-mip.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/packet-mip.c b/packet-mip.c
index c216273987..ce71552fd1 100644
--- a/packet-mip.c
+++ b/packet-mip.c
@@ -2,7 +2,7 @@
* Routines for Mobile IP dissection
* Copyright 2000, Stefan Raab <Stefan.Raab@nextel.com>
*
- * $Id: packet-mip.c,v 1.3 2000/05/27 17:51:15 guy Exp $
+ * $Id: packet-mip.c,v 1.4 2000/05/31 05:07:18 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -165,23 +165,23 @@ dissect_mip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
col_add_str(fd, COL_INFO, "Mobile IP Registration Request");
if (tree) {
- ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), NULL);
+ ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), FALSE);
mip_tree = proto_item_add_subtree(ti, ett_mip);
- proto_tree_add_item(mip_tree, hf_mip_type, 0, 1, type);
+ proto_tree_add_int(mip_tree, hf_mip_type, tvb, 0, 1, type);
code = tvb_get_guint8(tvb, 1);
- proto_tree_add_item(mip_tree, hf_mip_s, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_b, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_d, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_m, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_g, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_v, tvb, 1, 1, code);
-
- proto_tree_add_item(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2));
- proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4));
- proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8));
- proto_tree_add_item(mip_tree, hf_mip_coa, tvb, 12, 4, tvb_get_letohl(tvb, 12));
- proto_tree_add_item(mip_tree, hf_mip_ident, tvb, 16, 8, tvb_get_ptr(tvb, 16, 8));
+ proto_tree_add_boolean(mip_tree, hf_mip_s, tvb, 1, 1, code);
+ proto_tree_add_boolean(mip_tree, hf_mip_b, tvb, 1, 1, code);
+ proto_tree_add_boolean(mip_tree, hf_mip_d, tvb, 1, 1, code);
+ proto_tree_add_boolean(mip_tree, hf_mip_m, tvb, 1, 1, code);
+ proto_tree_add_boolean(mip_tree, hf_mip_g, tvb, 1, 1, code);
+ proto_tree_add_boolean(mip_tree, hf_mip_v, tvb, 1, 1, code);
+
+ proto_tree_add_int(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2));
+ proto_tree_add_ipv4(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4));
+ proto_tree_add_ipv4(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8));
+ proto_tree_add_ipv4(mip_tree, hf_mip_coa, tvb, 12, 4, tvb_get_letohl(tvb, 12));
+ proto_tree_add_bytes(mip_tree, hf_mip_ident, tvb, 16, 8, tvb_get_ptr(tvb, 16, 8));
}
}
@@ -191,16 +191,16 @@ dissect_mip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
col_add_str(fd, COL_INFO, "Mobile IP Registration Reply");
if (tree) {
- ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), NULL);
+ ti = proto_tree_add_item(tree, proto_mip, tvb, 0, tvb_length(tvb), FALSE);
mip_tree = proto_item_add_subtree(ti, ett_mip);
- proto_tree_add_item(mip_tree, hf_mip_type, tvb, 0, 1, type);
+ proto_tree_add_int(mip_tree, hf_mip_type, tvb, 0, 1, type);
code = tvb_get_guint8(tvb, 1);
- proto_tree_add_item(mip_tree, hf_mip_code, tvb, 1, 1, code);
- proto_tree_add_item(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2));
- proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4));
- proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8));
- proto_tree_add_item(mip_tree, hf_mip_ident, tvb, 12, 8, tvb_get_ptr(tvb, 12, 8));
+ proto_tree_add_uint(mip_tree, hf_mip_code, tvb, 1, 1, code);
+ proto_tree_add_int(mip_tree, hf_mip_life, tvb, 2, 2, tvb_get_ntohs(tvb, 2));
+ proto_tree_add_ipv4(mip_tree, hf_mip_homeaddr, tvb, 4, 4, tvb_get_letohl(tvb, 4));
+ proto_tree_add_ipv4(mip_tree, hf_mip_haaddr, tvb, 8, 4, tvb_get_letohl(tvb, 8));
+ proto_tree_add_bytes(mip_tree, hf_mip_ident, tvb, 12, 8, tvb_get_ptr(tvb, 12, 8));
}
}
}