smb2: dissect FSCTL_PIPE_WAIT

Change-Id: Iec4fe90d792f745d8c754afc9b18ca6f7a708caa
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-on: https://code.wireshark.org/review/9437
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gregor Beck 2012-09-13 17:27:51 +02:00 committed by Anders Broman
parent 9c7acde712
commit 7ee967c2b2
1 changed files with 41 additions and 0 deletions

View File

@ -197,6 +197,8 @@ static int hf_smb2_ioctl_function = -1;
static int hf_smb2_ioctl_function_device = -1;
static int hf_smb2_ioctl_function_access = -1;
static int hf_smb2_ioctl_function_function = -1;
static int hf_smb2_fsctl_pipe_wait_timeout = -1;
static int hf_smb2_fsctl_pipe_wait_name = -1;
static int hf_smb2_ioctl_function_method = -1;
static int hf_smb2_ioctl_resiliency_timeout = -1;
static int hf_smb2_ioctl_resiliency_reserved = -1;
@ -1327,6 +1329,7 @@ static const value_string smb2_ioctl_vals[] = {
{0x0009C040, "FSCTL_SET_COMPRESSION"}, /* dissector implemented */
{0x0009C280, "FSCTL_SET_INTEGRITY_INFORMATION"},
{0x0011C017, "FSCTL_PIPE_TRANSCEIVE"}, /* dissector implemented */
{0x00110018, "FSCTL_PIPE_WAIT"},
{0x00140078, "FSCTL_SRV_REQUEST_RESUME_KEY"},
{0x001401D4, "FSCTL_LMR_REQUEST_RESILIENCY"}, /* dissector implemented */
{0x001401FC, "FSCTL_QUERY_NETWORK_INTERFACE_INFO"}, /* dissector implemented */
@ -4478,6 +4481,33 @@ dissect_smb2_FSCTL_PIPE_TRANSCEIVE(tvbuff_t *tvb, packet_info *pinfo, proto_tree
dissect_file_data_dcerpc(tvb, pinfo, tree, offset, tvb_captured_length_remaining(tvb, offset), top_tree);
}
static void
dissect_smb2_FSCTL_PIPE_WAIT(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, int offset, proto_tree *top_tree, gboolean data_in _U_)
{
guint8 timeout_specified = tvb_get_guint8(tvb, offset + 12);
guint32 name_len = tvb_get_letohs(tvb, offset + 8);
const gchar *name;
int off = offset + 14;
guint16 bc = tvb_captured_length_remaining(tvb, off);
int len = name_len;
/* sanity check */
tvb_ensure_bytes_exist(tvb, off, name_len);
name = get_unicode_or_ascii_string(tvb, &off, TRUE, &len, TRUE, TRUE, &bc);
if (name == NULL) {
name = "";
}
col_append_fstr(pinfo->cinfo, COL_INFO, " Pipe: %s", name);
if (top_tree) {
proto_tree_add_string(top_tree, hf_smb2_fsctl_pipe_wait_name, tvb, offset + 14, name_len, name);
if (timeout_specified) {
proto_tree_add_item(top_tree, hf_smb2_fsctl_pipe_wait_timeout, tvb, 0, 8, ENC_LITTLE_ENDIAN);
}
}
}
static void
dissect_smb2_FSCTL_LMR_REQUEST_RESILIENCY(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean data_in)
{
@ -4989,6 +5019,9 @@ dissect_smb2_ioctl_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
case 0x0011c017:
dissect_smb2_FSCTL_PIPE_TRANSCEIVE(tvb, pinfo, tree, 0, top_tree, data_in);
break;
case 0x00110018:
dissect_smb2_FSCTL_PIPE_WAIT(tvb, pinfo, tree, 0, top_tree, data_in);
break;
case 0x001401D4: /* FSCTL_LMR_REQUEST_RESILIENCY */
dissect_smb2_FSCTL_LMR_REQUEST_RESILIENCY(tvb, pinfo, tree, 0, data_in);
break;
@ -8067,6 +8100,14 @@ proto_register_smb2(void)
{ "Method", "smb2.ioctl.function.method", FT_UINT32, BASE_HEX,
VALS(smb2_ioctl_method_vals), 0x00000003, "Method for Ioctl", HFILL }},
{ &hf_smb2_fsctl_pipe_wait_timeout,
{ "Timeout", "smb2.fsctl.wait.timeout", FT_INT64, BASE_DEC,
NULL, 0, "Wait timeout", HFILL }},
{ &hf_smb2_fsctl_pipe_wait_name,
{ "Name", "smb2.fsctl.wait.name", FT_STRING, BASE_NONE,
NULL, 0, "Pipe name", HFILL }},
{ &hf_smb2_ioctl_resiliency_timeout,
{ "Timeout", "smb2.ioctl.resiliency.timeout", FT_UINT32, BASE_DEC,
NULL, 0, "Resiliency timeout", HFILL }},