#include <stdio.h>#include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/ipc.h>#include <unistd.h>#include <fcntl.h>#include <time.h>#include <curl/curl.h>#include "../../mem/mem.h"#include "../../db/db.h"#include "xcap_functions.h"#include "xcap_client.h"#include "../presence/hash.h"

Go to the source code of this file.
Defines | |
| #define | ETAG_HDR "Etag: " |
| #define | ETAG_HDR_LEN strlen("Etag: ") |
Functions | |
| int | bind_xcap (xcap_api_t *api) |
| char * | get_node_selector (xcap_node_sel_t *node_sel) |
| size_t | get_xcap_etag (void *ptr, size_t size, size_t nmemb, void *stream) |
| char * | get_xcap_path (xcap_get_req_t req) |
| char * | send_http_get (char *path, unsigned int xcap_port, char *match_etag, int match_type, char **etag) |
| size_t | write_function (void *ptr, size_t size, size_t nmemb, void *stream) |
| void | xcapFreeNodeSel (xcap_node_sel_t *node) |
| char * | xcapGetElem (xcap_get_req_t req, char **etag) |
| char * | xcapGetNewDoc (xcap_get_req_t req, str user, str domain) |
| xcap_node_sel_t * | xcapInitNodeSel (void) |
| xcap_node_sel_t * | xcapNodeSelAddStep (xcap_node_sel_t *curr_sel, str *name, str *namespace, int pos, attr_test_t *attr_test, str *extra_sel) |
| xcap_node_sel_t * | xcapNodeSelAddTerminal (xcap_node_sel_t *curr_sel, char *attr_sel, char *namespace_sel, char *extra_sel) |
| #define ETAG_HDR "Etag: " |
| #define ETAG_HDR_LEN strlen("Etag: ") |
| int bind_xcap | ( | xcap_api_t * | api | ) |
Definition at line 51 of file xcap_functions.c.
References xcap_api::add_step, xcap_api::add_terminal, xcap_api::free_node_sel, xcap_api::get_elem, xcap_api::getNewDoc, xcap_api::int_node_sel, LM_ERR, register_xcapcb(), xcap_api::register_xcb, xcapFreeNodeSel(), xcapGetElem(), xcapGetNewDoc(), xcapInitNodeSel(), xcapNodeSelAddStep(), and xcapNodeSelAddTerminal().
Referenced by mod_init().
| char* get_node_selector | ( | xcap_node_sel_t * | node_sel | ) |
Definition at line 261 of file xcap_functions.c.
References buf, ERR_MEM, _str::len, len, ns_list::name, ns_list::next, step::next, xcap_node_sel::ns_list, NULL, pkg_malloc, PKG_MEM_STR, _str::s, s, xcap_node_sel::size, xcap_node_sel::steps, step::val, and ns_list::value.
Referenced by get_xcap_path().
| size_t get_xcap_etag | ( | void * | ptr, | |
| size_t | size, | |||
| size_t | nmemb, | |||
| void * | stream | |||
| ) |
Definition at line 496 of file xcap_functions.c.
References ERR_MEM, ETAG_HDR, ETAG_HDR_LEN, len, NULL, pkg_malloc, and PKG_MEM_STR.
Referenced by send_http_get().
| char * get_xcap_path | ( | xcap_get_req_t | req | ) |
Definition at line 402 of file xcap_functions.c.
References xcap_doc_sel::auid, xcap_get_req::doc_sel, ERR_MEM, xcap_doc_sel::filename, get_node_selector(), _str::len, len, LM_ERR, xcap_get_req::node_sel, NULL, pkg_free, pkg_malloc, PKG_MEM_STR, _str::s, xcap_node_sel::size, xcap_doc_sel::type, USERS_TYPE, xcap_get_req::xcap_root, and xcap_doc_sel::xid.
Referenced by xcapGetElem(), and xcapGetNewDoc().
| char* send_http_get | ( | char * | path, | |
| unsigned int | xcap_port, | |||
| char * | match_etag, | |||
| int | match_type, | |||
| char ** | etag | |||
| ) |
Definition at line 519 of file xcap_functions.c.
References buf, get_xcap_etag(), IF_MATCH, len, LM_ERR, NULL, pkg_free, and write_function().
Referenced by query_xcap_update(), refreshXcapDoc(), xcapGetElem(), and xcapGetNewDoc().
| size_t write_function | ( | void * | ptr, | |
| size_t | size, | |||
| size_t | nmemb, | |||
| void * | stream | |||
| ) |
| void xcapFreeNodeSel | ( | xcap_node_sel_t * | node | ) |
Definition at line 69 of file xcap_functions.c.
References ns_list::next, step::next, xcap_node_sel::ns_list, pkg_free, _str::s, s, xcap_node_sel::steps, step::val, and ns_list::value.
Referenced by bind_xcap().
| char* xcapGetElem | ( | xcap_get_req_t | req, | |
| char ** | etag | |||
| ) |
Definition at line 465 of file xcap_functions.c.
References xcap_get_req::etag, get_xcap_path(), LM_DBG, LM_ERR, xcap_get_req::match_type, NULL, pkg_free, xcap_get_req::port, and send_http_get().
Referenced by bind_xcap().
| char* xcapGetNewDoc | ( | xcap_get_req_t | req, | |
| str | user, | |||
| str | domain | |||
| ) |
Definition at line 306 of file xcap_functions.c.
References DB_INT, DB_STR, DB_STRING, xcap_get_req::doc_sel, xcap_doc_sel::doc_type, get_xcap_path(), db_func::insert, db_val_t::int_val, _str::len, LM_DBG, LM_ERR, db_val_t::nul, NULL, pkg_free, xcap_get_req::port, _str::s, send_http_get(), str_doc_col, str_doc_type_col, str_doc_uri_col, str_domain_col, str_etag_col, str_port_col, str_source_col, str_username_col, db_val_t::str_val, db_val_t::string_val, db_val_t::type, db_func::use_table, db_val_t::val, XCAP_CL_MOD, xcap_db, xcap_db_table, and xcap_dbf.
Referenced by bind_xcap().
| xcap_node_sel_t* xcapInitNodeSel | ( | void | ) |
Definition at line 96 of file xcap_functions.c.
References ERR_MEM, xcap_node_sel::last_ns, xcap_node_sel::last_step, xcap_node_sel::ns_list, NULL, pkg_free, pkg_malloc, PKG_MEM_STR, and xcap_node_sel::steps.
Referenced by bind_xcap().
| xcap_node_sel_t* xcapNodeSelAddStep | ( | xcap_node_sel_t * | curr_sel, | |
| str * | name, | |||
| str * | namespace, | |||
| int | pos, | |||
| attr_test_t * | attr_test, | |||
| str * | extra_sel | |||
| ) |
Definition at line 137 of file xcap_functions.c.
References ERR_MEM, xcap_node_sel::last_ns, xcap_node_sel::last_step, _str::len, LM_ERR, ns_list::name, att_test::name, ns_list::next, step::next, xcap_node_sel::ns_no, NULL, pkg_free, pkg_malloc, PKG_MEM_STR, _str::s, s, xcap_node_sel::size, step::val, ns_list::value, and att_test::value.
Referenced by bind_xcap().
| xcap_node_sel_t* xcapNodeSelAddTerminal | ( | xcap_node_sel_t * | curr_sel, | |
| char * | attr_sel, | |||
| char * | namespace_sel, | |||
| char * | extra_sel | |||
| ) |
1.5.6