12#ifndef __PACKET_SMB_H__
13#define __PACKET_SMB_H__
15#include "ws_symbol_export.h"
20WS_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
123 uint32_t payload_len;
124 const uint8_t *payload_data;
125 uint64_t smb_file_offset;
126 uint32_t smb_chunk_len;
133 uint32_t ioctl_function;
149#define SMB_SIF_TID_IS_IPC 0x0001
150#define SMB_SIF_IS_CONTINUED 0x0002
171 uint32_t frame_req, frame_res;
176 smb_extra_info_t extra_info_type;
179 bool fid_seen_in_request;
197 unsigned char *param_descrip;
198 unsigned char *data_descrip;
199 unsigned char *aux_data_descrip;
206#define TRANSACTION_PIPE 0
207#define TRANSACTION_MAILSLOT 1
217 GHashTable *unmatched;
221 GHashTable *primaries;
224 GHashTable *tid_service;
230 GSList *GSL_fid_info;
242 int tid, pid, uid, mid;
257 uint16_t bc,
int dataoffset, uint16_t datalen);
260#define SMB_FID_TYPE_UNKNOWN 0
261#define SMB_FID_TYPE_FILE 1
262#define SMB_FID_TYPE_DIR 2
263#define SMB_FID_TYPE_PIPE 3
281 uint8_t oplock_level;
291 uint32_t create_flags;
292 uint32_t access_mask;
293 uint32_t file_attributes;
294 uint32_t share_access;
295 uint32_t create_options;
296 uint32_t create_disposition;
324 int offset,
int len, uint16_t fid,
bool is_created,
bool is_closed,
bool is_generated,
smb_info_t* si);
330 int offset,
bool setstate);
332extern bool smb_dcerpc_reassembly;
336extern int dissect_nt_create_options(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
338extern int dissect_nt_share_access(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
340extern int dissect_smb_access_mask(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
345extern bool sid_display_hex;
347extern int dissect_security_information_mask(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
353extern int dissect_nt_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, uint16_t *bcp);
354extern int dissect_nt_user_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, uint16_t *bcp);
355extern int dissect_nt_get_user_quota(
tvbuff_t *tvb,
proto_tree *tree,
int offset, uint32_t *bcp);
359extern int dissect_qfi_SMB_FILE_STREAM_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *parent_tree,
int offset, uint16_t *bcp,
bool *trunc,
int unicode);
360extern int dissect_qfi_SMB_FILE_NAME_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, uint16_t *bcp,
bool *trunc,
bool unicode);
366extern int dissect_qfi_SMB_FILE_COMPRESSION_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, uint16_t *bcp,
bool *trunc);
367extern int dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, uint16_t *bcp,
bool *trunc);
368extern int dissect_qfi_SMB_FILE_ATTRIBUTE_TAG_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, uint16_t *bcp,
bool *trunc);
369extern int dissect_qsfi_SMB_FILE_ALLOCATION_INFO(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
int offset, uint16_t *bcp,
bool *trunc);
371extern int dissect_nt_notify_completion_filter(
tvbuff_t *tvb,
proto_tree *parent_tree,
int offset);
377extern const char *tree_ip_str(
packet_info *pinfo, uint16_t cmd);
Definition packet_info.h:43
Definition packet-smb.h:112
Definition packet-smb.h:299
Definition packet-smb.h:289
Definition packet-smb.h:272
Definition packet-smb.h:279
Definition packet-smb.h:266
Definition packet-smb.h:312
Definition value_string.h:169
Definition value_string.h:25
Definition wmem_tree-int.h:48
Definition packet-smb.h:215
Definition packet-smb.h:240
Definition packet-smb.h:130
Definition packet-smb.h:170
Definition packet-smb.h:138
Definition packet-smb.h:190
Definition tvbuff-int.h:35