]>
The Tcpdump Group git mirrors - tcpdump/blob - smb.h
2 * Copyright (C) Andrew Tridgell 1995-1999
4 * This software may be distributed either under the terms of the
5 * BSD-style license that accompanies tcpdump or the GNU GPL version 2
9 #define SMBMIN(a,b) ((a)<(b)?(a):(b))
12 #define SMBmkdir 0x00 /* create directory */
13 #define SMBrmdir 0x01 /* delete directory */
14 #define SMBopen 0x02 /* open file */
15 #define SMBcreate 0x03 /* create file */
16 #define SMBclose 0x04 /* close file */
17 #define SMBflush 0x05 /* flush file */
18 #define SMBunlink 0x06 /* delete file */
19 #define SMBmv 0x07 /* rename file */
20 #define SMBgetatr 0x08 /* get file attributes */
21 #define SMBsetatr 0x09 /* set file attributes */
22 #define SMBread 0x0A /* read from file */
23 #define SMBwrite 0x0B /* write to file */
24 #define SMBlock 0x0C /* lock byte range */
25 #define SMBunlock 0x0D /* unlock byte range */
26 #define SMBctemp 0x0E /* create temporary file */
27 #define SMBmknew 0x0F /* make new file */
28 #define SMBchkpth 0x10 /* check directory path */
29 #define SMBexit 0x11 /* process exit */
30 #define SMBlseek 0x12 /* seek */
31 #define SMBtcon 0x70 /* tree connect */
32 #define SMBtconX 0x75 /* tree connect and X*/
33 #define SMBtdis 0x71 /* tree disconnect */
34 #define SMBnegprot 0x72 /* negotiate protocol */
35 #define SMBdskattr 0x80 /* get disk attributes */
36 #define SMBsearch 0x81 /* search directory */
37 #define SMBsplopen 0xC0 /* open print spool file */
38 #define SMBsplwr 0xC1 /* write to print spool file */
39 #define SMBsplclose 0xC2 /* close print spool file */
40 #define SMBsplretq 0xC3 /* return print queue */
41 #define SMBsends 0xD0 /* send single block message */
42 #define SMBsendb 0xD1 /* send broadcast message */
43 #define SMBfwdname 0xD2 /* forward user name */
44 #define SMBcancelf 0xD3 /* cancel forward */
45 #define SMBgetmac 0xD4 /* get machine name */
46 #define SMBsendstrt 0xD5 /* send start of multi-block message */
47 #define SMBsendend 0xD6 /* send end of multi-block message */
48 #define SMBsendtxt 0xD7 /* send text of multi-block message */
51 #define SMBlockread 0x13 /* Lock a range and read */
52 #define SMBwriteunlock 0x14 /* Unlock a range then write */
53 #define SMBreadbraw 0x1a /* read a block of data with no smb header */
54 #define SMBwritebraw 0x1d /* write a block of data with no smb header */
55 #define SMBwritec 0x20 /* secondary write request */
56 #define SMBwriteclose 0x2c /* write a file then close it */
58 /* dos extended protocol */
59 #define SMBreadBraw 0x1A /* read block raw */
60 #define SMBreadBmpx 0x1B /* read block multiplexed */
61 #define SMBreadBs 0x1C /* read block (secondary response) */
62 #define SMBwriteBraw 0x1D /* write block raw */
63 #define SMBwriteBmpx 0x1E /* write block multiplexed */
64 #define SMBwriteBs 0x1F /* write block (secondary request) */
65 #define SMBwriteC 0x20 /* write complete response */
66 #define SMBsetattrE 0x22 /* set file attributes expanded */
67 #define SMBgetattrE 0x23 /* get file attributes expanded */
68 #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
69 #define SMBtrans 0x25 /* transaction - name, bytes in/out */
70 #define SMBtranss 0x26 /* transaction (secondary request/response) */
71 #define SMBioctl 0x27 /* IOCTL */
72 #define SMBioctls 0x28 /* IOCTL (secondary request/response) */
73 #define SMBcopy 0x29 /* copy */
74 #define SMBmove 0x2A /* move */
75 #define SMBecho 0x2B /* echo */
76 #define SMBopenX 0x2D /* open and X */
77 #define SMBreadX 0x2E /* read and X */
78 #define SMBwriteX 0x2F /* write and X */
79 #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
80 #define SMBffirst 0x82 /* find first */
81 #define SMBfunique 0x83 /* find unique */
82 #define SMBfclose 0x84 /* find close */
83 #define SMBinvalid 0xFE /* invalid command */
85 /* Extended 2.0 protocol */
86 #define SMBtrans2 0x32 /* TRANS2 protocol set */
87 #define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
88 #define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
89 #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
90 #define SMBulogoffX 0x74 /* user logoff */
92 /* NT SMB extensions. */
93 #define SMBnttrans 0xA0 /* NT transact */
94 #define SMBnttranss 0xA1 /* NT transact secondary */
95 #define SMBntcreateX 0xA2 /* NT create and X */
96 #define SMBntcancel 0xA4 /* NT cancel */
98 /* pathworks special */
99 #define pSETDIR '\377'
102 /* these are the TRANS2 sub commands */
103 #define TRANSACT2_OPEN 0
104 #define TRANSACT2_FINDFIRST 1
105 #define TRANSACT2_FINDNEXT 2
106 #define TRANSACT2_QFSINFO 3
107 #define TRANSACT2_SETFSINFO 4
108 #define TRANSACT2_QPATHINFO 5
109 #define TRANSACT2_SETPATHINFO 6
110 #define TRANSACT2_QFILEINFO 7
111 #define TRANSACT2_SETFILEINFO 8
112 #define TRANSACT2_FSCTL 9
113 #define TRANSACT2_IOCTL 10
114 #define TRANSACT2_FINDNOTIFYFIRST 11
115 #define TRANSACT2_FINDNOTIFYNEXT 12
116 #define TRANSACT2_MKDIR 13
118 #define PTR_DIFF(p1, p2) ((size_t)(((char *)(p1)) - (char *)(p2)))
121 const u_char
*smb_fdata(const u_char
*, const char *, const u_char
*, int);