r21297: Remove the GTK+ tools and library from the main repository. They are now...
[Samba/ekacnet.git] / source4 / include / core.h
blob81daaefa11e18764ba5d8144e1a07e89d0f113ed
1 /*
2 Unix SMB/CIFS implementation.
3 Core Samba data types
5 Copyright (C) Andrew Tridgell 1992-2000
6 Copyright (C) Stefan Metzmacher 2004
7 Copyright (C) Jelmer Vernooij 2005
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 2 of the License, or
12 (at your option) any later version.
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.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _SAMBA_CORE_H
25 #define _SAMBA_CORE_H
27 #include "libcli/util/nt_status.h"
29 #include <stdbool.h>
30 #include <stdlib.h>
31 typedef bool BOOL;
33 #define False false
34 #define True true
36 /* used to hold an arbitrary blob of data */
37 typedef struct datablob {
38 uint8_t *data;
39 size_t length;
40 } DATA_BLOB;
42 struct data_blob_list_item {
43 struct data_blob_list_item *prev,*next;
44 DATA_BLOB blob;
47 /* by making struct ldb_val and DATA_BLOB the same, we can simplify
48 a fair bit of code */
49 #define ldb_val datablob
51 /* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte aligned */
52 typedef uint64_t NTTIME;
55 we use struct ipv4_addr to avoid having to include all the
56 system networking headers everywhere
58 struct ipv4_addr {
59 uint32_t addr;
62 typedef NTSTATUS (*init_module_fn) (void);
64 /*
65 use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really
66 just a dom sid, but with the sub_auths represented as a conformant
67 array. As with all in-structure conformant arrays, the array length
68 is placed before the start of the structure. That's what gives rise
69 to the extra num_auths elemenent. We don't want the Samba code to
70 have to bother with such esoteric NDR details, so its easier to just
71 define it as a dom_sid and use pidl magic to make it all work. It
72 just means you need to mark a sid as a "dom_sid2" in the IDL when you
73 know it is of the conformant array variety
75 #define dom_sid2 dom_sid
77 /* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
78 #define dom_sid28 dom_sid
80 /* protocol types. It assumes that higher protocols include lower protocols
81 as subsets. FIXME: Move to one of the smb-specific headers */
82 enum protocol_types {
83 PROTOCOL_NONE,
84 PROTOCOL_CORE,
85 PROTOCOL_COREPLUS,
86 PROTOCOL_LANMAN1,
87 PROTOCOL_LANMAN2,
88 PROTOCOL_NT1,
89 PROTOCOL_SMB2
92 /* passed to br lock code. FIXME: Move to one of the smb-specific headers */
93 enum brl_type {
94 READ_LOCK,
95 WRITE_LOCK,
96 PENDING_READ_LOCK,
97 PENDING_WRITE_LOCK
100 enum server_role {
101 ROLE_STANDALONE=0,
102 ROLE_DOMAIN_MEMBER=1,
103 ROLE_DOMAIN_CONTROLLER=2,
106 enum announce_as {/* Types of machine we can announce as. */
107 ANNOUNCE_AS_NT_SERVER=1,
108 ANNOUNCE_AS_WIN95=2,
109 ANNOUNCE_AS_WFW=3,
110 ANNOUNCE_AS_NT_WORKSTATION=4
114 #endif /* _SAMBA_CORE_H */