xref: /titanic_50/usr/src/uts/common/smbsrv/ndl/dssetup.ndl (revision 7ec363dc481bba196d724969022171de4687989f)
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 _DSSETUP_NDL_
27#define	_DSSETUP_NDL_
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31/*
32 * Active Directory Service Setup
33 */
34
35#include "ndrtypes.ndl"
36
37
38#define	DSSETUP_OPNUM_DsRoleGetPrimaryDomainInfo	0x00
39#define	DSSETUP_OPNUM_DsRoleDnsNameToFlatName		0x01
40#define	DSSETUP_OPNUM_DsRoleDcAsDc			0x02
41#define	DSSETUP_OPNUM_DsRoleDcAsReplica			0x03
42#define	DSSETUP_OPNUM_DsRoleDemoteDc			0x04
43#define	DSSETUP_OPNUM_DsRoleGetDcOperationProgress	0x05
44#define	DSSETUP_OPNUM_DsRoleGetDcOperationResults	0x06
45#define	DSSETUP_OPNUM_DsRoleCancel			0x07
46#define	DSSETUP_OPNUM_DsRoleServerSaveStateForUpgrade	0x08
47#define	DSSETUP_OPNUM_DsRoleUpgradeDownlevelServer	0x09
48#define	DSSETUP_OPNUM_DsRoleAbortDownlevelServerUpgrade	0x0a
49
50/*
51 * DS roles
52 */
53#define	DS_ROLE_STANDALONE_WORKSTATION	0
54#define	DS_ROLE_MEMBER_WORKSTATION	1
55#define	DS_ROLE_STANDALONE_SERVER	2
56#define	DS_ROLE_MEMBER_SERVER		3
57#define	DS_ROLE_BACKUP_DC		4
58#define	DS_ROLE_PRIMARY_DC		5
59
60/*
61 * DS role flags
62 */
63#define	DS_ROLE_PRIMARY_DS_RUNNING              0x00000001
64#define	DS_ROLE_PRIMARY_DS_MIXED_MODE           0x00000002
65#define	DS_ROLE_UPGRADE_IN_PROGRESS             0x00000004
66#define	DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT	0x01000000
67
68/*
69 * DS role upgrade
70 */
71#define	DS_ROLE_NOT_UPGRADING		0
72#define	DS_ROLE_UPGRADING		1
73
74/*
75 * DS role previous
76 */
77#define	DS_ROLE_PREVIOUS_UNKNOWN	0
78#define	DS_ROLE_PREVIOUS_PRIMARY	1
79#define	DS_ROLE_PREVIOUS_BACKUP		2
80
81/*
82 * DS role state
83 */
84#define	DS_ROLE_OP_IDLE			0
85#define	DS_ROLE_OP_ACTIVE		1
86#define	DS_ROLE_OP_NEEDS_REBOOT		2
87
88/*
89 * DS role information levels
90 */
91#define	DS_ROLE_BASIC_INFORMATION	1
92#define	DS_ROLE_UPGRADE_STATUS		2
93#define	DS_ROLE_OP_STATUS		3
94
95struct dssetup_uuid {
96	DWORD	data1;
97	WORD	data2;
98	WORD	data3;
99	BYTE	data4[8];
100};
101typedef struct dssetup_uuid dssetup_uuid_t;
102
103/*
104 * DS_ROLE_BASIC_INFORMATION
105 */
106struct dssetup_DsRolePrimaryDomInfo1 {
107	DWORD role;
108	DWORD flags;
109	LPTSTR nt_domain;
110	LPTSTR dns_domain;
111	LPTSTR forest;
112	dssetup_uuid_t domain_guid;
113};
114
115/*
116 * DS_ROLE_UPGRADE_STATUS
117 */
118struct dssetup_DsRolePrimaryDomInfo2 {
119	DWORD upgrade_state;
120	DWORD previous_role;
121};
122
123/*
124 * DS_ROLE_OP_STATUS
125 */
126struct dssetup_DsRolePrimaryDomInfo3 {
127	DWORD status;
128};
129
130union dssetup_GetPrimaryDomainInfo_ru {
131	UNION_INFO_ENT(1,dssetup_DsRolePrimaryDomInfo);
132	UNION_INFO_ENT(2,dssetup_DsRolePrimaryDomInfo);
133	UNION_INFO_ENT(3,dssetup_DsRolePrimaryDomInfo);
134	DEFAULT	char *nullptr;
135};
136
137struct dssetup_GetPrimaryDomainInfoRes {
138	DWORD address;
139	WORD switch_value;
140	SWITCH(switch_value)
141		union dssetup_GetPrimaryDomainInfo_ru ru;
142};
143
144OPERATION(DSSETUP_OPNUM_DsRoleGetPrimaryDomainInfo)
145struct dssetup_DsRoleGetPrimaryDomainInfo {
146	IN	WORD level;
147	OUT	DWORD address;
148	OUT	WORD switch_value;
149  SWITCH(level)
150	OUT	union dssetup_GetPrimaryDomainInfo_ru ru;
151	OUT	DWORD status;
152};
153
154
155/*
156 ***********************************************************************
157 * DSSETUP interface definiton.
158 ***********************************************************************
159 */
160INTERFACE(0)
161union dssetup_interface {
162	CASE(DSSETUP_OPNUM_DsRoleGetPrimaryDomainInfo)
163		struct dssetup_DsRoleGetPrimaryDomainInfo GetPrimaryDomainInfo;
164};
165typedef union dssetup_interface dssetup_interface_t;
166EXTERNTYPEINFO(dssetup_interface)
167
168#endif /* _DSSETUP_NDL_ */
169