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.
22 #include "libcli/ldap/ldap.h"
24 struct ldapsrv_connection {
25 struct stream_connection *connection;
26 struct gensec_security *gensec;
27 struct auth_session_info *session_info;
28 struct ldapsrv_service *service;
29 struct tls_context *tls;
30 struct ldapsrv_partition *default_partition;
31 struct ldapsrv_partition *partitions;
33 /* are we using gensec wrapping? */
36 /* connection should be terminated if non-null */
37 const char *terminate;
39 struct packet_context *packet;
43 struct ldapsrv_connection *conn;
44 struct ldap_message *request;
45 struct ldapsrv_reply {
46 struct ldapsrv_reply *prev, *next;
47 struct ldap_message *msg;
51 struct ldapsrv_service;
52 struct ldapsrv_partition;
54 struct ldapsrv_partition_ops {
56 NTSTATUS (*Init)(struct ldapsrv_partition *partition, struct ldapsrv_connection *conn);
57 NTSTATUS (*Bind)(struct ldapsrv_partition *partition, struct ldapsrv_connection *conn);
58 NTSTATUS (*Search)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_SearchRequest *r);
59 NTSTATUS (*Modify)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ModifyRequest *r);
60 NTSTATUS (*Add)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_AddRequest *r);
61 NTSTATUS (*Del)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_DelRequest *r);
62 NTSTATUS (*ModifyDN)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ModifyDNRequest *r);
63 NTSTATUS (*Compare)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_CompareRequest *r);
64 NTSTATUS (*Abandon)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_AbandonRequest *r);
65 NTSTATUS (*Extended)(struct ldapsrv_partition *partition, struct ldapsrv_call *call, struct ldap_ExtendedRequest *r);
68 struct ldapsrv_partition {
69 struct ldapsrv_partition *prev,*next;
72 const struct ldapsrv_partition_ops *ops;
77 struct ldapsrv_service {
78 struct tls_params *tls_params;