xref: /titanic_50/usr/src/uts/common/smbsrv/ndl/netdfs.ndl (revision 6343349bf9d42501532d1ee2e75718d86ee366fe)
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 2007 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#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31/*
32 * NT Distributed File Service (NETDFS) RPC interface definition.
33 */
34
35#include "ndrtypes.ndl"
36
37
38#define	NETDFS_ABSTRACT_UUID		"4fc742e0-4a10-11cf-827300aa004ae673"
39#define	NETDFS_ABSTRACT_VERS		3
40
41#define	NETDFS_TRANSFER_UUID		"8a885d04-1ceb-11c9-9fe808002b104860"
42#define	NETDFS_TRANSFER_VERS		2
43
44#define	NETDFS_OPNUM_GETVER		0x00
45#define	NETDFS_OPNUM_ADD		0x01
46#define	NETDFS_OPNUM_REMOVE		0x02
47#define	NETDFS_OPNUM_SETINFO		0x03
48#define	NETDFS_OPNUM_GETINFO		0x04
49#define	NETDFS_OPNUM_ENUM		0x05
50#define	NETDFS_OPNUM_RENAME		0x06
51#define	NETDFS_OPNUM_MOVE		0x07
52#define	NETDFS_OPNUM_ADDSTDROOT		0x0c
53#define	NETDFS_OPNUM_REMSTDROOT		0x0d
54#define	NETDFS_OPNUM_ENUMEX		0x15
55
56#define	DFS_MANAGER_VERSION_NT4		0x01
57#define	DFS_MANAGER_VERSION_W2K		0x02
58#define	DFS_MANAGER_VERSION_W2K3	0x04
59
60
61#define	DFS_PROP_FLAG_INSITE_REFERRALS	0x01
62#define	DFS_PROP_FLAG_ROOT_SCALABILITY	0x02
63#define	DFS_PROP_FLAG_SITE_COSTING	0x04
64#define	DFS_PROP_FLAG_TARGET_FAILBACK	0x08
65#define	DFS_PROP_FLAG_CLUSTER_ENABLED	0x10
66
67
68#define	DFS_STORAGE_PRI_INVALID		-1
69#define	DFS_STORAGE_PRI_SITE_COST_NORM	0
70#define	DFS_STORAGE_PRI_GLOBAL_HIGH	1
71#define	DFS_STORAGE_PRI_SITE_COST_HIGH	2
72#define	DFS_STORAGE_PRI_SITE_COST_LOW	3
73#define	DFS_STORAGE_PRI_GLOBAL_LOW	4
74
75
76struct netdfs_storage_info {
77	DWORD state;
78	LPTSTR server;
79	LPTSTR share;
80};
81
82
83struct netdfs_storage_info2 {
84	DWORD state;
85	LPTSTR server;
86	LPTSTR share;
87	DWORD priority;
88	DWORD rank;
89};
90
91struct netdfs_info1 {
92	LPTSTR entry_path;
93};
94
95
96struct netdfs_info2 {
97	LPTSTR entry_path;
98	LPTSTR comment;
99	DWORD state;
100	DWORD n_store;
101};
102
103
104struct netdfs_info3 {
105	LPTSTR entry_path;
106	LPTSTR comment;
107	DWORD state;
108	DWORD n_store;
109  SIZE_IS(n_store)
110	struct netdfs_storage_info *si;
111};
112
113
114struct netdfs_info4 {
115	LPTSTR entry_path;
116	LPTSTR comment;
117	DWORD state;
118	DWORD timeout;
119	DWORD guuid[4];
120	DWORD n_store;
121  SIZE_IS(n_store)
122	struct netdfs_storage_info *si;
123};
124
125
126struct netdfs_info6 {
127	LPTSTR entry_path;
128	LPTSTR comment;
129	DWORD state;
130	DWORD timeout;
131	DWORD guuid[4];
132	DWORD flags;
133	DWORD pktsize;
134	DWORD n_store;
135  SIZE_IS(n_store)
136	struct netdfs_storage_info2 *si;
137};
138
139
140struct netdfs_info100 {
141	LPTSTR comment;
142};
143
144
145struct netdfs_info101 {
146	DWORD state;
147};
148
149
150struct netdfs_info102 {
151	DWORD timeout;
152};
153
154
155struct netdfs_info103 {
156	DWORD property_flags;
157};
158
159
160struct netdfs_info104 {
161	DWORD priority_class;
162	DWORD priority_rank;
163};
164
165
166struct netdfs_info105 {
167	LPTSTR comment;
168	DWORD volume_state;
169	DWORD timeout;
170	DWORD property_flag_mask;
171	DWORD property_flags;
172};
173
174
175struct netdfs_info106 {
176	DWORD storage_state;
177	DWORD priority_class;
178	DWORD priority_rank;
179};
180
181
182struct netdfs_info200 {
183	LPTSTR entry_path;
184};
185
186
187struct netdfs_info300 {
188	DWORD flavor;
189	LPTSTR entry_path;
190};
191
192
193union netdfs_info_u {
194        CASE(1) struct netdfs_info1 *info1;
195	CASE(2) struct netdfs_info2 *info2;
196	CASE(3) struct netdfs_info3 *info3;
197	CASE(4) struct netdfs_info4 *info4;
198	CASE(6) struct netdfs_info6 *info6;
199	CASE(100) struct netdfs_info100 *info100;
200	CASE(101) struct netdfs_info101 *info101;
201	CASE(102) struct netdfs_info102 *info102;
202	CASE(103) struct netdfs_info103 *info103;
203	CASE(104) struct netdfs_info104 *info104;
204	CASE(105) struct netdfs_info105 *info105;
205	CASE(106) struct netdfs_info106 *info106;
206	DEFAULT char *nullptr;
207};
208
209
210struct netdfs_info {
211	DWORD level;
212  SWITCH(level)
213	union netdfs_info_u iu;
214};
215
216
217struct netdfs_array1 {
218	DWORD count;
219  SIZE_IS(count)
220	struct netdfs_info1 *info1;
221};
222
223struct netdfs_array2 {
224	DWORD count;
225  SIZE_IS(count)
226	struct netdfs_info2 *info2;
227};
228
229struct netdfs_array3 {
230	DWORD count;
231  SIZE_IS(count)
232	struct netdfs_info3 *info3;
233};
234
235struct netdfs_array4 {
236	DWORD count;
237  SIZE_IS(count)
238	struct netdfs_info4 *info4;
239};
240
241struct netdfs_array6 {
242	DWORD count;
243  SIZE_IS(count)
244	struct netdfs_info6 *info6;
245};
246
247struct netdfs_array200 {
248	DWORD count;
249  SIZE_IS(count)
250	struct netdfs_info200 *info200;
251};
252
253struct netdfs_array300 {
254	DWORD count;
255  SIZE_IS(count)
256	struct netdfs_info300 *info300;
257};
258
259union netdfs_enum_info_u {
260	CASE(1) struct netdfs_array1 *info1;
261	CASE(2) struct netdfs_array2 *info2;
262	CASE(3) struct netdfs_array3 *info3;
263	CASE(4) struct netdfs_array4 *info4;
264	CASE(6) struct netdfs_array6 *info6;
265	CASE(200) struct netdfs_array200 *info200;
266	CASE(300) struct netdfs_array300 *info300;
267	DEFAULT char *nullptr;
268};
269
270
271struct netdfs_enum_info {
272	DWORD address;
273	DWORD level;
274  SWITCH(level)
275	union netdfs_enum_info_u iu;
276};
277
278
279/*
280 ***********************************************************************
281 * Return server version id
282 ***********************************************************************
283 */
284OPERATION(NETDFS_OPNUM_GETVER)
285struct netdfs_getver {
286	OUT		DWORD version;
287};
288
289
290/*
291 ***********************************************************************
292 * Add a new volume or additional storage for an existing volume at
293 * dfs_path.
294 ***********************************************************************
295 */
296OPERATION(NETDFS_OPNUM_ADD)
297struct netdfs_add {
298	IN REFERENCE	LPTSTR dfs_path;
299	IN REFERENCE	LPTSTR server;
300	IN		LPTSTR share;
301	IN		LPTSTR comment;
302	IN		DWORD flags;
303	OUT		DWORD status;
304};
305
306
307/*
308 ***********************************************************************
309 * Remove a volume or additional storage for volume from the DFS at
310 * dfs_path. When applied to the last storage in a volume, removes
311 * the volume from the DFS.
312 ***********************************************************************
313 */
314OPERATION(NETDFS_OPNUM_REMOVE)
315struct netdfs_remove {
316	IN REFERENCE	LPTSTR dfs_path;
317	IN		LPTSTR server;
318	IN		LPTSTR share;
319	OUT		DWORD status;
320};
321
322
323/*
324 ***********************************************************************
325 * Set information about the volume or storage. If the server and share
326 * are specified, the information set is specific to that server and
327 * share. Otherwise the information is specific to the volume as a whole.
328 *
329 * Valid levels are 100-102.
330 ***********************************************************************
331 */
332OPERATION(NETDFS_OPNUM_SETINFO)
333struct netdfs_setinfo {
334	IN REFERENCE	LPTSTR dfs_path;
335	IN		LPTSTR server;
336	IN		LPTSTR share;
337	IN		DWORD level;
338	IN		struct netdfs_info info;
339	OUT		DWORD status;
340};
341
342
343/*
344 ***********************************************************************
345 * Get information about the volume or storage. If the server and share
346 * are specified, the information returned is specific to that server
347 * and share. Otherwise the information is specific to the volume as a
348 * whole.
349 *
350 * Valid levels are 1-4, 100-102.
351 ***********************************************************************
352 */
353OPERATION(NETDFS_OPNUM_GETINFO)
354struct netdfs_getinfo {
355	IN REFERENCE	LPTSTR dfs_path;
356	IN		LPTSTR server;
357	IN		LPTSTR share;
358	IN		DWORD level;
359	OUT		struct netdfs_info info;
360	OUT		DWORD status;
361};
362
363
364/*
365 ***********************************************************************
366 * Get information about all of the volumes in the DFS. dfs_path is
367 * the "server" part of the UNC name used to refer to this particular
368 * DFS.
369 *
370 * Valid levels are 1-3.
371 ***********************************************************************
372 */
373OPERATION(NETDFS_OPNUM_ENUM)
374struct netdfs_enum {
375	IN		DWORD level;
376	IN		DWORD pref_max_len;
377	INOUT		struct netdfs_enum_info *info;
378	INOUT		DWORD *resume_handle;
379	OUT		DWORD status;
380};
381
382
383/*
384 ***********************************************************************
385 * Rename the current Win32 path in a DFS to a new Win32 path in the
386 * same DFS.
387 ***********************************************************************
388 */
389OPERATION(NETDFS_OPNUM_RENAME)
390struct netdfs_rename {
391	IN REFERENCE	LPTSTR dfs_path;
392	IN REFERENCE	LPTSTR new_path;
393	OUT		DWORD status;
394};
395
396
397/*
398 ***********************************************************************
399 * Move a DFS volume and all subordinate volumes from one place in the
400 * DFS to another place in the DFS.
401 ***********************************************************************
402 */
403OPERATION(NETDFS_OPNUM_MOVE)
404struct netdfs_move {
405	IN REFERENCE	LPTSTR dfs_path;
406	IN REFERENCE	LPTSTR new_path;
407	OUT		DWORD status;
408};
409
410
411/*
412 ***********************************************************************
413 * Add a DFS root share.
414 ***********************************************************************
415 */
416OPERATION(NETDFS_OPNUM_ADDSTDROOT)
417struct netdfs_addstdroot {
418	IN REFERENCE	LPTSTR server;
419	IN REFERENCE	LPTSTR share;
420	IN REFERENCE	LPTSTR comment;
421	IN		DWORD flags;
422	OUT		DWORD status;
423};
424
425/*
426 ***********************************************************************
427 * Remove a DFS root share.
428 ***********************************************************************
429 */
430OPERATION(NETDFS_OPNUM_REMSTDROOT)
431struct netdfs_remstdroot {
432	IN REFERENCE	LPTSTR server;
433	IN REFERENCE	LPTSTR share;
434	IN		DWORD flags;
435	OUT		DWORD status;
436};
437
438
439/*
440 ***********************************************************************
441 * Get information about all of the volumes in the DFS. dfs_path is
442 * the "server" part of the UNC name used to refer to this particular
443 * DFS.
444 *
445 * Valid levels are 1-3.
446 ***********************************************************************
447 */
448OPERATION(NETDFS_OPNUM_ENUMEX)
449struct netdfs_enumex {
450	IN REFERENCE	LPTSTR dfs_path;
451	IN		DWORD level;
452	IN		DWORD pref_max_len;
453	INOUT		struct netdfs_enum_info *info;
454	INOUT		DWORD *resume_handle;
455	OUT		DWORD status;
456};
457
458
459/*
460 ***********************************************************************
461 * The NETDFS interface definiton.
462 ***********************************************************************
463 */
464INTERFACE(0)
465union netdfs_interface {
466	CASE(NETDFS_OPNUM_GETVER)
467		struct netdfs_getver		netdfs_getver;
468	CASE(NETDFS_OPNUM_ADD)
469		struct netdfs_add		netdfs_add;
470	CASE(NETDFS_OPNUM_REMOVE)
471		struct netdfs_remove		netdfs_remove;
472	CASE(NETDFS_OPNUM_SETINFO)
473		struct netdfs_setinfo		netdfs_setinfo;
474	CASE(NETDFS_OPNUM_GETINFO)
475		struct netdfs_getinfo		netdfs_getinfo;
476	CASE(NETDFS_OPNUM_ENUM)
477		struct netdfs_enum		netdfs_enum;
478	CASE(NETDFS_OPNUM_MOVE)
479		struct netdfs_move		netdfs_move;
480	CASE(NETDFS_OPNUM_RENAME)
481		struct netdfs_rename		netdfs_rename;
482	CASE(NETDFS_OPNUM_ADDSTDROOT)
483		struct netdfs_addstdroot	netdfs_addstdroot;
484	CASE(NETDFS_OPNUM_REMSTDROOT)
485		struct netdfs_remstdroot	netdfs_remstdroot;
486	CASE(NETDFS_OPNUM_ENUMEX)
487		struct netdfs_enumex		netdfs_enumex;
488};
489typedef union netdfs_interface	netdfs_interface_t;
490EXTERNTYPEINFO(netdfs_interface)
491
492
493#endif /* _NETDFS_NDL_ */
494