2 * xcap_client module - XCAP client for Kamailio
4 * Copyright (C) 2007 Voice Sistem S.R.L.
6 * This file is part of Kamailio, a free SIP server.
8 * Kamailio is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version
13 * Kamailio is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 #include "xcap_callbacks.h"
33 #define IF_NONE_MATCH 2
35 /* macros for the entities responsible for handling a record inserted
38 #define INTEGRATED_SERVER 0
39 #define XCAP_CL_MOD 1 /* xcap_client module responsibility */
42 typedef struct xcap_doc_sel
51 typedef struct ns_list
64 typedef struct xcap_node_sel
75 typedef struct att_test
81 typedef struct xcap_get_req
85 xcap_doc_sel_t doc_sel;
86 xcap_node_sel_t* node_sel;
91 xcap_node_sel_t* xcapInitNodeSel(void);
92 typedef xcap_node_sel_t* (*xcap_nodeSel_init_t )(void);
94 xcap_node_sel_t* xcapNodeSelAddStep(xcap_node_sel_t* curr_sel, str* name,
95 str* namespace, int pos, attr_test_t* attr_test, str* extra_sel);
97 typedef xcap_node_sel_t* (*xcap_nodeSel_add_step_t)(xcap_node_sel_t* curr_sel,
98 str* name,str* namespace,int pos,attr_test_t* attr_test,str* extra_sel);
100 xcap_node_sel_t* xcapNodeSelAddTerminal(xcap_node_sel_t* curr_sel,
101 char* attr_sel, char* namespace_sel, char* extra_sel );
103 typedef xcap_node_sel_t* (*xcap_nodeSel_add_terminal_t)(xcap_node_sel_t* curr_sel,
104 char* attr_sel, char* namespace_sel, char* extra_sel );
106 void xcapFreeNodeSel(xcap_node_sel_t* node);
108 typedef void (*xcap_nodeSel_free_t)(xcap_node_sel_t* node);
110 /* specifical function to get a new document, not present in xcap table
111 * to be updated and handled by the xcap_client module*/
112 char* xcapGetNewDoc(xcap_get_req_t req, str user, str domain);
113 typedef char* (*xcapGetNewDoc_t)(xcap_get_req_t req, str user, str domain);
115 typedef struct xcap_api {
116 xcap_nodeSel_init_t int_node_sel;
117 xcap_nodeSel_add_step_t add_step;
118 xcap_nodeSel_add_terminal_t add_terminal;
119 xcap_nodeSel_free_t free_node_sel;
120 xcapGetNewDoc_t getNewDoc;
121 register_xcapcb_t register_xcb;
124 int bind_xcap(xcap_api_t* api);
126 typedef int (*bind_xcap_t)(xcap_api_t* api);
128 char* send_http_get(char* path, unsigned int xcap_port, char* match_etag,
129 int match_type, char** etag);