Data Structures | Files | Defines | Typedefs | Enumerations | Functions

Bdb

Data Structures

Files

Defines

Typedefs

Enumerations

Functions


Typedef Documentation

typedef struct _bdb_cmd bdb_cmd_t

This data structure extends the generic data structure db_cmd in the database API with data specific to the ldap driver.

typedef struct _bdb_con bdb_con_t

This structure represents connections to BDB. It contains BDB specific per-connection data,

typedef struct bdb_uri bdb_uri_t

This is the BDB specific structure that will be attached to generic db_uri structures in the database API in SER. The structure contains parsed elements of the ldap: URI.


Enumeration Type Documentation

Enumerator:
BDB_CONNECTED 

The connection has been connected successfully.

Definition at line 50 of file bdb_con.h.


Function Documentation

int bdb_cmd ( db_cmd_t cmd  ) 

This function allocates and initializes memory for a new bdb_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 bdb_cmd structure will be attached.
int bdb_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 bdb_cmd_free ( db_cmd_t cmd,
bdb_cmd_t 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 56 of file bdb_cmd.c.

References _bdb_cmd::dbcp, _bdb_cmd::gen, and _str::s.

int bdb_con ( db_con_t *  con  ) 

This function creates a new bdb_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 BDB payload
Return values:
0 on success
A negative number on error
int bdb_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 bdb_con_disconnect ( db_con_t *  con  ) 

Disconnects a previously connected connection to BDB.

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

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

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

Definition at line 52 of file bdb_con.c.

int bdb_fld ( db_fld_t *  fld,
char *  table 
)

This function creates a new BDB 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.
int bdb_uri ( db_uri_t *  uri  ) 

This function builds a new bdb_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 bdb_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 bdb 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 66 of file bdb_uri.c.

References cmpstr, and bdb_uri::uri.