#include <stdlib.h>
#include <jabberd.h>
#include <v2l_vcard.h>
Include dependency graph for v2l_vcard.c:

Go to the source code of this file.
Data Structures | |
| struct | v2l_vCardItem |
| vCard template item. SLL. All of relations tag<->LDAP attr read from template More... | |
Defines | |
| #define | LOG_ERROR_MEM log_error (ZONE, "Unable to allocate memory") |
Functions | |
| static v2l_vCardItem * | _v2l_vcard_map (v2l_Config *self) |
| static int | _v2l_create_fn (xmlnode vcard) |
| static v2l_LdapRequest * | _v2l_set_sn12 (v2l_LdapRequest *req) |
| static xmlnode | _v2l_ldap2vcard_generic (v2l_vCardItem *item, const char **vals, xmlnode res) |
| static v2l_LdapRequest * | _v2l_vcard2ldap_generic (v2l_vCardItem *item, xmlnode data, v2l_LdapRequest *req) |
| static v2l_vCardItem * | _v2l_vcard_find_attr (v2l_vCardItem *item, const char *attr) |
| static int | _v2l_vcard_attr_match (const char *attr, void **shrdata) |
| static void | _v2l_vcard_attr_value (const char *attr, const char **vals, void *pointer, void *shrdata) |
| xmlnode | v2l_vcard_get (v2l_Config *self, v2l_LdapConn *curr_conn) |
| int | v2l_vcard_set (v2l_Config *self, v2l_LdapConn *curr_conn, xmlnode data) |
Variables | |
| static const char * | _V2L_MAP_VCARD [] |
Definition in file v2l_vcard.c.
| static int _v2l_create_fn | ( | xmlnode | vcard | ) | [static] |
Creates the FN tag Creates FN tag from GIVEN and FAMILY tags.
| vcard | The vCard. |
Definition at line 427 of file v2l_vcard.c.
References LOG_ERROR_MEM.
Referenced by v2l_vcard_get().
Here is the caller graph for this function:

| static xmlnode _v2l_ldap2vcard_generic | ( | v2l_vCardItem * | item, | |
| const char ** | vals, | |||
| xmlnode | res | |||
| ) | [static] |
Map function from LDAP to XML vCard.
| item | Info about the tag (name, parent group and attribute associated) | |
| vals | array of values for the attribe. | |
| [in,out] | res | The vCard, output is appended here. |
Definition at line 477 of file v2l_vcard.c.
References v2l_vCardItem::group, and v2l_vCardItem::vcard.
Referenced by _v2l_vcard_attr_value().
Here is the caller graph for this function:

| static v2l_LdapRequest * _v2l_set_sn12 | ( | v2l_LdapRequest * | req | ) | [static] |
Sets sn1 and sn2 from sn Hack. IrisPerson has two surnames: first surname and mother's maiden name. This function splits sn in two. Should be called when the list of request are complete and before program excutes them.
| req | The SLL of LDAP requests. |
Definition at line 515 of file v2l_vcard.c.
References v2l_LdapRequest::attr, LOG_ERROR_MEM, v2l_LdapRequest::next, and v2l_add_attr_str().
Referenced by v2l_vcard_set().
Here is the call graph for this function:

Here is the caller graph for this function:

| static v2l_LdapRequest * _v2l_vcard2ldap_generic | ( | v2l_vCardItem * | item, | |
| xmlnode | data, | |||
| v2l_LdapRequest * | req | |||
| ) | [static] |
Map function from XML Vcard to LDAP.
| item | Info about the tag (name, parent group and attribute associated) | |
| data | Thhe vCard. | |
| [in,out] | req | List of requests, the new request is appended here. |
Definition at line 504 of file v2l_vcard.c.
References v2l_vCardItem::ldap, and v2l_add_attr_str().
Referenced by v2l_vcard_set().
Here is the call graph for this function:

Here is the caller graph for this function:

| static int _v2l_vcard_attr_match | ( | const char * | attr, | |
| void ** | shrdata | |||
| ) | [static] |
Is LDAP object attribute linked to any tag? Utility function.
| attr | The attribute. | |
| [out] | shrdata | Contents the address of any map's node. NULL if no match |
Definition at line 403 of file v2l_vcard.c.
References _v2l_vcard_find_attr(), and _v2l_vcard_map().
Referenced by v2l_vcard_get().
Here is the call graph for this function:

Here is the caller graph for this function:

| static void _v2l_vcard_attr_value | ( | const char * | attr, | |
| const char ** | vals, | |||
| void * | pointer, | |||
| void * | shrdata | |||
| ) | [static] |
Function applied to all attrs. Utility function, walker function.
| attr | The attribute. | |
| vals | Values of attribute. | |
| pointer | Deferenced pointer to vCard. | |
| shrdata | Data shared with the match function. |
Definition at line 411 of file v2l_vcard.c.
References _v2l_ldap2vcard_generic(), and v2l_vCardItem::vcard.
Referenced by v2l_vcard_get().
Here is the call graph for this function:

Here is the caller graph for this function:

| static v2l_vCardItem * _v2l_vcard_find_attr | ( | v2l_vCardItem * | item, | |
| const char * | attr | |||
| ) | [static] |
Finds tag linked to attr Parses the translation map since 'item' node.
| item | Where the search starts. | |
| attr | The attribute; |
Definition at line 384 of file v2l_vcard.c.
References v2l_vCardItem::ldap, and v2l_vCardItem::next.
Referenced by _v2l_vcard_attr_match().
Here is the caller graph for this function:

| static v2l_vCardItem * _v2l_vcard_map | ( | v2l_Config * | self | ) | [static] |
Gets the translation map. If it is not initilized yet, the function reads the template from disk and sets the map.
| self | Module config, if map is initialized can be NULL. |
Definition at line 288 of file v2l_vcard.c.
References _V2L_MAP_VCARD, v2l_Config::confpath, v2l_vCardItem::group, v2l_vCardItem::ldap, v2l_vCardItem::next, v2l_Config::poolref, and v2l_vCardItem::vcard.
Referenced by _v2l_vcard_attr_match(), v2l_vcard_get(), and v2l_vcard_set().
Here is the caller graph for this function:

| xmlnode v2l_vcard_get | ( | v2l_Config * | self, | |
| v2l_LdapConn * | curr_conn | |||
| ) |
Gets user vCard in xml format.
| self | Module config | |
| curr_conn | user connection. |
Definition at line 177 of file v2l_vcard.c.
References _v2l_create_fn(), _v2l_vcard_attr_match(), _v2l_vcard_attr_value(), _v2l_vcard_map(), v2l_ldap_for_all_attrs(), v2l_ldap_get_entry(), and v2l_vCardItem::vcard.
Referenced by _v2l_packets_handler().
Here is the call graph for this function:

Here is the caller graph for this function:

| int v2l_vcard_set | ( | v2l_Config * | self, | |
| v2l_LdapConn * | curr_conn, | |||
| xmlnode | data | |||
| ) |
Writes vCard to user LDAP directory entry.
| self | Module config | |
| curr_conn | user connection. | |
| data | the vCard |
Definition at line 230 of file v2l_vcard.c.
References _v2l_set_sn12(), _v2l_vcard2ldap_generic(), _v2l_vcard_map(), v2l_vCardItem::group, v2l_Config::irishack, v2l_vCardItem::next, v2l_request_record(), and v2l_vCardItem::vcard.
Referenced by _v2l_packets_handler().
Here is the call graph for this function:

Here is the caller graph for this function:

const char* _V2L_MAP_VCARD[] [static] |
List of all XML vCard tags supported
Definition at line 123 of file v2l_vcard.c.
Referenced by _v2l_vcard_map().
1.5.1