nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / lib / libpkix / pkix_pl_nss / module / pkix_pl_ldapdefaultclient.h
blob9bc24188e3d608280fd87626aabb7d5f1b1bd714
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the PKIX-C library.
16 * The Initial Developer of the Original Code is
17 * Sun Microsystems, Inc.
18 * Portions created by the Initial Developer are
19 * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
21 * Contributor(s):
22 * Sun Microsystems, Inc.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 * pkix_pl_ldapdefaultclient.h
40 * LDAPDefaultClient Object Type Definition
44 #ifndef _PKIX_PL_LDAPDEFAULTCLIENT_H
45 #define _PKIX_PL_LDAPDEFAULTCLIENT_H
47 #include "pkix_pl_ldapt.h"
48 #include "pkix_pl_common.h"
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
55 * At the time of this version, there are unresolved questions about the LDAP
56 * protocol. Although RFC1777 describes a BIND and UNBIND message, it is not
57 * clear whether they are appropriate to this application. We have tested only
58 * using servers that do not expect authentication, and that reject BIND
59 * messages. It is not clear what values might be appropriate for the bindname
60 * and authentication fields, which are currently implemented as char strings
61 * supplied by the caller. (If this changes, the API and possibly the templates
62 * will have to change.) Therefore the LDAPClient_Create API contains a
63 * BindAPI structure, a union, which will have to be revised and extended when
64 * this area of the protocol is better understood.
68 typedef enum {
69 CONNECT_PENDING,
70 CONNECTED,
71 BIND_PENDING,
72 BIND_RESPONSE,
73 BIND_RESPONSE_PENDING,
74 BOUND,
75 SEND_PENDING,
76 RECV,
77 RECV_PENDING,
78 RECV_INITIAL,
79 RECV_NONINITIAL,
80 ABANDON_PENDING
81 } LdapClientConnectStatus;
83 struct PKIX_PL_LdapDefaultClientStruct {
84 PKIX_PL_LdapClient vtable;
85 LdapClientConnectStatus connectStatus;
86 PKIX_UInt32 messageID;
87 PKIX_PL_HashTable *cachePtr;
88 PKIX_PL_Socket *clientSocket;
89 PRPollDesc pollDesc;
90 void *callbackList; /* cast this to (PKIX_PL_Socket_Callback *) */
91 LDAPBindAPI *bindAPI;
92 PRArenaPool *arena;
93 PRTime lastIO;
94 void *sendBuf;
95 PKIX_UInt32 bytesToWrite;
96 void *rcvBuf;
97 PKIX_UInt32 capacity;
98 void *currentInPtr;
99 PKIX_UInt32 currentBytesAvailable;
100 void *bindMsg;
101 PKIX_UInt32 bindMsgLen;
102 PKIX_List *entriesFound;
103 PKIX_PL_LdapRequest *currentRequest;
104 PKIX_PL_LdapResponse *currentResponse;
107 /* see source file for function documentation */
109 PKIX_Error *pkix_pl_LdapDefaultClient_RegisterSelf(void *plContext);
111 #ifdef __cplusplus
113 #endif
115 #endif /* _PKIX_PL_LDAPDEFAULTCLIENT_H */