---
name: "cldap_open"
section: "3"
platform: "linux"
package: "libopenldap-dev"
version: "1:1.2.12-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/cldap_open"
---

# cldap\_open(3)

Prepare for Connectionless LDAP Communication

## NAME

cldap\_open - Prepare for Connectionless LDAP Communication

## SYNOPSIS

```
#include <lber.h>
#include <ldap.h>
```

**LDAP \*cldap\_open(host, port)** **char \*host;** **int port;**

## DESCRIPTION

**The** **cldap\_open()** **routine is called to prepare for connectionless LDAP** **communication (over** **udp**(4p)). **It allocates an LDAP structure which** **is passed to future search requests.**

**cldap\_open()** **takes** *host***, the nane of the host on which the LDAP server is running, and** *port***, the port number to which to connect.  If the default** **IANA-assigned port of 389 is desired, LDAP\_PORT should be specified for** *port***.**  *host* **can contain a space-separated list of hosts or** **addresses to try.** **cldap\_open()** **returns a pointer to an LDAP structure, which should be** **passed to subsequent calls to** [**cldap\_search\_s**(3)](/cldap_search_s/3.md), [**cldap\_setretryinfo**(3)](/cldap_setretryinfo/3.md), **and** [**cldap\_close**(3)](/cldap_close/3.md). **Certain fields in the LDAP structure can be set to** **indicate size limit, time limit, and how aliases are handled during** **operations.  See** [**ldap\_open**(3)](/ldap_open/3.md) **and \<ldap.h\> for more details.**

## ERRORS

**If an error occurs,** **cldap\_open()** **will return NULL and errno will be set appropriately.**

## SEE ALSO

[**ldap**(3)](/ldap/3.md) [**cldap\_search\_s**(3)](/cldap_search_s/3.md), [**cldap\_setretryinfo**(3)](/cldap_setretryinfo/3.md), [**cldap\_close**(3)](/cldap_close/3.md), **udp**(4p)

## ACKNOWLEDGEMENTS

**OpenLDAP** **is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).** **OpenLDAP** **is derived from University of Michigan LDAP 3.3 Release.**
