ldap_open

Initializes the LDAP library and opens a connection to the LDAP server. This function has been deprecated; use the ldap_init function.

LDAP Version:v2 or higher
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  LDAP *ldap_open (
     const char   *hostname,
     int           portno);
  
  

Parameters

hostname

(IN) Contains the names of the available hosts, each separated by a space, or a list of IP addresses (in dot format) of the hosts, each separated by a space. If a port number is included with the name or the address, it is separated from them with a colon (:), for example hostname:port.

portno

(IN) Contains the TCP port number to connect to. If a port number is included with the hostname parameter, this parameter is ignored.

Return Values

>0

Pointer to a session handle

NULL

Failure to establish a session

Remarks

The port number assigned to LDAP is 389.

If the connection is established to an LDAP v2 server, an LDAP bind function must be called before any other operations can be performed.

See Also

ldap_init