2 Unix SMB/CIFS implementation.
3 SMB parameters and setup, plus a whole lot more.
5 Copyright (C) Andrew Tridgell 1992-2000
6 Copyright (C) John H Terpstra 1996-2002
7 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
8 Copyright (C) Paul Ashton 1998-2000
9 Copyright (C) Simo Sorce 2001-2002
10 Copyright (C) Martin Pool 2002
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 #define _BOOL /* So we don't typedef BOOL again in vfs.h */
39 /* string manipulation flags - see clistr.c and srvstr.c */
40 #define STR_TERMINATE 1
44 #define STR_NOALIGN 16
45 #define STR_NO_RANGE_CHECK 32
46 #define STR_LEN8BIT 64
47 #define STR_TERMINATE_ASCII 128 /* only terminate if ascii */
48 #define STR_LEN_NOTERM 256 /* the length field is the unterminated length */
54 /* for compatibility */
55 #define SID_NAME_USE samr_SidType
57 /* used to hold an arbitrary blob of data */
58 typedef struct data_blob {
63 /* Globally Unique ID */
66 /* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
67 typedef uint64_t NTTIME;
69 /* 8 byte aligned 'hyper' type from MS IDL */
70 typedef uint64_t HYPER_T;
76 /* used for network interfaces */
79 struct interface *next, *prev;
85 /* the following are used by loadparm for option lists */
88 P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
89 P_STRING,P_USTRING,P_ENUM,P_SEP
94 P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
108 BOOL (*special)(const char *, char **);
109 const struct enum_list *enum_list;
125 #define FLAG_BASIC 0x0001 /* fundamental options */
126 #define FLAG_SHARE 0x0002 /* file sharing options */
127 #define FLAG_PRINT 0x0004 /* printing options */
128 #define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */
129 #define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */
130 #define FLAG_ADVANCED 0x0020 /* Parameters that the wizard will operate on */
131 #define FLAG_DEVELOPER 0x0040 /* Parameters that the wizard will operate on */
132 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
133 #define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */
134 #define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */
135 #define FLAG_CMDLINE 0x8000 /* this option was set from the command line */
137 #ifndef LOCKING_VERSION
138 #define LOCKING_VERSION 4
139 #endif /* LOCKING_VERSION */
142 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
150 * Loopback command offsets.
153 #define OPBRK_CMD_LEN_OFFSET 0
154 #define OPBRK_CMD_PORT_OFFSET 4
155 #define OPBRK_CMD_HEADER_LEN 6
157 #define OPBRK_MESSAGE_CMD_OFFSET 0
160 #define OPLOCK_BREAK_CMD 0x1
161 #define KERNEL_OPLOCK_BREAK_CMD 0x2
162 #define LEVEL_II_OPLOCK_BREAK_CMD 0x3
163 #define ASYNC_LEVEL_II_OPLOCK_BREAK_CMD 0x4
166 * Capabilities abstracted for different systems.
169 #define KERNEL_OPLOCK_CAPABILITY 0x1
172 * Oplock break command code sent via the kernel interface (if it exists).
176 * 0 2 2+devsize 2+devsize+inodesize
177 * +----+--------+--------+----------+
178 * | cmd| dev | inode | fileid |
179 * +----+--------+--------+----------+
181 #define KERNEL_OPLOCK_BREAK_DEV_OFFSET 2
182 #define KERNEL_OPLOCK_BREAK_INODE_OFFSET (KERNEL_OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T))
183 #define KERNEL_OPLOCK_BREAK_FILEID_OFFSET (KERNEL_OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T))
184 #define KERNEL_OPLOCK_BREAK_MSG_LEN (KERNEL_OPLOCK_BREAK_FILEID_OFFSET + sizeof(unsigned long))
187 #define CMD_REPLY 0x8000
189 #include "smb_macros.h"
191 /* A netbios name structure. */
199 /* A netbios node status array element. */
206 #include "rpc_secdes.h"
211 Do you want session setups at user level security with a invalid
212 password to be rejected or allowed in as guest? WinNT rejects them
213 but it can be a pain as it means "net view" needs to use a password
215 You have 3 choices in the setting of map_to_guest:
217 "NEVER_MAP_TO_GUEST" means session setups with an invalid password
218 are rejected. This is the default.
220 "MAP_TO_GUEST_ON_BAD_USER" means session setups with an invalid password
221 are rejected, unless the username does not exist, in which case it
222 is treated as a guest login
224 "MAP_TO_GUEST_ON_BAD_PASSWORD" means session setups with an invalid password
225 are treated as a guest login
227 Note that map_to_guest only has an effect in user or server
231 #define NEVER_MAP_TO_GUEST 0
232 #define MAP_TO_GUEST_ON_BAD_USER 1
233 #define MAP_TO_GUEST_ON_BAD_PASSWORD 2
235 #define SAFE_NETBIOS_CHARS ". -_"
237 /* generic iconv conversion structure */
239 size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft,
240 char **outbuf, size_t *outbytesleft);
241 size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft,
242 char **outbuf, size_t *outbytesleft);
243 size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
244 char **outbuf, size_t *outbytesleft);
245 void *cd_direct, *cd_pull, *cd_push;
248 #include "lib/cmdline/popt_common.h"
250 #endif /* _REWRITE_H */