2 * Defines for SMB2 packet dissection
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998, 1999 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef __PACKET_SMB2_H__
26 #define __PACKET_SMB2_H__
28 /* SMB2 command codes. With MSVC and a
29 * libwireshark.dll, we need a special declaration.
31 WS_VAR_IMPORT const value_string smb2_cmd_vals[];
33 /* Structure to keep track of information specific to a single
34 * SMB2 transaction. Here we store things we need to remember between
35 * a specific request and a specific response.
37 * There is no guarantee we will have this structure available for all
38 * SMB2 packets so a dissector must check this pointer for NULL
39 * before dereferencing it.
41 * private data is set to NULL when the structure is created. It is used
42 * for communications between the Request and the Response packets.
45 SMB2_EI_NONE, /* Unassigned / NULL */
46 SMB2_EI_TREENAME, /* tid tracking char * */
47 SMB2_EI_FILENAME, /* fid tracking char * */
48 SMB2_EI_FINDPATTERN /* find tracking char * */
50 typedef struct _smb2_saved_info_t {
54 guint32 frame_req, frame_res;
57 smb2_extra_info_t extra_info_type;
60 typedef struct _smb2_tid_info_t {
62 guint32 connect_frame;
67 typedef struct _smb2_sesid_info_t {
76 /* Structure to keep track of conversations and the hash tables.
77 * There is one such structure for each conversation.
79 typedef struct _smb2_conv_info_t {
80 /* these two tables are used to match requests with responses */
81 GHashTable *unmatched;
86 /* This structure contains information from the SMB2 header
87 * as well as pointers to the conversation and the transaction specific
90 #define SMB2_FLAGS_RESPONSE 0x00000001
91 #define SMB2_FLAGS_ASYNC_CMD 0x00000002
92 #define SMB2_FLAGS_CHAINED 0x00000004
93 #define SMB2_FLAGS_SIGNATURE 0x00000008
94 #define SMB2_FLAGS_DFS_OP 0x10000000
95 typedef struct _smb2_info_t {
97 guint32 ioctl_function;
103 smb2_conv_info_t *conv;
104 smb2_saved_info_t *saved;
105 smb2_tid_info_t *tree;
106 smb2_sesid_info_t *session;
107 proto_tree *top_tree;
111 int dissect_smb2_FILE_OBJECTID_BUFFER(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset);
112 int dissect_smb2_ioctl_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 *ioctl_function);
113 void dissect_smb2_ioctl_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *top_tree, guint32 ioctl_function, gboolean data_in);