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
;
148 [ignore] gensec_security
*gensec
;
149 [ignore] user_struct
*compat
;
150 [ignore] smbXsrv_tcon_table
*tcon_table
;
154 [case(0)] smbXsrv_session
*info0
;
155 [default] hyper *dummy
;
158 typedef [public] struct {
159 smbXsrv_version_values
version;
160 [value
(0)] uint32 reserved
;
161 [switch_is(version)] smbXsrv_sessionU info
;
164 void smbXsrv_session_decode
(
165 [in] smbXsrv_sessionB blob
169 * smbXsrv_session_close is use in the MSG_SMBXSRV_SESSION_CLOSE
173 uint32 old_session_global_id
;
174 hyper old_session_wire_id
;
175 NTTIME old_creation_time
;
176 hyper new_session_wire_id
;
177 } smbXsrv_session_close0
;
180 [case(0)] smbXsrv_session_close0
*info0
;
181 [default] hyper *dummy
;
182 } smbXsrv_session_closeU
;
184 typedef [public] struct {
185 smbXsrv_version_values
version;
186 [value
(0)] uint32 reserved
;
187 [switch_is(version)] smbXsrv_session_closeU info
;
188 } smbXsrv_session_closeB
;
190 void smbXsrv_session_close_decode
(
191 [in] smbXsrv_session_closeB blob
197 [ignore] db_record
*db_rec
;
198 uint32 tcon_global_id
;
201 NTTIME creation_time
;
202 [charset
(UTF8
),string] char share_name
[];
203 boolean8 encryption_required
;
204 } smbXsrv_tcon_global0
;
207 [case(0)] smbXsrv_tcon_global0
*info0
;
208 [default] hyper *dummy
;
209 } smbXsrv_tcon_globalU
;
211 typedef [public] struct {
212 smbXsrv_version_values
version;
214 [switch_is(version)] smbXsrv_tcon_globalU info
;
215 } smbXsrv_tcon_globalB
;
217 void smbXsrv_tcon_global_decode
(
218 [in] smbXsrv_tcon_globalB blob
222 * The main server code should just work with
223 * 'struct smbXsrv_tcon' and never use
224 * smbXsrv_tcon0, smbXsrv_tconU
225 * and smbXsrv_tconB directly.
227 * If we need to change the smbXsrv_tcon,
228 * we can just rename smbXsrv_tcon
229 * to smbXsrv_tcon0 and add a new
230 * smbXsrv_tcon for version 1
231 * and could implement transparent mapping.
234 [ignore] smbXsrv_tcon_table
*table
;
235 [ignore] db_record
*db_rec
;
237 [ref] smbXsrv_tcon_global0
*global
;
240 [ignore] connection_struct
*compat
;
244 [case(0)] smbXsrv_tcon
*info0
;
245 [default] hyper *dummy
;
248 typedef [public] struct {
249 smbXsrv_version_values
version;
250 [value
(0)] uint32 reserved
;
251 [switch_is(version)] smbXsrv_tconU info
;
254 void smbXsrv_tcon_decode
(
255 [in] smbXsrv_tconB blob
261 [ignore] db_record
*db_rec
;
263 uint32 open_global_id
;
264 hyper open_persistent_id
;
265 hyper open_volatile_id
;
269 * TODO: for durable/resilient/persistent handles we need more
270 * things here. See [MS-SMB2] 3.3.1.10 Per Open
272 * NOTE: this is still version 0, which is not a stable format!
274 } smbXsrv_open_global0
;
277 [case(0)] smbXsrv_open_global0
*info0
;
278 [default] hyper *dummy
;
279 } smbXsrv_open_globalU
;
281 typedef [public] struct {
283 smbXsrv_version_values
version;
285 [switch_is(version)] smbXsrv_open_globalU info
;
286 } smbXsrv_open_globalB
;
288 void smbXsrv_open_global_decode
(
289 [in] smbXsrv_open_globalB blob
293 * The main server code should just work with
294 * 'struct smbXsrv_open' and never use
295 * smbXsrv_open0, smbXsrv_openU
296 * and smbXsrv_openB directly.
298 * If we need to change the smbXsrv_open,
299 * we can just rename smbXsrv_open
300 * to smbXsrv_open0 and add a new
301 * smbXsrv_open for version 1
302 * and could implement transparent mapping.
305 [ignore] smbXsrv_open_table
*table
;
306 [ignore] db_record
*db_rec
;
308 [ref] smbXsrv_open_global0
*global
;
311 [ignore] files_struct
*compat
;
315 [case(0)] smbXsrv_open
*info0
;
316 [default] hyper *dummy
;
319 typedef [public] struct {
320 smbXsrv_version_values
version;
321 [value
(0)] uint32 reserved
;
322 [switch_is(version)] smbXsrv_openU info
;
325 void smbXsrv_open_decode
(
326 [in] smbXsrv_openB blob