From Mariusz Okrój and Sebastien Vincent via https://bugs.wireshark.org/bugzilla...
[obnox/wireshark/wip.git] / epan / dissectors / packet-xmpp.c
1 /* packet-xmpp.c
2  * Wireshark's XMPP dissector.
3  * 
4  * Copyright 2011, Mariusz Okroj <okrojmariusz[]gmail.com>
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31 #include<stdio.h>
32 #include<string.h>
33 #include <glib.h>
34
35 #include <epan/packet.h>
36 #include <epan/proto.h>
37 #include <epan/emem.h>
38 #include <epan/conversation.h>
39 #include <epan/strutil.h>
40 #include <epan/expert.h>
41 #include <epan/prefs.h>
42
43 #include <epan/dissectors/packet-xml.h>
44
45 #include <packet-xmpp-utils.h>
46 #include <packet-xmpp.h>
47 #include <packet-xmpp-core.h>
48 #include <packet-xmpp-jingle.h>
49
50 #define XMPP_PORT 5222
51
52 static dissector_handle_t xml_handle = NULL;
53
54 int proto_xmpp = -1;
55
56 static gboolean xmpp_desegment = TRUE;
57
58 gint hf_xmpp_xmlns = -1;
59 gint hf_xmpp_id = -1;
60 gint hf_xmpp_from = -1;
61 gint hf_xmpp_to = -1;
62 gint hf_xmpp_type = -1;
63
64 gint hf_xmpp_iq = -1;
65
66 gint hf_xmpp_query = -1;
67 gint hf_xmpp_query_node = -1;
68
69 gint hf_xmpp_query_item = -1;
70 gint hf_xmpp_query_item_jid = -1;
71 gint hf_xmpp_query_item_name = -1;
72 gint hf_xmpp_query_item_subscription = -1;
73 gint hf_xmpp_query_item_ask = -1;
74 gint hf_xmpp_query_item_group = -1;
75 gint hf_xmpp_query_item_node = -1;
76 gint hf_xmpp_query_item_approved = -1;
77
78 gint hf_xmpp_query_identity = -1;
79 gint hf_xmpp_query_identity_category = -1;
80 gint hf_xmpp_query_identity_type = -1;
81 gint hf_xmpp_query_identity_name = -1;
82 gint hf_xmpp_query_identity_lang = -1;
83
84 gint hf_xmpp_query_feature = -1;
85
86 gint hf_xmpp_query_streamhost = -1;
87 gint hf_xmpp_query_streamhost_used = -1;
88 gint hf_xmpp_query_activate = -1;
89 gint hf_xmpp_query_udpsuccess = -1;
90
91 gint hf_xmpp_error = -1;
92 gint hf_xmpp_error_type = -1;
93 gint hf_xmpp_error_code = -1;
94 gint hf_xmpp_error_condition = -1;
95 gint hf_xmpp_error_text = -1;
96
97 gint hf_xmpp_iq_bind = -1;
98 gint hf_xmpp_iq_bind_jid = -1;
99 gint hf_xmpp_iq_bind_resource = -1;
100
101 gint hf_xmpp_services = -1;
102 gint hf_xmpp_channel = -1;
103
104 gint hf_xmpp_iq_session = -1;
105 gint hf_xmpp_stream = -1;
106 gint hf_xmpp_features = -1;
107
108 gint hf_xmpp_vcard  = -1;
109 gint hf_xmpp_vcard_x_update = -1;
110
111 gint hf_xmpp_jingle = -1;
112 gint hf_xmpp_jingle_sid = -1;
113 gint hf_xmpp_jingle_initiator = -1;
114 gint hf_xmpp_jingle_responder = -1;
115 gint hf_xmpp_jingle_action = -1;
116
117 gint hf_xmpp_jingle_content = -1;
118 gint hf_xmpp_jingle_content_creator = -1;
119 gint hf_xmpp_jingle_content_name = -1;
120 gint hf_xmpp_jingle_content_disposition = -1;
121 gint hf_xmpp_jingle_content_senders = -1;
122
123 gint hf_xmpp_jingle_content_description = -1;
124 gint hf_xmpp_jingle_content_description_media = -1;
125 gint hf_xmpp_jingle_content_description_ssrc = -1;
126
127 gint hf_xmpp_jingle_cont_desc_payload = -1;
128 gint hf_xmpp_jingle_cont_desc_payload_id = -1;
129 gint hf_xmpp_jingle_cont_desc_payload_channels = -1;
130 gint hf_xmpp_jingle_cont_desc_payload_clockrate = -1;
131 gint hf_xmpp_jingle_cont_desc_payload_maxptime = -1;
132 gint hf_xmpp_jingle_cont_desc_payload_name = -1;
133 gint hf_xmpp_jingle_cont_desc_payload_ptime = -1;
134
135 gint hf_xmpp_jingle_cont_desc_payload_param = -1;
136 gint hf_xmpp_jingle_cont_desc_payload_param_value = -1;
137 gint hf_xmpp_jingle_cont_desc_payload_param_name = -1;
138
139 gint hf_xmpp_jingle_cont_desc_enc = -1;
140 gint hf_xmpp_jingle_cont_desc_enc_zrtp_hash = -1;
141 gint hf_xmpp_jingle_cont_desc_enc_crypto = -1;
142
143 gint hf_xmpp_jingle_cont_desc_rtp_hdr = -1;
144 gint hf_xmpp_jingle_cont_desc_bandwidth = -1;
145
146 gint hf_xmpp_jingle_cont_trans = -1;
147 gint hf_xmpp_jingle_cont_trans_pwd = -1;
148 gint hf_xmpp_jingle_cont_trans_ufrag = -1;
149
150 gint hf_xmpp_jingle_cont_trans_cand = -1;
151 gint hf_xmpp_jingle_cont_trans_rem_cand = -1;
152 gint hf_xmpp_jingle_cont_trans_activated = -1;
153 gint hf_xmpp_jingle_cont_trans_candidate_error = -1;
154 gint hf_xmpp_jingle_cont_trans_candidate_used = -1;
155 gint hf_xmpp_jingle_cont_trans_proxy_error = -1;
156
157
158 gint hf_xmpp_jingle_reason = -1;
159 gint hf_xmpp_jingle_reason_condition = -1;
160 gint hf_xmpp_jingle_reason_text = -1;
161
162 gint hf_xmpp_jingle_rtp_info = -1;
163
164 gint hf_xmpp_jingle_file_transfer_offer = -1;
165 gint hf_xmpp_jingle_file_transfer_request = -1;
166 gint hf_xmpp_jingle_file_transfer_received = -1;
167 gint hf_xmpp_jingle_file_transfer_abort = -1;
168 gint hf_xmpp_jingle_file_transfer_checksum = -1;
169
170 gint hf_xmpp_si = -1;
171 gint hf_xmpp_si_file = -1;
172
173 gint hf_xmpp_iq_feature_neg = -1;
174 gint hf_xmpp_x_data = -1;
175 gint hf_xmpp_x_data_field = -1;
176 gint hf_xmpp_x_data_field_value = -1;
177
178 gint hf_xmpp_message = -1;
179 gint hf_xmpp_message_chatstate = -1;
180
181 gint hf_xmpp_message_thread = -1;
182 gint hf_xmpp_message_thread_parent = -1;
183
184 gint hf_xmpp_message_body = -1;
185 gint hf_xmpp_message_subject = -1;
186
187 gint hf_xmpp_ibb_open = -1;
188 gint hf_xmpp_ibb_close = -1;
189 gint hf_xmpp_ibb_data = -1;
190
191 gint hf_xmpp_delay = -1;
192
193 gint hf_xmpp_x_event = -1;
194 gint hf_xmpp_x_event_condition = -1;
195
196 gint hf_xmpp_presence = -1;
197 gint hf_xmpp_presence_show = -1;
198 gint hf_xmpp_presence_status = -1;
199 gint hf_xmpp_presence_caps = -1;
200
201 gint hf_xmpp_auth = -1;
202 gint hf_xmpp_challenge = -1;
203 gint hf_xmpp_response = -1;
204 gint hf_xmpp_success = -1;
205 gint hf_xmpp_failure = -1;
206 gint hf_xmpp_starttls = -1;
207 gint hf_xmpp_proceed = -1;
208
209 gint hf_xmpp_muc_x = -1;
210 gint hf_xmpp_muc_user_x  = -1;
211 gint hf_xmpp_muc_user_item  = -1;
212 gint hf_xmpp_muc_user_invite  = -1;
213
214 gint hf_xmpp_gtalk_session = -1;
215 gint hf_xmpp_gtalk_session_type = -1;
216 gint hf_xmpp_gtalk = -1;
217 gint hf_xmpp_gtalk_setting = -1;
218 gint hf_xmpp_gtalk_nosave_x = -1;
219 gint hf_xmpp_gtalk_mail_mailbox = -1;
220 gint hf_xmpp_gtalk_mail_new_mail = -1;
221 gint hf_xmpp_gtalk_transport_p2p = -1;
222
223
224 gint hf_xmpp_conf_info = -1;
225 gint hf_xmpp_conf_info_sid = -1;
226
227 gint hf_xmpp_unknown = -1;
228 gint hf_xmpp_unknown_attr = -1;
229
230 gint hf_xmpp_out = -1;
231 gint hf_xmpp_in = -1;
232 gint hf_xmpp_response_in = -1;
233 gint hf_xmpp_response_to = -1;
234 gint hf_xmpp_jingle_session = -1;
235 gint hf_xmpp_ibb = -1;
236
237 gint hf_xmpp_ping = -1;
238 gint hf_xmpp_hashes = -1;
239
240 gint hf_xmpp_jitsi_inputevt = -1;
241 gint hf_xmpp_jitsi_inputevt_rmt_ctrl = -1;
242
243 gint ett_xmpp = -1;
244 gint ett_xmpp_iq = -1;
245 gint ett_xmpp_query = -1;
246 gint ett_xmpp_query_item = -1;
247 gint ett_xmpp_query_identity = -1;
248 gint ett_xmpp_query_feature = -1;
249
250 gint ett_xmpp_query_streamhost = -1;
251 gint ett_xmpp_query_streamhost_used = -1;
252 gint ett_xmpp_query_udpsuccess = -1;
253
254 gint ett_xmpp_iq_error = -1;
255 gint ett_xmpp_iq_bind = -1;
256 gint ett_xmpp_iq_session = -1;
257 gint ett_xmpp_vcard = -1;
258 gint ett_xmpp_vcard_x_update = -1;
259
260 gint ett_xmpp_jingle = -1;
261 gint ett_xmpp_jingle_content = -1;
262 gint ett_xmpp_jingle_content_description = -1;
263 gint ett_xmpp_jingle_cont_desc_enc = -1;
264 gint ett_xmpp_jingle_cont_desc_enc_zrtp_hash = -1;
265 gint ett_xmpp_jingle_cont_desc_enc_crypto = -1;
266 gint ett_xmpp_jingle_cont_desc_rtp_hdr = -1;
267 gint ett_xmpp_jingle_cont_desc_bandwidth = -1;
268 gint ett_xmpp_jingle_cont_desc_payload = -1;
269 gint ett_xmpp_jingle_cont_desc_payload_param = -1;
270 gint ett_xmpp_jingle_cont_trans = -1;
271 gint ett_xmpp_jingle_cont_trans_cand = -1;
272 gint ett_xmpp_jingle_cont_trans_rem_cand = -1;
273 gint ett_xmpp_jingle_reason = -1;
274 gint ett_xmpp_jingle_rtp_info = -1;
275
276 gint ett_xmpp_jingle_file_transfer_offer = -1;
277 gint ett_xmpp_jingle_file_transfer_request = -1;
278 gint ett_xmpp_jingle_file_transfer_abort = -1;
279 gint ett_xmpp_jingle_file_transfer_received = -1;
280 gint ett_xmpp_jingle_file_transfer_checksum = -1;
281 gint ett_xmpp_jingle_file_transfer_file = -1;
282
283 gint ett_xmpp_services = -1;
284 gint ett_xmpp_services_relay = -1;
285 gint ett_xmpp_channel = -1;
286
287 gint ett_xmpp_si = -1;
288 gint ett_xmpp_si_file = -1;
289 gint ett_xmpp_si_file_range = -1;
290
291 gint ett_xmpp_iq_feature_neg = -1;
292 gint ett_xmpp_x_data = -1;
293 gint ett_xmpp_x_data_field = -1;
294 gint ett_xmpp_x_data_field_value = -1;
295
296 gint ett_xmpp_ibb_open = -1;
297 gint ett_xmpp_ibb_close = -1;
298 gint ett_xmpp_ibb_data = -1;
299
300 gint ett_xmpp_delay = -1;
301
302 gint ett_xmpp_x_event = -1;
303
304 gint ett_xmpp_message = -1;
305 gint ett_xmpp_message_thread = -1;
306 gint ett_xmpp_message_body = -1;
307 gint ett_xmpp_message_subject = -1;
308
309 gint ett_xmpp_presence = -1;
310 gint ett_xmpp_presence_status = -1;
311 gint ett_xmpp_presence_caps = -1;
312
313 gint ett_xmpp_auth = -1;
314 gint ett_xmpp_challenge = -1;
315 gint ett_xmpp_response = -1;
316 gint ett_xmpp_success = -1;
317 gint ett_xmpp_failure = -1;
318 gint ett_xmpp_stream = -1;
319 gint ett_xmpp_features = -1;
320 gint ett_xmpp_features_mechanisms = -1;
321 gint ett_xmpp_starttls = -1;
322 gint ett_xmpp_proceed = -1;
323
324 gint ett_xmpp_muc_x = -1;
325 gint ett_xmpp_muc_hist = -1;
326 gint ett_xmpp_muc_user_x = -1;
327 gint ett_xmpp_muc_user_item = -1;
328 gint ett_xmpp_muc_user_invite = -1;
329
330 gint ett_xmpp_gtalk_session = -1;
331 gint ett_xmpp_gtalk_session_desc = -1;
332 gint ett_xmpp_gtalk_session_cand = -1;
333 gint ett_xmpp_gtalk_session_desc_payload = -1;
334 gint ett_xmpp_gtalk_session_reason = -1;
335 gint ett_xmpp_gtalk_jingleinfo_stun = -1;
336 gint ett_xmpp_gtalk_jingleinfo_server = -1;
337 gint ett_xmpp_gtalk_jingleinfo_relay = -1;
338 gint ett_xmpp_gtalk_jingleinfo_relay_serv = -1;
339 gint ett_xmpp_gtalk_setting = -1;
340 gint ett_xmpp_gtalk_nosave_x = -1;
341 gint ett_xmpp_gtalk_mail_mailbox = -1;
342 gint ett_xmpp_gtalk_mail_mail_info = -1;
343 gint ett_xmpp_gtalk_mail_senders = -1;
344 gint ett_xmpp_gtalk_mail_sender = -1;
345 gint ett_xmpp_gtalk_status_status_list = -1;
346 gint ett_xmpp_gtalk_transport_p2p = -1;
347 gint ett_xmpp_gtalk_transport_p2p_cand = -1;
348
349 gint ett_xmpp_conf_info = -1;
350 gint ett_xmpp_conf_desc = -1;
351 gint ett_xmpp_conf_state = -1;
352 gint ett_xmpp_conf_users = -1;
353 gint ett_xmpp_conf_user = -1;
354 gint ett_xmpp_conf_endpoint = -1;
355 gint ett_xmpp_conf_media = -1;
356
357 gint ett_xmpp_ping = -1;
358 gint ett_xmpp_hashes = -1;
359 gint ett_xmpp_hashes_hash = -1;
360
361 gint ett_xmpp_jitsi_inputevt = -1;
362 gint ett_xmpp_jitsi_inputevt_rmt_ctrl = -1;
363
364 gint ett_unknown[ETT_UNKNOWN_LEN];
365
366 static void
367 dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
368
369     xml_frame_t *xml_frame;
370     gboolean out_packet;
371
372     conversation_t *conversation;
373     xmpp_conv_info_t *xmpp_info;
374
375     proto_tree *xmpp_tree = NULL;
376     proto_item *xmpp_item = NULL;
377
378     element_t *packet = NULL;
379
380     /*check if desegment
381      * now it checks that last char is '>',
382      * TODO checks that first element in packet is closed*/
383     int index;
384     gchar last_char;
385
386     if (xmpp_desegment)
387     {
388         index = tvb_reported_length(tvb) - 1;
389         if (index >= 0)
390         {
391             last_char = tvb_get_guint8(tvb, index);
392
393             while (last_char <= ' ' && index - 1 >= 0)
394             {
395                 index--;
396                 last_char = tvb_get_guint8(tvb, index);
397             }
398
399             if (index >= 0 && last_char != '>')
400             {
401                 pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
402                 return;
403             }
404         }
405     }
406
407     if(check_col(pinfo->cinfo, COL_PROTOCOL))
408         col_set_str(pinfo->cinfo, COL_PROTOCOL, "XMPP");
409
410     if (check_col(pinfo->cinfo, COL_INFO))
411             col_clear(pinfo->cinfo, COL_INFO);
412
413     /*if tree == NULL then xmpp_item and xmpp_tree will also NULL*/
414     xmpp_item = proto_tree_add_item(tree, proto_xmpp, tvb, 0, -1, ENC_NA);
415     xmpp_tree = proto_item_add_subtree(xmpp_item, ett_xmpp);
416     
417     call_dissector(xml_handle,tvb,pinfo,xmpp_tree);
418
419     /*if stream end occurs then return*/
420     if(xmpp_stream_close(xmpp_tree,tvb, pinfo))
421     {
422         if(xmpp_tree)
423             proto_tree_hide_first_child(xmpp_tree);
424         return;
425     }
426
427     if(!pinfo->private_data)
428         return;
429
430     /*data from XML dissector*/
431     xml_frame = ((xml_frame_t*)pinfo->private_data)->first_child;
432  
433     if(!xml_frame)
434         return;
435
436     conversation = find_or_create_conversation(pinfo);
437     xmpp_info = conversation_get_proto_data(conversation, proto_xmpp);
438
439     if (!xmpp_info) {
440         xmpp_info = se_alloc(sizeof (xmpp_conv_info_t));
441         xmpp_info->req_resp = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "xmpp_req_resp");
442         xmpp_info->jingle_sessions = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "xmpp_jingle_sessions");
443         xmpp_info->ibb_sessions = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "xmpp_ibb_sessions");
444         xmpp_info->gtalk_sessions = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "xmpp_gtalk_sessions");
445         conversation_add_proto_data(conversation, proto_xmpp, (void *) xmpp_info);
446     }
447
448     
449     if (pinfo->match_uint == pinfo->destport)
450         out_packet = TRUE;
451     else
452         out_packet = FALSE;
453
454     while(xml_frame)
455     {
456         packet = xml_frame_to_element_t(xml_frame, NULL, tvb);
457         DISSECTOR_ASSERT(packet);
458
459         if (strcmp(packet->name, "iq") == 0) {
460             xmpp_iq_reqresp_track(pinfo, packet, xmpp_info);
461             xmpp_jingle_session_track(pinfo, packet, xmpp_info);
462             xmpp_gtalk_session_track(pinfo, packet, xmpp_info);
463         }
464
465         if (strcmp(packet->name, "iq") == 0 || strcmp(packet->name, "message") == 0) {
466             xmpp_ibb_session_track(pinfo, packet, xmpp_info);
467         }
468
469         if (tree) { /* we are being asked for details */
470             proto_item *outin_item;
471
472             if (out_packet)
473                 outin_item = proto_tree_add_boolean(xmpp_tree, hf_xmpp_out, tvb, 0, 0, ENC_LITTLE_ENDIAN);
474             else
475                 outin_item = proto_tree_add_boolean(xmpp_tree, hf_xmpp_in, tvb, 0, 0, ENC_LITTLE_ENDIAN);
476
477             PROTO_ITEM_SET_HIDDEN(outin_item);
478
479
480             /*it hides tree generated by XML dissector*/
481             proto_tree_hide_first_child(xmpp_tree);
482
483             if (strcmp(packet->name, "iq") == 0) {
484                 xmpp_iq(xmpp_tree, tvb, pinfo, packet);
485             } else if (strcmp(packet->name, "presence") == 0) {
486                 xmpp_presence(xmpp_tree, tvb, pinfo, packet);
487             } else if (strcmp(packet->name, "message") == 0) {
488                 xmpp_message(xmpp_tree, tvb, pinfo, packet);
489             } else if (strcmp(packet->name, "auth") == 0) {
490                 xmpp_auth(xmpp_tree, tvb, pinfo, packet);
491             } else if (strcmp(packet->name, "challenge") == 0) {
492                 xmpp_challenge_response_success(xmpp_tree, tvb, pinfo, packet, hf_xmpp_challenge, ett_xmpp_challenge, "CHALLENGE");
493             } else if (strcmp(packet->name, "response") == 0) {
494                 xmpp_challenge_response_success(xmpp_tree, tvb, pinfo, packet, hf_xmpp_response, ett_xmpp_response, "RESPONSE");
495             } else if (strcmp(packet->name, "success") == 0) {
496                 xmpp_challenge_response_success(xmpp_tree, tvb, pinfo, packet, hf_xmpp_success, ett_xmpp_success, "SUCCESS");
497             } else if (strcmp(packet->name, "failure") == 0) {
498                 xmpp_failure(xmpp_tree, tvb, pinfo, packet);
499             } else if (strcmp(packet->name, "xml") == 0) {
500                 xmpp_xml_header(xmpp_tree, tvb, pinfo, packet);
501             } else if (strcmp(packet->name, "stream") == 0) {
502                 xmpp_stream(xmpp_tree, tvb, pinfo, packet);
503             } else if (strcmp(packet->name, "features") == 0) {
504                 xmpp_features(xmpp_tree, tvb, pinfo, packet);
505             } else if (strcmp(packet->name, "starttls") == 0) {
506                 xmpp_starttls(xmpp_tree, tvb, pinfo, packet);
507             }else if (strcmp(packet->name, "proceed") == 0) {
508                 xmpp_proceed(xmpp_tree, tvb, pinfo, packet);
509             }else {
510                 proto_tree_show_first_child(xmpp_tree);
511                 expert_add_info_format(pinfo, xmpp_tree, PI_UNDECODED, PI_NOTE, "Unknown packet: %s", packet->name);
512                 col_clear(pinfo->cinfo, COL_INFO);
513                 col_append_fstr(pinfo->cinfo, COL_INFO, "UNKNOWN PACKET ");
514             }
515
516             /*appends to COL_INFO information about src or dst*/
517             if (pinfo->match_uint == pinfo->destport) {
518                 attr_t *to = get_attr(packet, "to");
519                 if (to)
520                     col_append_fstr(pinfo->cinfo, COL_INFO, "> %s ", to->value);
521             } else {
522                 attr_t *from = get_attr(packet, "from");
523                 if (from)
524                     col_append_fstr(pinfo->cinfo, COL_INFO, "< %s ", from->value);
525             }
526         }
527
528         element_t_tree_free(packet);
529         xml_frame = xml_frame->next_sibling;
530     }
531 }
532
533
534 void
535 proto_register_xmpp(void) {
536     static hf_register_info hf[] = {
537         { &hf_xmpp_iq,
538             {
539                 "IQ", "xmpp.iq", FT_NONE, BASE_NONE, NULL, 0x0,
540                 "iq packet", HFILL
541             }},
542             {&hf_xmpp_xmlns,
543             {
544                 "xmlns", "xmpp.xmlns", FT_STRING, BASE_NONE, NULL, 0x0,
545                 "element namespace", HFILL
546             }},
547             { &hf_xmpp_id,
548             {
549                 "id", "xmpp.id", FT_STRING, BASE_NONE, NULL, 0x0,
550                 "packet id", HFILL
551             }},
552             { &hf_xmpp_type,
553             {
554                 "type", "xmpp.type", FT_STRING, BASE_NONE, NULL, 0x0,
555                 "packet type", HFILL
556             }},
557              { &hf_xmpp_from,
558             {
559                 "from", "xmpp.from", FT_STRING, BASE_NONE, NULL, 0x0,
560                 "packet from", HFILL
561             }},
562              { &hf_xmpp_to,
563             {
564                 "to", "xmpp.to", FT_STRING, BASE_NONE, NULL, 0x0,
565                 "packet to", HFILL
566             }},
567             { &hf_xmpp_query,
568             {
569                 "QUERY", "xmpp.query", FT_NONE, BASE_NONE, NULL, 0x0,
570                 "iq query", HFILL
571             }},
572             { &hf_xmpp_query_node,
573             {
574                 "node", "xmpp.query.node", FT_STRING, BASE_NONE, NULL, 0x0,
575                 "iq query node", HFILL
576             }},
577             { &hf_xmpp_query_item,
578             {
579                 "ITEM", "xmpp.query.item", FT_NONE, BASE_NONE, NULL, 0x0,
580                 "iq query item", HFILL
581
582             }},
583             { &hf_xmpp_query_item_jid,
584             {
585                 "jid", "xmpp.query.item.jid", FT_STRING, BASE_NONE, NULL, 0x0,
586                 "iq query item jid", HFILL
587
588             }},
589             { &hf_xmpp_query_item_name,
590             {
591                 "name", "xmpp.query.item.name", FT_STRING, BASE_NONE, NULL, 0x0,
592                 "iq query item name", HFILL
593             }},
594             { &hf_xmpp_query_item_subscription,
595             {
596                 "subscription", "xmpp.query.item.subscription", FT_STRING, BASE_NONE, NULL, 0x0,
597                 "iq query item subscription", HFILL
598             }},
599             { &hf_xmpp_query_item_ask,
600             {
601                 "ask", "xmpp.query.item.ask", FT_STRING, BASE_NONE, NULL, 0x0,
602                 "iq query item ask", HFILL
603             }},
604             { &hf_xmpp_query_item_group,
605             {
606                 "GROUP", "xmpp.query.item.group", FT_STRING, BASE_NONE, NULL, 0x0,
607                 "iq query item group", HFILL
608
609             }},
610             { &hf_xmpp_query_item_approved,
611             {
612                 "approved", "xmpp.query.item.approved", FT_STRING, BASE_NONE, NULL, 0x0,
613                 "iq query item approved", HFILL
614
615             }},
616             { &hf_xmpp_query_item_node,
617             {
618                 "node", "xmpp.query.item.node", FT_STRING, BASE_NONE, NULL, 0x0,
619                 "iq query item node", HFILL
620
621             }},
622             { &hf_xmpp_query_identity,
623             {
624                 "IDENTITY", "xmpp.query.identity", FT_NONE, BASE_NONE, NULL, 0x0,
625                 "iq query identity", HFILL
626
627             }},
628             { &hf_xmpp_query_identity_category,
629             {
630                 "category", "xmpp.query.identity.category", FT_STRING, BASE_NONE, NULL, 0x0,
631                 "iq query identity category", HFILL
632
633             }},
634             { &hf_xmpp_query_identity_type,
635             {
636                 "type", "xmpp.query.identity.type", FT_STRING, BASE_NONE, NULL, 0x0,
637                 "iq query identity type", HFILL
638
639             }},
640             { &hf_xmpp_query_identity_name,
641             {
642                 "name", "xmpp.query.identity.name", FT_STRING, BASE_NONE, NULL, 0x0,
643                 "iq query identity name", HFILL
644
645             }},
646             { &hf_xmpp_query_identity_lang,
647             {
648                 "lang", "xmpp.query.identity.lang", FT_STRING, BASE_NONE, NULL, 0x0,
649                 "iq query identity lang", HFILL
650
651             }},
652             { &hf_xmpp_query_feature,
653             {
654                 "FEATURE", "xmpp.query.feature", FT_STRING, BASE_NONE, NULL, 0x0,
655                 "iq query feature", HFILL
656
657             }},
658             { &hf_xmpp_query_streamhost,
659             {
660                 "STREAMHOST", "xmpp.query.streamhost", FT_NONE, BASE_NONE, NULL, 0x0,
661                 "iq query streamhost", HFILL
662
663             }},
664             { &hf_xmpp_query_streamhost_used,
665             {
666                 "STREAMHOST-USED", "xmpp.query.streamhost-used", FT_NONE, BASE_NONE, NULL, 0x0,
667                 "iq query streamhost-used", HFILL
668
669             }},
670             { &hf_xmpp_query_activate,
671             {
672                 "ACTIVATE", "xmpp.query.activate", FT_STRING, BASE_NONE, NULL, 0x0,
673                 "iq query activate", HFILL
674
675             }},
676             { &hf_xmpp_query_udpsuccess,
677             {
678                 "UDPSUCCESS", "xmpp.query.udpsuccess", FT_NONE, BASE_NONE, NULL, 0x0,
679                 "iq query streamhost-used", HFILL
680
681             }},
682             { &hf_xmpp_error,
683             {
684                 "ERROR", "xmpp.error", FT_NONE, BASE_NONE, NULL, 0x0,
685                 "iq error", HFILL
686             }},
687             { &hf_xmpp_error_code,
688             {
689                 "code", "xmpp.error.code", FT_STRING, BASE_NONE, NULL, 0x0,
690                 "iq stanza error code", HFILL
691
692             }},
693             { &hf_xmpp_error_type,
694             {
695                 "type", "xmpp.error.type", FT_STRING, BASE_NONE, NULL, 0x0,
696                 "iq error type", HFILL
697
698             }},
699             { &hf_xmpp_error_condition,
700             {
701                 "CONDITION", "xmpp.error.condition", FT_STRING, BASE_NONE, NULL, 0x0,
702                 "iq error condition", HFILL
703
704             }},
705             { &hf_xmpp_error_text,
706             {
707                 "TEXT", "xmpp.error.text", FT_STRING, BASE_NONE, NULL, 0x0,
708                 "iq error text", HFILL
709
710             }},
711             { &hf_xmpp_iq_bind,
712             {
713                 "BIND", "xmpp.iq.bind", FT_NONE, BASE_NONE, NULL, 0x0,
714                 "iq bind", HFILL
715
716             }},
717             { &hf_xmpp_iq_bind_jid,
718             {
719                 "jid", "xmpp.iq.bind.jid", FT_STRING, BASE_NONE, NULL, 0x0,
720                 "iq bind jid", HFILL
721
722             }},
723             { &hf_xmpp_iq_bind_resource,
724             {
725                 "resource", "xmpp.iq.bind.resource", FT_STRING, BASE_NONE, NULL, 0x0,
726                 "iq bind resource", HFILL
727
728             }},
729             { &hf_xmpp_services,
730             {
731                 "SERVICES", "xmpp.services", FT_NONE, BASE_NONE, NULL, 0x0,
732                 "http://jabber.org/protocol/jinglenodes services", HFILL
733             }},
734             { &hf_xmpp_channel,
735             {
736                 "CHANNEL", "xmpp.channel", FT_NONE, BASE_NONE, NULL, 0x0,
737                 "http://jabber.org/protocol/jinglenodes#channel", HFILL
738             }},
739             { &hf_xmpp_iq_session,
740             {
741                 "SESSION", "xmpp.iq.session", FT_NONE, BASE_NONE, NULL, 0x0,
742                 "iq session", HFILL
743             }},
744             { &hf_xmpp_vcard,
745             {
746                 "VCARD", "xmpp.vcard", FT_NONE, BASE_NONE, NULL, 0x0,
747                 "vcard-temp", HFILL
748             }},
749             { &hf_xmpp_vcard_x_update,
750             {
751                 "X VCARD-UPDATE", "xmpp.vcard-update", FT_NONE, BASE_NONE, NULL, 0x0,
752                 "vcard-temp:x:update", HFILL
753             }},
754             { &hf_xmpp_jingle,
755             {
756                 "JINGLE", "xmpp.jingle", FT_NONE, BASE_NONE, NULL, 0x0,
757                 "iq jingle", HFILL
758             }},
759             { &hf_xmpp_jingle_action,
760             {
761                 "action", "xmpp.jingle.action", FT_STRING, BASE_NONE, NULL, 0x0,
762                 "iq jingle action", HFILL
763             }},
764             { &hf_xmpp_jingle_sid,
765             {
766                 "sid", "xmpp.jingle.sid", FT_STRING, BASE_NONE, NULL, 0x0,
767                 "iq jingle sid", HFILL
768             }},
769             { &hf_xmpp_jingle_initiator,
770             {
771                 "initiator", "xmpp.jingle.initiator", FT_STRING, BASE_NONE, NULL, 0x0,
772                 "iq jingle initiator", HFILL
773             }},
774             { &hf_xmpp_jingle_responder,
775             {
776                 "responder", "xmpp.jingle.responder", FT_STRING, BASE_NONE, NULL, 0x0,
777                 "iq jingle responder", HFILL
778             }},
779             { &hf_xmpp_jingle_content,
780             {
781                 "CONTENT", "xmpp.jingle.content", FT_NONE, BASE_NONE, NULL, 0x0,
782                 "iq jingle content", HFILL
783             }},
784             { &hf_xmpp_jingle_content_creator,
785             {
786                 "creator", "xmpp.jingle.content.creator", FT_STRING, BASE_NONE, NULL, 0x0,
787                 "iq jingle content creator", HFILL
788             }},
789             { &hf_xmpp_jingle_content_name,
790             {
791                 "name", "xmpp.jingle.content.name", FT_STRING, BASE_NONE, NULL, 0x0,
792                 "iq jingle content name", HFILL
793             }},
794             { &hf_xmpp_jingle_content_disposition,
795             {
796                 "disposition", "xmpp.jingle.content.disposition", FT_STRING, BASE_NONE, NULL, 0x0,
797                 "iq jingle content disposition", HFILL
798             }},
799             { &hf_xmpp_jingle_content_senders,
800             {
801                 "senders", "xmpp.jingle.content.senders", FT_STRING, BASE_NONE, NULL, 0x0,
802                 "iq jingle content senders", HFILL
803             }},
804             { &hf_xmpp_jingle_content_description,
805             {
806                 "DESCRIPTION", "xmpp.jingle.content.description", FT_NONE, BASE_NONE, NULL, 0x0,
807                 "iq jingle content description", HFILL
808             }},
809             { &hf_xmpp_jingle_content_description_media,
810             {
811                 "media", "xmpp.jingle.content.description.media", FT_STRING, BASE_NONE, NULL, 0x0,
812                 "iq jingle content description", HFILL
813             }},
814             { &hf_xmpp_jingle_content_description_ssrc,
815             {
816                 "ssrc", "xmpp.jingle.content.description.ssrc", FT_STRING, BASE_NONE, NULL, 0x0,
817                 "iq jingle content description ssrc", HFILL
818             }},
819             { &hf_xmpp_jingle_cont_desc_payload,
820             {
821                 "PAYLOAD-TYPE", "xmpp.jingle.content.description.payload-type", FT_NONE, BASE_NONE, NULL, 0x0,
822                 "iq jingle content description payload-type", HFILL
823             }},
824             { &hf_xmpp_jingle_cont_desc_payload_id,
825             {
826                 "id", "xmpp.jingle.content.description.payload-type.id", FT_STRING, BASE_NONE, NULL, 0x0,
827                 "iq jingle content description payload-type id", HFILL
828             }},
829             { &hf_xmpp_jingle_cont_desc_payload_channels,
830             {
831                 "channels", "xmpp.jingle.content.description.payload-type.channels", FT_STRING, BASE_NONE, NULL, 0x0,
832                 "iq jingle content description payload-type channels", HFILL
833             }},
834             { &hf_xmpp_jingle_cont_desc_payload_clockrate,
835             {
836                 "clockrate", "xmpp.jingle.content.description.payload-type.clockrate", FT_STRING, BASE_NONE, NULL, 0x0,
837                 "iq jingle content description payload-type clockrate", HFILL
838             }},
839             { &hf_xmpp_jingle_cont_desc_payload_maxptime,
840             {
841                 "maxptime", "xmpp.jingle.content.description.payload-type.maxptime", FT_STRING, BASE_NONE, NULL, 0x0,
842                 "iq jingle content description payload-type maxptime", HFILL
843             }},
844             { &hf_xmpp_jingle_cont_desc_payload_name,
845             {
846                 "name", "xmpp.jingle.content.description.payload-type.name", FT_STRING, BASE_NONE, NULL, 0x0,
847                 "iq jingle content description payload-type name", HFILL
848             }},
849             { &hf_xmpp_jingle_cont_desc_payload_ptime,
850             {
851                 "ptime", "xmpp.jingle.content.description.payload-type.ptime", FT_STRING, BASE_NONE, NULL, 0x0,
852                 "iq jingle content description payload-type ptime", HFILL
853             }},
854             { &hf_xmpp_jingle_cont_desc_payload_param,
855             {
856                 "PARAMETER", "xmpp.jingle.content.description.payload-type.parameter", FT_NONE, BASE_NONE, NULL, 0x0,
857                 "iq jingle content description payload-type parameter", HFILL
858             }},
859             { &hf_xmpp_jingle_cont_desc_payload_param_name,
860             {
861                 "name", "xmpp.jingle.content.description.payload-type.parameter.name", FT_STRING, BASE_NONE, NULL, 0x0,
862                 "iq jingle content description payload-type parameter name", HFILL
863             }},
864             { &hf_xmpp_jingle_cont_desc_payload_param_value,
865             {
866                 "value", "xmpp.jingle.content.description.payload-type.parameter.value", FT_STRING, BASE_NONE, NULL, 0x0,
867                 "iq jingle content description payload-type parameter value", HFILL
868             }},
869             { &hf_xmpp_jingle_cont_trans,
870             {
871                 "TRANSPORT", "xmpp.jingle.content.transport", FT_NONE, BASE_NONE, NULL, 0x0,
872                 "iq jingle content transport", HFILL
873             }},
874             { &hf_xmpp_jingle_cont_trans_ufrag,
875             {
876                 "ufrag", "xmpp.jingle.content.transport.ufrag", FT_STRING, BASE_NONE, NULL, 0x0,
877                 "iq jingle content transport ufrag", HFILL
878             }},
879             { &hf_xmpp_jingle_cont_trans_pwd,
880             {
881                 "pwd", "xmpp.jingle.content.transport.pwd", FT_STRING, BASE_NONE, NULL, 0x0,
882                 "iq jingle content transport pwd", HFILL
883             }},
884             { &hf_xmpp_jingle_cont_trans_cand,
885             {
886                 "CANDIDATE", "xmpp.jingle.content.transport.candidate", FT_NONE, BASE_NONE, NULL, 0x0,
887                 "iq jingle content transport candidate", HFILL
888             }},
889             { &hf_xmpp_jingle_cont_trans_rem_cand,
890             {
891                 "REMOTE-CANDIDATE", "xmpp.jingle.content.transport.remote-candidate", FT_NONE, BASE_NONE, NULL, 0x0,
892                 "iq jingle content transport remote-candidate", HFILL
893             }},
894             { &hf_xmpp_jingle_cont_trans_activated,
895             {
896                 "ACTIVATED", "xmpp.jingle.content.transport.activated", FT_NONE, BASE_NONE, NULL, 0x0,
897                 "urn:xmpp:jingle:transports:s5b:1 activated", HFILL
898             }},
899             { &hf_xmpp_jingle_cont_trans_candidate_used,
900             {
901                 "CANDIDATE-USED", "xmpp.jingle.content.transport.candidate-used", FT_NONE, BASE_NONE, NULL, 0x0,
902                 "urn:xmpp:jingle:transports:s5b:1 candidate-used", HFILL
903             }},
904             { &hf_xmpp_jingle_cont_trans_candidate_error,
905             {
906                 "CANDIDATE-ERROR", "xmpp.jingle.content.transport.candidate-error", FT_NONE, BASE_NONE, NULL, 0x0,
907                 "urn:xmpp:jingle:transports:s5b:1 candidate-error", HFILL
908             }},
909              { &hf_xmpp_jingle_cont_trans_proxy_error,
910             {
911                 "PROXY-ERROR", "xmpp.jingle.content.transport.proxy-error", FT_NONE, BASE_NONE, NULL, 0x0,
912                 "urn:xmpp:jingle:transports:s5b:1 proxy-error", HFILL
913             }},
914             { &hf_xmpp_jingle_cont_desc_enc,
915             {
916                 "ENCRYPTION", "xmpp.jingle.content.description.encryption", FT_NONE, BASE_NONE, NULL, 0x0,
917                 "iq jingle content descryption encryption", HFILL
918             }},
919             { &hf_xmpp_jingle_cont_desc_enc_zrtp_hash,
920             {
921                 "ZRTP-HASH", "xmpp.jingle.content.description.encryption.zrtp-hash", FT_NONE, BASE_NONE, NULL, 0x0,
922                 "iq jingle content descryption encryption zrtp-hash", HFILL
923             }},
924             { &hf_xmpp_jingle_cont_desc_enc_crypto,
925             {
926                 "CRYPTO", "xmpp.jingle.content.description.encryption.crypto", FT_NONE, BASE_NONE, NULL, 0x0,
927                 "iq jingle content descryption encryption crypto", HFILL
928             }},
929             { &hf_xmpp_jingle_cont_desc_bandwidth,
930             {
931                 "BANDWIDTH", "xmpp.jingle.content.description.bandwidth", FT_NONE, BASE_NONE, NULL, 0x0,
932                 "iq jingle content descryption bandwidth", HFILL
933             }},
934             { &hf_xmpp_jingle_cont_desc_rtp_hdr,
935             {
936                 "RTP-HDREXT", "xmpp.jingle.content.description.rtp-hdrext", FT_NONE, BASE_NONE, NULL, 0x0,
937                 "iq jingle content descryption rtp-hdrext", HFILL
938             }},
939             { &hf_xmpp_jingle_reason,
940             {
941                 "REASON", "xmpp.jingle.reason", FT_NONE, BASE_NONE, NULL, 0x0,
942                 "iq jingle reason", HFILL
943             }},
944             { &hf_xmpp_jingle_reason_condition,
945             {
946                 "CONDITION", "xmpp.jingle.reason.condition", FT_STRING, BASE_NONE, NULL, 0x0,
947                 "iq jingle reason condition", HFILL
948             }},
949             { &hf_xmpp_jingle_reason_text,
950             {
951                 "TEXT", "xmpp.jingle.reason.text", FT_STRING, BASE_NONE, NULL, 0x0,
952                 "iq jingle reason text", HFILL
953             }},
954             { &hf_xmpp_jingle_rtp_info,
955             {
956                 "RTP-INFO", "xmpp.jingle.rtp_info", FT_STRING, BASE_NONE, NULL, 0x0,
957                 "iq jingle rtp-info(ringing, active, hold, mute, ...)", HFILL
958             }},
959             { &hf_xmpp_jingle_file_transfer_offer,
960             {
961                 "OFFER", "xmpp.jingle.content.description.offer", FT_NONE, BASE_NONE, NULL, 0x0,
962                 "urn:xmpp:jingle:apps:file-transfer:3 offer", HFILL
963             }},
964             { &hf_xmpp_jingle_file_transfer_request,
965             {
966                 "REQUEST", "xmpp.jingle.content.description.request", FT_NONE, BASE_NONE, NULL, 0x0,
967                 "urn:xmpp:jingle:apps:file-transfer:3 request", HFILL
968             }},
969             { &hf_xmpp_jingle_file_transfer_received,
970             {
971                 "RECEIVED", "xmpp.jingle.content.received", FT_NONE, BASE_NONE, NULL, 0x0,
972                 "urn:xmpp:jingle:apps:file-transfer:3 received", HFILL
973             }},
974             { &hf_xmpp_jingle_file_transfer_abort,
975             {
976                 "ABORT", "xmpp.jingle.content.abort", FT_NONE, BASE_NONE, NULL, 0x0,
977                 "urn:xmpp:jingle:apps:file-transfer:3 abort", HFILL
978             }},
979             { &hf_xmpp_jingle_file_transfer_checksum,
980             {
981                 "CHECKSUM", "xmpp.jingle.content.checksum", FT_NONE, BASE_NONE, NULL, 0x0,
982                 "urn:xmpp:jingle:apps:file-transfer:3 checksum", HFILL
983             }},
984             { &hf_xmpp_si,
985             {
986                 "SI", "xmpp.si", FT_NONE, BASE_NONE, NULL, 0x0,
987                 "iq si", HFILL
988             }},
989             { &hf_xmpp_si_file,
990             {
991                 "FILE", "xmpp.si.file", FT_NONE, BASE_NONE, NULL, 0x0,
992                 "iq si file", HFILL
993             }},
994             { &hf_xmpp_iq_feature_neg,
995             {
996                 "FEATURE", "xmpp.feature-neg", FT_NONE, BASE_NONE, NULL, 0x0,
997                 "http://jabber.org/protocol/feature-neg", HFILL
998             }},
999             { &hf_xmpp_x_data,
1000             {
1001                 "X-DATA", "xmpp.x-data", FT_NONE, BASE_NONE, NULL, 0x0,
1002                 "jabber:x:data", HFILL
1003             }},
1004             { &hf_xmpp_x_data_field,
1005             {
1006                 "FIELD", "xmpp.x-data.field", FT_NONE, BASE_NONE, NULL, 0x0,
1007                 "jabber:x:data field", HFILL
1008             }},
1009             { &hf_xmpp_x_data_field_value,
1010             {
1011                 "VALUE", "xmpp.x-data.field.value", FT_NONE, BASE_NONE, NULL, 0x0,
1012                 "jabber:x:data field value", HFILL
1013             }},
1014             { &hf_xmpp_delay,
1015             {
1016                 "DELAY", "xmpp.delay", FT_NONE, BASE_NONE, NULL, 0x0,
1017                 "urn:xmpp:delay", HFILL
1018             }},
1019             { &hf_xmpp_x_event,
1020             {
1021                 "X EVENT", "xmpp.x-event", FT_NONE, BASE_NONE, NULL, 0x0,
1022                 "jabber:x:event", HFILL
1023             }},
1024             { &hf_xmpp_x_event_condition,
1025             {
1026                 "CONDITION", "xmpp.x-event.condition", FT_STRING, BASE_NONE, NULL, 0x0,
1027                 "jabber:x:event condition", HFILL
1028             }},
1029             { &hf_xmpp_presence,
1030             {
1031                 "PRESENCE", "xmpp.presence", FT_NONE, BASE_NONE, NULL, 0x0,
1032                 "presence packet", HFILL
1033             }},
1034             { &hf_xmpp_presence_show,
1035             {
1036                 "SHOW", "xmpp.presence.show", FT_STRING, BASE_NONE, NULL, 0x0,
1037                 "presence show", HFILL
1038             }},
1039             { &hf_xmpp_presence_status,
1040             {
1041                 "STATUS", "xmpp.presence.status", FT_NONE, BASE_NONE, NULL, 0x0,
1042                 "presence status", HFILL
1043             }},
1044             { &hf_xmpp_presence_caps,
1045             {
1046                 "CAPS", "xmpp.presence.caps", FT_NONE, BASE_NONE, NULL, 0x0,
1047                 "presence caps", HFILL
1048             }},
1049             { &hf_xmpp_message,
1050             {
1051                 "MESSAGE", "xmpp.message", FT_NONE, BASE_NONE, NULL, 0x0,
1052                 "message packet", HFILL
1053             }},
1054             { &hf_xmpp_message_chatstate,
1055             {
1056                 "CHATSTATE", "xmpp.message.chatstate", FT_STRING, BASE_NONE, NULL, 0x0,
1057                 "message chatstate", HFILL
1058             }},
1059             { &hf_xmpp_message_thread,
1060             {
1061                 "THREAD", "xmpp.message.thread", FT_NONE, BASE_NONE, NULL, 0x0,
1062                 "message thread", HFILL
1063             }},
1064             { &hf_xmpp_message_body,
1065             {
1066                 "BODY", "xmpp.message.body", FT_NONE, BASE_NONE, NULL, 0x0,
1067                 "message body", HFILL
1068             }},
1069              { &hf_xmpp_message_subject,
1070             {
1071                 "SUBJECT", "xmpp.message.subject", FT_NONE, BASE_NONE, NULL, 0x0,
1072                 "message subject", HFILL
1073             }},
1074             { &hf_xmpp_message_thread_parent,
1075             {
1076                 "parent", "xmpp.message.thread.parent", FT_STRING, BASE_NONE, NULL, 0x0,
1077                 "message thread parent", HFILL
1078             }},
1079             { &hf_xmpp_auth,
1080             {
1081                 "AUTH", "xmpp.auth", FT_NONE, BASE_NONE, NULL, 0x0,
1082                 "auth packet", HFILL
1083             }},
1084             { &hf_xmpp_stream,
1085             {
1086                 "STREAM", "xmpp.stream", FT_NONE, BASE_NONE, NULL, 0x0,
1087                 "XMPP stream", HFILL
1088             }},
1089             { &hf_xmpp_challenge,
1090             {
1091                 "CHALLENGE", "xmpp.challenge", FT_NONE, BASE_NONE, NULL, 0x0,
1092                 "challenge packet", HFILL
1093             }},
1094             { &hf_xmpp_response,
1095             {
1096                 "RESPONSE", "xmpp.response", FT_NONE, BASE_NONE, NULL, 0x0,
1097                 "response packet", HFILL
1098             }},
1099             { &hf_xmpp_success,
1100             {
1101                 "SUCCESS", "xmpp.success", FT_NONE, BASE_NONE, NULL, 0x0,
1102                 "success packet", HFILL
1103             }},
1104             { &hf_xmpp_failure,
1105             {
1106                 "FAILURE", "xmpp.failure", FT_NONE, BASE_NONE, NULL, 0x0,
1107                 "failure packet", HFILL
1108             }},
1109             { &hf_xmpp_features,
1110             {
1111                 "FEATURES", "xmpp.features", FT_NONE, BASE_NONE, NULL, 0x0,
1112                 "stream features", HFILL
1113             }},
1114             { &hf_xmpp_starttls,
1115             {
1116                 "STARTTLS", "xmpp.starttls", FT_NONE, BASE_NONE, NULL, 0x0,
1117                 "starttls packet", HFILL
1118             }},
1119             { &hf_xmpp_proceed,
1120             {
1121                 "PROCEED", "xmpp.proceed", FT_NONE, BASE_NONE, NULL, 0x0,
1122                 "proceed packet", HFILL
1123             }},
1124             { &hf_xmpp_unknown,
1125             {
1126                 "UNKNOWN", "xmpp.unknown", FT_STRING, BASE_NONE, NULL, 0x0,
1127                 "unknown element", HFILL
1128             }},
1129             { &hf_xmpp_unknown_attr,
1130             {
1131                 "UNKNOWN ATTR", "xmpp.unknown_attr", FT_STRING, BASE_NONE, NULL, 0x0,
1132                 "unknown attribute", HFILL
1133             }},
1134             { &hf_xmpp_ibb_open,
1135             {
1136                 "IBB-OPEN", "xmpp.ibb.open", FT_NONE, BASE_NONE, NULL, 0x0,
1137                 "xmpp ibb open", HFILL
1138             }},
1139             { &hf_xmpp_ibb_close,
1140             {
1141                 "IBB-CLOSE", "xmpp.ibb.close", FT_NONE, BASE_NONE, NULL, 0x0,
1142                 "xmpp ibb close", HFILL
1143             }},
1144             { &hf_xmpp_ibb_data,
1145             {
1146                 "IBB-DATA", "xmpp.ibb.data", FT_NONE, BASE_NONE, NULL, 0x0,
1147                 "xmpp ibb data", HFILL
1148             }},
1149             { &hf_xmpp_muc_x,
1150             {
1151                 "X MUC", "xmpp.muc-x", FT_NONE, BASE_NONE, NULL, 0x0,
1152                 "http://jabber.org/protocol/muc", HFILL
1153             }},
1154             { &hf_xmpp_muc_user_x,
1155             {
1156                 "X MUC-USER", "xmpp.muc-user-x", FT_NONE, BASE_NONE, NULL, 0x0,
1157                 "http://jabber.org/protocol/muc#user", HFILL
1158             }},
1159             { &hf_xmpp_muc_user_item,
1160             {
1161                 "ITEM", "xmpp.muc-user-x.item", FT_NONE, BASE_NONE, NULL, 0x0,
1162                 "muc#user item", HFILL
1163             }},
1164             { &hf_xmpp_muc_user_invite,
1165             {
1166                 "INVITE", "xmpp.muc-user-x.invite", FT_NONE, BASE_NONE, NULL, 0x0,
1167                 "muc#user invite", HFILL
1168             }},
1169             { &hf_xmpp_gtalk_session,
1170             {
1171                 "GTALK-SESSION", "xmpp.gtalk.session", FT_NONE, BASE_NONE, NULL, 0x0,
1172                 "GTalk session", HFILL
1173             }},
1174             { &hf_xmpp_gtalk_session_type,
1175             {
1176                 "type", "xmpp.gtalk.session.type", FT_STRING, BASE_NONE, NULL, 0x0,
1177                 "GTalk session type", HFILL
1178             }},
1179             { &hf_xmpp_gtalk,
1180             {
1181                 "GTALK SESSION", "xmpp.gtalk", FT_STRING, BASE_NONE, NULL, 0x0,
1182                 "GTalk SID", HFILL
1183             }},
1184             { &hf_xmpp_gtalk_setting,
1185             {
1186                 "USERSETTING", "xmpp.gtalk.setting", FT_NONE, BASE_NONE, NULL, 0x0,
1187                 "google:setting usersetting", HFILL
1188             }},
1189             { &hf_xmpp_gtalk_nosave_x,
1190             {
1191                 "X-NOSAVE", "xmpp.gtalk.nosave.x", FT_NONE, BASE_NONE, NULL, 0x0,
1192                 "google:nosave x", HFILL
1193             }},
1194             { &hf_xmpp_gtalk_mail_mailbox,
1195             {
1196                 "MAILBOX", "xmpp.gtalk.mailbox", FT_NONE, BASE_NONE, NULL, 0x0,
1197                 "google:mail:notify mailbox", HFILL
1198             }},
1199             { &hf_xmpp_gtalk_mail_new_mail,
1200             {
1201                 "NEW MAIL", "xmpp.gtalk.new-mail", FT_NONE, BASE_NONE, NULL, 0x0,
1202                 "google:mail:notify new-mail", HFILL
1203             }},
1204             { &hf_xmpp_gtalk_transport_p2p,
1205             {
1206                 "TRANSPORT", "xmpp.gtalk.transport-p2p", FT_NONE, BASE_NONE, NULL, 0x0,
1207                 "google/transport/p2p", HFILL
1208             }},
1209             { &hf_xmpp_conf_info,
1210             {
1211                 "CONFERENCE INFO", "xmpp.conf-info", FT_NONE, BASE_NONE, NULL, 0x0,
1212                 "urn:ietf:params:xml:ns:conference-info", HFILL
1213             }},
1214              { &hf_xmpp_conf_info_sid,
1215             {
1216                 "sid", "xmpp.conf-info.sid", FT_STRING, BASE_NONE, NULL, 0x0,
1217                 "urn:ietf:params:xml:ns:conference-info sid", HFILL
1218             }},
1219             { &hf_xmpp_response_in,
1220                 { "Response In", "xmpp.response_in",
1221                 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1222                 "The response to this request is in this frame", HFILL }
1223             },
1224             { &hf_xmpp_response_to,
1225                 { "Request In", "xmpp.response_to",
1226                 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
1227                 "This is a response to the request in this frame", HFILL }
1228             },
1229             { &hf_xmpp_out,
1230             {
1231                 "Out", "xmpp.out", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1232                 "Outgoing packet", HFILL
1233             }},
1234             { &hf_xmpp_in,
1235             {
1236                 "In", "xmpp.in", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1237                 "Ingoing packet", HFILL
1238             }},
1239             { &hf_xmpp_ibb,
1240             {
1241                 "IBB SESSION", "xmpp.ibb", FT_STRING, BASE_NONE, NULL, 0x0,
1242                 "In-Band Bytestreams session", HFILL
1243             }},
1244             { &hf_xmpp_jingle_session,
1245             {
1246                 "JINGLE SESSION", "xmpp.jingle_session", FT_STRING, BASE_NONE, NULL, 0x0,
1247                 "Jingle SID", HFILL
1248             }},
1249             { &hf_xmpp_ping,
1250             {
1251                 "PING", "xmpp.ping", FT_NONE, BASE_NONE, NULL, 0x0,
1252                 "urn:xmpp:ping", HFILL
1253             }},
1254             { &hf_xmpp_hashes,
1255             {
1256                 "HASHES", "xmpp.hashes", FT_NONE, BASE_NONE, NULL, 0x0,
1257                 "urn:xmpp:hashes:0", HFILL
1258             }},
1259             { &hf_xmpp_jitsi_inputevt,
1260             {
1261                 "INPUTEVT", "xmpp.inputevt", FT_NONE, BASE_NONE, NULL, 0x0,
1262                 "http://jitsi.org/protocol/inputevt", HFILL
1263             }},
1264             { &hf_xmpp_jitsi_inputevt_rmt_ctrl,
1265             {
1266                 "REMOTE-CONTROL", "xmpp.inputevt.remote-control", FT_NONE, BASE_NONE, NULL, 0x0,
1267                 "http://jitsi.org/protocol/inputevt remote-control", HFILL
1268             }},
1269     };
1270
1271     static gint * ett[] = {
1272         &ett_xmpp,
1273         &ett_xmpp_iq,
1274         &ett_xmpp_query,
1275         &ett_xmpp_query_item,
1276         &ett_xmpp_query_identity,
1277         &ett_xmpp_query_feature,
1278         &ett_xmpp_query_streamhost,
1279         &ett_xmpp_query_streamhost_used,
1280         &ett_xmpp_query_udpsuccess,
1281         &ett_xmpp_iq_error,
1282         &ett_xmpp_iq_bind,
1283         &ett_xmpp_iq_session,
1284         &ett_xmpp_vcard,
1285         &ett_xmpp_vcard_x_update,
1286         &ett_xmpp_jingle,
1287         &ett_xmpp_jingle_content,
1288         &ett_xmpp_jingle_content_description,
1289         &ett_xmpp_jingle_cont_desc_payload,
1290         &ett_xmpp_jingle_cont_desc_payload_param,
1291         &ett_xmpp_jingle_cont_desc_enc,
1292         &ett_xmpp_jingle_cont_desc_enc_zrtp_hash,
1293         &ett_xmpp_jingle_cont_desc_enc_crypto,
1294         &ett_xmpp_jingle_cont_desc_bandwidth,
1295         &ett_xmpp_jingle_cont_desc_rtp_hdr,
1296         &ett_xmpp_jingle_cont_trans,
1297         &ett_xmpp_jingle_cont_trans_cand,
1298         &ett_xmpp_jingle_cont_trans_rem_cand,
1299         &ett_xmpp_jingle_reason,
1300         &ett_xmpp_jingle_rtp_info,
1301         &ett_xmpp_services,
1302         &ett_xmpp_services_relay,
1303         &ett_xmpp_channel,
1304         &ett_xmpp_si,
1305         &ett_xmpp_si_file,
1306         &ett_xmpp_si_file_range,
1307         &ett_xmpp_iq_feature_neg,
1308         &ett_xmpp_x_data,
1309         &ett_xmpp_x_data_field,
1310         &ett_xmpp_x_data_field_value,
1311         &ett_xmpp_ibb_open,
1312         &ett_xmpp_ibb_close,
1313         &ett_xmpp_ibb_data,
1314         &ett_xmpp_delay,
1315         &ett_xmpp_x_event,
1316         &ett_xmpp_message,
1317         &ett_xmpp_message_thread,
1318         &ett_xmpp_message_subject,
1319         &ett_xmpp_message_body,
1320         &ett_xmpp_presence,
1321         &ett_xmpp_presence_status,
1322         &ett_xmpp_presence_caps,
1323         &ett_xmpp_auth,
1324         &ett_xmpp_challenge,
1325         &ett_xmpp_response,
1326         &ett_xmpp_success,
1327         &ett_xmpp_failure,
1328         &ett_xmpp_muc_x,
1329         &ett_xmpp_muc_hist,
1330         &ett_xmpp_muc_user_x,
1331         &ett_xmpp_muc_user_item,
1332         &ett_xmpp_muc_user_invite,
1333         &ett_xmpp_gtalk_session,
1334         &ett_xmpp_gtalk_session_desc,
1335         &ett_xmpp_gtalk_session_desc_payload,
1336         &ett_xmpp_gtalk_session_cand,
1337         &ett_xmpp_gtalk_session_reason,
1338         &ett_xmpp_gtalk_jingleinfo_stun,
1339         &ett_xmpp_gtalk_jingleinfo_server,
1340         &ett_xmpp_gtalk_jingleinfo_relay,
1341         &ett_xmpp_gtalk_jingleinfo_relay_serv,
1342         &ett_xmpp_gtalk_setting,
1343         &ett_xmpp_gtalk_nosave_x,
1344         &ett_xmpp_gtalk_mail_mailbox,
1345         &ett_xmpp_gtalk_mail_mail_info,
1346         &ett_xmpp_gtalk_mail_senders,
1347         &ett_xmpp_gtalk_mail_sender,
1348         &ett_xmpp_gtalk_status_status_list,
1349         &ett_xmpp_conf_info,
1350         &ett_xmpp_conf_desc,
1351         &ett_xmpp_conf_state,
1352         &ett_xmpp_conf_users,
1353         &ett_xmpp_conf_user,
1354         &ett_xmpp_conf_endpoint,
1355         &ett_xmpp_conf_media,
1356         &ett_xmpp_gtalk_transport_p2p,
1357         &ett_xmpp_gtalk_transport_p2p_cand,
1358         &ett_xmpp_ping,
1359         &ett_xmpp_hashes_hash,
1360         &ett_xmpp_hashes,
1361         &ett_xmpp_jingle_file_transfer_offer,
1362         &ett_xmpp_jingle_file_transfer_request,
1363         &ett_xmpp_jingle_file_transfer_received,
1364         &ett_xmpp_jingle_file_transfer_abort,
1365         &ett_xmpp_jingle_file_transfer_checksum,
1366         &ett_xmpp_jingle_file_transfer_file,
1367         &ett_xmpp_jitsi_inputevt,
1368         &ett_xmpp_jitsi_inputevt_rmt_ctrl,
1369         &ett_xmpp_stream,
1370         &ett_xmpp_features,
1371         &ett_xmpp_features_mechanisms,
1372         &ett_xmpp_starttls,
1373         &ett_xmpp_proceed,
1374     };
1375
1376     module_t *xmpp_module;
1377
1378     static gint* ett_unknown_ptr[ETT_UNKNOWN_LEN];
1379     gint i;
1380     for(i=0;i<ETT_UNKNOWN_LEN;i++)
1381     {
1382         ett_unknown[i] = -1;
1383         ett_unknown_ptr[i] = &ett_unknown[i];
1384     }
1385
1386     
1387
1388     proto_xmpp = proto_register_protocol(
1389             "XMPP Protocol", /* name       */
1390             "XMPP", /* short name */
1391             "xmpp" /* abbrev     */
1392             );
1393
1394     xmpp_module = prefs_register_protocol(proto_xmpp, NULL);
1395     prefs_register_bool_preference(xmpp_module, "desegment",
1396             "Reasemble XMPP messages",
1397             "Whether the XMPP dissector should reassemble messages. "
1398             "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings",
1399             &xmpp_desegment);
1400
1401     proto_register_field_array(proto_xmpp, hf, array_length(hf));
1402     proto_register_subtree_array(ett, array_length(ett));
1403     proto_register_subtree_array(ett_unknown_ptr, array_length(ett_unknown_ptr));
1404
1405     register_dissector("xmpp", dissect_xmpp, proto_xmpp);
1406 }
1407
1408 void
1409 proto_reg_handoff_xmpp(void) {
1410     static dissector_handle_t xmpp_handle;
1411
1412     xml_handle = find_dissector("xml");
1413
1414     /*xmpp_handle = create_dissector_handle(dissect_xmpp, proto_xmpp);*/
1415     xmpp_handle = find_dissector("xmpp");
1416
1417     dissector_add_uint("tcp.port", XMPP_PORT, xmpp_handle);
1418
1419 }
1420 /*
1421 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1422 *
1423 * Local variables:
1424 * c-basic-offset: 4
1425 * tab-width: 8
1426 * indent-tabs-mode: nil
1427 * End:
1428 *
1429 * ex: set shiftwidth=4 tabstop=8 expandtab:
1430 * :indentSize=4:tabSize=8:noTabs=true:
1431 */