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 2 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, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "libcli/ldap/ldap.h"
26 enum ldap_request_state { LDAP_REQUEST_SEND=1, LDAP_REQUEST_PENDING=2, LDAP_REQUEST_DONE=3, LDAP_REQUEST_ERROR=4 };
28 /* this is the handle that the caller gets when an async ldap message
31 struct ldap_request *next, *prev;
32 struct ldap_connection *conn;
34 enum ldap_request_tag type;
36 enum ldap_request_state state;
39 struct ldap_message **replies;
44 void (*fn)(struct ldap_request *);
48 struct timed_event *time_event;
52 /* main context for a ldap client connection */
53 struct ldap_connection {
54 struct socket_context *sock;
60 const char *simple_pw;
70 enum { LDAP_BIND_SIMPLE, LDAP_BIND_SASL } type;
74 /* next message id to assign */
75 unsigned next_messageid;
77 /* Outstanding LDAP requests that have not yet been replied to */
78 struct ldap_request *pending;
80 /* Let's support SASL */
81 struct gensec_security *gensec;
83 /* set if we are wrapping requests */
86 /* the default timeout for messages */
89 /* last error message */
93 struct event_context *event_ctx;
97 struct packet_context *packet;