still ok
[metze/samba/wip.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_NO_BIND                = 0x0002,
26                 ADS_AUTH_ANON_BIND              = 0x0004,
27                 ADS_AUTH_SASL_SIGN              = 0x0020,
28                 ADS_AUTH_SASL_SEAL              = 0x0040,
29                 ADS_AUTH_SASL_FORCE             = 0x0080,
30                 ADS_AUTH_SASL_STARTTLS          = 0x0200,
31                 ADS_AUTH_SASL_LDAPS             = 0x0400,
32                 ADS_AUTH_GENERATE_KRB5_CONFIG   = 0x0800,
33                 ADS_AUTH_CLDAP_ONLY             = 0x1000
34         } ads_auth_flags;
35
36         const int ADS_SASL_WRAPPING_IN_MAX_WRAPPED = 0x0FFFFFFF;
37         const int ADS_SASL_WRAPPING_OUT_MAX_WRAPPED = 0x00A00000;
38
39         typedef [nopull,nopush] struct {
40                 string realm;
41                 string workgroup;
42                 string ldap_server;
43                 boolean8 gc;     /* Is this a global catalog server? */
44                 boolean8 no_fallback; /* Bail if the ldap_server is not available */
45         } ads_server;
46
47         typedef [nopull,nopush] struct {
48                 string kdc_server;
49                 ads_auth_flags flags;
50                 NTTIME expire_time;
51                 [ignore] struct ads_reconnect_state *reconnect_state;
52         } ads_auth;
53
54         typedef [nopull,nopush] struct {
55                 nbt_server_type flags; /* cldap flags identifying the services. */
56                 string workgroup;
57                 string realm;
58                 string bind_path;
59                 string ldap_server_name;
60                 string server_site_name;
61                 string client_site_name;
62                 time_t current_time;
63                 int time_offset;
64                 string schema_path;
65                 string config_path;
66                 int ldap_page_size;
67         } ads_config;
68
69         typedef [nopull,nopush] struct {
70                 uint32 ofs;
71                 uint32 needed;
72                 uint32 left;
73                 uint32 max_wrapped;
74                 uint32 min_wrapped;
75                 uint32 size;
76                 uint8 *buf;
77         } ads_ldap_buf_in;
78
79         typedef [nopull,nopush] struct {
80                 uint32 ofs;
81                 uint32 left;
82                 uint32 max_unwrapped;
83                 uint32 sig_size;
84                 uint32 size;
85                 uint8 *buf;
86         } ads_ldap_buf_out;
87
88         typedef [nopull,nopush] struct {
89                 ads_saslwrap_type wrap_type;
90                 [ignore] ads_saslwrap_ops *wrap_ops;
91 #ifdef HAVE_ADS
92                 [ignore] struct sockbuf_io_desc *sbiod; /* lowlevel state for LDAP wrapping */
93 #endif /* HAVE_ADS */
94                 [ignore] TALLOC_CTX *mem_ctx;
95                 [ignore] void *wrap_private_data;
96                 ads_ldap_buf_in in;
97                 ads_ldap_buf_out out;
98         } ads_saslwrap;
99
100         typedef [nopull,nopush] struct {
101                 [ignore] TALLOC_CTX *mem_ctx;
102                 [ignore] timeval endtime;
103 #ifdef HAVE_ADS
104                 [ignore] struct sockbuf_io_desc *sbiod; /* lowlevel state for LDAP wrapping */
105                 [ignore] struct tstream_tls_params *tls_params;
106                 [ignore] struct tstream_tls_sync *tls_sync;
107 #endif /* HAVE_ADS */
108         } ads_tlswrap;
109
110         typedef [nopull,nopush] struct {
111                 [ignore] ldap *ld;
112                 sockaddr_storage ss; /* the ip of the active connection, if any */
113                 time_t last_attempt; /* last attempt to reconnect, monotonic clock */
114                 int port;
115         } ads_ldap;
116
117         typedef [public,nopull,nopush] struct {
118                 /* info needed to find the server */
119                 ads_server server;
120
121                 /* info needed to authenticate */
122                 ads_auth auth;
123
124                 /* info derived from the servers config */
125                 ads_config config;
126
127 #ifdef HAVE_ADS
128                 ads_saslwrap ldap_wrap_data;
129                 ads_tlswrap ldap_tls_data;
130                 /* info about the current LDAP connection */
131                 ads_ldap ldap;
132 #endif /* HAVE_ADS */
133
134         } ads_struct;
135 }
136
137