"Fossies" - the Fresh Open Source Software Archive

Member "ldapexplorertool-2.0.1/src/ldapclass.h" (28 Nov 2006, 3048 Bytes) of package /linux/privat/old/ldapexplorertool-2.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ldapclass.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef __LET_LDAPCLASS__
    2 #define __LET_LDAPCLASS__
    3 
    4 #include <ldap.h>
    5 #include <wx/string.h>
    6 #include <wx/hashmap.h>
    7 #include "ldapentry.h"
    8 
    9 #define LF_OPERATIONAL 1
   10 #define LF_ALL  2
   11 #define LF_ALL_OPERATIONAL  3
   12 #define LF_NONE 4
   13 
   14 WX_DECLARE_HASH_MAP( int, LDAPMessage*, wxIntegerHash, wxIntegerEqual, Search_Results_Map );
   15 
   16 class LdapClass
   17 {
   18     public:
   19         LdapClass();
   20         virtual ~LdapClass();
   21         
   22         wxString GetErrorStr( void );
   23         int Open( const wxString& p_Server, u_short p_Port = LDAP_PORT );
   24         int Init( const wxString& p_Server, u_short p_Port = LDAP_PORT );
   25         virtual void Close( void );
   26         
   27         int SetCACert( const wxString& p_CACertFile );
   28         int SetClientCert( const wxString& p_CertFile );
   29         int SetClientKey( const wxString& p_KeyFile );
   30         int StartTLS( void );
   31         
   32         int SimpleBind( const wxString& p_User, const wxString& p_Password );
   33         int SimpleBind( void );
   34         int SetVersion( u_short p_Version );
   35         int GetVersion( u_short& p_Version );
   36         int SetOption( int p_Option, void* p_Value );
   37         int GetOption( int p_Option, void* p_Value );
   38         int Referals( bool p_Follow );
   39         int SetSizeLimit( int p_Size );
   40         int GetSizeLimit( int& p_Size );
   41         int SetTimeLimit( int p_Time );
   42         int GetTimeLimit( int& p_Time );
   43         int Search( int& p_RequestId, const wxString& p_Base, int p_Scope, const wxString& p_Filter,
   44             wxArrayString* p_Attributes = NULL, bool p_GetValues = true, u_short p_AttFlags = 0, 
   45             long p_Timeout = 0, int p_SizeLimit = 0 );
   46         bool GetEntry( int p_RequestId, int p_Index, LdapEntry& p_Entry );
   47         int GetEntryCount( int p_RequestId );
   48         int GetResultCount( int p_RequestId );
   49         void CloseSearch( int p_RequestId );
   50         
   51         int AddEntry( LdapEntry& p_Entry );
   52         int ReplaceEntry( LdapEntry& p_Entry );
   53         int DeleteEntry( LdapEntry& p_Entry );
   54         int Rename( const wxString& p_OldDn, const wxString& p_NewRDn );
   55         
   56         int AddAttribute( LdapEntry& p_Entry );
   57         int DeleteAttribute( const wxString& p_Dn, const wxString& p_AttributeName );
   58         int AddAttributeValue( const wxString& p_Dn, const wxString& p_AttributeName, const wxString& p_Value );
   59         int AddAttributeValue( const wxString& p_Dn, const wxString& p_AttributeName, const berval& p_Value );
   60         int DeleteAttributeValue( const wxString& p_Dn, const wxString& p_AttributeName, const wxString& p_Value );
   61         int DeleteAttributeValue( const wxString& p_Dn, const wxString& p_AttributeName, const berval& p_Value );
   62         
   63         int CopyTo( int p_Id, const wxString& p_ToDn, const wxString& p_OldDn );
   64 
   65         wxArrayString Explode_Dn( const wxString& p_Dn );
   66         
   67         virtual bool IsBinaryAttribute( const wxString& p_Name )=0;
   68         
   69         protected:
   70         
   71         LDAPMod** Attributes2Mods( LdapEntry& p_Entry, int p_Operation );
   72         void FillEntry( LDAPMessage* p_Msg, LdapEntry& p_Entry );
   73         char** Build_Attribute_Array( const char*p_Array1, wxArrayString* p_Array2, char* p_Str );
   74         void Free_Attribute_Array( char** p_Array );
   75         int CopyEntry( LDAPMessage* p_Entry, const wxString& p_ToDn, const wxString& p_OldDn );
   76         
   77         int     m_Err ;
   78     private:
   79         LDAP*   m_LDAP ;
   80         
   81         Search_Results_Map  m_ResultsMap ;
   82 };
   83 #endif