andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: /* andre@0: * pkix_pl_ldapdefaultclient.h andre@0: * andre@0: * LDAPDefaultClient Object Type Definition andre@0: * andre@0: */ andre@0: andre@0: #ifndef _PKIX_PL_LDAPDEFAULTCLIENT_H andre@0: #define _PKIX_PL_LDAPDEFAULTCLIENT_H andre@0: andre@0: #include "pkix_pl_ldapt.h" andre@0: #include "pkix_pl_common.h" andre@0: andre@0: #ifdef __cplusplus andre@0: extern "C" { andre@0: #endif andre@0: andre@0: /* andre@0: * At the time of this version, there are unresolved questions about the LDAP andre@0: * protocol. Although RFC1777 describes a BIND and UNBIND message, it is not andre@0: * clear whether they are appropriate to this application. We have tested only andre@0: * using servers that do not expect authentication, and that reject BIND andre@0: * messages. It is not clear what values might be appropriate for the bindname andre@0: * and authentication fields, which are currently implemented as char strings andre@0: * supplied by the caller. (If this changes, the API and possibly the templates andre@0: * will have to change.) Therefore the LDAPClient_Create API contains a andre@0: * BindAPI structure, a union, which will have to be revised and extended when andre@0: * this area of the protocol is better understood. andre@0: * andre@0: */ andre@0: andre@0: typedef enum { andre@0: CONNECT_PENDING, andre@0: CONNECTED, andre@0: BIND_PENDING, andre@0: BIND_RESPONSE, andre@0: BIND_RESPONSE_PENDING, andre@0: BOUND, andre@0: SEND_PENDING, andre@0: RECV, andre@0: RECV_PENDING, andre@0: RECV_INITIAL, andre@0: RECV_NONINITIAL, andre@0: ABANDON_PENDING andre@0: } LdapClientConnectStatus; andre@0: andre@0: struct PKIX_PL_LdapDefaultClientStruct { andre@0: PKIX_PL_LdapClient vtable; andre@0: LdapClientConnectStatus connectStatus; andre@0: PKIX_UInt32 messageID; andre@0: PKIX_PL_HashTable *cachePtr; andre@0: PKIX_PL_Socket *clientSocket; andre@0: PRPollDesc pollDesc; andre@0: void *callbackList; /* cast this to (PKIX_PL_Socket_Callback *) */ andre@0: LDAPBindAPI *bindAPI; andre@0: PLArenaPool *arena; andre@0: PRTime lastIO; andre@0: void *sendBuf; andre@0: PKIX_UInt32 bytesToWrite; andre@0: void *rcvBuf; andre@0: PKIX_UInt32 capacity; andre@0: void *currentInPtr; andre@0: PKIX_UInt32 currentBytesAvailable; andre@0: void *bindMsg; andre@0: PKIX_UInt32 bindMsgLen; andre@0: PKIX_List *entriesFound; andre@0: PKIX_PL_LdapRequest *currentRequest; andre@0: PKIX_PL_LdapResponse *currentResponse; andre@0: }; andre@0: andre@0: /* see source file for function documentation */ andre@0: andre@0: PKIX_Error *pkix_pl_LdapDefaultClient_RegisterSelf(void *plContext); andre@0: andre@0: #ifdef __cplusplus andre@0: } andre@0: #endif andre@0: andre@0: #endif /* _PKIX_PL_LDAPDEFAULTCLIENT_H */