r3881: Split up the LIBNDR_GEN subsystem into NDR_* and RPC_NDR_* subsystems.
[samba.git] / source / libnet / libnet_rpc.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 and enum for finding a domain controller */
22 enum libnet_find_pdc_level {
23         LIBNET_FIND_PDC_GENERIC
24 };
25
26 union libnet_find_pdc {
27         /* find to a domains PDC */
28         struct {
29                 enum libnet_find_pdc_level level;
30
31                 struct {
32                         const char *domain_name;
33                 } in;
34
35                 struct  {
36                         const char *pdc_name;
37                 } out;
38         } generic;
39 };
40
41 /* struct and enum for connecting to a dcerpc inferface */
42 enum libnet_rpc_connect_level {
43         LIBNET_RPC_CONNECT_STANDARD,
44         LIBNET_RPC_CONNECT_PDC
45 };
46
47 union libnet_rpc_connect {
48         /* connect to a standart server */
49         struct {
50                 enum libnet_rpc_connect_level level;
51
52                 struct {
53                         const char *server_name;
54                         const char *dcerpc_iface_name;
55                         const char *dcerpc_iface_uuid;
56                         uint32 dcerpc_iface_version;
57                 } in;
58
59                 struct _libnet_rpc_connect_out {
60                         struct dcerpc_pipe *dcerpc_pipe;
61                         const char *error_string;
62                 } out;
63         } standard;
64
65         /* connect to a domains PDC */
66         struct {
67                 enum libnet_rpc_connect_level level;
68
69                 struct {
70                         const char *domain_name;
71                         const char *dcerpc_iface_name;
72                         const char *dcerpc_iface_uuid;
73                         uint32 dcerpc_iface_version;
74                 } in;
75
76                 struct _libnet_rpc_connect_out out;
77         } pdc;
78 };