Data Structures | Files | Defines | Enumerations | Functions

LDAP Database Driver
[Database Abstraction Layer]

Collaboration diagram for LDAP Database Driver:

Data Structures

Files

Defines

Enumerations

Functions


Enumeration Type Documentation

Enumerator:
LD_CONNECTED 

The connection has been connected successfully.

Definition at line 46 of file ld_con.h.


Function Documentation

int ld_cmd ( db_cmd_t cmd  ) 

This function allocates and initializes memory for a new ld_cmd data structure. The data structure is then attached to the generic db_cmd structure in cmd parameter.

Parameters:
cmd A generic db_cmd structure to which the newly created ld_cmd structure will be attached.
int ld_cmd_exec ( db_res_t *  res,
db_cmd_t cmd 
)

This is the main execution function in this driver. It is executed whenever a SER module calls db_exec and the target database of the commands is ldap.

Parameters:
res A pointer to (optional) result structure if the command returns a result.
Return values:
0 if executed successfully
A negative number if the database server failed to execute command
A positive number if there was an error on client side (SER)
static void ld_cmd_free ( db_cmd_t cmd,
struct ld_cmd payload 
) [static]

This function frees all memory used by ld_cmd structure.

Parameters:
cmd A pointer to generic db_cmd command being freed.
payload A pointer to ld_cmd structure to be freed.

Definition at line 53 of file ld_cmd.c.

References ld_cmd::gen, and ld_cmd::result.

int ld_con ( db_con_t *  con  ) 

This function creates a new ld_con structure and attachs the structure to the generic db_con structure in the parameter.

Parameters:
con A generic db_con structure to be extended with LDAP payload
Return values:
0 on success
A negative number on error
int ld_con_connect ( db_con_t *  con  ) 

This function is called when a SER module calls db_connect to establish a new connection to the database server.

Parameters:
con A structure representing database connection.
Return values:
0 on success.
A negative number on error.
void ld_con_disconnect ( db_con_t *  con  ) 

Disconnects a previously connected connection to LDAP server.

Parameters:
con A structure representing the connection to be disconnected.
static void ld_con_free ( db_con_t *  con,
struct ld_con payload 
) [static]

This function function frees all memory that is in use by a ld_con structure.

Parameters:
con A generic db_con connection structure.
payload LDAP specific payload to be freed.

Definition at line 51 of file ld_con.c.

References ld_uri::uri.

int ld_fld ( db_fld_t *  fld,
char *  table 
)

This function creates a new LDAP specific payload structure and attaches the structure to the generic db_fld structure.

Parameters:
fld A generic db_fld structure to be exended.
table Name of the table on the server.
Return values:
0 on success.
A negative number on error.
static void ld_fld_free ( db_fld_t *  fld,
struct ld_fld *  payload 
) [static]

This function frees all memory used by a ld_fld structure

Parameters:
fld Generic db_fld_t* structure being freed.
payload The ldap extension structure to be freed

Definition at line 150 of file ld_fld.c.

int ld_uri ( db_uri_t *  uri  ) 

This function builds a new ld_uri structure from the body of the generic URI given to it in parameter.

Parameters:
uri A generic db_uri structure.
Return values:
0 on success
A negative number on error.
static unsigned char ld_uri_cmp ( db_uri_t *  uri1,
db_uri_t *  uri2 
) [static]

This function is called whenever the database abstraction layer in SER needs to compare to URIs with the ldap scheme. The function compares hosts and port numbers of both URIs (host part comparison is case insensitive). The URI comparison is mainly used to by the connection pool to determine if a connection to a given server already exists.

Definition at line 57 of file ld_uri.c.

References cmpstr, and ld_uri::ldap_url.