1 .TH LDAP_OPEN 3 "28 March 1996" "U-M LDAP LDVERSION"
3 ldap_init, ldap_open \- Initialize the LDAP library and open a connection to an LDAP server
11 LDAP *ldap_open(host, port)
17 LDAP *ldap_init(host, port)
24 opens a connection to an LDAP server and allocates an LDAP
25 structure which is used to identify
26 the connection and to maintain per-connection information.
28 allocates an LDAP structure but does not open an initial connection. One
29 of these two routines must be called before any operations are attempted.
32 takes \fIhost\fP, the hostname on which the LDAP server is
33 running, and \fIport\fP, the port number to which to connect. If the default
34 IANA-assigned port of 389 is desired, LDAP_PORT should be specified for
35 \fIport\fP. The \fIhost\fP parameter may contain a blank-separated list
36 of hosts to try to connect to, and each host may optionally by of the form
37 \fIhost:port\fP. If present, the \fI:port\fP overrides the \fIport\fP
40 Upon successfully making a connection to an
43 returns a pointer to an LDAP structure (defined below), which
44 should be passed to subsequent calls to
47 etc. Certain fields in the LDAP structure can be set to indicate size limit,
48 time limit, and how aliases are handled during operations. See <ldap.h>
54 /* ... other stuff you should not mess with ... */
57 #define LDAP_DEREF_NEVER 0
58 #define LDAP_DEREF_SEARCHING 1
59 #define LDAP_DEREF_FINDING 2
60 #define LDAP_DEREF_ALWAYS 3
63 #define LDAP_NO_LIMIT 0
68 unsigned long ld_options;
69 #define LDAP_OPT_REFERRALS 0x00000002 /* set by default */
70 #define LDAP_OPT_RESTART 0x00000004
71 /* ... other stuff you should not mess with ... */
80 but does not open a connection
81 to the LDAP server. The actual connection open will occur when the
82 first operation is attempted. At this time,
85 be used if the LDAP library is compiled with LDAP_REFERRALS defined.
87 If an error occurs, these routines will return NULL and errno should be
90 Options that affect a particular LDAP instance may be set by modifying
91 the \fIld_options\fP field in the LDAP structure. This field is set
92 to \fILDAP_OPT_REFERRALS\fP in
95 which causes the library to automatically follow referrals
96 to other servers that may be returned in response to an LDAP operation.
98 The other supported option is \fILDAP_OPT_RESTART\fP, which if set will
99 cause the LDAP library to restart the
101 system call when it is interrupted by the system (i.e., errno is set to
102 EINTR). This option is not supported on the Macintosh and under MS-DOS.
104 An option can be turned off by clearing the appropriate bit in the
105 \fIld_options\fP field.
107 There are other elements in the LDAP structure that you should not
108 change. You should not make any assumptions about the order of elements
109 in the LDAP structure.