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