#include <ldap.h>
#include <time.h>
#include <v2l_config.h>
Include dependency graph for v2l_conn.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | v2l_LdapConn |
| Simple Linked List of connections to LDAP directory. More... | |
| struct | v2l_LdapRequest |
| Request (SLL) for LDAP directory. More... | |
| struct | v2l_LdapEvt |
| LDAP environment. Control struct for perform operations on the LDAP directory and retrieve results. More... | |
Typedefs | |
| typedef int(*) | v2l_AttrMatchFunction (const char *attr, void **shrdata) |
| typedef void(*) | v2l_AttrValueFunction (const char *attr, const char **vals, void *pointer, void *shrdata) |
Functions | |
| v2l_LdapConn * | v2l_get_conn (v2l_Config *self, const char *user) |
| v2l_LdapConn * | v2l_get_master_conn (v2l_Config *self) |
| void | v2l_free_allconn (void) |
| v2l_LdapEvt * | v2l_ldap_get_entry (v2l_Config *self, v2l_LdapConn *curr_conn) |
| int | v2l_request_record (v2l_Config *self, v2l_LdapConn *curr_conn, v2l_LdapRequest *req) |
| v2l_LdapRequest * | v2l_add_attr_str (v2l_LdapRequest *req, const char *attr, const char *str) |
| void | v2l_ldap_for_all_attrs (v2l_AttrValueFunction value_func, v2l_AttrMatchFunction match_func, void *pointer, v2l_LdapEvt *evt_res) |
Definition in file v2l_conn.h.
| typedef int(*) v2l_AttrMatchFunction(const char *attr, void **shrdata) |
Match function type Generic attribute matching routine.
| attr | The attribute. | |
| [out] | shrdata | Generic deferenced pointer. Shared data with 'value function' |
Definition at line 69 of file v2l_conn.h.
| typedef void(*) v2l_AttrValueFunction(const char *attr, const char **vals, void *pointer, void *shrdata) |
Values read function type Generic values handling routine.
| attr | The attribute. | |
| vals | Values of attribute. | |
| pointer | Generic multipurpose pointer. | |
| shrdata | Shared data with 'match function' |
Definition at line 80 of file v2l_conn.h.
| v2l_LdapRequest* v2l_add_attr_str | ( | v2l_LdapRequest * | req, | |
| const char * | attr, | |||
| const char * | str | |||
| ) |
Adds a new request to the list.
| req | The list of requests. | |
| attr | attribute name. | |
| str | attribute value. |
Definition at line 381 of file v2l_conn.c.
References _v2l_add_attr().
Referenced by _v2l_set_sn12(), and _v2l_vcard2ldap_generic().
Here is the call graph for this function:

Here is the caller graph for this function:

| void v2l_free_allconn | ( | void | ) |
Frees and closes all connections (ephemeral or not) If connections doesn't exist does nothing.
Definition at line 240 of file v2l_conn.c.
References _v2l_free_walker(), and V2L_CONN_LIST.
Referenced by v2l_config_shutdown().
Here is the call graph for this function:

Here is the caller graph for this function:

| v2l_LdapConn* v2l_get_conn | ( | v2l_Config * | self, | |
| const char * | user | |||
| ) |
Gets a (ephemeral) connection by name. Creates one if doesn't exist.
| self | Module config. | |
| user | the username |
Definition at line 189 of file v2l_conn.c.
References _v2l_create_conn(), _v2l_ldap_get_credentials(), LOG_ERROR_MEM, and V2L_CONN_LIST.
Referenced by _v2l_packets_handler().
Here is the call graph for this function:

Here is the caller graph for this function:

| v2l_LdapConn* v2l_get_master_conn | ( | v2l_Config * | self | ) |
Gets a connection master connection. Creates one if doesn't exist.
| self | Module config. |
Definition at line 233 of file v2l_conn.c.
References _v2l_create_conn(), v2l_Config::binddn, v2l_Config::bindpw, v2l_Config::host, v2l_Config::port, and V2L_ADMIN.
Referenced by v2l_config_init().
Here is the call graph for this function:

Here is the caller graph for this function:

| void v2l_ldap_for_all_attrs | ( | v2l_AttrValueFunction | value_func, | |
| v2l_AttrMatchFunction | match_func, | |||
| void * | pointer, | |||
| v2l_LdapEvt * | evt_res | |||
| ) |
Applies a function to all LDAP object attributes.
| value_func | Walker function. | |
| match_func | Match function. If returns true we'll call to value_func | |
| pointer | Generic multipurpose pointer. It will be passed to value_func | |
| evt_res | LDAP descriptor, control code and result. |
Definition at line 419 of file v2l_conn.c.
References v2l_LdapEvt::ld, and v2l_LdapEvt::result.
Referenced by v2l_vcard_get().
Here is the caller graph for this function:

| v2l_LdapEvt* v2l_ldap_get_entry | ( | v2l_Config * | self, | |
| v2l_LdapConn * | curr_conn | |||
| ) |
Retrieves an user entry from the LDAP directory.
| self | Module config | |
| curr_conn | user connection. |
Definition at line 247 of file v2l_conn.c.
References _v2l_ldap_search(), _v2l_ldap_sync(), v2l_LdapConn::entry, v2l_LdapConn::ld, v2l_LdapEvt::ld, LOG_ERROR_MEM, v2l_LdapEvt::result, and v2l_Config::suffix.
Referenced by v2l_vcard_get().
Here is the call graph for this function:

Here is the caller graph for this function:

| int v2l_request_record | ( | v2l_Config * | self, | |
| v2l_LdapConn * | curr_conn, | |||
| v2l_LdapRequest * | req | |||
| ) |
Executes a list of changes on the LDAP directory.
| self | Module config | |
| curr_conn | The user connection. | |
| req | list of changes. |
Definition at line 285 of file v2l_conn.c.
References _v2l_count_attrs(), _v2l_ldap_modify(), _v2l_ldap_sync(), v2l_LdapRequest::attr, v2l_LdapConn::binddn, v2l_LdapConn::ld, v2l_LdapEvt::ld, LOG_ERROR_MEM, v2l_LdapRequest::next, v2l_LdapEvt::rc, v2l_LdapEvt::result, and v2l_LdapConn::user.
Referenced by v2l_vcard_set().
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1