import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunk
[metze/old/v3-2-winbind-ndr.git] / source / include / rpc_ds.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Gerald Carter                  2002
5       
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.
10    
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.
15    
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.
19 */
20
21 #ifndef _RPC_DS_H /* _RPC_LSA_H */
22 #define _RPC_DS_H 
23
24 #include "rpc_misc.h"
25
26
27 /* Opcodes available on PIPE_LSARPC_DS */
28
29 #define DS_GETPRIMDOMINFO      0x00
30 #define DS_NOP                 0xFF     /* no op -- placeholder */
31
32 /* Opcodes available on PIPE_NETLOGON */
33
34 #define DS_ENUM_DOM_TRUSTS      0x28
35
36
37 /* macros for RPC's */
38
39 /* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */
40
41 /* flags */
42
43 #define DSROLE_PRIMARY_DS_RUNNING           0x00000001
44 #define DSROLE_PRIMARY_DS_MIXED_MODE        0x00000002
45 #define DSROLE_UPGRADE_IN_PROGRESS          0x00000004
46 #define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT  0x01000000
47
48 /* machine role */
49
50 #define DSROLE_STANDALONE_SRV           2       
51 #define DSROLE_DOMAIN_MEMBER_SRV        3
52 #define DSROLE_BDC                      4
53 #define DSROLE_PDC                      5
54
55
56 typedef struct
57 {
58         uint16          machine_role;
59         uint16          unknown;                /* 0x6173 -- maybe just alignment? */
60         
61         uint32          flags;
62         
63         uint32          netbios_ptr;
64         uint32          dnsname_ptr;
65         uint32          forestname_ptr;
66         
67         struct uuid     domain_guid;
68         
69         UNISTR2 netbios_domain;
70
71         UNISTR2 dns_domain;     /* our dns domain */
72         UNISTR2 forest_domain;  /* root domain of the forest to which we belong */
73 } DSROLE_PRIMARY_DOMAIN_INFO_BASIC;
74
75 typedef struct
76 {
77         DSROLE_PRIMARY_DOMAIN_INFO_BASIC        *basic;
78 } DS_DOMINFO_CTR;
79
80 /* info levels for ds_getprimdominfo() */
81
82 #define DsRolePrimaryDomainInfoBasic            1
83
84
85 /* DS_Q_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() request */
86 typedef struct 
87 {
88         uint16  level;
89 } DS_Q_GETPRIMDOMINFO;
90
91 /* DS_R_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() response */
92 typedef struct 
93 {
94         uint32          ptr;
95                 
96         uint16          level;
97         uint16          unknown0;       /* 0x455c -- maybe just alignment? */
98
99         DS_DOMINFO_CTR  info;
100         
101         NTSTATUS status;
102 } DS_R_GETPRIMDOMINFO;
103
104 typedef struct {
105         /* static portion of structure */
106         uint32          netbios_ptr;
107         uint32          dns_ptr;
108         uint32          flags;
109         uint32          parent_index;
110         uint32          trust_type;
111         uint32          trust_attributes;
112         uint32          sid_ptr;
113         struct uuid     guid;
114         
115         UNISTR2         netbios_domain;
116         UNISTR2         dns_domain;
117         DOM_SID2        sid;
118
119 } DS_DOMAIN_TRUSTS;
120
121 struct ds_domain_trust {
122         /* static portion of structure */
123         uint32          flags;
124         uint32          parent_index;
125         uint32          trust_type;
126         uint32          trust_attributes;
127         struct uuid     guid;
128         
129         DOM_SID sid;
130         char *netbios_domain;
131         char *dns_domain;
132 };
133
134 typedef struct {
135
136         uint32                  ptr;
137         uint32                  max_count;
138         DS_DOMAIN_TRUSTS        *trusts;
139         
140 } DS_DOMAIN_TRUSTS_CTR;
141
142 #define DS_DOMAIN_IN_FOREST           0x0001    /* domains in the forest to which 
143                                                    we belong; even different domain trees */
144 #define DS_DOMAIN_DIRECT_OUTBOUND     0x0002    /* trusted domains */
145 #define DS_DOMAIN_TREE_ROOT           0x0004    /* root of our forest; also available in
146                                                    DsRoleGetPrimaryDomainInfo() */
147 #define DS_DOMAIN_PRIMARY             0x0008    /* our domain */
148 #define DS_DOMAIN_NATIVE_MODE         0x0010    /* native mode AD servers */
149 #define DS_DOMAIN_DIRECT_INBOUND      0x0020    /* trusting domains */
150
151 /* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */
152 typedef struct 
153 {
154         uint32          server_ptr;
155         UNISTR2         server;
156         uint32          flags;
157         
158 } DS_Q_ENUM_DOM_TRUSTS;
159
160 /* DS_R_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() response */
161 typedef struct 
162 {
163         uint32                  num_domains;
164         DS_DOMAIN_TRUSTS_CTR    domains;
165                 
166         NTSTATUS status;
167
168 } DS_R_ENUM_DOM_TRUSTS;
169
170
171 #endif /* _RPC_DS_H */