Up to Contents

Back to Overview

Common Data Structures

Some data structures that are common to several LDAP API functions are defined here:

           typedef struct ldap LDAP;

           typedef struct ldapmsg LDAPMessage;
           #define NULLMSG ((LDAPMessage *) NULL)

           struct berval {
                   unsigned long   bv_len;
                   char            *bv_val;
           };

           struct timeval {
                   long            tv_sec;
                   long            tv_usec;
           };

The LDAP structure is an opaque data type that represents an LDAP session. Typically this corresponds to a connection to a single server, but it may encompass several server connections in the face of LDAPv3 referrals.

The LDAPMessage structure is an opaque data type that is used to return results and error information.

The berval structure is used to represent arbitrary binary data and its fields have the following meanings:

bv_len
Length of data in bytes.
bv_val
A pointer to the data itself.

The timeval structure is used to represent an interval of time and its fields have the following meanings:

tv_sec
Seconds component of time interval.
tv_usec
Microseconds component of time interval.

Up to Contents

Forward to LDAP Error Codes