12 #ifndef __PACKET_SMB_H__
13 #define __PACKET_SMB_H__
15 #include "ws_symbol_export.h"
20 WS_DLL_PUBLIC
bool sid_name_snooping;
29 #define SMB_COM_CREATE_DIRECTORY 0x00
30 #define SMB_COM_DELETE_DIRECTORY 0x01
31 #define SMB_COM_OPEN 0x02
32 #define SMB_COM_CREATE 0x03
33 #define SMB_COM_CLOSE 0x04
34 #define SMB_COM_FLUSH 0x05
35 #define SMB_COM_DELETE 0x06
36 #define SMB_COM_RENAME 0x07
37 #define SMB_COM_QUERY_INFORMATION 0x08
38 #define SMB_COM_SET_INFORMATION 0x09
39 #define SMB_COM_READ 0x0A
40 #define SMB_COM_WRITE 0x0B
41 #define SMB_COM_LOCK_BYTE_RANGE 0x0C
42 #define SMB_COM_UNLOCK_BYTE_RANGE 0x0D
43 #define SMB_COM_CREATE_TEMPORARY 0x0E
44 #define SMB_COM_CREATE_NEW 0x0F
45 #define SMB_COM_CHECK_DIRECTORY 0x10
46 #define SMB_COM_PROCESS_EXIT 0x11
47 #define SMB_COM_SEEK 0x12
48 #define SMB_COM_LOCK_AND_READ 0x13
49 #define SMB_COM_WRITE_AND_UNLOCK 0x14
50 #define SMB_COM_READ_RAW 0x1A
51 #define SMB_COM_READ_MPX 0x1B
52 #define SMB_COM_READ_MPX_SECONDARY 0x1C
53 #define SMB_COM_WRITE_RAW 0x1D
54 #define SMB_COM_WRITE_MPX 0x1E
55 #define SMB_COM_WRITE_MPX_SECONDARY 0x1F
56 #define SMB_COM_WRITE_COMPLETE 0x20
57 #define SMB_COM_QUERY_SERVER 0x21
58 #define SMB_COM_SET_INFORMATION2 0x22
59 #define SMB_COM_QUERY_INFORMATION2 0x23
60 #define SMB_COM_LOCKING_ANDX 0x24
61 #define SMB_COM_TRANSACTION 0x25
62 #define SMB_COM_TRANSACTION_SECONDARY 0x26
63 #define SMB_COM_IOCTL 0x27
64 #define SMB_COM_IOCTL_SECONDARY 0x28
65 #define SMB_COM_COPY 0x29
66 #define SMB_COM_MOVE 0x2A
67 #define SMB_COM_ECHO 0x2B
68 #define SMB_COM_WRITE_AND_CLOSE 0x2C
69 #define SMB_COM_OPEN_ANDX 0x2D
70 #define SMB_COM_READ_ANDX 0x2E
71 #define SMB_COM_WRITE_ANDX 0x2F
72 #define SMB_COM_NEW_FILE_SIZE 0x30
73 #define SMB_COM_CLOSE_AND_TREE_DISC 0x31
74 #define SMB_COM_TRANSACTION2 0x32
75 #define SMB_COM_TRANSACTION2_SECONDARY 0x33
76 #define SMB_COM_FIND_CLOSE2 0x34
77 #define SMB_COM_FIND_NOTIFY_CLOSE 0x35
79 #define SMB_COM_TREE_CONNECT 0x70
80 #define SMB_COM_TREE_DISCONNECT 0x71
81 #define SMB_COM_NEGOTIATE 0x72
82 #define SMB_COM_SESSION_SETUP_ANDX 0x73
83 #define SMB_COM_LOGOFF_ANDX 0x74
84 #define SMB_COM_TREE_CONNECT_ANDX 0x75
85 #define SMB_COM_QUERY_INFORMATION_DISK 0x80
86 #define SMB_COM_SEARCH 0x81
87 #define SMB_COM_FIND 0x82
88 #define SMB_COM_FIND_UNIQUE 0x83
89 #define SMB_COM_FIND_CLOSE 0x84
90 #define SMB_COM_NT_TRANSACT 0xA0
91 #define SMB_COM_NT_TRANSACT_SECONDARY 0xA1
92 #define SMB_COM_NT_CREATE_ANDX 0xA2
93 #define SMB_COM_NT_CANCEL 0xA4
94 #define SMB_COM_NT_RENAME 0xA5
95 #define SMB_COM_OPEN_PRINT_FILE 0xC0
96 #define SMB_COM_WRITE_PRINT_FILE 0xC1
97 #define SMB_COM_CLOSE_PRINT_FILE 0xC2
98 #define SMB_COM_GET_PRINT_QUEUE 0xC3
99 #define SMB_COM_READ_BULK 0xD8
100 #define SMB_COM_WRITE_BULK 0xD9
101 #define SMB_COM_WRITE_BULK_DATA 0xDA
105 #define SMB_SUCCESS 0x00
106 #define SMB_ERRDOS 0x01
107 #define SMB_ERRSRV 0x02
108 #define SMB_ERRHRD 0x03
109 #define SMB_ERRCMD 0x04
124 const guint8 *payload_data;
125 guint64 smb_file_offset;
126 guint32 smb_chunk_len;
133 guint32 ioctl_function;
140 gboolean resume_keys;
148 #define SMB_SIF_TID_IS_IPC 0x0001
149 #define SMB_SIF_IS_CONTINUED 0x0002
169 guint32 frame_req, frame_res;
174 smb_extra_info_t extra_info_type;
177 gboolean fid_seen_in_request;
195 guchar *param_descrip;
196 guchar *data_descrip;
197 guchar *aux_data_descrip;
204 #define TRANSACTION_PIPE 0
205 #define TRANSACTION_MAILSLOT 1
215 GHashTable *unmatched;
219 GHashTable *primaries;
222 GHashTable *tid_service;
223 gboolean raw_ntlmssp;
228 GSList *GSL_fid_info;
239 int tid, pid, uid, mid;
254 guint16 bc,
int dataoffset, guint16 datalen);
257 #define SMB_FID_TYPE_UNKNOWN 0
258 #define SMB_FID_TYPE_FILE 1
259 #define SMB_FID_TYPE_DIR 2
260 #define SMB_FID_TYPE_PIPE 3
288 guint32 create_flags;
290 guint32 file_attributes;
291 guint32 share_access;
292 guint32 create_options;
293 guint32 create_disposition;
321 int offset,
int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated,
smb_info_t* si);
327 int offset, gboolean setstate);
329 extern bool smb_dcerpc_reassembly;
333 extern int dissect_nt_create_options(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
335 extern int dissect_nt_share_access(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
337 extern int dissect_smb_access_mask(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
342 extern bool sid_display_hex;
344 extern int dissect_security_information_mask(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
350 extern int dissect_nt_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, guint16 *bcp);
351 extern int dissect_nt_user_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, guint16 *bcp);
352 extern int dissect_nt_get_user_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, guint32 *bcp);
356 extern int dissect_qfi_SMB_FILE_STREAM_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *parent_tree,
int offset, guint16 *bcp,
bool *trunc,
int unicode);
357 extern int dissect_qfi_SMB_FILE_NAME_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, guint16 *bcp,
bool *trunc, gboolean unicode);
363 extern int dissect_qfi_SMB_FILE_COMPRESSION_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, guint16 *bcp,
bool *trunc);
364 extern int dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, guint16 *bcp,
bool *trunc);
365 extern int dissect_qfi_SMB_FILE_ATTRIBUTE_TAG_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, guint16 *bcp,
bool *trunc);
366 extern int dissect_qsfi_SMB_FILE_ALLOCATION_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, guint16 *bcp,
bool *trunc);
368 extern int dissect_nt_notify_completion_filter(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
374 extern const gchar *tree_ip_str(
packet_info *pinfo, guint16 cmd);
Definition: packet_info.h:44
Definition: packet-smb.h:112
Definition: packet-smb.h:296
Definition: packet-smb.h:286
Definition: packet-smb.h:269
Definition: packet-smb.h:276
Definition: packet-smb.h:263
Definition: packet-smb.h:309
Definition: value_string.h:170
Definition: value_string.h:26
Definition: wmem_tree-int.h:48
Definition: packet-smb.h:213
Definition: packet-smb.h:237
Definition: packet-smb.h:130
Definition: packet-smb.h:168
Definition: packet-smb.h:137
Definition: packet-smb.h:188
Definition: tvbuff-int.h:35