9ad042b2bb787f58d28b9fd51192b8870b495545
[bbaumbach/samba-autobuild/.git] / source4 / 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 3 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, see <http://www.gnu.org/licenses/>.
18 */
19
20
21 #include "librpc/rpc/dcerpc.h"
22
23 /*
24  * struct definition for connecting to a dcerpc inferface
25  */
26
27 enum libnet_RpcConnect_level {
28         LIBNET_RPC_CONNECT_SERVER,          /* connect to a standalone rpc server */
29         LIBNET_RPC_CONNECT_SERVER_ADDRESS,  /* connect to a standalone rpc server, 
30                                                knowing both name and address */
31         LIBNET_RPC_CONNECT_PDC,             /* connect to a domain pdc (resolves domain
32                                                name to a pdc address before connecting) */
33         LIBNET_RPC_CONNECT_DC,              /* connect to any DC (resolves domain
34                                                name to a DC address before connecting) */
35         LIBNET_RPC_CONNECT_BINDING,         /* specified binding string */
36         LIBNET_RPC_CONNECT_DC_INFO          /* connect to a DC and provide basic domain
37                                                information (name, realm, sid, guid) */
38 };
39
40 struct libnet_RpcConnect {
41         enum libnet_RpcConnect_level level;
42
43         struct {
44                 const char *name;
45                 const char *address;
46                 const char *binding;
47                 const struct dcerpc_interface_table *dcerpc_iface;
48         } in;
49         struct {
50                 struct dcerpc_pipe *dcerpc_pipe;
51                 
52                 /* parameters provided in LIBNET_RPC_CONNECT_DC_INFO level, null otherwise */
53                 const char *domain_name;
54                 struct dom_sid *domain_sid;
55                 const char *realm;           /* these parameters are only present if */
56                 struct GUID *guid;           /* the remote server is known to be AD */
57
58                 const char *error_string;
59         } out;
60 };
61
62
63 /*
64  * Monitor messages sent from libnet_rpc.c functions
65  */
66
67 struct msg_net_lookup_dc {
68         const char *domain_name;
69         const char *hostname;
70         const char *address;
71 };
72
73
74 struct msg_net_pipe_connected {
75         const char *host;
76         const char *endpoint;
77         enum dcerpc_transport_t transport;
78 };