74 new_cap = gw_malloc(
sizeof(*new_cap));
93 debug(
"wsp", 0,
"Dumping capability at %p:", cap);
95 debug(
"wsp", 0,
" id = %d", cap->
id);
96 debug(
"wsp", 0,
" name:");
98 debug(
"wsp", 0,
" data:");
100 if (cap->
data == NULL)
103 debug(
"wsp", 0,
"Capability dump ends.");
109 if (caps_list == NULL) {
110 debug(
"wsp", 0,
"NULL capability list");
113 debug(
"wsp", 0,
"Dumping capability list at %p, length %ld",
118 debug(
"wsp", 0,
"End of capability list dump");
132 if (caps_list == NULL)
165 while (pos < capslen) {
166 unsigned long length;
172 if (pos < 0 || length == 0)
190 if (length < (nullpos + 1 - pos))
194 length - (nullpos + 1 - pos));
203 warning(0,
"WSP: Error unpacking capabilities");
214 for (i = 0; i < len; i++) {
223 if (datalen == 0 && cap->
accept)
229 error(0,
"WSP: Bad capability.");
240 if (cap->
id >= 0x80 || cap->
id < 0) {
241 error(0,
"WSP: Bad capability.");
268 for (i = 0; i < len; i++) {
272 || (!
name && cap->
id ==
id)) {
void error(int err, const char *fmt,...)
int wsp_cap_get_push_mor(List *caps_list, unsigned long *mor)
void wsp_cap_destroy_list(List *caps_list)
int wsp_cap_get_server_sdu(List *caps_list, unsigned long *sdu)
void gwlist_append(List *list, void *item)
void octstr_append(Octstr *ostr1, const Octstr *ostr2)
long gwlist_len(List *list)
void * gwlist_get(List *list, long pos)
void octstr_append_char(Octstr *ostr, int ch)
Capability * wsp_cap_create(int id, Octstr *name, Octstr *data)
void wsp_cap_dump(Capability *cap)
static int wsp_cap_get_data(List *caps_list, int id, Octstr *name, Octstr **data)
List * wsp_cap_duplicate_list(List *caps_list)
#define octstr_copy(ostr, from, len)
long octstr_search_char(const Octstr *ostr, int ch, long pos)
static struct pid_list * found
int wsp_cap_get_client_sdu(List *caps_list, unsigned long *sdu)
Capability * wsp_cap_duplicate(Capability *cap)
List * wsp_cap_unpack_list(Octstr *caps)
static void wsp_cap_destroy_item(void *cap)
#define octstr_duplicate(ostr)
#define octstr_dump(ostr, level,...)
int wsp_cap_get_method_mor(List *caps_list, unsigned long *mor)
int wsp_cap_count(List *caps_list, int id, Octstr *name)
void warning(int err, const char *fmt,...)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
long octstr_len(const Octstr *ostr)
void octstr_append_uintvar(Octstr *ostr, unsigned long value)
void wsp_cap_dump_list(List *caps_list)
void debug(const char *place, int err, const char *fmt,...)
Octstr * wsp_cap_pack_list(List *caps_list)
long octstr_extract_uintvar(Octstr *ostr, unsigned long *value, long pos)
int octstr_get_char(const Octstr *ostr, long pos)
void wsp_cap_destroy(Capability *cap)
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)