1 #include "ldaputils.hh"
4 void ldapSetOption( LDAP
*conn
, int option
, void *value
)
6 if( ldap_set_option( conn
, option
, value
) != LDAP_OPT_SUCCESS
)
8 throw( LDAPException( "Unable to set option" ) );
12 void ldapGetOption( LDAP
*conn
, int option
, void *value
)
14 if( ldap_get_option( conn
, option
, value
) != LDAP_OPT_SUCCESS
)
16 throw( LDAPException( "Unable to get option" ) );
20 std::string
ldapGetError( LDAP
*conn
, int code
)
23 ldapGetOption( conn
, LDAP_OPT_ERROR_NUMBER
, &code
);
24 return std::string( ldap_err2string( code
) );
27 int ldapWaitResult( LDAP
*conn
, int msgid
, int timeout
, LDAPMessage
** result
)
36 int rc
= ldap_result( conn
, msgid
, LDAP_MSG_ONE
, &tv
, &res
);
38 if ( rc
== -1 || rc
== 0 )