libcli/smb move enum protocol_types to a common header
[bbaumbach/samba-autobuild/.git] / libcli / smb / smb_constants.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    SMB parameters and setup, plus a whole lot more.
5
6    Copyright (C) Andrew Tridgell              2011
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef _SMB_CONSTANTS_H
23 #define _SMB_CONSTANTS_H
24
25 /* protocol types. It assumes that higher protocols include lower protocols
26    as subsets. */
27 enum protocol_types {
28         PROTOCOL_NONE,
29         PROTOCOL_CORE,
30         PROTOCOL_COREPLUS,
31         PROTOCOL_LANMAN1,
32         PROTOCOL_LANMAN2,
33         PROTOCOL_NT1,
34         PROTOCOL_SMB2
35 };
36
37 /* NT Flags2 bits - cifs6.txt section 3.1.2 */
38 #define FLAGS2_LONG_PATH_COMPONENTS    0x0001
39 #define FLAGS2_EXTENDED_ATTRIBUTES     0x0002
40 #define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004
41 #define FLAGS2_UNKNOWN_BIT4            0x0010
42 #define FLAGS2_IS_LONG_NAME            0x0040
43 #define FLAGS2_EXTENDED_SECURITY       0x0800
44 #define FLAGS2_DFS_PATHNAMES           0x1000
45 #define FLAGS2_READ_PERMIT_EXECUTE     0x2000
46 #define FLAGS2_32_BIT_ERROR_CODES      0x4000
47 #define FLAGS2_UNICODE_STRINGS         0x8000
48 #define FLAGS2_WIN2K_SIGNATURE         0xC852 /* Hack alert ! For now... JRA. */
49
50 /* FileAttributes (search attributes) field */
51 #define FILE_ATTRIBUTE_READONLY         0x0001L
52 #define FILE_ATTRIBUTE_HIDDEN           0x0002L
53 #define FILE_ATTRIBUTE_SYSTEM           0x0004L
54 #define FILE_ATTRIBUTE_VOLUME           0x0008L
55 #define FILE_ATTRIBUTE_DIRECTORY        0x0010L
56 #define FILE_ATTRIBUTE_ARCHIVE          0x0020L
57 #define FILE_ATTRIBUTE_DEVICE           0x0040L
58 #define FILE_ATTRIBUTE_NORMAL           0x0080L
59 #define FILE_ATTRIBUTE_TEMPORARY        0x0100L
60 #define FILE_ATTRIBUTE_SPARSE           0x0200L
61 #define FILE_ATTRIBUTE_REPARSE_POINT    0x0400L
62 #define FILE_ATTRIBUTE_COMPRESSED       0x0800L
63 #define FILE_ATTRIBUTE_OFFLINE          0x1000L
64 #define FILE_ATTRIBUTE_NONINDEXED       0x2000L
65 #define FILE_ATTRIBUTE_ENCRYPTED        0x4000L
66 #define FILE_ATTRIBUTE_ALL_MASK         0x7FFFL
67
68 #define SAMBA_ATTRIBUTES_MASK           (FILE_ATTRIBUTE_READONLY|\
69                                         FILE_ATTRIBUTE_HIDDEN|\
70                                         FILE_ATTRIBUTE_SYSTEM|\
71                                         FILE_ATTRIBUTE_DIRECTORY|\
72                                         FILE_ATTRIBUTE_ARCHIVE)
73
74 #endif /* _SMB_CONSTANTS_H */