aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-omapi.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-11-05 23:07:35 -0500
committerAnders Broman <a.broman58@gmail.com>2014-11-13 05:17:36 +0000
commitf8e24c9fdc550cd5fa52e39615230cc8fe91ec03 (patch)
treee96d22834e5e7d10e2815443f213f52bbfbb9bed /epan/dissectors/packet-omapi.c
parent0515087b46e845374efd2b4d24eeecf269878902 (diff)
Eliminate proto_tree_add_text for some dissectors.
Change-Id: Ide14bcac0b1563bee4260ac9c1a280ba99e97e71 Reviewed-on: https://code.wireshark.org/review/5261 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: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-omapi.c')
-rw-r--r--epan/dissectors/packet-omapi.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/epan/dissectors/packet-omapi.c b/epan/dissectors/packet-omapi.c
index a47f35ed90..b9151d7a94 100644
--- a/epan/dissectors/packet-omapi.c
+++ b/epan/dissectors/packet-omapi.c
@@ -70,6 +70,12 @@ static int hf_omapi_obj_value_len = -1;
static int hf_omapi_obj_value = -1;
static int hf_omapi_signature = -1;
+/* Generated from convert_proto_tree_add_text.pl */
+static int hf_omapi_empty_string = -1;
+static int hf_omapi_object_end_tag = -1;
+static int hf_omapi_message_end_tag = -1;
+static int hf_omapi_no_value = -1;
+
static gint ett_omapi = -1;
#define OMAPI_PORT 7911
@@ -169,11 +175,11 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (msglength == 0)
{
- proto_tree_add_text(omapi_tree, tvb, 0, 0, "Empty string");
+ proto_tree_add_item(omapi_tree, hf_omapi_empty_string, tvb, 0, 0, ENC_NA);
}
else if (msglength == (guint32)~0)
{
- proto_tree_add_text(omapi_tree, tvb, 0, 0, "No value");
+ proto_tree_add_item(omapi_tree, hf_omapi_no_value, tvb, 0, 0, ENC_NA);
}
else
{
@@ -183,8 +189,7 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msglength = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
}
- proto_tree_add_text(omapi_tree, tvb, ptvcursor_current_offset(cursor), 2, "Message end tag");
- ptvcursor_advance(cursor, 2);
+ ptvcursor_add(cursor, hf_omapi_message_end_tag, 2, ENC_NA);
objlength = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
while (objlength)
@@ -196,11 +201,11 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (objlength == 0)
{
- proto_tree_add_text(omapi_tree, tvb, 0, 0, "Empty string");
+ proto_tree_add_item(omapi_tree, hf_omapi_empty_string, tvb, 0, 0, ENC_NA);
}
else if (objlength == (guint32)~0)
{
- proto_tree_add_text(omapi_tree, tvb, 0, 0, "No value");
+ proto_tree_add_item(omapi_tree, hf_omapi_no_value, tvb, 0, 0, ENC_NA);
}
else
{
@@ -210,8 +215,7 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
objlength = tvb_get_ntohs(tvb, ptvcursor_current_offset(cursor));
}
- proto_tree_add_text(omapi_tree, tvb, ptvcursor_current_offset(cursor), 2, "Object end tag");
- ptvcursor_advance(cursor, 2);
+ ptvcursor_add(cursor, hf_omapi_object_end_tag, 2, ENC_NA);
if (authlength > 0) {
ptvcursor_add(cursor, hf_omapi_signature, authlength, ENC_NA);
@@ -291,7 +295,14 @@ proto_register_omapi(void)
{ &hf_omapi_signature,
{ "Signature", "omapi.signature",
FT_BYTES, BASE_NONE, NULL, 0x0,
- NULL, HFILL }}
+ NULL, HFILL }},
+
+ /* Generated from convert_proto_tree_add_text.pl */
+ { &hf_omapi_empty_string, { "Empty string", "omapi.empty_string", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_omapi_no_value, { "No value", "omapi.no_value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_omapi_message_end_tag, { "Message end tag", "omapi.message_end_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_omapi_object_end_tag, { "Object end tag", "omapi.object_end_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+
};
static gint *ett[] = {