2 Unix SMB/CIFS Implementation.
4 ldap client side header
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "libcli/ldap/ldap.h"
25 enum ldap_request_state { LDAP_REQUEST_SEND=1, LDAP_REQUEST_PENDING=2, LDAP_REQUEST_DONE=3, LDAP_REQUEST_ERROR=4 };
27 /* this is the handle that the caller gets when an async ldap message
30 struct ldap_request *next, *prev;
31 struct ldap_connection *conn;
33 enum ldap_request_tag type;
35 enum ldap_request_state state;
38 struct ldap_message **replies;
43 void (*fn)(struct ldap_request *);
47 struct timed_event *time_event;
51 /* main context for a ldap client connection */
52 struct ldap_connection {
53 struct socket_context *sock;
59 const char *simple_pw;
69 enum { LDAP_BIND_SIMPLE, LDAP_BIND_SASL } type;
73 /* next message id to assign */
74 unsigned next_messageid;
76 /* Outstanding LDAP requests that have not yet been replied to */
77 struct ldap_request *pending;
79 /* Let's support SASL */
80 struct gensec_security *gensec;
82 /* the default timeout for messages */
85 /* last error message */
89 struct event_context *event_ctx;
93 struct packet_context *packet;