r1836: - as abartlet said to me, we need to contact the users domain pdcfor doing a
[ira/wip.git] / source4 / libnet / libnet.h
1 /* 
2    Unix SMB/CIFS implementation.
3    
4    Copyright (C) Stefan Metzmacher      2004
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 struct libnet_context {
22         TALLOC_CTX *mem_ctx;
23
24         /* here we need:
25          * a client env context
26          * a user env context
27          */
28 };
29
30 /* struct and enum for connecting to a dcerpc inferface */
31 enum libnet_rpc_connect_level {
32         LIBNET_RPC_CONNECT_PDC
33 };
34
35 union libnet_rpc_connect {
36         /* connect to a domains PDC */
37         struct {
38                 enum libnet_rpc_connect_level level;
39
40                 struct {
41                         const char *domain_name;
42                         const char *dcerpc_iface_name;
43                         const char *dcerpc_iface_uuid;
44                         uint32 dcerpc_iface_version;
45                 } in;
46
47                 struct  {
48                         struct dcerpc_pipe *dcerpc_pipe;
49                 } out;
50         } pdc;
51 };
52
53
54 /* struct and enum for doing a remote password change */
55 enum libnet_ChangePassword_level {
56         LIBNET_CHANGE_PASSWORD_GENERIC,
57         LIBNET_CHANGE_PASSWORD_RPC,
58         LIBNET_CHANGE_PASSWORD_KRB5,
59         LIBNET_CHANGE_PASSWORD_LDAP,
60         LIBNET_CHANGE_PASSWORD_RAP
61 };
62
63 union libnet_ChangePassword {
64         struct {
65                 enum libnet_ChangePassword_level level;
66
67                 struct _libnet_ChangePassword_in {
68                         const char *account_name;
69                         const char *domain_name;
70                         const char *oldpassword;
71                         const char *newpassword;
72                 } in;
73
74                 struct _libnet_ChangePassword_out {
75                         const char *error_string;
76                 } out;
77         } generic;
78
79         struct {
80                 enum libnet_ChangePassword_level level;
81                 struct _libnet_ChangePassword_in in;
82                 struct _libnet_ChangePassword_out out;
83         } rpc;
84
85         struct {
86                 enum libnet_ChangePassword_level level;
87                 struct _libnet_ChangePassword_in in;
88                 struct _libnet_ChangePassword_out out;
89         } krb5;
90
91         struct {
92                 enum libnet_ChangePassword_level level;
93                 struct _libnet_ChangePassword_in in;
94                 struct _libnet_ChangePassword_out out;
95         } ldap;
96
97         struct {
98                 enum libnet_ChangePassword_level level;
99                 struct _libnet_ChangePassword_in in;
100                 struct _libnet_ChangePassword_out out;
101         } rap;
102 };
103
104 /* struct and enum for doing a remote password set */
105 enum libnet_SetPassword_level {
106         LIBNET_SET_PASSWORD_GENERIC,
107         LIBNET_SET_PASSWORD_RPC,
108         LIBNET_SET_PASSWORD_KRB5,
109         LIBNET_SET_PASSWORD_LDAP,
110         LIBNET_SET_PASSWORD_RAP
111 };
112
113 union libnet_SetPassword {
114         struct {
115                 enum libnet_SetPassword_level level;
116
117                 struct _libnet_SetPassword_in {
118                         const char *account_name;
119                         const char *domain_name;
120                         const char *newpassword;
121                 } in;
122
123                 struct _libnet_SetPassword_out {
124                         const char *error_string;
125                 } out;
126         } generic;
127
128         struct {
129                 enum libnet_SetPassword_level level;
130                 struct _libnet_SetPassword_in in;
131                 struct _libnet_SetPassword_out out;
132         } rpc;
133
134         struct {
135                 enum libnet_SetPassword_level level;
136                 struct _libnet_SetPassword_in in;
137                 struct _libnet_SetPassword_out out;
138         } krb5;
139
140         struct {
141                 enum libnet_SetPassword_level level;
142                 struct _libnet_SetPassword_in in;
143                 struct _libnet_SetPassword_out out;
144         } ldap;
145
146         struct {
147                 enum libnet_ChangePassword_level level;
148                 struct _libnet_SetPassword_in in;
149                 struct _libnet_SetPassword_out out;
150         } rap;
151 };