3 import
"server_id.idl";
8 uuid("07408340-ae31-11e1-97dc-539f7fddc06f"),
10 pointer_default(unique),
11 helpstring("smbXsrv structures")
16 * smbXsrv_version* is designed to allow
17 * rolling code upgrades in future (within a cluster).
19 * This just adds the infrastructure,
20 * but we does not implement it yet!
22 * Currently it only prevents that
23 * nodes with a different version numbers
24 * cannot run at the same time.
26 * Each node checks at startup, if the version
27 * matches the version of all other nodes.
28 * And it exits if the version does not match
29 * to avoid corruption.
31 * While it would be possible to add versioning
32 * to each of our internal databases it is easier
33 * use a dedicated database "smbXsrv_version_global.tdb"
34 * to hold the global version information.
36 * This removes extra complexity from the individual
37 * databases and allows that we add/remove databases
38 * or use different indexing keys.
41 typedef [v1_enum] enum {
43 * NOTE: Version 0 is designed to be unstable and the format
44 * may change during development.
46 SMBXSRV_VERSION_0
= 0x00000000
47 } smbXsrv_version_values
;
49 const uint32 SMBXSRV_VERSION_CURRENT
= SMBXSRV_VERSION_0
;
53 smbXsrv_version_values min_version
;
54 smbXsrv_version_values max_version
;
55 smbXsrv_version_values current_version
;
56 } smbXsrv_version_node0
;
59 [ignore] db_record
*db_rec
;
60 [range(1, 1024)] uint32 num_nodes
;
61 smbXsrv_version_node0 nodes
[num_nodes
];
62 } smbXsrv_version_global0
;
65 [case(0)] smbXsrv_version_global0
*info0
;
66 [default] hyper *dummy
;
67 } smbXsrv_version_globalU
;
69 typedef [public] struct {
70 smbXsrv_version_values
version;
72 [switch_is(version)] smbXsrv_version_globalU info
;
73 } smbXsrv_version_globalB
;
75 void smbXsrv_version_global_decode
(
76 [in] smbXsrv_version_globalB blob
83 [charset
(UTF8
),string] char local_address
[];
84 [charset
(UTF8
),string] char remote_address
[];
85 [charset
(UTF8
),string] char remote_name
[];
86 [noprint
] DATA_BLOB signing_key
;
87 uint32 auth_session_info_seqnum
;
88 } smbXsrv_channel_global0
;
91 [ignore] db_record
*db_rec
;
92 uint32 session_global_id
;
93 hyper session_wire_id
;
95 NTTIME expiration_time
;
97 * auth_session is NULL until the
98 * session is valid for the first time.
100 uint32 auth_session_info_seqnum
;
101 auth_session_info
*auth_session_info
;
102 uint16 connection_dialect
;
103 boolean8 signing_required
;
104 boolean8 encryption_required
;
105 [noprint
] DATA_BLOB signing_key
;
106 [noprint
] DATA_BLOB encryption_key
;
107 [noprint
] DATA_BLOB decryption_key
;
108 [noprint
] DATA_BLOB application_key
;
109 [range(1, 1024)] uint32 num_channels
;
110 smbXsrv_channel_global0 channels
[num_channels
];
111 } smbXsrv_session_global0
;
114 [case(0)] smbXsrv_session_global0
*info0
;
115 [default] hyper *dummy
;
116 } smbXsrv_session_globalU
;
118 typedef [public] struct {
119 smbXsrv_version_values
version;
121 [switch_is(version)] smbXsrv_session_globalU info
;
122 } smbXsrv_session_globalB
;
124 void smbXsrv_session_global_decode
(
125 [in] smbXsrv_session_globalB blob
129 * The main server code should just work with
130 * 'struct smbXsrv_session' and never use
131 * smbXsrv_session0, smbXsrv_sessionU
132 * and smbXsrv_sessionB directly.
134 * If we need to change the smbXsrv_session,
135 * we can just rename smbXsrv_session
136 * to smbXsrv_session0 and add a new
137 * smbXsrv_session for version 1
138 * and could implement transparent mapping.
141 [ignore] smbXsrv_session_table
*table
;
142 [ignore] db_record
*db_rec
;
143 [ignore] smbXsrv_connection
*connection
;
145 [ref] smbXsrv_session_global0
*global
;
150 [ignore] gensec_security
*gensec
;
151 [ignore] user_struct
*compat
;
152 [ignore] smbXsrv_tcon_table
*tcon_table
;
156 [case(0)] smbXsrv_session
*info0
;
157 [default] hyper *dummy
;
160 typedef [public] struct {
161 smbXsrv_version_values
version;
162 [value
(0)] uint32 reserved
;
163 [switch_is(version)] smbXsrv_sessionU info
;
166 void smbXsrv_session_decode
(
167 [in] smbXsrv_sessionB blob
171 * smbXsrv_session_close is use in the MSG_SMBXSRV_SESSION_CLOSE
175 uint32 old_session_global_id
;
176 hyper old_session_wire_id
;
177 NTTIME old_creation_time
;
178 hyper new_session_wire_id
;
179 } smbXsrv_session_close0
;
182 [case(0)] smbXsrv_session_close0
*info0
;
183 [default] hyper *dummy
;
184 } smbXsrv_session_closeU
;
186 typedef [public] struct {
187 smbXsrv_version_values
version;
188 [value
(0)] uint32 reserved
;
189 [switch_is(version)] smbXsrv_session_closeU info
;
190 } smbXsrv_session_closeB
;
192 void smbXsrv_session_close_decode
(
193 [in] smbXsrv_session_closeB blob
199 [ignore] db_record
*db_rec
;
200 uint32 tcon_global_id
;
203 NTTIME creation_time
;
204 [charset
(UTF8
),string] char share_name
[];
205 boolean8 encryption_required
;
206 } smbXsrv_tcon_global0
;
209 [case(0)] smbXsrv_tcon_global0
*info0
;
210 [default] hyper *dummy
;
211 } smbXsrv_tcon_globalU
;
213 typedef [public] struct {
214 smbXsrv_version_values
version;
216 [switch_is(version)] smbXsrv_tcon_globalU info
;
217 } smbXsrv_tcon_globalB
;
219 void smbXsrv_tcon_global_decode
(
220 [in] smbXsrv_tcon_globalB blob
224 * The main server code should just work with
225 * 'struct smbXsrv_tcon' and never use
226 * smbXsrv_tcon0, smbXsrv_tconU
227 * and smbXsrv_tconB directly.
229 * If we need to change the smbXsrv_tcon,
230 * we can just rename smbXsrv_tcon
231 * to smbXsrv_tcon0 and add a new
232 * smbXsrv_tcon for version 1
233 * and could implement transparent mapping.
236 [ignore] smbXsrv_tcon_table
*table
;
237 [ignore] db_record
*db_rec
;
239 [ref] smbXsrv_tcon_global0
*global
;
242 [ignore] connection_struct
*compat
;
246 [case(0)] smbXsrv_tcon
*info0
;
247 [default] hyper *dummy
;
250 typedef [public] struct {
251 smbXsrv_version_values
version;
252 [value
(0)] uint32 reserved
;
253 [switch_is(version)] smbXsrv_tconU info
;
256 void smbXsrv_tcon_decode
(
257 [in] smbXsrv_tconB blob
263 [ignore] db_record
*db_rec
;
265 uint32 open_global_id
;
266 hyper open_persistent_id
;
267 hyper open_volatile_id
;
271 * TODO: for durable/resilient/persistent handles we need more
272 * things here. See [MS-SMB2] 3.3.1.10 Per Open
274 * NOTE: this is still version 0, which is not a stable format!
276 } smbXsrv_open_global0
;
279 [case(0)] smbXsrv_open_global0
*info0
;
280 [default] hyper *dummy
;
281 } smbXsrv_open_globalU
;
283 typedef [public] struct {
285 smbXsrv_version_values
version;
287 [switch_is(version)] smbXsrv_open_globalU info
;
288 } smbXsrv_open_globalB
;
290 void smbXsrv_open_global_decode
(
291 [in] smbXsrv_open_globalB blob
295 * The main server code should just work with
296 * 'struct smbXsrv_open' and never use
297 * smbXsrv_open0, smbXsrv_openU
298 * and smbXsrv_openB directly.
300 * If we need to change the smbXsrv_open,
301 * we can just rename smbXsrv_open
302 * to smbXsrv_open0 and add a new
303 * smbXsrv_open for version 1
304 * and could implement transparent mapping.
307 [ignore] smbXsrv_open_table
*table
;
308 [ignore] db_record
*db_rec
;
310 [ref] smbXsrv_open_global0
*global
;
313 [ignore] files_struct
*compat
;
317 [case(0)] smbXsrv_open
*info0
;
318 [default] hyper *dummy
;
321 typedef [public] struct {
322 smbXsrv_version_values
version;
323 [value
(0)] uint32 reserved
;
324 [switch_is(version)] smbXsrv_openU info
;
327 void smbXsrv_open_decode
(
328 [in] smbXsrv_openB blob