aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-11-25 05:41:00 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-11-25 05:41:00 +0000
commitcfc56af5140e16d87838fb3efdd3a4d4ca7a6871 (patch)
tree5745667f6705760c9192797551ed881c1eb4b0d0 /epan
parentd93bd8606cd45193881c657638001cd87175af18 (diff)
some info level updates
svn path=/trunk/; revision=16579
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-smb.c45
-rw-r--r--epan/dissectors/packet-smb.h2
-rw-r--r--epan/dissectors/packet-smb2.c170
3 files changed, 164 insertions, 53 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index deee67ae1e..85ca85dc61 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -506,6 +506,7 @@ static int hf_smb_qfsi_information_level = -1;
static int hf_smb_number_of_links = -1;
static int hf_smb_delete_pending = -1;
static int hf_smb_index_number = -1;
+static int hf_smb_position = -1;
static int hf_smb_current_offset = -1;
static int hf_smb_t2_alignment = -1;
static int hf_smb_t2_stream_name_length = -1;
@@ -10469,6 +10470,36 @@ dissect_qfi_SMB_FILE_STANDARD_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
return offset;
}
+/* this dissects the SMB_QUERY_FILE_INTERNAL_INFO
+*/
+int
+dissect_qfi_SMB_FILE_INTERNAL_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
+ int offset, guint16 *bcp, gboolean *trunc)
+{
+ /* file id */
+ CHECK_BYTE_COUNT_SUBR(8);
+ proto_tree_add_item(tree, hf_smb_index_number, tvb, offset, 8, TRUE);
+ COUNT_BYTES_SUBR(8);
+
+ *trunc = FALSE;
+ return offset;
+}
+
+/* this dissects the SMB_QUERY_FILE_POSITION_INFO
+*/
+int
+dissect_qfi_SMB_FILE_POSITION_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
+ int offset, guint16 *bcp, gboolean *trunc)
+{
+ /* file id */
+ CHECK_BYTE_COUNT_SUBR(8);
+ proto_tree_add_item(tree, hf_smb_position, tvb, offset, 8, TRUE);
+ COUNT_BYTES_SUBR(8);
+
+ *trunc = FALSE;
+ return offset;
+}
+
/* this dissects the SMB_QUERY_FILE_EA_INFO
as described in 4.2.16.6
*/
@@ -11055,6 +11086,10 @@ dissect_qpi_loi_vals(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
offset = dissect_qfi_SMB_FILE_STANDARD_INFO(tvb, pinfo, tree, offset, bcp,
&trunc);
break;
+ case 1006: /* SMB_FILE_INTERNAL_INFORMATION */
+ offset = dissect_qfi_SMB_FILE_INTERNAL_INFO(tvb, pinfo, tree, offset, bcp,
+ &trunc);
+ break;
case 0x0103: /*Query File EA Info*/
case 1007: /* SMB_FILE_EA_INFORMATION */
offset = dissect_qfi_SMB_FILE_EA_INFO(tvb, pinfo, tree, offset, bcp,
@@ -11065,6 +11100,10 @@ dissect_qpi_loi_vals(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
offset = dissect_qfi_SMB_FILE_ALTERNATE_NAME_INFO(tvb, pinfo, tree, offset, bcp,
&trunc);
break;
+ case 1014: /* SMB_FILE_POSITION_INFORMATION */
+ offset = dissect_qfi_SMB_FILE_POSITION_INFO(tvb, pinfo, tree, offset, bcp,
+ &trunc);
+ break;
case 0x0107: /*Query File All Info*/
case 1018: /* SMB_FILE_ALL_INFORMATION */
#if 1
@@ -17128,9 +17167,13 @@ proto_register_smb(void)
VALS(delete_pending_vals), 0, "Is this object about to be deleted?", HFILL }},
{ &hf_smb_index_number,
- { "Index Number", "smb.index_number", FT_UINT64, BASE_DEC,
+ { "Index Number", "smb.index_number", FT_UINT64, BASE_HEX,
NULL, 0, "File system unique identifier", HFILL }},
+ { &hf_smb_position,
+ { "Position", "smb.position", FT_UINT64, BASE_DEC,
+ NULL, 0, "File position", HFILL }},
+
{ &hf_smb_current_offset,
{ "Current Offset", "smb.offset", FT_UINT64, BASE_DEC,
NULL, 0, "Current offset in the file", HFILL }},
diff --git a/epan/dissectors/packet-smb.h b/epan/dissectors/packet-smb.h
index b9357f0810..7ac94e9aef 100644
--- a/epan/dissectors/packet-smb.h
+++ b/epan/dissectors/packet-smb.h
@@ -308,6 +308,8 @@ extern int dissect_qfi_SMB_FILE_EA_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, p
extern int dissect_qfi_SMB_FILE_STREAM_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint16 *bcp, gboolean *trunc, int unicode);
extern int dissect_qfi_SMB_FILE_ALTERNATE_NAME_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);
extern int dissect_qfi_SMB_FILE_STANDARD_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);
+extern int dissect_qfi_SMB_FILE_INTERNAL_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);
+extern int dissect_qfi_SMB_FILE_POSITION_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);
extern int dissect_qfi_SMB_FILE_COMPRESSION_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);
#endif
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 1680a2e262..f19336b1bc 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -98,14 +98,17 @@ static int hf_smb2_server_guid = -1;
static int hf_smb2_class = -1;
static int hf_smb2_infolevel = -1;
static int hf_smb2_max_response_size = -1;
+static int hf_smb2_max_transaction_in_size = -1;
static int hf_smb2_required_buffer_size = -1;
static int hf_smb2_response_size = -1;
-static int hf_smb2_file_info_04 = -1;
-static int hf_smb2_file_info_05 = -1;
-static int hf_smb2_file_info_07 = -1;
-static int hf_smb2_file_info_08 = -1;
+static int hf_smb2_file_basic_info = -1;
+static int hf_smb2_file_standard_info = -1;
+static int hf_smb2_file_internal_info = -1;
+static int hf_smb2_file_ea_info = -1;
+static int hf_smb2_file_access_info = -1;
static int hf_smb2_file_info_0a = -1;
static int hf_smb2_file_info_0d = -1;
+static int hf_smb2_file_position_info = -1;
static int hf_smb2_file_info_0f = -1;
static int hf_smb2_file_info_12 = -1;
static int hf_smb2_file_info_15 = -1;
@@ -158,10 +161,12 @@ static gint ett_smb2_ea = -1;
static gint ett_smb2_header = -1;
static gint ett_smb2_command = -1;
static gint ett_smb2_secblob = -1;
-static gint ett_smb2_file_info_04 = -1;
-static gint ett_smb2_file_info_05 = -1;
-static gint ett_smb2_file_info_07 = -1;
-static gint ett_smb2_file_info_08 = -1;
+static gint ett_smb2_file_basic_info = -1;
+static gint ett_smb2_file_standard_info = -1;
+static gint ett_smb2_file_internal_info = -1;
+static gint ett_smb2_file_ea_info = -1;
+static gint ett_smb2_file_access_info = -1;
+static gint ett_smb2_file_position_info = -1;
static gint ett_smb2_file_info_12 = -1;
static gint ett_smb2_file_info_15 = -1;
static gint ett_smb2_file_info_16 = -1;
@@ -197,12 +202,14 @@ static const value_string smb2_class_vals[] = {
{ 0, NULL }
};
-#define SMB2_FILE_INFO_04 0x04
-#define SMB2_FILE_INFO_05 0x05
-#define SMB2_FILE_INFO_07 0x07
-#define SMB2_FILE_INFO_08 0x08
+#define SMB2_FILE_BASIC_INFO 0x04
+#define SMB2_FILE_STANDARD_INFO 0x05
+#define SMB2_FILE_INTERNAL_INFO 0x06
+#define SMB2_FILE_EA_INFO 0x07
+#define SMB2_FILE_ACCESS_INFO 0x08
#define SMB2_FILE_INFO_0a 0x0a
#define SMB2_FILE_INFO_0d 0x0d
+#define SMB2_FILE_POSITION_INFO 0x0e
#define SMB2_FILE_INFO_0f 0x0f
#define SMB2_FILE_INFO_12 0x12
#define SMB2_FILE_INFO_15 0x15
@@ -720,14 +727,14 @@ dissect_smb2_file_info_15(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
static int
-dissect_smb2_file_info_04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+dissect_smb2_file_basic_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
if(parent_tree){
- item = proto_tree_add_item(parent_tree, hf_smb2_file_info_04, tvb, offset, -1, TRUE);
- tree = proto_item_add_subtree(item, ett_smb2_file_info_04);
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_basic_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_basic_info);
}
/* create time */
@@ -753,7 +760,7 @@ dissect_smb2_file_info_04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
}
static int
-dissect_smb2_file_info_05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+dissect_smb2_file_standard_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@@ -761,8 +768,8 @@ dissect_smb2_file_info_05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
gboolean trunc;
if(parent_tree){
- item = proto_tree_add_item(parent_tree, hf_smb2_file_info_05, tvb, offset, -1, TRUE);
- tree = proto_item_add_subtree(item, ett_smb2_file_info_05);
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_standard_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_standard_info);
}
bc=tvb_length_remaining(tvb, offset);
@@ -770,16 +777,52 @@ dissect_smb2_file_info_05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
return offset;
}
+static int
+dissect_smb2_file_internal_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+{
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint16 bc;
+ gboolean trunc;
+
+ if(parent_tree){
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_internal_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_internal_info);
+ }
+
+ bc=tvb_length_remaining(tvb, offset);
+ offset = dissect_qfi_SMB_FILE_INTERNAL_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
+
+ return offset;
+}
+static int
+dissect_smb2_file_position_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+{
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ guint16 bc;
+ gboolean trunc;
+
+ if(parent_tree){
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_position_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_position_info);
+ }
+
+ bc=tvb_length_remaining(tvb, offset);
+ offset = dissect_qfi_SMB_FILE_POSITION_INFO(tvb, pinfo, tree, offset, &bc, &trunc);
+
+ return offset;
+}
static int
-dissect_smb2_file_info_08(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+dissect_smb2_file_access_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
if(parent_tree){
- item = proto_tree_add_item(parent_tree, hf_smb2_file_info_08, tvb, offset, -1, TRUE);
- tree = proto_item_add_subtree(item, ett_smb2_file_info_08);
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_access_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_access_info);
}
/* access mask */
@@ -789,7 +832,7 @@ dissect_smb2_file_info_08(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
}
static int
-dissect_smb2_file_info_07(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
+dissect_smb2_file_ea_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, int offset, smb2_info_t *si _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
@@ -797,8 +840,8 @@ dissect_smb2_file_info_07(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *par
gboolean trunc;
if(parent_tree){
- item = proto_tree_add_item(parent_tree, hf_smb2_file_info_07, tvb, offset, -1, TRUE);
- tree = proto_item_add_subtree(item, ett_smb2_file_info_07);
+ item = proto_tree_add_item(parent_tree, hf_smb2_file_ea_info, tvb, offset, -1, TRUE);
+ tree = proto_item_add_subtree(item, ett_smb2_file_ea_info);
}
bc=tvb_length_remaining(tvb, offset);
@@ -1593,17 +1636,20 @@ dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
switch(class){
case SMB2_CLASS_FILE_INFO:
switch(infolevel){
- case SMB2_FILE_INFO_04:
- dissect_smb2_file_info_04(tvb, pinfo, tree, offset, si);
+ case SMB2_FILE_BASIC_INFO:
+ dissect_smb2_file_basic_info(tvb, pinfo, tree, offset, si);
+ break;
+ case SMB2_FILE_STANDARD_INFO:
+ dissect_smb2_file_standard_info(tvb, pinfo, tree, offset, si);
break;
- case SMB2_FILE_INFO_05:
- dissect_smb2_file_info_05(tvb, pinfo, tree, offset, si);
+ case SMB2_FILE_INTERNAL_INFO:
+ dissect_smb2_file_internal_info(tvb, pinfo, tree, offset, si);
break;
- case SMB2_FILE_INFO_07:
- dissect_smb2_file_info_07(tvb, pinfo, tree, offset, si);
+ case SMB2_FILE_EA_INFO:
+ dissect_smb2_file_ea_info(tvb, pinfo, tree, offset, si);
break;
- case SMB2_FILE_INFO_08:
- dissect_smb2_file_info_08(tvb, pinfo, tree, offset, si);
+ case SMB2_FILE_ACCESS_INFO:
+ dissect_smb2_file_access_info(tvb, pinfo, tree, offset, si);
break;
case SMB2_FILE_INFO_0a:
dissect_smb2_file_info_0a(tvb, pinfo, tree, offset, si);
@@ -1611,6 +1657,9 @@ dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
case SMB2_FILE_INFO_0d:
dissect_smb2_file_info_0d(tvb, pinfo, tree, offset, si);
break;
+ case SMB2_FILE_POSITION_INFO:
+ dissect_smb2_file_position_info(tvb, pinfo, tree, offset, si);
+ break;
case SMB2_FILE_INFO_0f:
dissect_smb2_file_info_0f(tvb, pinfo, tree, offset, si);
break;
@@ -1908,12 +1957,16 @@ dissect_smb2_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
offset = dissect_smb2_olb_length_offset(tvb, offset, &o_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_out_data);
/* some unknown bytes */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 8, TRUE);
- offset += 8;
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 12, TRUE);
+ offset += 12;
+
+ /* max transaction in size */
+ proto_tree_add_item(tree, hf_smb2_max_transaction_in_size, tvb, offset, 4, TRUE);
+ offset += 4;
/* some unknown bytes */
- proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 16, TRUE);
- offset += 16;
+ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 8, TRUE);
+ offset += 8;
/* out buffer */
dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data);
@@ -3217,6 +3270,9 @@ proto_register_smb2(void)
{ &hf_smb2_max_response_size,
{ "Max Response Size", "smb2.max_response_size", FT_UINT32, BASE_DEC,
NULL, 0, "SMB2 Maximum response size", HFILL }},
+ { &hf_smb2_max_transaction_in_size,
+ { "Max Transaction In Size", "smb2.max_transaction_in_size", FT_UINT32, BASE_DEC,
+ NULL, 0, "SMB2 Maximum transaction in size", HFILL }},
{ &hf_smb2_response_size,
{ "Response Size", "smb2.response_size", FT_UINT32, BASE_DEC,
NULL, 0, "SMB2 response size", HFILL }},
@@ -3351,21 +3407,29 @@ proto_register_smb2(void)
{ "SMB2_FILE_INFO_1c", "smb2.smb2_file_info_1c", FT_NONE, BASE_NONE,
NULL, 0, "SMB2_FILE_INFO_1c structure", HFILL }},
- { &hf_smb2_file_info_04,
- { "SMB2_FILE_INFO_04", "smb2.smb2_file_info_04", FT_NONE, BASE_NONE,
- NULL, 0, "SMB2_FILE_INFO_04 structure", HFILL }},
+ { &hf_smb2_file_basic_info,
+ { "SMB2_FILE_BASIC_INFO", "smb2.smb2_file_basic_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_BASIC_INFO structure", HFILL }},
+
+ { &hf_smb2_file_standard_info,
+ { "SMB2_FILE_STANDARD_INFO", "smb2.smb2_file_standard_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_STANDARD_INFO structure", HFILL }},
+
+ { &hf_smb2_file_internal_info,
+ { "SMB2_FILE_INTERNAL_INFO", "smb2.smb2_file_internal_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_INTERNAL_INFO structure", HFILL }},
- { &hf_smb2_file_info_05,
- { "SMB2_FILE_INFO_05", "smb2.smb2_file_info_05", FT_NONE, BASE_NONE,
- NULL, 0, "SMB2_FILE_INFO_05 structure", HFILL }},
+ { &hf_smb2_file_position_info,
+ { "SMB2_FILE_POSITION_INFO", "smb2.smb2_file_position_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_POSITION_INFO structure", HFILL }},
- { &hf_smb2_file_info_08,
- { "SMB2_FILE_INFO_08", "smb2.smb2_file_info_08", FT_NONE, BASE_NONE,
- NULL, 0, "SMB2_FILE_INFO_08 structure", HFILL }},
+ { &hf_smb2_file_access_info,
+ { "SMB2_FILE_ACCESS_INFO", "smb2.smb2_file_access_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_ACCESS_INFO structure", HFILL }},
- { &hf_smb2_file_info_07,
- { "SMB2_FILE_INFO_07", "smb2.smb2_file_info_07", FT_NONE, BASE_NONE,
- NULL, 0, "SMB2_FILE_INFO_07 structure", HFILL }},
+ { &hf_smb2_file_ea_info,
+ { "SMB2_FILE_EA_INFO", "smb2.smb2_file_ea_info", FT_NONE, BASE_NONE,
+ NULL, 0, "SMB2_FILE_EA_INFO structure", HFILL }},
{ &hf_smb2_file_info_22,
{ "SMB2_FILE_INFO_22", "smb2.smb2_file_info_22", FT_NONE, BASE_NONE,
@@ -3544,12 +3608,14 @@ proto_register_smb2(void)
&ett_smb2_header,
&ett_smb2_command,
&ett_smb2_secblob,
- &ett_smb2_file_info_04,
- &ett_smb2_file_info_05,
- &ett_smb2_file_info_07,
- &ett_smb2_file_info_08,
+ &ett_smb2_file_basic_info,
+ &ett_smb2_file_standard_info,
+ &ett_smb2_file_internal_info,
+ &ett_smb2_file_ea_info,
+ &ett_smb2_file_access_info,
&ett_smb2_file_info_0a,
&ett_smb2_file_info_0d,
+ &ett_smb2_file_position_info,
&ett_smb2_file_info_0f,
&ett_smb2_file_info_12,
&ett_smb2_file_info_15,