ldap_init man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       ldap_open, ldap_init - initialize an LDAP session

       cc [ flag... ] file... -lldap [ library... ]
       #include <lber.h>
       #include <ldap.h>

       LDAP *ldap_open(const char *host, int port);

       LDAP *ldap_init(const char *host, int port);

       The  ldap_open()	 function initializes an LDAP session and also opens a
       connection to an LDAP server before it returns to  the  caller.	Unlike
       ldap_open(),  ldap_init() does not open a connection to the LDAP server
       until an operation, such as a search request, is performed.

       The ldap_open() function is deprecated and should no  longer  be	 used.
       Call ldap_init() instead.

       A  list	of  LDAP hostnames or an IPv4 or IPv6 address can be specified
       with the	 ldap_open()  and  ldap_init()	functions.  The	 hostname  can
       include	a  port	 number, separated from the hostname by a colon (:). A
       port number included as part of the hostname takes precedence over  the
       port  parameter. The ldap_open() and ldap_init() functions attempt con‐
       nections with LDAP hosts in the order listed and return the first  suc‐
       cessful connection.

       These functions support the following parameters.

	       The  hostname,  IPv4  or IPv6 address of the host that runs the
	       LDAP server. A space-separated list of hostnames	 can  also  be
	       used for this parameter.

	       TCP  port number of a connection. Supply the constant LDAP_PORT
	       to obtain the default LDAP port of 389. If a  host  includes  a
	       port number, the default parameter is ignored.

       The  ldap_open()	 and  ldap_init() functions return a handle to an LDAP
       session that contains a pointer to an opaque structure.	The  structure
       must be passed to subsequent calls for the session. If a session cannot
       be initialized, the functions return  NULL  and	errno  should  be  set

       Various aspects of this opaque structure can be read or written to con‐
       trol the session-wide parameters.  Use  the  ldap_get_option(3LDAP)  to
       access  the current option values and the ldap_set_option(3LDAP) to set
       values for these options.

       Example 1 Specifying IPv4 and IPv6 Addresses

       LDAP  sessions  can  be	initialized  with  hostnames,  IPv4  or	  IPv6
       addresses, such as those shown in the following examples.

	 ldap_init("hosta:636 hostb", 389)
	 ldap_init("", 389)
	 ldap_init("[fec0::114:a00:20ff:ab3d:83ed]", 389)

       See attributes(5) for descriptions of the following attributes:

       │Interface Stability │ Evolving	      │
       │MT-Level	    │ Safe	      │

       errno(3C),   ldap(3LDAP),   ldap_bind(3LDAP),   ldap_get_option(3LDAP),
       ldap_set_option(3LDAP), attributes(5)

				 Jan 15, 2004		      LDAP_OPEN(3LDAP)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net