432be5609563b88dbae125d8a4a6dfeeb923355e
[ira/wip.git] / source4 / include / rewrite.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup, plus a whole lot more.
4    
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
11    
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.
16    
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.
21    
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.
25 */
26
27 #ifndef _REWRITE_H
28 #define _REWRITE_H
29
30 #define False (0)
31 #define True (1)
32 #define Auto (2)
33
34 #ifndef _BOOL
35 typedef int BOOL;
36 #define _BOOL       /* So we don't typedef BOOL again in vfs.h */
37 #endif
38
39 /* string manipulation flags - see clistr.c and srvstr.c */
40 #define STR_TERMINATE 1
41 #define STR_UPPER 2
42 #define STR_ASCII 4
43 #define STR_UNICODE 8
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 */
49
50 /* Debugging stuff */
51 #include "debug.h"
52 #include "doserr.h"
53
54 #include "enums.h"
55 #include "events.h"
56
57 #ifndef LOCKING_VERSION
58 #define LOCKING_VERSION 4
59 #endif /* LOCKING_VERSION */
60
61 #ifndef SIGNAL_CAST
62 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
63 #endif
64
65 #ifndef SELECT_CAST
66 #define SELECT_CAST
67 #endif
68
69 /*
70  * Loopback command offsets.
71  */
72
73 #define OPBRK_CMD_LEN_OFFSET 0
74 #define OPBRK_CMD_PORT_OFFSET 4
75 #define OPBRK_CMD_HEADER_LEN 6
76
77 #define OPBRK_MESSAGE_CMD_OFFSET 0
78
79 /* Message types */
80 #define OPLOCK_BREAK_CMD 0x1
81 #define KERNEL_OPLOCK_BREAK_CMD 0x2
82 #define LEVEL_II_OPLOCK_BREAK_CMD 0x3
83 #define ASYNC_LEVEL_II_OPLOCK_BREAK_CMD 0x4
84
85 #define CMD_REPLY 0x8000
86
87 #include "smb_macros.h"
88
89 #include "rpc_secdes.h"
90
91 #include "client.h"
92
93 #define SAFE_NETBIOS_CHARS ". -_"
94
95 /* generic iconv conversion structure */
96 typedef struct {
97         size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft,
98                          char **outbuf, size_t *outbytesleft);
99         size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft,
100                        char **outbuf, size_t *outbytesleft);
101         size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
102                        char **outbuf, size_t *outbytesleft);
103         void *cd_direct, *cd_pull, *cd_push;
104 } *smb_iconv_t;
105
106 #endif /* _REWRITE_H */