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