0fb8d2f4aca7f426902381f446da4e89ffbd1bae
[metze/samba/wip.git] / source4 / ldap_server / ldap_server.h
1 /* 
2    Unix SMB/CIFS implementation.
3    LDAP server
4    Copyright (C) Volker Lendecke 2004
5    Copyright (C) Stefan Metzmacher 2004
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "libcli/ldap/libcli_ldap.h"
22 #include "lib/socket/socket.h"
23 #include "lib/stream/packet.h"
24
25 struct ldapsrv_connection {
26         struct loadparm_context *lp_ctx;
27         struct stream_connection *connection;
28         struct gensec_security *gensec;
29         struct auth_session_info *session_info;
30         struct ldapsrv_service *service;
31         struct cli_credentials *server_credentials;
32         struct ldb_context *ldb;
33
34         struct {
35                 struct socket_context *raw;
36                 struct socket_context *tls;
37                 struct socket_context *sasl;
38         } sockets;
39
40         bool global_catalog;
41
42         struct packet_context *packet;
43
44         struct {
45                 int initial_timeout;
46                 int conn_idle_time;
47                 int max_page_size;
48                 int search_timeout;
49                 
50                 struct tevent_timer *ite;
51                 struct tevent_timer *te;
52         } limits;
53
54         struct ldapsrv_packet_interfaces *packet_interface;
55 };
56
57 struct ldapsrv_call {
58         struct ldapsrv_connection *conn;
59         struct ldap_message *request;
60         struct ldapsrv_reply {
61                 struct ldapsrv_reply *prev, *next;
62                 struct ldap_message *msg;
63         } *replies;
64         packet_send_callback_fn_t send_callback;
65         void *send_private;
66 };
67
68 struct ldapsrv_service {
69         struct tls_params *tls_params;
70         struct task_server *task;
71         struct ldapsrv_packet_interfaces {
72                 struct ldapsrv_packet_interfaces *next, *prev;
73                 struct packet_context *packet;
74                 struct ldapsrv_service *service;
75         } *packet_interfaces;
76 };
77
78 #include "ldap_server/proto.h"