4 import
"server_id.idl";
9 uuid("07408340-ae31-11e1-97dc-539f7fddc06f"),
11 pointer_default(unique),
12 helpstring("smbXsrv structures")
17 * smbXsrv_version* is designed to allow
18 * rolling code upgrades in future (within a cluster).
20 * This just adds the infrastructure,
21 * but we does not implement it yet!
23 * Currently it only prevents that
24 * nodes with a different version numbers
25 * cannot run at the same time.
27 * Each node checks at startup, if the version
28 * matches the version of all other nodes.
29 * And it exits if the version does not match
30 * to avoid corruption.
32 * While it would be possible to add versioning
33 * to each of our internal databases it is easier
34 * use a dedicated database "smbXsrv_version_global.tdb"
35 * to hold the global version information.
37 * This removes extra complexity from the individual
38 * databases and allows that we add/remove databases
39 * or use different indexing keys.
42 typedef [v1_enum] enum {
44 * NOTE: Version 0 is designed to be unstable and the format
45 * may change during development.
47 SMBXSRV_VERSION_0
= 0x00000000
48 } smbXsrv_version_values
;
50 const uint32 SMBXSRV_VERSION_CURRENT
= SMBXSRV_VERSION_0
;
54 smbXsrv_version_values min_version
;
55 smbXsrv_version_values max_version
;
56 smbXsrv_version_values current_version
;
57 } smbXsrv_version_node0
;
60 [ignore] db_record
*db_rec
;
61 [range(1, 1024)] uint32 num_nodes
;
62 smbXsrv_version_node0 nodes
[num_nodes
];
63 } smbXsrv_version_global0
;
66 [case(0)] smbXsrv_version_global0
*info0
;
67 [default] hyper *dummy
;
68 } smbXsrv_version_globalU
;
70 typedef [public] struct {
71 smbXsrv_version_values
version;
73 [switch_is(version)] smbXsrv_version_globalU info
;
74 } smbXsrv_version_globalB
;
76 void smbXsrv_version_global_decode
(
77 [in] smbXsrv_version_globalB blob
82 typedef [public] struct {
83 [ignore] struct tevent_context
*ev_ctx
;
84 [ignore] struct messaging_context
*msg_ctx
;
87 * There's just one 'sconn' per client.
88 * It holds the FSA layer details, which are global
89 * per client (process).
91 [ignore] struct smbd_server_connection
*sconn
;
94 * this session_table is used for SMB1 and SMB2,
96 [ignore] struct smbXsrv_session_table
*session_table
;
97 [ignore] hyper last_session_id
;
99 * this tcon_table is only used for SMB1.
101 [ignore] struct smbXsrv_tcon_table
*tcon_table
;
103 * this open_table is used for SMB1 and SMB2,
104 * because we have a global sconn->real_max_open_files
107 [ignore] struct smbXsrv_open_table
*open_table
;
110 * For now this is only one connection!
111 * With multi-channel support we'll get more than
114 [ignore] struct smbXsrv_connection
*connections
;
121 [charset
(UTF8
),string] char local_address
[];
122 [charset
(UTF8
),string] char remote_address
[];
123 [charset
(UTF8
),string] char remote_name
[];
124 [noprint
] DATA_BLOB signing_key
;
125 uint32 auth_session_info_seqnum
;
126 [ignore] smbXsrv_connection
*connection
;
127 } smbXsrv_channel_global0
;
130 [ignore] db_record
*db_rec
;
131 uint32 session_global_id
;
132 hyper session_wire_id
;
133 NTTIME creation_time
;
134 NTTIME expiration_time
;
136 * auth_session is NULL until the
137 * session is valid for the first time.
140 uint32 auth_session_info_seqnum
;
141 auth_session_info
*auth_session_info
;
142 uint16 connection_dialect
;
143 boolean8 signing_required
;
144 boolean8 encryption_required
;
145 [noprint
] DATA_BLOB signing_key
;
146 [noprint
] DATA_BLOB encryption_key
;
147 [noprint
] DATA_BLOB decryption_key
;
148 [noprint
] DATA_BLOB application_key
;
149 [range(1, 1024)] uint32 num_channels
;
150 smbXsrv_channel_global0 channels
[num_channels
];
151 } smbXsrv_session_global0
;
154 [case(0)] smbXsrv_session_global0
*info0
;
155 [default] hyper *dummy
;
156 } smbXsrv_session_globalU
;
158 typedef [public] struct {
159 smbXsrv_version_values
version;
161 [switch_is(version)] smbXsrv_session_globalU info
;
162 } smbXsrv_session_globalB
;
164 void smbXsrv_session_global_decode
(
165 [in] smbXsrv_session_globalB blob
169 * The main server code should just work with
170 * 'struct smbXsrv_session' and never use
171 * smbXsrv_session0, smbXsrv_sessionU
172 * and smbXsrv_sessionB directly.
174 * If we need to change the smbXsrv_session,
175 * we can just rename smbXsrv_session
176 * to smbXsrv_session0 and add a new
177 * smbXsrv_session for version 1
178 * and could implement transparent mapping.
181 [ignore] smbXsrv_session_table
*table
;
182 [ignore] db_record
*db_rec
;
183 [ignore] smbXsrv_client
*client
;
185 [ref] smbXsrv_session_global0
*global
;
188 hyper nonce_high_random
;
189 hyper nonce_high_max
;
192 [ignore] gensec_security
*gensec
;
193 [ignore] user_struct
*compat
;
194 [ignore] smbXsrv_tcon_table
*tcon_table
;
195 [ignore] smbXsrv_preauth
*preauth
;
199 [case(0)] smbXsrv_session
*info0
;
200 [default] hyper *dummy
;
203 typedef [public] struct {
204 smbXsrv_version_values
version;
205 [value
(0)] uint32 reserved
;
206 [switch_is(version)] smbXsrv_sessionU info
;
209 void smbXsrv_session_decode
(
210 [in] smbXsrv_sessionB blob
214 * smbXsrv_session_close is use in the MSG_SMBXSRV_SESSION_CLOSE
218 uint32 old_session_global_id
;
219 hyper old_session_wire_id
;
220 NTTIME old_creation_time
;
221 hyper new_session_wire_id
;
222 } smbXsrv_session_close0
;
225 [case(0)] smbXsrv_session_close0
*info0
;
226 [default] hyper *dummy
;
227 } smbXsrv_session_closeU
;
229 typedef [public] struct {
230 smbXsrv_version_values
version;
231 [value
(0)] uint32 reserved
;
232 [switch_is(version)] smbXsrv_session_closeU info
;
233 } smbXsrv_session_closeB
;
235 void smbXsrv_session_close_decode
(
236 [in] smbXsrv_session_closeB blob
242 [ignore] db_record
*db_rec
;
243 uint32 tcon_global_id
;
246 NTTIME creation_time
;
247 [charset
(UTF8
),string] char share_name
[];
248 boolean8 encryption_required
;
250 * for SMB1 this is the session that the tcon was opened on
252 uint32 session_global_id
;
253 } smbXsrv_tcon_global0
;
256 [case(0)] smbXsrv_tcon_global0
*info0
;
257 [default] hyper *dummy
;
258 } smbXsrv_tcon_globalU
;
260 typedef [public] struct {
261 smbXsrv_version_values
version;
263 [switch_is(version)] smbXsrv_tcon_globalU info
;
264 } smbXsrv_tcon_globalB
;
266 void smbXsrv_tcon_global_decode
(
267 [in] smbXsrv_tcon_globalB blob
271 * The main server code should just work with
272 * 'struct smbXsrv_tcon' and never use
273 * smbXsrv_tcon0, smbXsrv_tconU
274 * and smbXsrv_tconB directly.
276 * If we need to change the smbXsrv_tcon,
277 * we can just rename smbXsrv_tcon
278 * to smbXsrv_tcon0 and add a new
279 * smbXsrv_tcon for version 1
280 * and could implement transparent mapping.
283 [ignore] smbXsrv_tcon_table
*table
;
284 [ignore] db_record
*db_rec
;
286 [ref] smbXsrv_tcon_global0
*global
;
289 [ignore] connection_struct
*compat
;
293 [case(0)] smbXsrv_tcon
*info0
;
294 [default] hyper *dummy
;
297 typedef [public] struct {
298 smbXsrv_version_values
version;
299 [value
(0)] uint32 reserved
;
300 [switch_is(version)] smbXsrv_tconU info
;
303 void smbXsrv_tcon_decode
(
304 [in] smbXsrv_tconB blob
310 [ignore] db_record
*db_rec
;
312 uint32 open_global_id
;
313 hyper open_persistent_id
;
314 hyper open_volatile_id
;
319 GUID app_instance_id
;
321 * TODO: for durable/resilient/persistent handles we need more
322 * things here. See [MS-SMB2] 3.3.1.10 Per Open
324 * NOTE: this is still version 0, which is not a stable format!
326 NTTIME disconnect_time
;
327 uint32 durable_timeout_msec
;
329 DATA_BLOB backend_cookie
;
330 } smbXsrv_open_global0
;
333 [case(0)] smbXsrv_open_global0
*info0
;
334 [default] hyper *dummy
;
335 } smbXsrv_open_globalU
;
337 typedef [public] struct {
339 smbXsrv_version_values
version;
341 [switch_is(version)] smbXsrv_open_globalU info
;
342 } smbXsrv_open_globalB
;
344 void smbXsrv_open_global_decode
(
345 [in] smbXsrv_open_globalB blob
349 * The main server code should just work with
350 * 'struct smbXsrv_open' and never use
351 * smbXsrv_open0, smbXsrv_openU
352 * and smbXsrv_openB directly.
354 * If we need to change the smbXsrv_open,
355 * we can just rename smbXsrv_open
356 * to smbXsrv_open0 and add a new
357 * smbXsrv_open for version 1
358 * and could implement transparent mapping.
361 [ignore] smbXsrv_open_table
*table
;
362 [ignore] db_record
*db_rec
;
364 [ref] smbXsrv_open_global0
*global
;
367 [ignore] files_struct
*compat
;
371 [case(0)] smbXsrv_open
*info0
;
372 [default] hyper *dummy
;
375 typedef [public] struct {
376 smbXsrv_version_values
version;
377 [value
(0)] uint32 reserved
;
378 [switch_is(version)] smbXsrv_openU info
;
381 void smbXsrv_open_decode
(
382 [in] smbXsrv_openB blob