[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: API Libs and the v3 Protocol

On Mon, Sep 23, 2002 at 06:39:31PM +0100, Wm. G. Urquhart wrote:

> According to the documentation the libs provided for the C API support
> both the v2 and v3 protocols, with the default of v2. I'm trying to use
> ldap_bind on a v3 only installation so I need to be v3 'aware', how do I
> set this in my application?

Ian Logan wrote:

> You need to do something like:
> int version = 3;
> LDAP *ld = ldap_init( ldap_host, LDAP_PORT );
> ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version);

Yeah, it's a pity nobody's ever written a man page for this or
updated the main ldap page to hint at its existance (snip snip).
For the record, the code is in:


        LDAP    *ld,
        int             option,
        LDAP_CONST void *invalue)
        struct ldapoptions *lo;
        int *dbglvl = NULL;

        /* Get pointer to global option structure */
        lo = LDAP_INT_GLOBAL_OPT();
        if (lo == NULL) {
                return LDAP_NO_MEMORY;


Charles B. (Ben) Cranston