implemented attribute mapping and chmod. file attributes are mapped in
[vlendec/samba-autobuild/.git] / source3 / smbwrapper / smbw.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 2.0
4    SMB wrapper functions - definitions
5    Copyright (C) Andrew Tridgell 1998
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #define SMBW_PREFIX "/smb/"
23 #define SMBW_DUMMY "/dev/null"
24
25 #define SMBW_CLI_FD 512
26 #define SMBW_MAX_OPEN 8192
27
28 #define SMBW_FILE_MODE (S_IFREG | 0444)
29 #define SMBW_DIR_MODE (S_IFDIR | 0555)
30
31 #define SMBW_PWD_ENV "PWD"
32
33
34 struct smbw_server {
35         struct smbw_server *next, *prev;
36         struct cli_state cli;
37         char *server_name;
38         char *share_name;
39         dev_t dev;
40 };
41
42 struct smbw_filedes {
43         int cli_fd;
44         int ref_count;
45         char *fname;
46         off_t offset;
47 };
48
49 struct smbw_file {
50         struct smbw_file *next, *prev;
51         struct smbw_filedes *f;
52         int fd;
53         struct smbw_server *srv;
54 };
55
56 struct smbw_dir {
57         struct smbw_dir *next, *prev;
58         int fd;
59         int offset, count, malloced;
60         struct smbw_server *srv;
61         struct file_info *list;
62         char *path;
63 };
64