epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-xmpp-jingle.c
blob4af5395c0c78dd9aa265d8db919de36029b6e567
1 /* xmpp-jingle.c
2 * Wireshark's XMPP dissector.
4 * urn:xmpp:jingle:1
5 * urn:xmpp:jingle:apps:rtp:1
6 * urn:xmpp:jingle:apps:rtp:errors:1
7 * urn:xmpp:jingle:apps:rtp:info:1
8 * urn:xmpp:jingle:apps:rtp:rtp-hdrext:0
9 * urn:xmpp:jingle:apps:rtp:izrtp:1
11 * urn:xmpp:jingle:transports:ice-udp:1
12 * urn:xmpp:jingle:transports:raw-udp:1
13 * urn:xmpp:jingle:transports:s5b:1
14 * urn:xmpp:jingle:transports:ibb:1
16 * http://jabber.org/protocol/jinglenodes
17 * http://jabber.org/protocol/jinglenodes#channel
19 * Copyright 2011, Mariusz Okroj <okrojmariusz[]gmail.com>
21 * Wireshark - Network traffic analyzer
22 * By Gerald Combs <gerald@wireshark.org>
23 * Copyright 1998 Gerald Combs
25 * SPDX-License-Identifier: GPL-2.0-or-later
28 #include "config.h"
30 #include <epan/packet.h>
32 #include "packet-xmpp.h"
33 #include "packet-xmpp-jingle.h"
34 #include "packet-xmpp-conference.h"
35 #include "packet-xmpp-gtalk.h"
36 #include "packet-xmpp-other.h"
38 static void xmpp_jingle_content(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
39 static void xmpp_jingle_content_description_rtp(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
40 static void xmpp_jingle_cont_desc_rtp_payload(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
41 static void xmpp_jingle_cont_desc_rtp_payload_param(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
42 static void xmpp_jingle_cont_desc_rtp_enc(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
43 static void xmpp_jingle_cont_desc_rtp_enc_zrtp_hash(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
44 static void xmpp_jingle_cont_desc_rtp_enc_crypto(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
45 static void xmpp_jingle_cont_desc_rtp_bandwidth(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
46 static void xmpp_jingle_cont_desc_rtp_hdrext(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element);
47 static void xmpp_jingle_cont_trans_ice(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
48 static void xmpp_jingle_cont_trans_ice_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
49 static void xmpp_jingle_cont_trans_ice_remote_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
50 static void xmpp_jingle_reason(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
51 static void xmpp_jingle_rtp_info(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
52 static void xmpp_jinglenodes_relay_stun_tracker(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
53 static void xmpp_jingle_cont_trans_raw(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
54 static void xmpp_jingle_cont_trans_raw_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
55 static void xmpp_jingle_cont_trans_s5b(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
56 static void xmpp_jingle_cont_trans_s5b_candidate(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
57 static void xmpp_jingle_cont_trans_s5b_activated(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
58 static void xmpp_jingle_cont_trans_s5b_cand_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
59 static void xmpp_jingle_cont_trans_s5b_cand_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
60 static void xmpp_jingle_cont_trans_s5b_proxy_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
61 static void xmpp_jingle_cont_trans_ibb(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element);
63 static void xmpp_jingle_file_transfer_desc(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
64 static void xmpp_jingle_file_transfer_offer(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
65 static void xmpp_jingle_file_transfer_file(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
66 static void xmpp_jingle_file_transfer_request(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
67 static void xmpp_jingle_file_transfer_received(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
68 static void xmpp_jingle_file_transfer_abort(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
69 static void xmpp_jingle_file_transfer_checksum(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element);
71 /*XEP-0166: Jingle urn:xmpp:jingle:1*/
72 void
73 xmpp_jingle(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
75 proto_item *jingle_item;
76 proto_tree *jingle_tree;
78 static const char *rtp_info_msgs[] = {"active", "hold", "mute", "ringing", "unhold", "unmute"};
80 static const char *action_enums[] = {"content-accept","content-add", "content-modify",
81 "content-modify", "content-remove", "description-info", "security-info",
82 "session-accept", "session-info", "session-initiate", "session-terminate",
83 "transport-accept", "transport-info", "transport-reject", "transport-replace"
86 xmpp_array_t *action_array = xmpp_ep_init_array_t(pinfo->pool, action_enums,array_length(action_enums));
87 xmpp_array_t *rtp_info_array = xmpp_ep_init_array_t(pinfo->pool, rtp_info_msgs, array_length(rtp_info_msgs));
89 xmpp_attr_info attrs_info[] = {
90 {"xmlns", &hf_xmpp_xmlns, true, false, NULL, NULL},
91 {"action", &hf_xmpp_jingle_action, true, true, xmpp_val_enum_list, action_array},
92 {"sid", &hf_xmpp_jingle_sid, true, false, NULL, NULL},
93 {"initiator", &hf_xmpp_jingle_initiator, false, false, NULL, NULL},
94 {"responder", &hf_xmpp_jingle_responder, false, false, NULL, NULL}
97 xmpp_elem_info elems_info [] = {
98 {NAME, "content", xmpp_jingle_content, MANY},
99 {NAME, "reason", xmpp_jingle_reason, MANY},
100 {NAMES, rtp_info_array, xmpp_jingle_rtp_info, ONE},
101 {NAME, "conference-info", xmpp_conferece_info_advert, ONE}
104 xmpp_attr_t *action = xmpp_get_attr(element,"action");
105 col_append_fstr(pinfo->cinfo, COL_INFO, "JINGLE(%s) ", action?action->value:"");
108 jingle_item = proto_tree_add_item(tree, hf_xmpp_jingle, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
109 jingle_tree = proto_item_add_subtree(jingle_item, ett_xmpp_jingle);
111 xmpp_display_attrs(jingle_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
113 xmpp_display_elems(jingle_item, element, pinfo, tvb, elems_info, array_length(elems_info));
116 static void
117 xmpp_jingle_content(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
119 proto_item *content_item;
120 proto_tree *content_tree;
122 static const char *creator_enums[] = {"initiator","responder"};
123 xmpp_array_t *creator_enums_array = xmpp_ep_init_array_t(pinfo->pool, creator_enums,array_length(creator_enums));
125 xmpp_attr_info attrs_info[] = {
126 {"creator", &hf_xmpp_jingle_content_creator, true, false, xmpp_val_enum_list, creator_enums_array},
127 {"name", &hf_xmpp_jingle_content_name, true, true, NULL, NULL},
128 {"disposition", &hf_xmpp_jingle_content_disposition, false, false, NULL, NULL},
129 {"senders", &hf_xmpp_jingle_content_senders, false, false, NULL, NULL}
132 xmpp_elem_info elems_info [] = {
133 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "description", "xmlns", "urn:xmpp:jingle:apps:rtp:1"), xmpp_jingle_content_description_rtp, MANY},
134 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "description", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_desc, MANY},
135 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:ice-udp:1"), xmpp_jingle_cont_trans_ice, MANY},
136 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:raw-udp:1"), xmpp_jingle_cont_trans_raw, MANY},
137 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:s5b:1"), xmpp_jingle_cont_trans_s5b, MANY},
138 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:ibb:1"), xmpp_jingle_cont_trans_ibb, MANY},
139 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "http://www.google.com/transport/p2p"), xmpp_gtalk_transport_p2p, MANY},
140 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "received", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_received, MANY},
141 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "abort", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_abort, MANY},
142 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "checksum", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_checksum, MANY},
143 {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE},
146 content_item = proto_tree_add_item(tree, hf_xmpp_jingle_content, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
147 content_tree = proto_item_add_subtree(content_item, ett_xmpp_jingle_content);
149 xmpp_display_attrs(content_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
151 xmpp_display_elems(content_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
154 static void
155 xmpp_jingle_reason(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
157 proto_item *reason_item;
158 proto_tree *reason_tree;
160 xmpp_attr_info attrs_info[] = {
161 {"condition", &hf_xmpp_jingle_reason_condition, true, true, NULL, NULL},
162 {"sid", NULL, false, true, NULL, NULL},
163 {"rtp-error", NULL, false, true, NULL, NULL},
164 {"text", &hf_xmpp_jingle_reason_text, false, false, NULL, NULL}
167 xmpp_element_t *condition; /*1?*/
168 xmpp_element_t *text; /*0-1*/
169 xmpp_element_t *rtp_error;
171 static const char *reason_names[] = { "success", "busy", "failed-application", "cancel", "connectivity-error",
172 "decline", "expired", "failed-transport", "general-error", "gone", "incompatible-parameters",
173 "media-error", "security-error", "timeout", "unsupported-applications", "unsupported-transports"};
175 static const char *rtp_error_names[] = {"crypto-required", "invalid-crypto"};
177 reason_item = proto_tree_add_item(tree, hf_xmpp_jingle_reason, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
178 reason_tree = proto_item_add_subtree(reason_item, ett_xmpp_jingle_reason);
181 /*Looks for reason description. "alternative-session" may contain "sid" element
182 Elements are changed into attribute*/
183 if((condition = xmpp_steal_element_by_names(element, reason_names, array_length(reason_names)))!=NULL)
185 xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(pinfo->pool, condition->name, condition->offset, condition->length);
186 g_hash_table_insert(element->attrs, (void *)"condition", fake_cond);
188 } else if((condition = xmpp_steal_element_by_name(element, "alternative-session"))!=NULL)
190 xmpp_attr_t *fake_cond,*fake_alter_sid;
191 xmpp_element_t *sid;
193 fake_cond = xmpp_ep_init_attr_t(pinfo->pool, condition->name, condition->offset, condition->length);
194 g_hash_table_insert(element->attrs, (void *)"condition", fake_cond);
197 if((sid = xmpp_steal_element_by_name(condition, "sid"))!=NULL)
199 fake_alter_sid = xmpp_ep_init_attr_t(pinfo->pool, sid->name, sid->offset, sid->length);
200 g_hash_table_insert(element->attrs, (void *)"sid", fake_alter_sid);
204 if((rtp_error = xmpp_steal_element_by_names(element, rtp_error_names, array_length(rtp_error_names)))!=NULL)
206 xmpp_attr_t *fake_rtp_error = xmpp_ep_init_attr_t(pinfo->pool, rtp_error->name, rtp_error->offset, rtp_error->length);
207 g_hash_table_insert(element->attrs, (void *)"rtp-error", fake_rtp_error);
210 if((text = xmpp_steal_element_by_name(element, "text"))!=NULL)
212 xmpp_attr_t *fake_text = xmpp_ep_init_attr_t(pinfo->pool, text->data?text->data->value:"", text->offset, text->length);
213 g_hash_table_insert(element->attrs, (void *)"text", fake_text);
216 xmpp_display_attrs(reason_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
218 xmpp_unknown(reason_tree, tvb, pinfo, element);
221 /*XEP-0167: Jingle RTP Sessions urn:xmpp:jingle:apps:rtp:1*/
222 static void
223 xmpp_jingle_content_description_rtp(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
225 proto_item *desc_item;
226 proto_tree *desc_tree;
228 xmpp_attr_info attrs_info[] = {
229 {"xmlns", &hf_xmpp_xmlns, true, true, NULL, NULL},
230 {"media", &hf_xmpp_jingle_content_description_media, true, true, NULL, NULL},
231 {"ssrc", &hf_xmpp_jingle_content_description_ssrc , false, true, NULL, NULL}
234 xmpp_elem_info elems_info[] = {
235 {NAME, "payload-type", xmpp_jingle_cont_desc_rtp_payload, MANY},
236 {NAME, "bandwidth", xmpp_jingle_cont_desc_rtp_bandwidth, ONE},
237 {NAME, "encryption", xmpp_jingle_cont_desc_rtp_enc, ONE},
238 {NAME, "rtp-hdrext", xmpp_jingle_cont_desc_rtp_hdrext, MANY},
239 {NAME, "zrtp-hash", xmpp_jingle_cont_desc_rtp_enc_zrtp_hash, MANY}/*IMHO it shouldn't appear in description*/
243 desc_item = proto_tree_add_item(tree, hf_xmpp_jingle_content_description, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
244 desc_tree = proto_item_add_subtree(desc_item, ett_xmpp_jingle_content_description);
246 xmpp_display_attrs(desc_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
248 xmpp_display_elems(desc_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
251 static void
252 xmpp_jingle_cont_desc_rtp_payload(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
254 proto_item *payload_item;
255 proto_tree *payload_tree;
257 xmpp_attr_info attrs_info[] = {
258 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
259 {"id", &hf_xmpp_jingle_cont_desc_payload_id, true, true, NULL, NULL},
260 {"channels", &hf_xmpp_jingle_cont_desc_payload_channels, false, false, NULL, NULL},
261 {"clockrate", &hf_xmpp_jingle_cont_desc_payload_clockrate, false, false, NULL, NULL},
262 {"maxptime", &hf_xmpp_jingle_cont_desc_payload_maxptime, false, false, NULL, NULL},
263 {"name", &hf_xmpp_jingle_cont_desc_payload_name, false, true, NULL, NULL},
264 {"ptime", &hf_xmpp_jingle_cont_desc_payload_ptime, false, false, NULL, NULL}
267 xmpp_elem_info elems_info [] =
269 {NAME, "parameter", xmpp_jingle_cont_desc_rtp_payload_param, MANY}
272 payload_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_payload, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
273 payload_tree = proto_item_add_subtree(payload_item, ett_xmpp_jingle_cont_desc_payload);
275 xmpp_display_attrs(payload_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
277 xmpp_display_elems(payload_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
280 static void
281 xmpp_jingle_cont_desc_rtp_payload_param(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
283 proto_item *param_item;
284 proto_tree *param_tree;
286 proto_item *parent_item;
287 xmpp_attr_t *name, *value;
289 xmpp_attr_info attrs_info[] = {
290 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
291 {"name", &hf_xmpp_jingle_cont_desc_payload_param_name, true, true, NULL, NULL},
292 {"value", &hf_xmpp_jingle_cont_desc_payload_param_value, true, true, NULL, NULL}
295 name = xmpp_get_attr(element, "name");
296 value = xmpp_get_attr(element, "value");
298 if(name && value)
300 char *parent_item_label;
302 parent_item = proto_tree_get_parent(tree);
304 parent_item_label = proto_item_get_text(pinfo->pool, parent_item);
306 if(parent_item_label)
308 parent_item_label[strlen(parent_item_label)-1]= '\0';
309 proto_item_set_text(parent_item, "%s param(\"%s\")=%s]", parent_item_label ,name->value, value->value);
313 param_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_payload_param, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
314 param_tree = proto_item_add_subtree(param_item, ett_xmpp_jingle_cont_desc_payload_param);
316 xmpp_display_attrs(param_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
318 xmpp_unknown(param_tree, tvb, pinfo, element);
322 static void
323 xmpp_jingle_cont_desc_rtp_enc(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
325 proto_item *enc_item;
326 proto_tree *enc_tree;
328 xmpp_elem_info elems_info [] = {
329 {NAME, "zrtp-hash", xmpp_jingle_cont_desc_rtp_enc_zrtp_hash, MANY},
330 {NAME, "crypto", xmpp_jingle_cont_desc_rtp_enc_crypto, MANY}
333 enc_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_enc, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
334 enc_tree = proto_item_add_subtree(enc_item, ett_xmpp_jingle_cont_desc_enc);
336 xmpp_display_attrs(enc_tree, element, pinfo, tvb, NULL, 0);
337 xmpp_display_elems(enc_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
340 /*urn:xmpp:jingle:apps:rtp:zrtp:1*/
341 static void
342 xmpp_jingle_cont_desc_rtp_enc_zrtp_hash(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
344 proto_item *zrtp_hash_item;
345 proto_tree *zrtp_hash_tree;
347 xmpp_attr_info attrs_info[] = {
348 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
349 {"version", NULL, true, true,NULL,NULL},
350 {"hash", NULL, true, false, NULL, NULL}
353 zrtp_hash_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_enc_zrtp_hash, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
354 zrtp_hash_tree = proto_item_add_subtree(zrtp_hash_item, ett_xmpp_jingle_cont_desc_enc_zrtp_hash);
356 if(element->data)
358 xmpp_attr_t *fake_hash = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length);
359 g_hash_table_insert(element->attrs, (void *)"hash", fake_hash);
362 xmpp_display_attrs(zrtp_hash_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
364 xmpp_unknown(zrtp_hash_tree, tvb, pinfo, element);
367 static void
368 xmpp_jingle_cont_desc_rtp_enc_crypto(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
370 proto_item *crypto_item;
371 proto_tree *crypto_tree;
373 xmpp_attr_info attrs_info[] = {
374 {"crypto-suite", NULL, true, true, NULL, NULL},
375 {"key-params", NULL, true, false,NULL,NULL},
376 {"session-params", NULL, false, true, NULL, NULL},
377 {"tag", NULL, true, false, NULL, NULL}
380 crypto_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_enc_crypto, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
381 crypto_tree = proto_item_add_subtree(crypto_item, ett_xmpp_jingle_cont_desc_enc_crypto);
384 xmpp_display_attrs(crypto_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
386 xmpp_unknown(crypto_tree, tvb, pinfo, element);
389 static void
390 xmpp_jingle_cont_desc_rtp_bandwidth(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
392 proto_item *bandwidth_item;
393 proto_tree *bandwidth_tree;
395 xmpp_attr_info attrs_info[] = {
396 {"type", NULL, true, true, NULL, NULL},
397 {"value", NULL, true, true, NULL, NULL}
400 bandwidth_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_bandwidth, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
401 bandwidth_tree = proto_item_add_subtree(bandwidth_item, ett_xmpp_jingle_cont_desc_bandwidth);
403 if(element->data)
405 xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length);
406 g_hash_table_insert(element->attrs, (void *)"value", fake_value);
409 xmpp_display_attrs(bandwidth_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
410 xmpp_unknown(bandwidth_tree, tvb, pinfo, element);
413 /*urn:xmpp:jingle:apps:rtp:rtp-hdrext:0*/
414 static void
415 xmpp_jingle_cont_desc_rtp_hdrext(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo, xmpp_element_t* element)
417 proto_item *rtp_hdr_item;
418 proto_tree *rtp_hdr_tree;
420 static const char *senders[] = {"both", "initiator", "responder"};
421 xmpp_array_t *senders_enums = xmpp_ep_init_array_t(pinfo->pool, senders, 3);
423 xmpp_attr_info attrs_info[] = {
424 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
425 {"id", NULL, true, false, NULL, NULL},
426 {"uri", NULL, true, true, NULL, NULL},
427 {"senders", NULL, false, true, xmpp_val_enum_list, senders_enums},
428 {"parameter", NULL, false, true, NULL, NULL}
431 xmpp_element_t *parameter;
433 rtp_hdr_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_desc_rtp_hdr, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
434 rtp_hdr_tree = proto_item_add_subtree(rtp_hdr_item, ett_xmpp_jingle_cont_desc_rtp_hdr);
436 if((parameter = xmpp_steal_element_by_name(element, "parameter"))!=NULL)
438 xmpp_attr_t *name = xmpp_get_attr(element, "name");
439 xmpp_attr_t *fake_attr = xmpp_ep_init_attr_t(pinfo->pool, name?name->value:"", parameter->offset, parameter->length);
440 g_hash_table_insert(element->attrs, (void *)"parameter", fake_attr);
443 xmpp_display_attrs(rtp_hdr_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
445 xmpp_unknown(rtp_hdr_tree, tvb, pinfo, element);
448 /*urn:xmpp:jingle:apps:rtp:info:1*/
449 static void
450 xmpp_jingle_rtp_info(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
452 proto_item *rtp_info_item;
453 proto_tree *rtp_info_tree;
455 static const char *creator[] = {"initiator","responder"};
456 xmpp_array_t *creator_enums = xmpp_ep_init_array_t(pinfo->pool, creator, array_length(creator));
458 xmpp_attr_info mute_attrs_info[] = {
459 {"creator", NULL, true, true, xmpp_val_enum_list, creator_enums},
460 {"name", NULL, true, true, NULL, NULL}
463 rtp_info_item = proto_tree_add_string(tree, hf_xmpp_jingle_rtp_info, tvb, element->offset, element->length, element->name);
464 rtp_info_tree = proto_item_add_subtree(rtp_info_item, ett_xmpp_jingle_rtp_info);
466 if(strcmp("mute", element->name) == 0 || strcmp("unmute", element->name) == 0)
467 xmpp_display_attrs(rtp_info_tree, element, pinfo, tvb, mute_attrs_info, array_length(mute_attrs_info));
469 xmpp_unknown(rtp_info_tree, tvb, pinfo, element);
472 /*XEP-0176: Jingle ICE-UDP Transport Method urn:xmpp:jingle:transports:ice-udp:1*/
473 static void
474 xmpp_jingle_cont_trans_ice(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
476 proto_item *trans_item;
477 proto_tree *trans_tree;
479 xmpp_attr_info attrs_info[] = {
480 {"xmlns", &hf_xmpp_xmlns, false, true, NULL, NULL},
481 {"pwd", &hf_xmpp_jingle_cont_trans_pwd, false, false, NULL, NULL},
482 {"ufrag", &hf_xmpp_jingle_cont_trans_ufrag, false, true, NULL, NULL}
485 xmpp_elem_info elems_info [] = {
486 {NAME, "candidate", xmpp_jingle_cont_trans_ice_candidate, MANY},
487 {NAME, "remote-candidate", xmpp_jingle_cont_trans_ice_remote_candidate, ONE}
490 trans_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
491 trans_tree = proto_item_add_subtree(trans_item, ett_xmpp_jingle_cont_trans);
493 xmpp_display_attrs(trans_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
495 xmpp_display_elems(trans_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
498 static void
499 xmpp_jingle_cont_trans_ice_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
501 proto_item *cand_item;
502 proto_tree *cand_tree;
504 static const char *type_enums[] = {"host", "prflx", "relay", "srflx"};
505 xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums,array_length(type_enums));
507 xmpp_attr_info attrs_info[] = {
508 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
509 {"component", NULL, true, false, NULL, NULL},
510 {"foundation", NULL, true, false, NULL, NULL},
511 {"generation", NULL, true, false, NULL, NULL},
512 {"id", NULL, false, false, NULL, NULL}, /*in schemas id is marked as required, but in jitsi logs it doesn't appear*/
513 {"ip", NULL, true, true, NULL, NULL},
514 {"network", NULL, true, false, NULL, NULL},
515 {"port", NULL, true, false, NULL, NULL},
516 {"priority", NULL, true, true, NULL, NULL},
517 {"protocol", NULL, true, true, NULL, NULL},
518 {"rel-addr", NULL, false, false, NULL, NULL},
519 {"rel-port", NULL, false, false, NULL, NULL},
520 {"type", NULL, true, true, xmpp_val_enum_list, type_enums_array}
523 cand_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_cand, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
524 cand_tree = proto_item_add_subtree(cand_item, ett_xmpp_jingle_cont_trans_cand);
526 xmpp_display_attrs(cand_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
528 xmpp_unknown(cand_tree, tvb, pinfo, element);
531 static void
532 xmpp_jingle_cont_trans_ice_remote_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
534 proto_item *remote_cand_item;
535 proto_tree *remote_cand_tree;
537 xmpp_attr_info attrs_info[] = {
538 {"component", NULL, true, false, NULL, NULL},
539 {"ip", NULL, true, false, NULL, NULL},
540 {"port", NULL, true, false, NULL, NULL}
543 remote_cand_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_rem_cand, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
544 remote_cand_tree = proto_item_add_subtree(remote_cand_item, ett_xmpp_jingle_cont_trans_rem_cand);
546 xmpp_display_attrs(remote_cand_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
548 xmpp_unknown(remote_cand_tree, tvb, pinfo, element);
551 /*XEP-0177: Jingle Raw UDP Transport Method urn:xmpp:jingle:transports:raw-udp:1*/
552 static void
553 xmpp_jingle_cont_trans_raw(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
555 proto_item *trans_item;
556 proto_tree *trans_tree;
558 xmpp_attr_info attrs_info[] = {
559 {"xmlns", &hf_xmpp_xmlns, false, true, NULL, NULL}
562 xmpp_elem_info elems_info [] = {
563 {NAME, "candidate", xmpp_jingle_cont_trans_raw_candidate, MANY}
566 trans_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
567 trans_tree = proto_item_add_subtree(trans_item, ett_xmpp_jingle_cont_trans);
569 xmpp_display_attrs(trans_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
570 xmpp_display_elems(trans_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
573 static void
574 xmpp_jingle_cont_trans_raw_candidate(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
576 proto_item *cand_item;
577 proto_tree *cand_tree;
579 static const char *type_enums[] = {"host", "prflx", "relay", "srflx"};
580 xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums,array_length(type_enums));
582 xmpp_attr_info attrs_info[] = {
583 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
584 {"component", NULL, true, false, NULL, NULL},
585 {"generation", NULL, true, false, NULL, NULL},
586 {"id", NULL, true, false, NULL, NULL},
587 {"ip", NULL, true, true, NULL, NULL},
588 {"port", NULL, true, true, NULL, NULL},
589 {"type", NULL, true, true, xmpp_val_enum_list, type_enums_array}
592 cand_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_cand, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
593 cand_tree = proto_item_add_subtree(cand_item, ett_xmpp_jingle_cont_trans_cand);
595 xmpp_display_attrs(cand_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
596 xmpp_display_elems(cand_tree, element, pinfo, tvb, NULL, 0);
599 /*XEP-0260: Jingle SOCKS5 Bytestreams Transport Method urn:xmpp:jingle:transports:s5b:1*/
600 static void
601 xmpp_jingle_cont_trans_s5b(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
603 proto_item *trans_item;
604 proto_tree *trans_tree;
606 xmpp_attr_info attrs_info[] = {
607 {"xmlns", &hf_xmpp_xmlns, false, true, NULL, NULL},
608 {"mode", NULL, false, true, NULL, NULL},
609 {"sid", NULL, false, true, NULL, NULL},
612 xmpp_elem_info elems_info [] = {
613 {NAME, "candidate", xmpp_jingle_cont_trans_s5b_candidate, MANY},
614 {NAME, "activated", xmpp_jingle_cont_trans_s5b_activated, ONE},
615 {NAME, "candidate-used", xmpp_jingle_cont_trans_s5b_cand_used, ONE},
616 {NAME, "candidate-error", xmpp_jingle_cont_trans_s5b_cand_error, ONE},
617 {NAME, "proxy-error", xmpp_jingle_cont_trans_s5b_proxy_error, ONE},
620 trans_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
621 trans_tree = proto_item_add_subtree(trans_item, ett_xmpp_jingle_cont_trans);
623 xmpp_display_attrs(trans_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
624 xmpp_display_elems(trans_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
627 static void
628 xmpp_jingle_cont_trans_s5b_candidate(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
630 proto_item *cand_item;
631 proto_tree *cand_tree;
633 static const char * type_enums[] = {"assisted", "direct", "proxy", "tunnel"};
634 xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums));
636 xmpp_attr_info attrs_info[] = {
637 {"xmlns", &hf_xmpp_xmlns, false, false, NULL, NULL},
638 {"cid", NULL, true, true, NULL, NULL},
639 {"jid", NULL, true, true, NULL, NULL},
640 {"port", NULL, false, true, NULL, NULL},
641 {"priority", NULL, true, true, NULL, NULL},
642 {"type", NULL, true, true, xmpp_val_enum_list, type_enums_array}
645 cand_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_cand, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
646 cand_tree = proto_item_add_subtree(cand_item, ett_xmpp_jingle_cont_trans_cand);
648 xmpp_display_attrs(cand_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
649 xmpp_display_elems(cand_tree, element, pinfo, tvb, NULL, 0);
652 static void
653 xmpp_jingle_cont_trans_s5b_activated(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
655 proto_item *activated_item;
656 xmpp_attr_t *cid = xmpp_get_attr(element, "cid");
658 activated_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_activated, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
659 proto_item_append_text(activated_item, " [cid=\"%s\"]",cid?cid->value:"");
661 xmpp_unknown(tree, tvb, pinfo, element);
664 static void
665 xmpp_jingle_cont_trans_s5b_cand_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
667 proto_item *cand_used_item;
668 xmpp_attr_t *cid = xmpp_get_attr(element, "cid");
670 cand_used_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_candidate_used, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
671 proto_item_append_text(cand_used_item, " [cid=\"%s\"]",cid?cid->value:"");
673 xmpp_unknown(tree, tvb, pinfo, element);
676 static void
677 xmpp_jingle_cont_trans_s5b_cand_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
679 proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_candidate_error, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
680 xmpp_unknown(tree, tvb, pinfo, element);
683 static void
684 xmpp_jingle_cont_trans_s5b_proxy_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
686 proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans_proxy_error, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
687 xmpp_unknown(tree, tvb, pinfo, element);
690 /*XEP-0261: Jingle In-Band Bytestreams Transport Method urn:xmpp:jingle:transports:ibb:1*/
691 static void
692 xmpp_jingle_cont_trans_ibb(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element) {
693 proto_item *trans_item;
694 proto_tree *trans_tree;
696 xmpp_attr_info attrs_info[] = {
697 {"xmlns", &hf_xmpp_xmlns, false, true, NULL, NULL},
698 {"block-size", NULL, true, true, NULL, NULL},
699 {"sid", NULL, true, true, NULL, NULL},
700 {"stanza", NULL, false, true, NULL, NULL}
703 trans_item = proto_tree_add_item(tree, hf_xmpp_jingle_cont_trans, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
704 trans_tree = proto_item_add_subtree(trans_item, ett_xmpp_jingle_cont_trans);
706 xmpp_display_attrs(trans_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
707 xmpp_display_elems(trans_tree, element, pinfo, tvb, NULL, 0);
710 /*XEP-0234: Jingle File Transfer urn:xmpp:jingle:apps:file-transfer:3*/
711 static void
712 xmpp_jingle_file_transfer_desc(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
714 proto_item *desc_item;
715 proto_tree *desc_tree;
717 xmpp_attr_info attrs_info[] = {
718 {"xmlns", &hf_xmpp_xmlns, true, true, NULL, NULL}
721 xmpp_elem_info elems_info[] = {
722 {NAME, "offer", xmpp_jingle_file_transfer_offer, ONE},
723 {NAME, "request", xmpp_jingle_file_transfer_request, ONE}
726 desc_item = proto_tree_add_item(tree, hf_xmpp_jingle_content_description, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
727 desc_tree = proto_item_add_subtree(desc_item, ett_xmpp_jingle_content_description);
729 xmpp_display_attrs(desc_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
730 xmpp_display_elems(desc_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
733 static void
734 xmpp_jingle_file_transfer_offer(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
736 proto_item *offer_item;
737 proto_tree *offer_tree;
739 xmpp_elem_info elems_info[] = {
740 {NAME, "file", xmpp_jingle_file_transfer_file, MANY},
743 offer_item = proto_tree_add_item(tree, hf_xmpp_jingle_file_transfer_offer, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
744 offer_tree = proto_item_add_subtree(offer_item, ett_xmpp_jingle_file_transfer_offer);
746 xmpp_display_attrs(offer_tree, element, pinfo, tvb, NULL, 0);
747 xmpp_display_elems(offer_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
750 static void
751 xmpp_jingle_file_transfer_request(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
753 proto_item *request_item;
754 proto_tree *request_tree;
756 xmpp_elem_info elems_info[] = {
757 {NAME, "file", xmpp_jingle_file_transfer_file, MANY},
760 request_item = proto_tree_add_item(tree, hf_xmpp_jingle_file_transfer_request, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
761 request_tree = proto_item_add_subtree(request_item, ett_xmpp_jingle_file_transfer_request);
763 xmpp_display_attrs(request_tree, element, pinfo, tvb, NULL, 0);
764 xmpp_display_elems(request_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
767 static void
768 xmpp_jingle_file_transfer_received(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
770 proto_item *received_item;
771 proto_tree *received_tree;
773 xmpp_elem_info elems_info[] = {
774 {NAME, "file", xmpp_jingle_file_transfer_file, MANY},
777 received_item = proto_tree_add_item(tree, hf_xmpp_jingle_file_transfer_received, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
778 received_tree = proto_item_add_subtree(received_item, ett_xmpp_jingle_file_transfer_received);
780 xmpp_display_attrs(received_tree, element, pinfo, tvb, NULL, 0);
781 xmpp_display_elems(received_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
784 static void
785 xmpp_jingle_file_transfer_abort(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
787 proto_item *abort_item;
788 proto_tree *abort_tree;
790 xmpp_elem_info elems_info[] = {
791 {NAME, "file", xmpp_jingle_file_transfer_file, MANY},
794 abort_item = proto_tree_add_item(tree, hf_xmpp_jingle_file_transfer_abort, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
795 abort_tree = proto_item_add_subtree(abort_item, ett_xmpp_jingle_file_transfer_abort);
797 xmpp_display_attrs(abort_tree, element, pinfo, tvb, NULL, 0);
798 xmpp_display_elems(abort_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
801 static void
802 xmpp_jingle_file_transfer_checksum(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
804 proto_item *checksum_item;
805 proto_tree *checksum_tree;
807 xmpp_elem_info elems_info[] = {
808 {NAME, "file", xmpp_jingle_file_transfer_file, MANY},
811 checksum_item = proto_tree_add_item(tree, hf_xmpp_jingle_file_transfer_checksum, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
812 checksum_tree = proto_item_add_subtree(checksum_item, ett_xmpp_jingle_file_transfer_checksum);
814 xmpp_display_attrs(checksum_tree, element, pinfo, tvb, NULL, 0);
815 xmpp_display_elems(checksum_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
818 static void
819 xmpp_jingle_file_transfer_file(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* element)
821 proto_tree *file_tree;
823 xmpp_attr_info attrs_info[] = {
824 {"name", NULL, false, true, NULL, NULL},
825 {"size", NULL, false, true, NULL, NULL},
826 {"date", NULL, false, true, NULL, NULL}
829 xmpp_elem_info elems_info[] = {
830 {NAME, "hashes", xmpp_hashes, ONE}
833 file_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_jingle_file_transfer_file, NULL, "FILE");
835 xmpp_change_elem_to_attrib(pinfo->pool, "name", "name", element, xmpp_transform_func_cdata);
836 xmpp_change_elem_to_attrib(pinfo->pool, "size", "size", element, xmpp_transform_func_cdata);
837 xmpp_change_elem_to_attrib(pinfo->pool, "date", "date", element, xmpp_transform_func_cdata);
839 xmpp_display_attrs(file_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
840 xmpp_display_elems(file_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
843 /*XEP-0278: Jingle Relay Nodes http://jabber.org/protocol/jinglenodes*/
844 void
845 xmpp_jinglenodes_services(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
847 proto_item *services_item;
848 proto_tree *services_tree;
850 xmpp_attr_info attrs_info[] = {
851 {"xmlns", &hf_xmpp_xmlns, true, true, NULL, NULL}
854 xmpp_elem_info elems_info[] = {
855 {NAME, "relay", xmpp_jinglenodes_relay_stun_tracker, ONE},
856 {NAME, "tracker", xmpp_jinglenodes_relay_stun_tracker, ONE},
857 {NAME, "stun", xmpp_jinglenodes_relay_stun_tracker, ONE},
860 col_append_str(pinfo->cinfo, COL_INFO, "SERVICES ");
862 services_item = proto_tree_add_item(tree, hf_xmpp_services, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
863 services_tree = proto_item_add_subtree(services_item, ett_xmpp_services);
865 xmpp_display_attrs(services_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
866 xmpp_display_elems(services_tree, element, pinfo, tvb, elems_info, array_length(elems_info));
869 static void
870 xmpp_jinglenodes_relay_stun_tracker(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
872 proto_tree *relay_tree;
874 xmpp_attr_info attrs_info[] = {
875 {"address", NULL, true, true, NULL, NULL},
876 {"port", NULL, false, true, NULL, NULL},
877 {"policy", NULL, true, true, NULL, NULL},
878 {"protocol", NULL, true, true, NULL, NULL},
881 relay_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_services_relay, NULL, element->name);
883 xmpp_display_attrs(relay_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
884 xmpp_display_elems(relay_tree, element, pinfo, tvb, NULL, 0);
887 void
888 xmpp_jinglenodes_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element)
890 proto_item *channel_item;
891 proto_tree *channel_tree;
893 xmpp_attr_info attrs_info[] = {
894 {"xmlns", &hf_xmpp_xmlns, true, false, NULL, NULL},
895 {"id", NULL, false, false, NULL, NULL},
896 {"host", NULL, false, true, NULL, NULL},
897 {"localport", NULL, false, true, NULL, NULL},
898 {"remoteport", NULL, false, true, NULL, NULL},
899 {"protocol", NULL, true, true, NULL, NULL},
900 {"maxkbps", NULL, false, false, NULL, NULL},
901 {"expire", NULL, false, false, NULL, NULL},
904 channel_item = proto_tree_add_item(tree, hf_xmpp_channel, tvb, element->offset, element->length, ENC_BIG_ENDIAN);
905 channel_tree = proto_item_add_subtree(channel_item, ett_xmpp_channel);
907 xmpp_display_attrs(channel_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info));
908 xmpp_display_elems(channel_tree, element, pinfo, tvb, NULL, 0);
911 * Editor modelines - https://www.wireshark.org/tools/modelines.html
913 * Local variables:
914 * c-basic-offset: 4
915 * tab-width: 8
916 * indent-tabs-mode: nil
917 * End:
919 * ex: set shiftwidth=4 tabstop=8 expandtab:
920 * :indentSize=4:tabSize=8:noTabs=true: