smbdotconf: add client ldap sasl wrapping = {starttls,ldaps}
[slow/samba-autobuild/.git] / source3 / librpc / idl / ads.idl
1 #include "idl_types.h"
2 #include "config.h"
3
4 /*
5   ads interface definition
6 */
7
8 import "nbt.idl";
9
10 cpp_quote("#include <system/network.h>")
11
12 [
13         pointer_default(unique)
14 ]
15 interface ads
16 {
17         typedef [public] enum {
18                 ADS_SASLWRAP_TYPE_PLAIN = 1,
19                 ADS_SASLWRAP_TYPE_SIGN = 2,
20                 ADS_SASLWRAP_TYPE_SEAL = 4
21         } ads_saslwrap_type;
22
23         /* ads auth control flags */
24         typedef [public] bitmap {
25                 ADS_AUTH_DISABLE_KERBEROS       = 0x0001,
26                 ADS_AUTH_NO_BIND                = 0x0002,
27                 ADS_AUTH_ANON_BIND              = 0x0004,
28                 ADS_AUTH_ALLOW_NTLMSSP          = 0x0010,
29                 ADS_AUTH_SASL_SIGN              = 0x0020,
30                 ADS_AUTH_SASL_SEAL              = 0x0040,
31                 ADS_AUTH_SASL_FORCE             = 0x0080,
32                 ADS_AUTH_USER_CREDS             = 0x0100,
33                 ADS_AUTH_SASL_STARTTLS          = 0x0200,
34                 ADS_AUTH_SASL_LDAPS             = 0x0400
35         } ads_auth_flags;
36
37         const int ADS_SASL_WRAPPING_IN_MAX_WRAPPED = 0x0FFFFFFF;
38         const int ADS_SASL_WRAPPING_OUT_MAX_WRAPPED = 0x00A00000;
39
40         typedef [nopull,nopush] struct {
41                 string realm;
42                 string workgroup;
43                 string ldap_server;
44                 boolean8 gc;     /* Is this a global catalog server? */
45                 boolean8 no_fallback; /* Bail if the ldap_server is not available */
46         } ads_server;
47
48         typedef [nopull,nopush] struct {
49                 string realm;
50                 string password;
51                 string user_name;
52                 string kdc_server;
53                 ads_auth_flags flags;
54                 int time_offset;
55                 string ccache_name;
56                 time_t tgt_expire;
57                 time_t tgs_expire;
58                 time_t renewable;
59         } ads_auth;
60
61         typedef [nopull,nopush] struct {
62                 nbt_server_type flags; /* cldap flags identifying the services. */
63                 string workgroup;
64                 string realm;
65                 string bind_path;
66                 string ldap_server_name;
67                 string server_site_name;
68                 string client_site_name;
69                 time_t current_time;
70                 string schema_path;
71                 string config_path;
72                 int ldap_page_size;
73         } ads_config;
74
75         typedef [nopull,nopush] struct {
76                 uint32 ofs;
77                 uint32 needed;
78                 uint32 left;
79                 uint32 max_wrapped;
80                 uint32 min_wrapped;
81                 uint32 size;
82                 uint8 *buf;
83         } ads_ldap_buf_in;
84
85         typedef [nopull,nopush] struct {
86                 uint32 ofs;
87                 uint32 left;
88                 uint32 max_unwrapped;
89                 uint32 sig_size;
90                 uint32 size;
91                 uint8 *buf;
92         } ads_ldap_buf_out;
93
94         typedef [nopull,nopush] struct {
95                 ads_saslwrap_type wrap_type;
96                 [ignore] ads_saslwrap_ops *wrap_ops;
97 #ifdef HAVE_ADS
98                 [ignore] struct sockbuf_io_desc *sbiod; /* lowlevel state for LDAP wrapping */
99 #endif /* HAVE_ADS */
100                 [ignore] TALLOC_CTX *mem_ctx;
101                 [ignore] void *wrap_private_data;
102                 ads_ldap_buf_in in;
103                 ads_ldap_buf_out out;
104         } ads_saslwrap;
105
106         typedef [nopull,nopush] struct {
107                 [ignore] TALLOC_CTX *mem_ctx;
108                 [ignore] timeval endtime;
109 #ifdef HAVE_ADS
110                 [ignore] struct sockbuf_io_desc *sbiod; /* lowlevel state for LDAP wrapping */
111                 [ignore] struct tstream_tls_params *tls_params;
112                 [ignore] struct tstream_tls_sync *tls_sync;
113 #endif /* HAVE_ADS */
114         } ads_tlswrap;
115
116         typedef [nopull,nopush] struct {
117                 [ignore] ldap *ld;
118                 sockaddr_storage ss; /* the ip of the active connection, if any */
119                 time_t last_attempt; /* last attempt to reconnect, monotonic clock */
120                 int port;
121         } ads_ldap;
122
123         typedef [public,nopull,nopush] struct {
124                 /* info needed to find the server */
125                 ads_server server;
126
127                 /* info needed to authenticate */
128                 ads_auth auth;
129
130                 /* info derived from the servers config */
131                 ads_config config;
132
133 #ifdef HAVE_ADS
134                 ads_saslwrap ldap_wrap_data;
135                 ads_tlswrap ldap_tls_data;
136                 /* info about the current LDAP connection */
137                 ads_ldap ldap;
138 #endif /* HAVE_ADS */
139
140         } ads_struct;
141 }
142
143