xref: /illumos-gate/usr/src/uts/common/smbsrv/ndl/netdfs.ndl (revision 69a119caa6570c7077699161b7c28b6ee9f8b0f4)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef _NETDFS_NDL_
27#define	_NETDFS_NDL_
28
29/*
30 * NT Distributed File Service (NETDFS) RPC interface definition.
31 */
32
33#include "ndrtypes.ndl"
34
35
36#define	NETDFS_ABSTRACT_UUID		"4fc742e0-4a10-11cf-8273-00aa004ae673"
37#define	NETDFS_ABSTRACT_VERS		3
38
39#define	NETDFS_TRANSFER_UUID		"8a885d04-1ceb-11c9-9fe8-08002b104860"
40#define	NETDFS_TRANSFER_VERS		2
41
42#define	NETDFS_OPNUM_GETVER		0x00
43#define	NETDFS_OPNUM_ADD		0x01
44#define	NETDFS_OPNUM_REMOVE		0x02
45#define	NETDFS_OPNUM_SETINFO		0x03
46#define	NETDFS_OPNUM_GETINFO		0x04
47#define	NETDFS_OPNUM_ENUM		0x05
48#define	NETDFS_OPNUM_MOVE		0x06
49#define	NETDFS_OPNUM_RENAME		0x07
50#define	NETDFS_OPNUM_ADDSTDROOT		0x0c
51#define	NETDFS_OPNUM_REMSTDROOT		0x0d
52#define	NETDFS_OPNUM_ENUMEX		0x15
53
54#define	DFS_MANAGER_VERSION_NT4		0x01
55#define	DFS_MANAGER_VERSION_W2K		0x02
56#define	DFS_MANAGER_VERSION_W2K3	0x04
57
58struct netdfs_uuid {
59	DWORD data1;
60	WORD data2;
61	WORD data3;
62	BYTE data4[8];
63};
64typedef struct netdfs_uuid netdfs_uuid_t;
65
66struct netdfs_storage_info {
67	DWORD state;
68	LPTSTR server;
69	LPTSTR share;
70};
71typedef struct netdfs_storage_info netdfs_storage_info_t;
72
73
74struct netdfs_storage_info1 {
75	DWORD state;
76	LPTSTR server;
77	LPTSTR share;
78	DWORD p_class;
79	WORD p_rank;
80	WORD p_reserved;
81};
82typedef struct netdfs_storage_info1 netdfs_storage_info1_t;
83
84struct netdfs_info1 {
85	LPTSTR entry_path;
86};
87typedef struct netdfs_info1 netdfs_info1_t;
88
89struct netdfs_info2 {
90	LPTSTR entry_path;
91	LPTSTR comment;
92	DWORD state;
93	DWORD n_store;
94};
95typedef struct netdfs_info2 netdfs_info2_t;
96
97struct netdfs_info3 {
98	LPTSTR entry_path;
99	LPTSTR comment;
100	DWORD state;
101	DWORD n_store;
102  SIZE_IS(n_store)
103	struct netdfs_storage_info *si;
104};
105typedef struct netdfs_info3 netdfs_info3_t;
106
107struct netdfs_info4 {
108	LPTSTR entry_path;
109	LPTSTR comment;
110	DWORD state;
111	DWORD timeout;
112	netdfs_uuid_t guid;
113	DWORD n_store;
114  SIZE_IS(n_store)
115	struct netdfs_storage_info *si;
116};
117typedef struct netdfs_info4 netdfs_info4_t;
118
119struct netdfs_info5 {
120	LPTSTR entry_path;
121	LPTSTR comment;
122	DWORD state;
123	DWORD timeout;
124	netdfs_uuid_t guid;
125	DWORD flags;
126	DWORD metadata_sz;
127	DWORD n_store;
128};
129typedef struct netdfs_info5 netdfs_info5_t;
130
131struct netdfs_info6 {
132	LPTSTR entry_path;
133	LPTSTR comment;
134	DWORD state;
135	DWORD timeout;
136	netdfs_uuid_t guid;
137	DWORD flags;
138	DWORD metadata_sz;
139	DWORD n_store;
140  SIZE_IS(n_store)
141	struct netdfs_storage_info1 *si;
142};
143typedef struct netdfs_info6 netdfs_info6_t;
144
145struct netdfs_info100 {
146	LPTSTR comment;
147};
148typedef struct netdfs_info100 netdfs_info100_t;
149
150struct netdfs_info101 {
151	DWORD state;
152};
153typedef struct netdfs_info101 netdfs_info101_t;
154
155
156struct netdfs_info102 {
157	DWORD timeout;
158};
159typedef struct netdfs_info102 netdfs_info102_t;
160
161
162struct netdfs_info103 {
163	DWORD property_flag_mask;
164	DWORD property_flags;
165};
166typedef struct netdfs_info103 netdfs_info103_t;
167
168
169struct netdfs_info104 {
170	DWORD priority_class;
171	WORD priority_rank;
172	WORD reserved;
173};
174typedef struct netdfs_info104 netdfs_info104_t;
175
176
177struct netdfs_info105 {
178	LPTSTR comment;
179	DWORD state;
180	DWORD timeout;
181	DWORD property_flag_mask;
182	DWORD property_flags;
183};
184typedef struct netdfs_info105 netdfs_info105_t;
185
186
187struct netdfs_info106 {
188	DWORD storage_state;
189	DWORD priority_class;
190	DWORD priority_rank;
191};
192
193
194struct netdfs_info200 {
195	LPTSTR entry_path;
196};
197
198
199struct netdfs_info300 {
200	DWORD flavor;
201	LPTSTR dfsname;
202};
203typedef struct netdfs_info300 netdfs_info300_t;
204
205
206union netdfs_info_u {
207        CASE(1) struct netdfs_info1 *info1;
208	CASE(2) struct netdfs_info2 *info2;
209	CASE(3) struct netdfs_info3 *info3;
210	CASE(4) struct netdfs_info4 *info4;
211	CASE(5) struct netdfs_info5 *info5;
212	CASE(6) struct netdfs_info6 *info6;
213	CASE(100) struct netdfs_info100 *info100;
214	CASE(101) struct netdfs_info101 *info101;
215	CASE(102) struct netdfs_info102 *info102;
216	CASE(103) struct netdfs_info103 *info103;
217	CASE(104) struct netdfs_info104 *info104;
218	CASE(105) struct netdfs_info105 *info105;
219	CASE(106) struct netdfs_info106 *info106;
220	DEFAULT char *nullptr;
221};
222
223
224struct netdfs_info {
225	DWORD level;
226  SWITCH(level)
227	union netdfs_info_u iu;
228};
229typedef struct netdfs_info netdfs_info_t;
230
231
232struct netdfs_array1 {
233	DWORD count;
234  SIZE_IS(count)
235	struct netdfs_info1 *info1;
236};
237
238struct netdfs_array2 {
239	DWORD count;
240  SIZE_IS(count)
241	struct netdfs_info2 *info2;
242};
243
244struct netdfs_array3 {
245	DWORD count;
246  SIZE_IS(count)
247	struct netdfs_info3 *info3;
248};
249
250struct netdfs_array4 {
251	DWORD count;
252  SIZE_IS(count)
253	struct netdfs_info4 *info4;
254};
255
256struct netdfs_array5 {
257	DWORD count;
258  SIZE_IS(count)
259	struct netdfs_info5 *info5;
260};
261
262struct netdfs_array6 {
263	DWORD count;
264  SIZE_IS(count)
265	struct netdfs_info6 *info6;
266};
267
268struct netdfs_array200 {
269	DWORD count;
270  SIZE_IS(count)
271	struct netdfs_info200 *info200;
272};
273
274struct netdfs_array300 {
275	DWORD count;
276  SIZE_IS(count)
277	struct netdfs_info300 *info300;
278};
279
280union netdfs_enum_info_u {
281	CASE(1) struct netdfs_array1 *info1;
282	CASE(2) struct netdfs_array2 *info2;
283	CASE(3) struct netdfs_array3 *info3;
284	CASE(4) struct netdfs_array4 *info4;
285	CASE(5) struct netdfs_array5 *info5;
286	CASE(6) struct netdfs_array6 *info6;
287	CASE(200) struct netdfs_array200 *info200;
288	CASE(300) struct netdfs_array300 *info300;
289	DEFAULT char *nullptr;
290};
291
292
293struct netdfs_enum_info {
294	DWORD level;
295	DWORD switch_value;
296  SWITCH(switch_value)
297	union netdfs_enum_info_u iu;
298};
299
300
301/*
302 ***********************************************************************
303 * Return server version id
304 ***********************************************************************
305 */
306OPERATION(NETDFS_OPNUM_GETVER)
307struct netdfs_getver {
308	OUT		DWORD version;
309};
310
311
312/*
313 ***********************************************************************
314 * Add a new volume or additional storage for an existing volume at
315 * dfs_path.
316 ***********************************************************************
317 */
318OPERATION(NETDFS_OPNUM_ADD)
319struct netdfs_add {
320	IN REFERENCE	LPTSTR dfs_path;
321	IN REFERENCE	LPTSTR server;
322	IN		LPTSTR share;
323	IN		LPTSTR comment;
324	IN		DWORD flags;
325	OUT		DWORD status;
326};
327typedef struct netdfs_add netdfs_add_t;
328
329
330/*
331 ***********************************************************************
332 * Remove a volume or additional storage for volume from the DFS at
333 * dfs_path. When applied to the last storage in a volume, removes
334 * the volume from the DFS.
335 ***********************************************************************
336 */
337OPERATION(NETDFS_OPNUM_REMOVE)
338struct netdfs_remove {
339	IN REFERENCE	LPTSTR dfs_path;
340	IN		LPTSTR server;
341	IN		LPTSTR share;
342	OUT		DWORD status;
343};
344
345
346/*
347 ***********************************************************************
348 * Set information about the volume or storage. If the server and share
349 * are specified, the information set is specific to that server and
350 * share. Otherwise the information is specific to the volume as a whole.
351 *
352 * Valid levels are 100-102.
353 ***********************************************************************
354 */
355OPERATION(NETDFS_OPNUM_SETINFO)
356struct netdfs_setinfo {
357	IN REFERENCE	LPTSTR dfs_path;
358	IN		LPTSTR server;
359	IN		LPTSTR share;
360	IN		DWORD level;
361	IN		struct netdfs_info info;
362	OUT		DWORD status;
363};
364typedef struct netdfs_setinfo netdfs_setinfo_t;
365
366
367/*
368 ***********************************************************************
369 * Get information about the volume or storage. If the server and share
370 * are specified, the information returned is specific to that server
371 * and share. Otherwise the information is specific to the volume as a
372 * whole.
373 *
374 * Valid levels are 1-4, 100-102.
375 ***********************************************************************
376 */
377OPERATION(NETDFS_OPNUM_GETINFO)
378struct netdfs_getinfo {
379	IN REFERENCE	LPTSTR dfs_path;
380	IN		LPTSTR server;
381	IN		LPTSTR share;
382	IN		DWORD level;
383	OUT		struct netdfs_info info;
384	OUT		DWORD status;
385};
386typedef struct netdfs_getinfo netdfs_getinfo_t;
387
388
389/*
390 ***********************************************************************
391 * Get information about all of the volumes in the DFS. dfs_path is
392 * the "server" part of the UNC name used to refer to this particular
393 * DFS.
394 *
395 * Valid levels are 1-3.
396 ***********************************************************************
397 */
398OPERATION(NETDFS_OPNUM_ENUM)
399struct netdfs_enum {
400	IN		DWORD level;
401	IN		DWORD pref_max_len;
402	INOUT		struct netdfs_enum_info *info;
403	INOUT		DWORD *resume_handle;
404	OUT		DWORD status;
405};
406typedef struct netdfs_enum netdfs_enum_t;
407
408
409/*
410 ***********************************************************************
411 * Rename the current Win32 path in a DFS to a new Win32 path in the
412 * same DFS.
413 ***********************************************************************
414 */
415OPERATION(NETDFS_OPNUM_RENAME)
416struct netdfs_rename {
417	IN REFERENCE	LPTSTR dfs_path;
418	IN REFERENCE	LPTSTR new_path;
419	OUT		DWORD status;
420};
421
422
423/*
424 ***********************************************************************
425 * Move a DFS volume and all subordinate volumes from one place in the
426 * DFS to another place in the DFS.
427 ***********************************************************************
428 */
429OPERATION(NETDFS_OPNUM_MOVE)
430struct netdfs_move {
431	IN REFERENCE	LPTSTR dfs_path;
432	IN REFERENCE	LPTSTR new_path;
433	IN		DWORD flags;
434	OUT		DWORD status;
435};
436
437
438/*
439 ***********************************************************************
440 * Add a DFS root share.
441 ***********************************************************************
442 */
443OPERATION(NETDFS_OPNUM_ADDSTDROOT)
444struct netdfs_addstdroot {
445	IN REFERENCE	LPTSTR server;
446	IN REFERENCE	LPTSTR share;
447	IN REFERENCE	LPTSTR comment;
448	IN		DWORD flags;
449	OUT		DWORD status;
450};
451
452/*
453 ***********************************************************************
454 * Remove a DFS root share.
455 ***********************************************************************
456 */
457OPERATION(NETDFS_OPNUM_REMSTDROOT)
458struct netdfs_remstdroot {
459	IN REFERENCE	LPTSTR server;
460	IN REFERENCE	LPTSTR share;
461	IN		DWORD flags;
462	OUT		DWORD status;
463};
464
465
466/*
467 ***********************************************************************
468 * Get information about all of the volumes in the DFS. dfs_path is
469 * the "server" part of the UNC name used to refer to this particular
470 * DFS.
471 *
472 * Valid levels are 1-3.
473 ***********************************************************************
474 */
475OPERATION(NETDFS_OPNUM_ENUMEX)
476struct netdfs_enumex {
477	IN REFERENCE	LPTSTR dfs_path;
478	IN		DWORD level;
479	IN		DWORD pref_max_len;
480	INOUT		struct netdfs_enum_info *info;
481	INOUT		DWORD *resume_handle;
482	OUT		DWORD status;
483};
484
485
486/*
487 ***********************************************************************
488 * The NETDFS interface definiton.
489 ***********************************************************************
490 */
491INTERFACE(0)
492union netdfs_interface {
493	CASE(NETDFS_OPNUM_GETVER)
494		struct netdfs_getver		netdfs_getver;
495	CASE(NETDFS_OPNUM_ADD)
496		struct netdfs_add		netdfs_add;
497	CASE(NETDFS_OPNUM_REMOVE)
498		struct netdfs_remove		netdfs_remove;
499	CASE(NETDFS_OPNUM_SETINFO)
500		struct netdfs_setinfo		netdfs_setinfo;
501	CASE(NETDFS_OPNUM_GETINFO)
502		struct netdfs_getinfo		netdfs_getinfo;
503	CASE(NETDFS_OPNUM_ENUM)
504		struct netdfs_enum		netdfs_enum;
505	CASE(NETDFS_OPNUM_MOVE)
506		struct netdfs_move		netdfs_move;
507	CASE(NETDFS_OPNUM_RENAME)
508		struct netdfs_rename		netdfs_rename;
509	CASE(NETDFS_OPNUM_ADDSTDROOT)
510		struct netdfs_addstdroot	netdfs_addstdroot;
511	CASE(NETDFS_OPNUM_REMSTDROOT)
512		struct netdfs_remstdroot	netdfs_remstdroot;
513	CASE(NETDFS_OPNUM_ENUMEX)
514		struct netdfs_enumex		netdfs_enumex;
515};
516typedef union netdfs_interface	netdfs_interface_t;
517EXTERNTYPEINFO(netdfs_interface)
518
519
520#endif /* _NETDFS_NDL_ */
521