1 .TH LDAP_OPEN 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2007 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_init, ldap_initialize, ldap_open \- Initialize the LDAP library and open a connection to an LDAP server
8 OpenLDAP LDAP (libldap, -lldap)
15 LDAP *ldap_open(host, port)
21 LDAP *ldap_init(host, port)
27 int ldap_initialize(ldp, uri)
34 opens a connection to an LDAP server and allocates an LDAP
35 structure which is used to identify
36 the connection and to maintain per-connection information.
38 allocates an LDAP structure but does not open an initial connection.
40 allocates an LDAP structure but does not open an initial connection. One
41 of these three routines must be called before any operations are attempted.
44 takes \fIhost\fP, the hostname on which the LDAP server is
45 running, and \fIport\fP, the port number to which to connect. If the default
46 IANA-assigned port of 389 is desired, LDAP_PORT should be specified for
47 \fIport\fP. The \fIhost\fP parameter may contain a blank-separated list
48 of hosts to try to connect to, and each host may optionally by of the form
49 \fIhost:port\fP. If present, the \fI:port\fP overrides the \fIport\fP
52 Upon successfully making a connection to an
55 returns a pointer to an opaque LDAP structure, which should be passed
56 to subsequent calls to
59 etc. Certain fields in the LDAP structure can be set to indicate size limit,
60 time limit, and how aliases are handled during operations; read and write access
61 to those fields must occur by calling
62 .BR ldap_get_option (3)
64 .BR ldap_set_option (3)
65 respectively, whenever possible.
71 but does not open a connection
72 to the LDAP server. The actual connection open will occur when the
73 first operation is attempted.
78 but it returns an integer indicating either success or the failure reason,
79 and it allows to specify details for the connection in the schema portion
86 are deprecated in favor of
87 .BR ldap_initialize() ,
88 essentially because the latter allows to specify a schema in the URI
89 and it explicitly returns an error code.
95 will return NULL and errno should be set appropriately.
97 will directly return the LDAP code associated to the error (or
100 errno should be set as well whenever appropriate.
104 .BR ldap_get_option (3),
105 .BR ldap_set_option (3),