port latest changes from SAMBA_3_0 tree
[Samba/bb.git] / source3 / include / rpc_ds.h
blob7350fdba1f9a7f52146a57596f067c0230a3d04e
1 /*
2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Gerald Carter 2002
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef _RPC_DS_H /* _RPC_LSA_H */
22 #define _RPC_DS_H
24 #include "rpc_misc.h"
27 /* Opcodes available on PIPE_LSARPC_DS */
29 #define DS_GETPRIMDOMINFO 0x00
31 /* Opcodes available on PIPE_NETLOGON */
33 #define DS_ENUM_DOM_TRUSTS 0x28
36 /* macros for RPC's */
38 #define DSROLE_PRIMARY_DS_RUNNING 0x00000001
39 #define DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002
40 #define DSROLE_UPGRADE_IN_PROGRESS 0x00000004
41 #define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000
43 typedef struct
45 uint16 machine_role;
46 uint16 unknown; /* 0x6173 -- maybe just alignment? */
48 uint32 flags;
50 uint32 netbios_ptr;
51 uint32 dnsname_ptr;
52 uint32 forestname_ptr;
54 GUID domain_guid;
56 UNISTR2 netbios_domain;
58 UNISTR2 dns_domain; /* our dns domain */
59 UNISTR2 forest_domain; /* root domain of the forest to which we belong */
60 } DSROLE_PRIMARY_DOMAIN_INFO_BASIC;
62 typedef struct
64 DSROLE_PRIMARY_DOMAIN_INFO_BASIC *basic;
65 } DS_DOMINFO_CTR;
67 /* info levels for ds_getprimdominfo() */
69 #define DsRolePrimaryDomainInfoBasic 1
72 /* DS_Q_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() request */
73 typedef struct
75 uint16 level;
76 } DS_Q_GETPRIMDOMINFO;
78 /* DS_R_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() response */
79 typedef struct
81 uint32 ptr;
83 uint16 level;
84 uint16 unknown0; /* 0x455c -- maybe just alignment? */
86 DS_DOMINFO_CTR info;
88 NTSTATUS status;
89 } DS_R_GETPRIMDOMINFO;
91 typedef struct {
92 /* static portion of structure */
93 uint32 netbios_ptr;
94 uint32 dns_ptr;
95 uint32 flags;
96 uint32 parent_index;
97 uint32 trust_type;
98 uint32 trust_attributes;
99 uint32 sid_ptr;
100 GUID guid;
102 UNISTR2 netbios_domain;
103 UNISTR2 dns_domain;
104 DOM_SID2 sid;
106 } DS_DOMAIN_TRUSTS;
108 typedef struct {
110 uint32 ptr;
111 uint32 max_count;
112 DS_DOMAIN_TRUSTS *trusts;
114 } DS_DOMAIN_TRUSTS_CTR;
116 #define DS_DOMAIN_IN_FOREST 0x0001 /* domains in the forest to which
117 we belong; even different domain trees */
118 #define DS_DOMAIN_DIRECT_OUTBOUND 0x0002 /* trusted domains */
119 #define DS_DOMAIN_TREE_ROOT 0x0004 /* root of our forest; also available in
120 DsRoleGetPrimaryDomainInfo() */
121 #define DS_DOMAIN_PRIMARY 0x0008 /* our domain */
122 #define DS_DOMAIN_NATIVE_MODE 0x0010 /* native mode AD servers */
123 #define DS_DOMAIN_DIRECT_INBOUND 0x0020 /* trusting domains */
125 /* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */
126 typedef struct
128 uint32 server_ptr;
129 UNISTR2 server;
130 uint32 flags;
132 } DS_Q_ENUM_DOM_TRUSTS;
134 /* DS_R_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() response */
135 typedef struct
137 uint32 num_domains;
138 DS_DOMAIN_TRUSTS_CTR domains;
140 NTSTATUS status;
142 } DS_R_ENUM_DOM_TRUSTS;
145 #endif /* _RPC_DS_H */