Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
LDAP Library Functionsldap_open(3LDAP)


NAME

 ldap_open, ldap_init - initialize an LDAP session

SYNOPSIS

 
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);

DESCRIPTION

 

ldap_open() initializes an LDAP session and additionally 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 is performed that requires it, for example, a search request.

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

Either function takes a space-separated list of hostnames or strings in the dot-notation form that represents the IP addresses of hosts running LDAP servers to to which it can connect. Each of thse hostnames may include a port number, which is separated from the hostname with a colon (":") character. If the port number is specified as part of the hostname, then this takes precedence over the port parameter. The functions will try these hosts in the order listed, and return the first successful connection.

PARAMETERS

 

These functions support the following parameters.

host
A space-separated list of hostnames or strings in the dot-notation form that represents the IP addresses of hosts running LDAP servers to which it can connect.
port
The TCP port number to which to connect. Supply the constant LDAP_PORT to obtain the default LDAP port of 389. If a host includes a port number, then this parameter is ignored.

ERRORS

 

Either function returns a handle to an LDAP session that containts a pointer to an opaque structure that must be passed to subsequent calls for that session. If these sessions cannot be initialized, these functions will return NULL, and errno should be set appropriately.

Various aspects of this opaque structure can be read or written to control the session-wide parameters. Useldap_get_option(3dlap) to access the current value of these options and ldap_set_option(3LDAP) to set the value of these options.

ATTRIBUTES

 

See attributes(5) for a description of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWcsl (32-bit)
SUNWcslx (64-bit)
Stability LevelEvolving

SEE ALSO

 

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


SunOS 5.9Go To TopLast Changed 25 Oct 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.