libndr: Avoid assigning duplicate versions to symbols
[amitay/samba.git] / source3 / include / MacExtensions.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell 1992-1998
5    Copyright (C) John H Terpstra 1996-1998
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1998
7    Copyright (C) Paul Ashton 1998
8     
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef _MAC_EXTENSIONS_H
23 #define _MAC_EXTENSIONS_H
24
25 /* Folder that holds the stream info */
26 #define STREAM_FOLDER                                   ".streams"
27 #define STREAM_FOLDER_SLASH                     ".streams/"
28
29 /* Common Streams Names*/
30 #define DefaultStreamTestLen    6
31 #define DefaultStreamTest               ":$DATA"
32 #define AFPDATA_STREAM                  "::$DATA"
33
34 #define AFPINFO_STREAM_NAME             ":AFP_AfpInfo"
35 #define AFPRESOURCE_STREAM_NAME         ":AFP_Resource"
36 #define AFPCOMMENTS_STREAM_NAME         ":Comments"
37 #define AFPDESKTOP_STREAM_NAME          ":AFP_DeskTop"
38 #define AFPIDINDEX_STREAM_NAME          ":AFP_IdIndex"
39
40 #define AFPINFO_STREAM                  AFPINFO_STREAM_NAME ":$DATA"
41 #define AFPRESOURCE_STREAM              AFPRESOURCE_STREAM_NAME ":$DATA"
42 #define AFPCOMMENTS_STREAM              AFPCOMMENTS_STREAM_NAME ":$DATA"
43 #define AFPDESKTOP_STREAM               AFPDESKTOP_STREAM_NAME ":$DATA"
44 #define AFPIDINDEX_STREAM               AFPIDINDEX_STREAM_NAME ":$DATA"
45
46 /*
47 ** NT's AFP_AfpInfo stream structure
48 */
49 #define AFP_INFO_SIZE           0x3c
50 #define AFP_Signature           0x41465000 
51 #define AFP_Version                     0x00000100
52 #define AFP_BackupTime          0x80000000
53 #define AFP_FinderSize          32
54
55 #define AFP_OFF_FinderInfo      16
56
57 /*
58 ** Original AFP_AfpInfo stream used by NT
59 ** We needed a way to store the create date so SAMBA
60 ** AFP_AfpInfo adds for bytes to this structrure
61 ** and call's it _SambaAfpInfo
62 */
63 typedef struct _AfpInfo
64 {
65          uint32_t       afpi_Signature;                 /* Must be *(PDWORD)"AFP" */
66          uint32_t       afpi_Version;                   /* Must be 0x00010000 */
67          uint32_t       afpi_Reserved1;
68          uint32_t       afpi_BackupTime;                /* Backup time for the file/dir */
69          unsigned char  afpi_FinderInfo[AFP_FinderSize];        /* Finder Info (32 bytes) */
70          unsigned char  afpi_ProDosInfo[6];     /* ProDos Info (6 bytes) # */
71          unsigned char  afpi_Reserved2[6];
72 } AfpInfo;
73
74 typedef struct _SambaAfpInfo
75 {
76          AfpInfo        afp; 
77          unsigned long  createtime;
78 } SambaAfpInfo;
79
80 /*
81 ** On SAMBA this structure is followed by 4 bytes that store the create
82 ** date of the file or folder asociated with it.
83 */
84
85 /*
86 ** These extensions are only supported with the NT LM 0.12 Dialect. These extensions
87 ** will be process on a share by share bases.
88 */
89
90 /*
91 ** Trans2_Query_FS_Information Call is used by the MacCIFS extensions for three reasons.
92 ** First to see if the remote server share supports the basic Macintosh CIFS extensions.
93 ** Second to return some basic need information about the share to the Macintosh.
94 ** Third to see if this share support any other Macintosh extensions.
95 **
96 ** We will be using information levels that are between 0x300 and 0x399 for all Macintosh
97 ** extensions calls. The first of these will be the SMB_MAC_QUERY_FS_INFO level which
98 ** will allow the server to return the MacQueryFSInfo structure. All fields are Little
99 ** Endian unless otherwise specified.
100 */
101 #define SMB_MAC_QUERY_FS_INFO 0x301
102
103
104
105 /* 
106 ** The server will return folder access control in the Trans2_Find_First2 
107 ** and Trans2_Find_Next2 message described later in this document. 
108 */
109 #define SUPPORT_MAC_ACCESS_CNTRL        0x0010
110 /*
111 ** The server supports setting/getting comments using the mechanism in this 
112 ** document instead of using the NTFS format described in the Introduction. 
113 */
114 #define SUPPORT_MAC_GETSETCOMMENTS      0x0020
115 /*
116 ** The Server supports setting and getting Macintosh desktop database information
117 ** using the mechanism in this document. 
118 */
119 #define SUPPORT_MAC_DESKTOPDB_CALLS     0x0040
120 /*
121 ** The server will return a unique id for files and directories in the 
122 ** Trans2_Find_First2 and Trans2_Find_Next2 message described later in this document. 
123 */
124 #define SUPPORT_MAC_UNIQUE_IDS          0x0080
125 /*
126 ** The server will return this flag telling the client that the server does
127 ** not support streams or the Macintosh extensions. The rest of this message
128 ** will be ignored by the client. 
129 */
130 #define NO_STREAMS_OR_MAC_SUPPORT       0x0100
131
132 /*
133 ** We will be adding a new info level to the Trans2_Find_First2 and Trans2_Find_Next2.
134 ** This info level will be SMB_MAC_FIND_BOTH_HFS_INFO and will support the server
135 ** return additional information need by the Macintosh. All fields are Little
136 ** Endian unless other wise specified.
137 */
138
139 #define SMB_MAC_FIND_BOTH_HFS_INFO        0x302
140
141 enum {
142         ownerRead       = 0x0400,
143         ownerWrite      = 0x0200,
144         ownerSearch     = 0x0100,
145         groupRead       = 0x0040,
146         groupWrite      = 0x0020,
147         groupSearch     = 0x0010,
148         otherRead       = 0x0004,
149         otherWrite      = 0x0002,
150         otherSearch     = 0x0001,
151         Owner           = 0x0800
152 };
153         
154
155 /*
156 ** We will be adding a new info level to the Trans2_Set_Path_Information.
157 ** This info level will be SMB_MAC_SET_FINDER_INFO and will support the client
158 ** setting information on the server need by the Macintosh. All fields are Little
159 ** Endian unless other wise specified.
160 */
161
162 #define SMB_MAC_SET_FINDER_INFO   0x303
163
164 enum {
165         SetCreateDate   = 0x01,                 /* If this is set then set the create date of the file/folder */
166         SetModDate              = 0x02,                 /* If this is set then set the modify date of the file/folder */
167         SetFLAttrib             = 0x04,                 /* If this is set then set the Macintosh lock bit of the file/folder */
168         FndrInfo1               = 0x08,                 /* If this is set then set the first 16 bytes of finder info */
169         FndrInfo2               = 0x10,                 /* If this is set then set the second 16 bytes of finder info */
170         SetHidden               = 0x20                  /* We are either setting or unsetting the hidden bit */
171 };
172
173
174 /*
175 ** We will be adding some new info level to the Trans2_Set_Path_Information and Trans2_Query_Path_Information.
176 ** These info levels will allow the client to add, get, and remove desktop inforamtion from the
177 ** server. How the server stores this information is up to them.
178 */
179
180 /*
181 ** We need to be able to store an application name and its creator in a database. We send a 
182 ** Trans2_Set_Path_Information call with the full path of the application in the path field. 
183 ** We will send an info level that represents adding an application name and creator to the database.
184 ** We will pass the File Creator in the data message. 
185 **
186 ** The server should just respond  with no error or an error.
187 */
188 #define SMB_MAC_DT_ADD_APPL       0x304
189
190 /*
191 ** We need to be able to remove an application name and its creator from a database. We send a 
192 ** Trans2_Set_Path_Information call with the full path of the application in the path field. 
193 ** We will send an info level that represents removing an application name and creator from the database.
194 ** We will pass the File Creator in the data message. 
195 **
196 ** The server should just respond  with no error or an error.
197 */
198 #define SMB_MAC_DT_REMOVE_APPL    0x305
199
200
201 /*
202 ** We need to be able to get an application name and its creator from a database. We send a 
203 ** Trans2_Query_Path_Information call in which the name field is just ignore. 
204 ** We will send an info level that represents getting an application name with a structure that 
205 ** contains the File Creator and index. Were index has the following meaning.
206 **              Index = 0; Get the application path from the database with the most current date.
207 **              Index > 0; Use the index to find the application path from the database.
208 **                              e.g.    index of 5 means get the fifth entry of this application name in the database.
209 **                                              if not entry return an error.
210 **
211 ** The server returns with a structure that contains the full path to the appication and
212 ** its creator's date.
213 */
214 #define SMB_MAC_DT_GET_APPL       0x306
215
216
217 /*
218 ** We need to be able to get an icon from a database. We send a Trans2_Query_Path_Information call in 
219 ** which the path name is ignore. We will send an info level that represents getting an icon with a structure
220 ** that contains the Requested size of the icon, the Icon type, File Creator, and File Type.
221 **
222 ** The server returns with a structure that contains the actual size of the icon 
223 ** (must be less than requested length) and the icon bit map. 
224 */
225 #define SMB_MAC_DT_GET_ICON       0x307
226
227
228 /*
229 ** We need to be able to get an icon from a database. We send a Trans2_Query_Path_Information call in 
230 ** which the path name is ignore. We will send an info level that represents getting an icon with a structure
231 ** that contains the index and File Creator. The index allows the client to make repeated calls to the server
232 ** gathering all icon stored by this file creator.
233 **              
234 **
235 ** The server returns with a structure that contains the actual size of the icon 
236 ** (must be less than requested length) and the icon bit map, File Type, and Icon Type. 
237 */
238 #define SMB_MAC_DT_GET_ICON_INFO          0x308
239
240
241
242 /*
243 ** We need to be able to add an icon to a database. We send a Trans2_Set_Path_Information call in 
244 ** which the path name is ignore. We will send an info level that represents setting an icon with a structure
245 ** that contains the icon data, icon size, icon type, the file type, and file creator.
246 **              
247 **
248 ** The server returns only that the call was successful or not.
249 */
250 #define SMB_MAC_DT_ADD_ICON       0x309
251
252 #endif /* _MAC_EXTENSIONS_H */
253
254 /* _MAC_EXTENSIONS_H */
255