diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-23 23:06:34 -0500 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-11-25 02:51:03 +0000 |
commit | e899c3e262594813fa765e44ad143d7f14d6d415 (patch) | |
tree | d29b23b24d3fd27c3ff72dfbfb6bbffa420de66a /epan/dissectors/packet-dcerpc-epm.c | |
parent | 4f8a6ec8669fe0b9b2ac642ab99cc853498e4721 (diff) | |
download | wireshark-e899c3e262594813fa765e44ad143d7f14d6d415.tar.gz |
Eliminate proto_tree_add_text from some dissectors.
Change-Id: Iadd80aab291e5de714891a9f3c79edeca19e9b93
Reviewed-on: https://code.wireshark.org/review/5458
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: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dcerpc-epm.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-epm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c index eafed8d94d..e9c3ecb981 100644 --- a/epan/dissectors/packet-dcerpc-epm.c +++ b/epan/dissectors/packet-dcerpc-epm.c @@ -47,6 +47,7 @@ static int hf_epm_hnd = -1; static int hf_epm_max_ents = -1; static int hf_epm_num_ents = -1; static int hf_epm_uuid = -1; +static int hf_epm_uuid_version = -1; static int hf_epm_tower_length = -1; /* static int hf_epm_tower_data = -1; */ static int hf_epm_max_towers = -1; @@ -367,7 +368,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, uuid.Data4[4], uuid.Data4[5], uuid.Data4[6], uuid.Data4[7]); } - proto_tree_add_text(tr, tvb, offset+17, 2, "Version %d.%d", tvb_get_guint8(tvb, offset+17), tvb_get_guint8(tvb, offset+18)); + proto_tree_add_item(tr, hf_epm_uuid_version, tvb, offset+17, 2, ENC_BIG_ENDIAN); /* Major/minor bytes treated as big endian */ { guint16 version = tvb_get_ntohs(tvb, offset+17); @@ -457,6 +458,12 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, return offset; } +static void +epm_fmt_uuid_version( gchar *result, guint32 revision ) +{ + g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); +} + /* typedef struct { unsigned int tower_len, [size_is(tower_len)] char tower[]; @@ -706,6 +713,8 @@ proto_register_epm (void) { "Num entries", "epm.num_ents", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epm_uuid, { "UUID", "epm.uuid", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_epm_uuid_version, + { "Version", "epm.uuid_version", FT_UINT16, BASE_CUSTOM, epm_fmt_uuid_version, 0x0, NULL, HFILL }}, { &hf_epm_annotation, { "Annotation", "epm.annotation", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_epm_proto_named_pipes, |