aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pppoe.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-09-05 08:48:37 -0400
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-09-06 07:44:46 +0000
commitceef7eba755cbecf670653360f72d864949dac49 (patch)
tree2cc48ebd17a4e7dc714f1b00af21f4f92546c948 /epan/dissectors/packet-pppoe.c
parentf1ad9eb212a6f4c5e1b6b1963bccf5f3a4900293 (diff)
Eliminate proto_tree_add_text from some of the dissectors.
Other minor cleanups while in the area. Change-Id: I8ea59205cfe6fab643d8fe01b75ce91532004fd9 Reviewed-on: https://code.wireshark.org/review/4004 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-pppoe.c')
-rw-r--r--epan/dissectors/packet-pppoe.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index fbf8f2e9e6..a1840d334a 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -450,7 +450,6 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr
proto_tree *pppoe_tree;
proto_item *ti;
proto_item *pppoe_tree_tag_length_item = NULL;
- proto_item *item;
/* Start Decoding Here. */
if (tree)
@@ -603,33 +602,24 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr
} else {
if (global_pppoe_show_tags_and_lengths) {
proto_item_append_text(pppoe_tree_tag_length_item, " [Wrong: should be 2]");
- item = pppoe_tree_tag_length_item;
- } else {
- item = proto_tree_add_text(pppoe_tree, tvb, tagstart+4, poe_tag_length,
- "%s: Wrong length: %u (expected 2)",
- proto_registrar_get_name(hf_pppoed_tag_seq_num),
- poe_tag_length);
}
- expert_add_info_format(pinfo, item, &ei_pppoe_tag_length, "Sequence Number tag: Wrong length: %u (expected 2)", poe_tag_length);
+
+ proto_tree_add_expert_format(pppoe_tree, pinfo, &ei_pppoe_tag_length, tvb, tagstart+4, poe_tag_length,
+ "Sequence Number tag: Wrong length: %u (expected 2)", poe_tag_length);
}
break;
- case PPPOE_TAG_CRED_SCALE:
+ case PPPOE_TAG_CRED_SCALE:
if (poe_tag_length == 2) {
proto_tree_add_item(pppoe_tree, hf_pppoed_tag_cred_scale, tvb,
tagstart+4, poe_tag_length, ENC_BIG_ENDIAN);
} else {
if (global_pppoe_show_tags_and_lengths) {
proto_item_append_text(pppoe_tree_tag_length_item, " [Wrong: should be 2]");
- item = pppoe_tree_tag_length_item;
- } else {
- item = proto_tree_add_text(pppoe_tree, tvb, tagstart+4, poe_tag_length,
- "%s: Wrong length: %u (expected 2)",
- proto_registrar_get_name(hf_pppoed_tag_cred_scale),
- poe_tag_length);
}
- expert_add_info_format(pinfo, item, &ei_pppoe_tag_length, "Credit Scale Factor tag: Wrong length: %u (expected 2)", poe_tag_length);
+ proto_tree_add_expert_format(pppoe_tree, pinfo, &ei_pppoe_tag_length, tvb, tagstart+4, poe_tag_length,
+ "Credit Scale Factor tag: Wrong length: %u (expected 2)", poe_tag_length);
}
- break;
+ break;
case PPPOE_TAG_RELAY_ID:
proto_tree_add_item(pppoe_tree, hf_pppoed_tag_relay_session_id, tvb,
tagstart+4, poe_tag_length, ENC_NA);