2 Unix SMB/CIFS implementation.
4 Copyright (C) Volker Lendecke 2004
5 Copyright (C) Stefan Metzmacher 2004
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 2 of the License, or
10 (at your option) any later version.
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.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 enum ldapsrv_call_state {
28 LDAPSRV_CALL_STATE_NEW = 0,
29 LDAPSRV_CALL_STATE_BUSY,
30 LDAPSRV_CALL_STATE_ASYNC,
31 LDAPSRV_CALL_STATE_ABORT,
32 LDAPSRV_CALL_STATE_COMPLETE
35 enum ldapsrv_reply_state {
36 LDAPSRV_REPLY_STATE_NEW = 0,
37 LDAPSRV_REPLY_STATE_SEND
40 struct ldapsrv_connection;
43 struct ldapsrv_call *prev,*next;
44 enum ldapsrv_call_state state;
46 struct ldapsrv_connection *conn;
48 struct ldap_message request;
50 struct ldapsrv_reply {
51 struct ldapsrv_reply *prev,*next;
52 enum ldapsrv_reply_state state;
53 struct ldap_message msg;
57 struct ldapsrv_service;
59 struct ldapsrv_connection {
60 struct server_connection *connection;
62 struct gensec_security *gensec;
63 struct auth_session_info *session_info;
65 struct rw_buffer sasl_in_buffer;
66 struct rw_buffer sasl_out_buffer;
68 struct rw_buffer in_buffer;
69 struct rw_buffer out_buffer;
71 struct ldapsrv_call *calls;
73 struct ldapsrv_service *service;
76 struct ldapsrv_partition;
78 struct ldapsrv_partition_ops {
80 NTSTATUS (*Init)(struct ldapsrv_partition *partition, struct ldapsrv_connection *conn);
81 NTSTATUS (*Search)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_SearchRequest *r);
82 NTSTATUS (*Modify)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ModifyRequest *r);
83 NTSTATUS (*Add)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_AddRequest *r);
84 NTSTATUS (*Del)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_DelRequest *r);
85 NTSTATUS (*ModifyDN)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ModifyDNRequest *r);
86 NTSTATUS (*Compare)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_CompareRequest *r);
87 NTSTATUS (*Abandon)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_AbandonRequest *r);
88 NTSTATUS (*Extended)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ExtendedRequest *r);
91 struct ldapsrv_partition {
92 struct ldapsrv_partition *prev,*next;
95 const struct ldapsrv_partition_ops *ops;
100 struct ldapsrv_service {
101 struct ldapsrv_partition *rootDSE;
102 struct ldapsrv_partition *default_partition;
103 struct ldapsrv_partition *partitions;