diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:29:03 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:29:03 +0000 |
commit | 067a0761790aabf2d6a829c59dbdac4c2d0fccdf (patch) | |
tree | ee4e7efac0f2d4a12f25d92b0b1fd222f1e47587 /epan/dissectors/packet-aruba-adp.c | |
parent | 1f19cd8f1b95aa5cfef763d266724e01a1c579e2 (diff) |
Use tvb_ip_to_str().
There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated.
svn path=/trunk/; revision=35545
Diffstat (limited to 'epan/dissectors/packet-aruba-adp.c')
-rw-r--r-- | epan/dissectors/packet-aruba-adp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-aruba-adp.c b/epan/dissectors/packet-aruba-adp.c index 389642124a..bd62cb084a 100644 --- a/epan/dissectors/packet-aruba-adp.c +++ b/epan/dissectors/packet-aruba-adp.c @@ -60,7 +60,7 @@ dissect_aruba_adp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *aruba_adp_tree = NULL; guint16 type; const guint8 *src_mac; - const guint8 *switchip; + const gchar *switchip; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ADP"); @@ -76,7 +76,7 @@ dissect_aruba_adp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) type = tvb_get_ntohs(tvb, 2); if (tree) { - proto_tree_add_item(aruba_adp_tree, hf_adp_type, tvb, 2, 2, FALSE); + proto_tree_add_item(aruba_adp_tree, hf_adp_type, tvb, 2, 2, FALSE); proto_tree_add_item(aruba_adp_tree, hf_adp_id, tvb, 4, 2, FALSE); } @@ -92,21 +92,21 @@ dissect_aruba_adp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(ti, ", Request Src MAC: %s", ether_to_str(src_mac)); break; - + case ADP_RESPONSE: - + proto_tree_add_item(aruba_adp_tree, hf_adp_switchip, tvb, 6, 4, FALSE); - switchip = tvb_get_ptr(tvb, 6, 4); - + switchip = tvb_ip_to_str(tvb, 6); + if (check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "ADP Response Switch IP: %s", ip_to_str(switchip)); - - proto_item_append_text(ti, ", Response Switch IP: %s", ip_to_str(switchip)); + col_add_fstr(pinfo->cinfo, COL_INFO, "ADP Response Switch IP: %s", switchip); + + proto_item_append_text(ti, ", Response Switch IP: %s", switchip); break; - + default: break; - + } } |