r24712: No longer expose the 'BOOL' data type in any interfaces.
[samba.git] / source4 / include / core.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Core Samba data types
4
5    Copyright (C) Andrew Tridgell              1992-2000
6    Copyright (C) Stefan Metzmacher                        2004
7    Copyright (C) Jelmer Vernooij                          2005
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
23 #ifndef _SAMBA_CORE_H
24 #define _SAMBA_CORE_H
25
26 #include "libcli/util/nt_status.h"
27
28 #include <stdlib.h>
29
30 /* used to hold an arbitrary blob of data */
31 typedef struct datablob {
32         uint8_t *data;
33         size_t length;
34 } DATA_BLOB;
35
36 struct data_blob_list_item {
37         struct data_blob_list_item *prev,*next;
38         DATA_BLOB blob;
39 };
40
41 /* by making struct ldb_val and DATA_BLOB the same, we can simplify
42    a fair bit of code */
43 #define ldb_val datablob
44
45 /* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte aligned */
46 typedef uint64_t NTTIME;
47
48 /*
49   we use struct ipv4_addr to avoid having to include all the
50   system networking headers everywhere
51 */
52 struct ipv4_addr {
53         uint32_t addr;
54 };
55
56 typedef NTSTATUS (*init_module_fn) (void);
57
58 /* 
59    use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really
60    just a dom sid, but with the sub_auths represented as a conformant
61    array. As with all in-structure conformant arrays, the array length
62    is placed before the start of the structure. That's what gives rise
63    to the extra num_auths elemenent. We don't want the Samba code to
64    have to bother with such esoteric NDR details, so its easier to just
65    define it as a dom_sid and use pidl magic to make it all work. It
66    just means you need to mark a sid as a "dom_sid2" in the IDL when you
67    know it is of the conformant array variety
68 */
69 #define dom_sid2 dom_sid
70
71 /* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
72 #define dom_sid28 dom_sid
73
74 /* protocol types. It assumes that higher protocols include lower protocols
75    as subsets. FIXME: Move to one of the smb-specific headers */
76 enum protocol_types {
77         PROTOCOL_NONE,
78         PROTOCOL_CORE,
79         PROTOCOL_COREPLUS,
80         PROTOCOL_LANMAN1,
81         PROTOCOL_LANMAN2,
82         PROTOCOL_NT1,
83         PROTOCOL_SMB2
84 };
85
86 /* passed to br lock code. FIXME: Move to one of the smb-specific headers */
87 enum brl_type {
88         READ_LOCK,
89         WRITE_LOCK,
90         PENDING_READ_LOCK,
91         PENDING_WRITE_LOCK
92 };
93
94 enum server_role {
95         ROLE_STANDALONE=0,
96         ROLE_DOMAIN_MEMBER=1,
97         ROLE_DOMAIN_CONTROLLER=2,
98 };
99
100 enum announce_as {/* Types of machine we can announce as. */
101         ANNOUNCE_AS_NT_SERVER=1,
102         ANNOUNCE_AS_WIN95=2,
103         ANNOUNCE_AS_WFW=3,
104         ANNOUNCE_AS_NT_WORKSTATION=4
105 };
106
107
108 #endif /* _SAMBA_CORE_H */