diff options
author | Michael Mann <mmann78@netscape.net> | 2015-05-31 11:45:36 -0400 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-31 21:08:59 +0000 |
commit | 4d74d0dccd7fc1d5472ed4d2d8adfd9b74835ffc (patch) | |
tree | fd719158cf20b6d4ef2c63fd29bdfbed2eaee55b /epan | |
parent | 7780159c03276d0e35df30f69d9a4806958c764e (diff) |
Eliminate proto_tree_add_text from packet-dcerpc-ndr.c and packet-dcerpc-netlogon.c
Change-Id: I65eff9c8087424087a307f18b96a202f0364e371
Reviewed-on: https://code.wireshark.org/review/8714
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dcerpc-ndr.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-netlogon.c | 17 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc.h | 1 |
4 files changed, 20 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index d3f7c9bc3d..bf6c41f10e 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -375,8 +375,7 @@ dissect_ndr_uint64(tvbuff_t *tvb, gint offset, packet_info *pinfo, if (!di->no_align && (offset % 8)) { gint padding = 8 - (offset % 8); - /*add the item for padding bytes*/ - proto_tree_add_text(tree, tvb, offset, padding, "NDR-Padding: %d bytes", padding); + proto_tree_add_item(tree, hf_dcerpc_ndr_padding, tvb, offset, padding, ENC_NA); offset += padding; } return dissect_dcerpc_uint64(tvb, offset, pinfo, diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index fe8fc3d54a..010f162a8a 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -411,6 +411,8 @@ static int hf_netlogon_dc_flags_dns_forest_flag = -1; static int hf_netlogon_s4u2proxytarget = -1; static int hf_netlogon_transitedlistsize = -1; static int hf_netlogon_transited_service = -1; +static int hf_netlogon_logon_duration = -1; +static int hf_netlogon_time_created = -1; static gint ett_nt_counted_longs_as_string = -1; static gint ett_dcerpc_netlogon = -1; @@ -865,12 +867,15 @@ netlogon_dissect_LOGOFF_UAS_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { + guint32 duration; + if(di->conformant_run){ /*just a run to handle conformant arrays, nothing to dissect */ return offset; } - proto_tree_add_text(tree, tvb, offset, 4, "Duration: unknown time format"); + duration = tvb_get_guint32(tvb, offset, DREP_ENC_INTEGER(drep)); + proto_tree_add_uint_format_value(tree, hf_netlogon_logon_duration, tvb, offset, 4, duration, "unknown time format"); offset+= 4; offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, di, drep, @@ -4354,6 +4359,7 @@ netlogon_dissect_UAS_INFO_0(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { + guint32 time_created; if(di->conformant_run){ /*just a run to handle conformant arrays, nothing to dissect */ return offset; @@ -4362,7 +4368,8 @@ netlogon_dissect_UAS_INFO_0(tvbuff_t *tvb, int offset, proto_tree_add_item(tree, hf_netlogon_computer_name, tvb, offset, 16, ENC_ASCII|ENC_NA); offset += 16; - proto_tree_add_text(tree, tvb, offset, 4, "Time Created: unknown time format"); + time_created = tvb_get_guint32(tvb, offset, DREP_ENC_INTEGER(drep)); + proto_tree_add_uint_format_value(tree, hf_netlogon_time_created, tvb, offset, 4, time_created, "unknown time format"); offset+= 4; offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, @@ -9208,6 +9215,12 @@ proto_register_dcerpc_netlogon(void) { &hf_netlogon_transited_service, { "Transited Service", "netlogon.transited_service", FT_STRING, BASE_NONE, NULL, 0, "S4U2 Transited Service name", HFILL }}, + { &hf_netlogon_logon_duration, + { "Duration", "netlogon.logon_duration", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_netlogon_time_created, + { "Time Created", "netlogon.time_created", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index cafb9ebecd..c5b9777566 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -449,6 +449,7 @@ static int hf_dcerpc_cn_flags_maybe = -1; static int hf_dcerpc_cn_flags_object = -1; static int hf_dcerpc_drep = -1; int hf_dcerpc_drep_byteorder = -1; + int hf_dcerpc_ndr_padding = -1; static int hf_dcerpc_drep_character = -1; static int hf_dcerpc_drep_fp = -1; static int hf_dcerpc_cn_frag_len = -1; @@ -6011,6 +6012,8 @@ proto_register_dcerpc(void) { "Data Representation", "dcerpc.drep", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_dcerpc_drep_byteorder, { "Byte order", "dcerpc.drep.byteorder", FT_UINT8, BASE_DEC, VALS(drep_byteorder_vals), 0x0, NULL, HFILL }}, + { &hf_dcerpc_ndr_padding, + { "NDR-Padding", "dcerpc.ndr_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_dcerpc_drep_character, { "Character", "dcerpc.drep.character", FT_UINT8, BASE_DEC, VALS(drep_character_vals), 0x0, NULL, HFILL }}, { &hf_dcerpc_drep_fp, diff --git a/epan/dissectors/packet-dcerpc.h b/epan/dissectors/packet-dcerpc.h index bd169d57df..2db4d8e5ab 100644 --- a/epan/dissectors/packet-dcerpc.h +++ b/epan/dissectors/packet-dcerpc.h @@ -542,6 +542,7 @@ typedef struct pol_value { extern int hf_dcerpc_drep_byteorder; +extern int hf_dcerpc_ndr_padding; #define FAKE_DCERPC_INFO_STRUCTURE \ /* Fake dcerpc_info structure */ \ |