Implement some of the minor possible speed improvment patches.
[metze/wireshark/wip.git] / epan / dissectors / packet-amqp.c
1 /* packet-amqp.c
2  *
3  * AMQP v0-9 Wireshark dissector plug-in
4  *
5  * Author: Martin Sustrik <sustrik@imatix.com>
6  *
7  * Copyright (c) 1996-2007 iMatix Corporation
8  *
9  * $Id$
10  *
11  * Wireshark - Network traffic analyzer
12  * By Gerald Combs <gerald@wireshark.org>
13  * Copyright 1998 Gerald Combs
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #    include "config.h"
32 #endif
33
34 #include <gmodule.h>
35 #include <glib.h>
36 #include <epan/packet.h>
37 #include <epan/emem.h>
38 #include <epan/dissectors/packet-tcp.h>
39 #include <epan/prefs.h>
40
41 /*  Generic data  */
42
43 static int amqp_port = 5672;
44
45 /*  Generic defines  */
46
47 #define AMQP_INCREMENT(offset, addend, bound) {\
48     int tmp;\
49     tmp = offset;\
50     offset += (addend);\
51     DISSECTOR_ASSERT(offset >= tmp && offset <= bound);\
52 }
53
54 #define AMQP_FRAME_TYPE_METHOD                                    1
55 #define AMQP_FRAME_TYPE_CONTENT_HEADER                            2
56 #define AMQP_FRAME_TYPE_CONTENT_BODY                              3
57 #define AMQP_FRAME_TYPE_OOB_METHOD                                4
58 #define AMQP_FRAME_TYPE_OOB_CONTENT_HEADER                        5
59 #define AMQP_FRAME_TYPE_OOB_CONTENT_BODY                          6
60 #define AMQP_FRAME_TYPE_TRACE                                     7
61 #define AMQP_FRAME_TYPE_HEARTBEAT                                 8
62
63 #define AMQP_CLASS_CONNECTION                                     10
64 #define AMQP_CLASS_CHANNEL                                        20
65 #define AMQP_CLASS_ACCESS                                         30
66 #define AMQP_CLASS_EXCHANGE                                       40
67 #define AMQP_CLASS_QUEUE                                          50
68 #define AMQP_CLASS_BASIC                                          60
69 #define AMQP_CLASS_FILE                                           70
70 #define AMQP_CLASS_STREAM                                         80
71 #define AMQP_CLASS_TX                                             90
72 #define AMQP_CLASS_DTX                                            100
73 #define AMQP_CLASS_TUNNEL                                         110
74
75 #define AMQP_METHOD_CONNECTION_START                              10
76 #define AMQP_METHOD_CONNECTION_START_OK                           11
77 #define AMQP_METHOD_CONNECTION_SECURE                             20
78 #define AMQP_METHOD_CONNECTION_SECURE_OK                          21
79 #define AMQP_METHOD_CONNECTION_TUNE                               30
80 #define AMQP_METHOD_CONNECTION_TUNE_OK                            31
81 #define AMQP_METHOD_CONNECTION_OPEN                               40
82 #define AMQP_METHOD_CONNECTION_OPEN_OK                            41
83 #define AMQP_METHOD_CONNECTION_REDIRECT                           42
84 #define AMQP_METHOD_CONNECTION_CLOSE                              50
85 #define AMQP_METHOD_CONNECTION_CLOSE_OK                           51
86
87 #define AMQP_METHOD_CHANNEL_OPEN                                  10
88 #define AMQP_METHOD_CHANNEL_OPEN_OK                               11
89 #define AMQP_METHOD_CHANNEL_FLOW                                  20
90 #define AMQP_METHOD_CHANNEL_FLOW_OK                               21
91 #define AMQP_METHOD_CHANNEL_CLOSE                                 40
92 #define AMQP_METHOD_CHANNEL_CLOSE_OK                              41
93 #define AMQP_METHOD_CHANNEL_RESUME                                50
94 #define AMQP_METHOD_CHANNEL_PING                                  60
95 #define AMQP_METHOD_CHANNEL_PONG                                  70
96 #define AMQP_METHOD_CHANNEL_OK                                    80
97
98 #define AMQP_METHOD_ACCESS_REQUEST                                10
99 #define AMQP_METHOD_ACCESS_REQUEST_OK                             11
100
101 #define AMQP_METHOD_EXCHANGE_DECLARE                              10
102 #define AMQP_METHOD_EXCHANGE_DECLARE_OK                           11
103 #define AMQP_METHOD_EXCHANGE_DELETE                               20
104 #define AMQP_METHOD_EXCHANGE_DELETE_OK                            21
105
106 #define AMQP_METHOD_QUEUE_DECLARE                                 10
107 #define AMQP_METHOD_QUEUE_DECLARE_OK                              11
108 #define AMQP_METHOD_QUEUE_BIND                                    20
109 #define AMQP_METHOD_QUEUE_BIND_OK                                 21
110 #define AMQP_METHOD_QUEUE_UNBIND                                  50
111 #define AMQP_METHOD_QUEUE_UNBIND_OK                               51
112 #define AMQP_METHOD_QUEUE_PURGE                                   30
113 #define AMQP_METHOD_QUEUE_PURGE_OK                                31
114 #define AMQP_METHOD_QUEUE_DELETE                                  40
115 #define AMQP_METHOD_QUEUE_DELETE_OK                               41
116
117 #define AMQP_METHOD_BASIC_QOS                                     10
118 #define AMQP_METHOD_BASIC_QOS_OK                                  11
119 #define AMQP_METHOD_BASIC_CONSUME                                 20
120 #define AMQP_METHOD_BASIC_CONSUME_OK                              21
121 #define AMQP_METHOD_BASIC_CANCEL                                  30
122 #define AMQP_METHOD_BASIC_CANCEL_OK                               31
123 #define AMQP_METHOD_BASIC_PUBLISH                                 40
124 #define AMQP_METHOD_BASIC_RETURN                                  50
125 #define AMQP_METHOD_BASIC_DELIVER                                 60
126 #define AMQP_METHOD_BASIC_GET                                     70
127 #define AMQP_METHOD_BASIC_GET_OK                                  71
128 #define AMQP_METHOD_BASIC_GET_EMPTY                               72
129 #define AMQP_METHOD_BASIC_ACK                                     80
130 #define AMQP_METHOD_BASIC_REJECT                                  90
131 #define AMQP_METHOD_BASIC_RECOVER                                 100
132
133 #define AMQP_METHOD_FILE_QOS                                      10
134 #define AMQP_METHOD_FILE_QOS_OK                                   11
135 #define AMQP_METHOD_FILE_CONSUME                                  20
136 #define AMQP_METHOD_FILE_CONSUME_OK                               21
137 #define AMQP_METHOD_FILE_CANCEL                                   30
138 #define AMQP_METHOD_FILE_CANCEL_OK                                31
139 #define AMQP_METHOD_FILE_OPEN                                     40
140 #define AMQP_METHOD_FILE_OPEN_OK                                  41
141 #define AMQP_METHOD_FILE_STAGE                                    50
142 #define AMQP_METHOD_FILE_PUBLISH                                  60
143 #define AMQP_METHOD_FILE_RETURN                                   70
144 #define AMQP_METHOD_FILE_DELIVER                                  80
145 #define AMQP_METHOD_FILE_ACK                                      90
146 #define AMQP_METHOD_FILE_REJECT                                   100
147
148 #define AMQP_METHOD_STREAM_QOS                                    10
149 #define AMQP_METHOD_STREAM_QOS_OK                                 11
150 #define AMQP_METHOD_STREAM_CONSUME                                20
151 #define AMQP_METHOD_STREAM_CONSUME_OK                             21
152 #define AMQP_METHOD_STREAM_CANCEL                                 30
153 #define AMQP_METHOD_STREAM_CANCEL_OK                              31
154 #define AMQP_METHOD_STREAM_PUBLISH                                40
155 #define AMQP_METHOD_STREAM_RETURN                                 50
156 #define AMQP_METHOD_STREAM_DELIVER                                60
157
158 #define AMQP_METHOD_TX_SELECT                                     10
159 #define AMQP_METHOD_TX_SELECT_OK                                  11
160 #define AMQP_METHOD_TX_COMMIT                                     20
161 #define AMQP_METHOD_TX_COMMIT_OK                                  21
162 #define AMQP_METHOD_TX_ROLLBACK                                   30
163 #define AMQP_METHOD_TX_ROLLBACK_OK                                31
164
165 #define AMQP_METHOD_DTX_SELECT                                    10
166 #define AMQP_METHOD_DTX_SELECT_OK                                 11
167 #define AMQP_METHOD_DTX_START                                     20
168 #define AMQP_METHOD_DTX_START_OK                                  21
169
170 #define AMQP_METHOD_TUNNEL_REQUEST                                10
171
172 /*  Registration functions for the dissector  */
173
174 void
175 proto_register_amqp(void);
176
177 void
178 proto_reg_handoff_amqp(void);
179
180 /*  Private functions  */
181
182 static void
183 dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
184
185 static guint
186 get_amqp_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
187
188 static void
189 dissect_amqp_field_table(tvbuff_t *tvb, int offset, int bound, size_t length, proto_item *item);
190
191 static void
192 dissect_amqp_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
193
194 static size_t
195 dissect_amqp_method_connection_start(tvbuff_t *tvb,
196     int offset, int bound, proto_tree *args_tree);
197
198 static size_t
199 dissect_amqp_method_connection_start_ok(tvbuff_t *tvb,
200     int offset, int bound, proto_tree *args_tree);
201
202 static size_t
203 dissect_amqp_method_connection_secure(tvbuff_t *tvb,
204     int offset, int bound, proto_tree *args_tree);
205
206 static size_t
207 dissect_amqp_method_connection_secure_ok(tvbuff_t *tvb,
208     int offset, int bound, proto_tree *args_tree);
209
210 static size_t
211 dissect_amqp_method_connection_tune(tvbuff_t *tvb,
212     int offset, int bound, proto_tree *args_tree);
213
214 static size_t
215 dissect_amqp_method_connection_tune_ok(tvbuff_t *tvb,
216     int offset, int bound, proto_tree *args_tree);
217
218 static size_t
219 dissect_amqp_method_connection_open(tvbuff_t *tvb,
220     int offset, int bound, proto_tree *args_tree);
221
222 static size_t
223 dissect_amqp_method_connection_open_ok(tvbuff_t *tvb,
224     int offset, int bound, proto_tree *args_tree);
225
226 static size_t
227 dissect_amqp_method_connection_redirect(tvbuff_t *tvb,
228     int offset, int bound, proto_tree *args_tree);
229
230 static size_t
231 dissect_amqp_method_connection_close(tvbuff_t *tvb,
232     int offset, int bound, proto_tree *args_tree);
233
234 static size_t
235 dissect_amqp_method_connection_close_ok(tvbuff_t *tvb,
236     int offset, int bound, proto_tree *args_tree);
237
238 static size_t
239 dissect_amqp_method_channel_open(tvbuff_t *tvb,
240     int offset, int bound, proto_tree *args_tree);
241
242 static size_t
243 dissect_amqp_method_channel_open_ok(tvbuff_t *tvb,
244     int offset, int bound, proto_tree *args_tree);
245
246 static size_t
247 dissect_amqp_method_channel_flow(tvbuff_t *tvb,
248     int offset, int bound, proto_tree *args_tree);
249
250 static size_t
251 dissect_amqp_method_channel_flow_ok(tvbuff_t *tvb,
252     int offset, int bound, proto_tree *args_tree);
253
254 static size_t
255 dissect_amqp_method_channel_close(tvbuff_t *tvb,
256     int offset, int bound, proto_tree *args_tree);
257
258 static size_t
259 dissect_amqp_method_channel_close_ok(tvbuff_t *tvb,
260     int offset, int bound, proto_tree *args_tree);
261
262 static size_t
263 dissect_amqp_method_channel_resume(tvbuff_t *tvb,
264     int offset, int bound, proto_tree *args_tree);
265
266 static size_t
267 dissect_amqp_method_channel_ping(tvbuff_t *tvb,
268     int offset, int bound, proto_tree *args_tree);
269
270 static size_t
271 dissect_amqp_method_channel_pong(tvbuff_t *tvb,
272     int offset, int bound, proto_tree *args_tree);
273
274 static size_t
275 dissect_amqp_method_channel_ok(tvbuff_t *tvb,
276     int offset, int bound, proto_tree *args_tree);
277
278 static size_t
279 dissect_amqp_method_access_request(tvbuff_t *tvb,
280     int offset, int bound, proto_tree *args_tree);
281
282 static size_t
283 dissect_amqp_method_access_request_ok(tvbuff_t *tvb,
284     int offset, int bound, proto_tree *args_tree);
285
286 static size_t
287 dissect_amqp_method_exchange_declare(tvbuff_t *tvb,
288     int offset, int bound, proto_tree *args_tree);
289
290 static size_t
291 dissect_amqp_method_exchange_declare_ok(tvbuff_t *tvb,
292     int offset, int bound, proto_tree *args_tree);
293
294 static size_t
295 dissect_amqp_method_exchange_delete(tvbuff_t *tvb,
296     int offset, int bound, proto_tree *args_tree);
297
298 static size_t
299 dissect_amqp_method_exchange_delete_ok(tvbuff_t *tvb,
300     int offset, int bound, proto_tree *args_tree);
301
302 static size_t
303 dissect_amqp_method_queue_declare(tvbuff_t *tvb,
304     int offset, int bound, proto_tree *args_tree);
305
306 static size_t
307 dissect_amqp_method_queue_declare_ok(tvbuff_t *tvb,
308     int offset, int bound, proto_tree *args_tree);
309
310 static size_t
311 dissect_amqp_method_queue_bind(tvbuff_t *tvb,
312     int offset, int bound, proto_tree *args_tree);
313
314 static size_t
315 dissect_amqp_method_queue_bind_ok(tvbuff_t *tvb,
316     int offset, int bound, proto_tree *args_tree);
317
318 static size_t
319 dissect_amqp_method_queue_unbind(tvbuff_t *tvb,
320     int offset, int bound, proto_tree *args_tree);
321
322 static size_t
323 dissect_amqp_method_queue_unbind_ok(tvbuff_t *tvb,
324     int offset, int bound, proto_tree *args_tree);
325
326 static size_t
327 dissect_amqp_method_queue_purge(tvbuff_t *tvb,
328     int offset, int bound, proto_tree *args_tree);
329
330 static size_t
331 dissect_amqp_method_queue_purge_ok(tvbuff_t *tvb,
332     int offset, int bound, proto_tree *args_tree);
333
334 static size_t
335 dissect_amqp_method_queue_delete(tvbuff_t *tvb,
336     int offset, int bound, proto_tree *args_tree);
337
338 static size_t
339 dissect_amqp_method_queue_delete_ok(tvbuff_t *tvb,
340     int offset, int bound, proto_tree *args_tree);
341
342 static size_t
343 dissect_amqp_method_basic_qos(tvbuff_t *tvb,
344     int offset, int bound, proto_tree *args_tree);
345
346 static size_t
347 dissect_amqp_method_basic_qos_ok(tvbuff_t *tvb,
348     int offset, int bound, proto_tree *args_tree);
349
350 static size_t
351 dissect_amqp_method_basic_consume(tvbuff_t *tvb,
352     int offset, int bound, proto_tree *args_tree);
353
354 static size_t
355 dissect_amqp_method_basic_consume_ok(tvbuff_t *tvb,
356     int offset, int bound, proto_tree *args_tree);
357
358 static size_t
359 dissect_amqp_method_basic_cancel(tvbuff_t *tvb,
360     int offset, int bound, proto_tree *args_tree);
361
362 static size_t
363 dissect_amqp_method_basic_cancel_ok(tvbuff_t *tvb,
364     int offset, int bound, proto_tree *args_tree);
365
366 static size_t
367 dissect_amqp_method_basic_publish(tvbuff_t *tvb,
368     int offset, int bound, proto_tree *args_tree);
369
370 static size_t
371 dissect_amqp_method_basic_return(tvbuff_t *tvb,
372     int offset, int bound, proto_tree *args_tree);
373
374 static size_t
375 dissect_amqp_method_basic_deliver(tvbuff_t *tvb,
376     int offset, int bound, proto_tree *args_tree);
377
378 static size_t
379 dissect_amqp_method_basic_get(tvbuff_t *tvb,
380     int offset, int bound, proto_tree *args_tree);
381
382 static size_t
383 dissect_amqp_method_basic_get_ok(tvbuff_t *tvb,
384     int offset, int bound, proto_tree *args_tree);
385
386 static size_t
387 dissect_amqp_method_basic_get_empty(tvbuff_t *tvb,
388     int offset, int bound, proto_tree *args_tree);
389
390 static size_t
391 dissect_amqp_method_basic_ack(tvbuff_t *tvb,
392     int offset, int bound, proto_tree *args_tree);
393
394 static size_t
395 dissect_amqp_method_basic_reject(tvbuff_t *tvb,
396     int offset, int bound, proto_tree *args_tree);
397
398 static size_t
399 dissect_amqp_method_basic_recover(tvbuff_t *tvb,
400     int offset, int bound, proto_tree *args_tree);
401
402 static size_t
403 dissect_amqp_method_file_qos(tvbuff_t *tvb,
404     int offset, int bound, proto_tree *args_tree);
405
406 static size_t
407 dissect_amqp_method_file_qos_ok(tvbuff_t *tvb,
408     int offset, int bound, proto_tree *args_tree);
409
410 static size_t
411 dissect_amqp_method_file_consume(tvbuff_t *tvb,
412     int offset, int bound, proto_tree *args_tree);
413
414 static size_t
415 dissect_amqp_method_file_consume_ok(tvbuff_t *tvb,
416     int offset, int bound, proto_tree *args_tree);
417
418 static size_t
419 dissect_amqp_method_file_cancel(tvbuff_t *tvb,
420     int offset, int bound, proto_tree *args_tree);
421
422 static size_t
423 dissect_amqp_method_file_cancel_ok(tvbuff_t *tvb,
424     int offset, int bound, proto_tree *args_tree);
425
426 static size_t
427 dissect_amqp_method_file_open(tvbuff_t *tvb,
428     int offset, int bound, proto_tree *args_tree);
429
430 static size_t
431 dissect_amqp_method_file_open_ok(tvbuff_t *tvb,
432     int offset, int bound, proto_tree *args_tree);
433
434 static size_t
435 dissect_amqp_method_file_stage(tvbuff_t *tvb,
436     int offset, int bound, proto_tree *args_tree);
437
438 static size_t
439 dissect_amqp_method_file_publish(tvbuff_t *tvb,
440     int offset, int bound, proto_tree *args_tree);
441
442 static size_t
443 dissect_amqp_method_file_return(tvbuff_t *tvb,
444     int offset, int bound, proto_tree *args_tree);
445
446 static size_t
447 dissect_amqp_method_file_deliver(tvbuff_t *tvb,
448     int offset, int bound, proto_tree *args_tree);
449
450 static size_t
451 dissect_amqp_method_file_ack(tvbuff_t *tvb,
452     int offset, int bound, proto_tree *args_tree);
453
454 static size_t
455 dissect_amqp_method_file_reject(tvbuff_t *tvb,
456     int offset, int bound, proto_tree *args_tree);
457
458 static size_t
459 dissect_amqp_method_stream_qos(tvbuff_t *tvb,
460     int offset, int bound, proto_tree *args_tree);
461
462 static size_t
463 dissect_amqp_method_stream_qos_ok(tvbuff_t *tvb,
464     int offset, int bound, proto_tree *args_tree);
465
466 static size_t
467 dissect_amqp_method_stream_consume(tvbuff_t *tvb,
468     int offset, int bound, proto_tree *args_tree);
469
470 static size_t
471 dissect_amqp_method_stream_consume_ok(tvbuff_t *tvb,
472     int offset, int bound, proto_tree *args_tree);
473
474 static size_t
475 dissect_amqp_method_stream_cancel(tvbuff_t *tvb,
476     int offset, int bound, proto_tree *args_tree);
477
478 static size_t
479 dissect_amqp_method_stream_cancel_ok(tvbuff_t *tvb,
480     int offset, int bound, proto_tree *args_tree);
481
482 static size_t
483 dissect_amqp_method_stream_publish(tvbuff_t *tvb,
484     int offset, int bound, proto_tree *args_tree);
485
486 static size_t
487 dissect_amqp_method_stream_return(tvbuff_t *tvb,
488     int offset, int bound, proto_tree *args_tree);
489
490 static size_t
491 dissect_amqp_method_stream_deliver(tvbuff_t *tvb,
492     int offset, int bound, proto_tree *args_tree);
493
494 static size_t
495 dissect_amqp_method_tx_select(tvbuff_t *tvb,
496     int offset, int bound, proto_tree *args_tree);
497
498 static size_t
499 dissect_amqp_method_tx_select_ok(tvbuff_t *tvb,
500     int offset, int bound, proto_tree *args_tree);
501
502 static size_t
503 dissect_amqp_method_tx_commit(tvbuff_t *tvb,
504     int offset, int bound, proto_tree *args_tree);
505
506 static size_t
507 dissect_amqp_method_tx_commit_ok(tvbuff_t *tvb,
508     int offset, int bound, proto_tree *args_tree);
509
510 static size_t
511 dissect_amqp_method_tx_rollback(tvbuff_t *tvb,
512     int offset, int bound, proto_tree *args_tree);
513
514 static size_t
515 dissect_amqp_method_tx_rollback_ok(tvbuff_t *tvb,
516     int offset, int bound, proto_tree *args_tree);
517
518 static size_t
519 dissect_amqp_method_dtx_select(tvbuff_t *tvb,
520     int offset, int bound, proto_tree *args_tree);
521
522 static size_t
523 dissect_amqp_method_dtx_select_ok(tvbuff_t *tvb,
524     int offset, int bound, proto_tree *args_tree);
525
526 static size_t
527 dissect_amqp_method_dtx_start(tvbuff_t *tvb,
528     int offset, int bound, proto_tree *args_tree);
529
530 static size_t
531 dissect_amqp_method_dtx_start_ok(tvbuff_t *tvb,
532     int offset, int bound, proto_tree *args_tree);
533
534 static size_t
535 dissect_amqp_method_tunnel_request(tvbuff_t *tvb,
536     int offset, int bound, proto_tree *args_tree);
537
538 static size_t
539 dissect_amqp_content_header_basic(tvbuff_t *tvb,
540     int offset, int bound, proto_tree *prop_tree);
541
542 static size_t
543 dissect_amqp_content_header_file(tvbuff_t *tvb,
544     int offset, int bound, proto_tree *prop_tree);
545
546 static size_t
547 dissect_amqp_content_header_stream(tvbuff_t *tvb,
548     int offset, int bound, proto_tree *prop_tree);
549
550 static size_t
551 dissect_amqp_content_header_tunnel(tvbuff_t *tvb,
552     int offset, int bound, proto_tree *prop_tree);
553
554 /*  Various handles  */
555
556 static int proto_amqp = -1;
557
558 static int hf_amqp_type = -1;
559 static int hf_amqp_channel = -1;
560 static int hf_amqp_length = -1;
561 static int hf_amqp_method_class_id = -1;
562 static int hf_amqp_method_connection_method_id = -1;
563 static int hf_amqp_method_channel_method_id = -1;
564 static int hf_amqp_method_access_method_id = -1;
565 static int hf_amqp_method_exchange_method_id = -1;
566 static int hf_amqp_method_queue_method_id = -1;
567 static int hf_amqp_method_basic_method_id = -1;
568 static int hf_amqp_method_file_method_id = -1;
569 static int hf_amqp_method_stream_method_id = -1;
570 static int hf_amqp_method_tx_method_id = -1;
571 static int hf_amqp_method_dtx_method_id = -1;
572 static int hf_amqp_method_tunnel_method_id = -1;
573 static int hf_amqp_method_arguments = -1;
574 static int hf_amqp_method_connection_start_version_major = -1;
575 static int hf_amqp_method_connection_start_version_minor = -1;
576 static int hf_amqp_method_connection_start_server_properties = -1;
577 static int hf_amqp_method_connection_start_mechanisms = -1;
578 static int hf_amqp_method_connection_start_locales = -1;
579 static int hf_amqp_method_connection_start_ok_client_properties = -1;
580 static int hf_amqp_method_connection_start_ok_mechanism = -1;
581 static int hf_amqp_method_connection_start_ok_response = -1;
582 static int hf_amqp_method_connection_start_ok_locale = -1;
583 static int hf_amqp_method_connection_secure_challenge = -1;
584 static int hf_amqp_method_connection_secure_ok_response = -1;
585 static int hf_amqp_method_connection_tune_channel_max = -1;
586 static int hf_amqp_method_connection_tune_frame_max = -1;
587 static int hf_amqp_method_connection_tune_heartbeat = -1;
588 static int hf_amqp_method_connection_tune_ok_channel_max = -1;
589 static int hf_amqp_method_connection_tune_ok_frame_max = -1;
590 static int hf_amqp_method_connection_tune_ok_heartbeat = -1;
591 static int hf_amqp_method_connection_open_virtual_host = -1;
592 static int hf_amqp_method_connection_open_capabilities = -1;
593 static int hf_amqp_method_connection_open_insist = -1;
594 static int hf_amqp_method_connection_open_ok_known_hosts = -1;
595 static int hf_amqp_method_connection_redirect_host = -1;
596 static int hf_amqp_method_connection_redirect_known_hosts = -1;
597 static int hf_amqp_method_connection_close_reply_code = -1;
598 static int hf_amqp_method_connection_close_reply_text = -1;
599 static int hf_amqp_method_connection_close_class_id = -1;
600 static int hf_amqp_method_connection_close_method_id = -1;
601 static int hf_amqp_method_channel_open_out_of_band = -1;
602 static int hf_amqp_method_channel_open_ok_channel_id = -1;
603 static int hf_amqp_method_channel_flow_active = -1;
604 static int hf_amqp_method_channel_flow_ok_active = -1;
605 static int hf_amqp_method_channel_close_reply_code = -1;
606 static int hf_amqp_method_channel_close_reply_text = -1;
607 static int hf_amqp_method_channel_close_class_id = -1;
608 static int hf_amqp_method_channel_close_method_id = -1;
609 static int hf_amqp_method_channel_resume_channel_id = -1;
610 static int hf_amqp_method_access_request_realm = -1;
611 static int hf_amqp_method_access_request_exclusive = -1;
612 static int hf_amqp_method_access_request_passive = -1;
613 static int hf_amqp_method_access_request_active = -1;
614 static int hf_amqp_method_access_request_write = -1;
615 static int hf_amqp_method_access_request_read = -1;
616 static int hf_amqp_method_access_request_ok_ticket = -1;
617 static int hf_amqp_method_exchange_declare_ticket = -1;
618 static int hf_amqp_method_exchange_declare_exchange = -1;
619 static int hf_amqp_method_exchange_declare_type = -1;
620 static int hf_amqp_method_exchange_declare_passive = -1;
621 static int hf_amqp_method_exchange_declare_durable = -1;
622 static int hf_amqp_method_exchange_declare_auto_delete = -1;
623 static int hf_amqp_method_exchange_declare_internal = -1;
624 static int hf_amqp_method_exchange_declare_nowait = -1;
625 static int hf_amqp_method_exchange_declare_arguments = -1;
626 static int hf_amqp_method_exchange_delete_ticket = -1;
627 static int hf_amqp_method_exchange_delete_exchange = -1;
628 static int hf_amqp_method_exchange_delete_if_unused = -1;
629 static int hf_amqp_method_exchange_delete_nowait = -1;
630 static int hf_amqp_method_queue_declare_ticket = -1;
631 static int hf_amqp_method_queue_declare_queue = -1;
632 static int hf_amqp_method_queue_declare_passive = -1;
633 static int hf_amqp_method_queue_declare_durable = -1;
634 static int hf_amqp_method_queue_declare_exclusive = -1;
635 static int hf_amqp_method_queue_declare_auto_delete = -1;
636 static int hf_amqp_method_queue_declare_nowait = -1;
637 static int hf_amqp_method_queue_declare_arguments = -1;
638 static int hf_amqp_method_queue_declare_ok_queue = -1;
639 static int hf_amqp_method_queue_declare_ok_message_count = -1;
640 static int hf_amqp_method_queue_declare_ok_consumer_count = -1;
641 static int hf_amqp_method_queue_bind_ticket = -1;
642 static int hf_amqp_method_queue_bind_queue = -1;
643 static int hf_amqp_method_queue_bind_exchange = -1;
644 static int hf_amqp_method_queue_bind_routing_key = -1;
645 static int hf_amqp_method_queue_bind_nowait = -1;
646 static int hf_amqp_method_queue_bind_arguments = -1;
647 static int hf_amqp_method_queue_unbind_ticket = -1;
648 static int hf_amqp_method_queue_unbind_queue = -1;
649 static int hf_amqp_method_queue_unbind_exchange = -1;
650 static int hf_amqp_method_queue_unbind_routing_key = -1;
651 static int hf_amqp_method_queue_unbind_arguments = -1;
652 static int hf_amqp_method_queue_purge_ticket = -1;
653 static int hf_amqp_method_queue_purge_queue = -1;
654 static int hf_amqp_method_queue_purge_nowait = -1;
655 static int hf_amqp_method_queue_purge_ok_message_count = -1;
656 static int hf_amqp_method_queue_delete_ticket = -1;
657 static int hf_amqp_method_queue_delete_queue = -1;
658 static int hf_amqp_method_queue_delete_if_unused = -1;
659 static int hf_amqp_method_queue_delete_if_empty = -1;
660 static int hf_amqp_method_queue_delete_nowait = -1;
661 static int hf_amqp_method_queue_delete_ok_message_count = -1;
662 static int hf_amqp_method_basic_qos_prefetch_size = -1;
663 static int hf_amqp_method_basic_qos_prefetch_count = -1;
664 static int hf_amqp_method_basic_qos_global = -1;
665 static int hf_amqp_method_basic_consume_ticket = -1;
666 static int hf_amqp_method_basic_consume_queue = -1;
667 static int hf_amqp_method_basic_consume_consumer_tag = -1;
668 static int hf_amqp_method_basic_consume_no_local = -1;
669 static int hf_amqp_method_basic_consume_no_ack = -1;
670 static int hf_amqp_method_basic_consume_exclusive = -1;
671 static int hf_amqp_method_basic_consume_nowait = -1;
672 static int hf_amqp_method_basic_consume_filter = -1;
673 static int hf_amqp_method_basic_consume_ok_consumer_tag = -1;
674 static int hf_amqp_method_basic_cancel_consumer_tag = -1;
675 static int hf_amqp_method_basic_cancel_nowait = -1;
676 static int hf_amqp_method_basic_cancel_ok_consumer_tag = -1;
677 static int hf_amqp_method_basic_publish_ticket = -1;
678 static int hf_amqp_method_basic_publish_exchange = -1;
679 static int hf_amqp_method_basic_publish_routing_key = -1;
680 static int hf_amqp_method_basic_publish_mandatory = -1;
681 static int hf_amqp_method_basic_publish_immediate = -1;
682 static int hf_amqp_method_basic_return_reply_code = -1;
683 static int hf_amqp_method_basic_return_reply_text = -1;
684 static int hf_amqp_method_basic_return_exchange = -1;
685 static int hf_amqp_method_basic_return_routing_key = -1;
686 static int hf_amqp_method_basic_deliver_consumer_tag = -1;
687 static int hf_amqp_method_basic_deliver_delivery_tag = -1;
688 static int hf_amqp_method_basic_deliver_redelivered = -1;
689 static int hf_amqp_method_basic_deliver_exchange = -1;
690 static int hf_amqp_method_basic_deliver_routing_key = -1;
691 static int hf_amqp_method_basic_get_ticket = -1;
692 static int hf_amqp_method_basic_get_queue = -1;
693 static int hf_amqp_method_basic_get_no_ack = -1;
694 static int hf_amqp_method_basic_get_ok_delivery_tag = -1;
695 static int hf_amqp_method_basic_get_ok_redelivered = -1;
696 static int hf_amqp_method_basic_get_ok_exchange = -1;
697 static int hf_amqp_method_basic_get_ok_routing_key = -1;
698 static int hf_amqp_method_basic_get_ok_message_count = -1;
699 static int hf_amqp_method_basic_get_empty_cluster_id = -1;
700 static int hf_amqp_method_basic_ack_delivery_tag = -1;
701 static int hf_amqp_method_basic_ack_multiple = -1;
702 static int hf_amqp_method_basic_reject_delivery_tag = -1;
703 static int hf_amqp_method_basic_reject_requeue = -1;
704 static int hf_amqp_method_basic_recover_requeue = -1;
705 static int hf_amqp_method_file_qos_prefetch_size = -1;
706 static int hf_amqp_method_file_qos_prefetch_count = -1;
707 static int hf_amqp_method_file_qos_global = -1;
708 static int hf_amqp_method_file_consume_ticket = -1;
709 static int hf_amqp_method_file_consume_queue = -1;
710 static int hf_amqp_method_file_consume_consumer_tag = -1;
711 static int hf_amqp_method_file_consume_no_local = -1;
712 static int hf_amqp_method_file_consume_no_ack = -1;
713 static int hf_amqp_method_file_consume_exclusive = -1;
714 static int hf_amqp_method_file_consume_nowait = -1;
715 static int hf_amqp_method_file_consume_filter = -1;
716 static int hf_amqp_method_file_consume_ok_consumer_tag = -1;
717 static int hf_amqp_method_file_cancel_consumer_tag = -1;
718 static int hf_amqp_method_file_cancel_nowait = -1;
719 static int hf_amqp_method_file_cancel_ok_consumer_tag = -1;
720 static int hf_amqp_method_file_open_identifier = -1;
721 static int hf_amqp_method_file_open_content_size = -1;
722 static int hf_amqp_method_file_open_ok_staged_size = -1;
723 static int hf_amqp_method_file_publish_ticket = -1;
724 static int hf_amqp_method_file_publish_exchange = -1;
725 static int hf_amqp_method_file_publish_routing_key = -1;
726 static int hf_amqp_method_file_publish_mandatory = -1;
727 static int hf_amqp_method_file_publish_immediate = -1;
728 static int hf_amqp_method_file_publish_identifier = -1;
729 static int hf_amqp_method_file_return_reply_code = -1;
730 static int hf_amqp_method_file_return_reply_text = -1;
731 static int hf_amqp_method_file_return_exchange = -1;
732 static int hf_amqp_method_file_return_routing_key = -1;
733 static int hf_amqp_method_file_deliver_consumer_tag = -1;
734 static int hf_amqp_method_file_deliver_delivery_tag = -1;
735 static int hf_amqp_method_file_deliver_redelivered = -1;
736 static int hf_amqp_method_file_deliver_exchange = -1;
737 static int hf_amqp_method_file_deliver_routing_key = -1;
738 static int hf_amqp_method_file_deliver_identifier = -1;
739 static int hf_amqp_method_file_ack_delivery_tag = -1;
740 static int hf_amqp_method_file_ack_multiple = -1;
741 static int hf_amqp_method_file_reject_delivery_tag = -1;
742 static int hf_amqp_method_file_reject_requeue = -1;
743 static int hf_amqp_method_stream_qos_prefetch_size = -1;
744 static int hf_amqp_method_stream_qos_prefetch_count = -1;
745 static int hf_amqp_method_stream_qos_consume_rate = -1;
746 static int hf_amqp_method_stream_qos_global = -1;
747 static int hf_amqp_method_stream_consume_ticket = -1;
748 static int hf_amqp_method_stream_consume_queue = -1;
749 static int hf_amqp_method_stream_consume_consumer_tag = -1;
750 static int hf_amqp_method_stream_consume_no_local = -1;
751 static int hf_amqp_method_stream_consume_exclusive = -1;
752 static int hf_amqp_method_stream_consume_nowait = -1;
753 static int hf_amqp_method_stream_consume_filter = -1;
754 static int hf_amqp_method_stream_consume_ok_consumer_tag = -1;
755 static int hf_amqp_method_stream_cancel_consumer_tag = -1;
756 static int hf_amqp_method_stream_cancel_nowait = -1;
757 static int hf_amqp_method_stream_cancel_ok_consumer_tag = -1;
758 static int hf_amqp_method_stream_publish_ticket = -1;
759 static int hf_amqp_method_stream_publish_exchange = -1;
760 static int hf_amqp_method_stream_publish_routing_key = -1;
761 static int hf_amqp_method_stream_publish_mandatory = -1;
762 static int hf_amqp_method_stream_publish_immediate = -1;
763 static int hf_amqp_method_stream_return_reply_code = -1;
764 static int hf_amqp_method_stream_return_reply_text = -1;
765 static int hf_amqp_method_stream_return_exchange = -1;
766 static int hf_amqp_method_stream_return_routing_key = -1;
767 static int hf_amqp_method_stream_deliver_consumer_tag = -1;
768 static int hf_amqp_method_stream_deliver_delivery_tag = -1;
769 static int hf_amqp_method_stream_deliver_exchange = -1;
770 static int hf_amqp_method_stream_deliver_queue = -1;
771 static int hf_amqp_method_dtx_start_dtx_identifier = -1;
772 static int hf_amqp_method_tunnel_request_meta_data = -1;
773 static int hf_amqp_field = -1;
774 static int hf_amqp_header_class_id = -1;
775 static int hf_amqp_header_weight = -1;
776 static int hf_amqp_header_body_size = -1;
777 static int hf_amqp_header_property_flags = -1;
778 static int hf_amqp_header_properties = -1;
779 static int hf_amqp_header_basic_content_type = -1;
780 static int hf_amqp_header_basic_content_encoding = -1;
781 static int hf_amqp_header_basic_headers = -1;
782 static int hf_amqp_header_basic_delivery_mode = -1;
783 static int hf_amqp_header_basic_priority = -1;
784 static int hf_amqp_header_basic_correlation_id = -1;
785 static int hf_amqp_header_basic_reply_to = -1;
786 static int hf_amqp_header_basic_expiration = -1;
787 static int hf_amqp_header_basic_message_id = -1;
788 static int hf_amqp_header_basic_timestamp = -1;
789 static int hf_amqp_header_basic_type = -1;
790 static int hf_amqp_header_basic_user_id = -1;
791 static int hf_amqp_header_basic_app_id = -1;
792 static int hf_amqp_header_basic_cluster_id = -1;
793 static int hf_amqp_header_file_content_type = -1;
794 static int hf_amqp_header_file_content_encoding = -1;
795 static int hf_amqp_header_file_headers = -1;
796 static int hf_amqp_header_file_priority = -1;
797 static int hf_amqp_header_file_reply_to = -1;
798 static int hf_amqp_header_file_message_id = -1;
799 static int hf_amqp_header_file_filename = -1;
800 static int hf_amqp_header_file_timestamp = -1;
801 static int hf_amqp_header_file_cluster_id = -1;
802 static int hf_amqp_header_stream_content_type = -1;
803 static int hf_amqp_header_stream_content_encoding = -1;
804 static int hf_amqp_header_stream_headers = -1;
805 static int hf_amqp_header_stream_priority = -1;
806 static int hf_amqp_header_stream_timestamp = -1;
807 static int hf_amqp_header_tunnel_headers = -1;
808 static int hf_amqp_header_tunnel_proxy_name = -1;
809 static int hf_amqp_header_tunnel_data_name = -1;
810 static int hf_amqp_header_tunnel_durable = -1;
811 static int hf_amqp_header_tunnel_broadcast = -1;
812 static int hf_amqp_payload = -1;
813 static int hf_amqp_init_protocol = -1;
814 static int hf_amqp_init_id_major = -1;
815 static int hf_amqp_init_id_minor = -1;
816 static int hf_amqp_init_version_major = -1;
817 static int hf_amqp_init_version_minor = -1;
818
819 static gint ett_amqp = -1;
820 static gint ett_args = -1;
821 static gint ett_props = -1;
822 static gint ett_field_table = -1;
823 static gint ett_amqp_init = -1;
824
825 /*  Various enumerations  */
826
827 static const value_string amqp_frame_types [] = {
828     {AMQP_FRAME_TYPE_METHOD,             "Method"},
829     {AMQP_FRAME_TYPE_CONTENT_HEADER,     "Content header"},
830     {AMQP_FRAME_TYPE_CONTENT_BODY,       "Content body"},
831     {AMQP_FRAME_TYPE_OOB_METHOD,         "OOB Method"},
832     {AMQP_FRAME_TYPE_OOB_CONTENT_HEADER, "OOB Content header"},
833     {AMQP_FRAME_TYPE_OOB_CONTENT_BODY,   "OOB Content body"},
834     {AMQP_FRAME_TYPE_TRACE ,             "Trace"},
835     {AMQP_FRAME_TYPE_HEARTBEAT,          "Heartbeat"},
836     {0, NULL}
837 };
838
839 static const value_string amqp_method_classes [] = {
840     {10, "Connection"},
841     {20, "Channel"},
842     {30, "Access"},
843     {40, "Exchange"},
844     {50, "Queue"},
845     {60, "Basic"},
846     {70, "File"},
847     {80, "Stream"},
848     {90, "Tx"},
849     {100, "Dtx"},
850     {110, "Tunnel"},
851     {0, NULL}
852 };
853
854 static const value_string amqp_method_connection_methods [] = {
855     {10, "Start"},
856     {11, "Start-Ok"},
857     {20, "Secure"},
858     {21, "Secure-Ok"},
859     {30, "Tune"},
860     {31, "Tune-Ok"},
861     {40, "Open"},
862     {41, "Open-Ok"},
863     {42, "Redirect"},
864     {50, "Close"},
865     {51, "Close-Ok"},
866     {0, NULL}
867 };
868
869 static const value_string amqp_method_channel_methods [] = {
870     {10, "Open"},
871     {11, "Open-Ok"},
872     {20, "Flow"},
873     {21, "Flow-Ok"},
874     {40, "Close"},
875     {41, "Close-Ok"},
876     {50, "Resume"},
877     {60, "Ping"},
878     {70, "Pong"},
879     {80, "Ok"},
880     {0, NULL}
881 };
882
883 static const value_string amqp_method_access_methods [] = {
884     {10, "Request"},
885     {11, "Request-Ok"},
886     {0, NULL}
887 };
888
889 static const value_string amqp_method_exchange_methods [] = {
890     {10, "Declare"},
891     {11, "Declare-Ok"},
892     {20, "Delete"},
893     {21, "Delete-Ok"},
894     {0, NULL}
895 };
896
897 static const value_string amqp_method_queue_methods [] = {
898     {10, "Declare"},
899     {11, "Declare-Ok"},
900     {20, "Bind"},
901     {21, "Bind-Ok"},
902     {50, "Unbind"},
903     {51, "Unbind-Ok"},
904     {30, "Purge"},
905     {31, "Purge-Ok"},
906     {40, "Delete"},
907     {41, "Delete-Ok"},
908     {0, NULL}
909 };
910
911 static const value_string amqp_method_basic_methods [] = {
912     {10, "Qos"},
913     {11, "Qos-Ok"},
914     {20, "Consume"},
915     {21, "Consume-Ok"},
916     {30, "Cancel"},
917     {31, "Cancel-Ok"},
918     {40, "Publish"},
919     {50, "Return"},
920     {60, "Deliver"},
921     {70, "Get"},
922     {71, "Get-Ok"},
923     {72, "Get-Empty"},
924     {80, "Ack"},
925     {90, "Reject"},
926     {100, "Recover"},
927     {0, NULL}
928 };
929
930 static const value_string amqp_method_file_methods [] = {
931     {10, "Qos"},
932     {11, "Qos-Ok"},
933     {20, "Consume"},
934     {21, "Consume-Ok"},
935     {30, "Cancel"},
936     {31, "Cancel-Ok"},
937     {40, "Open"},
938     {41, "Open-Ok"},
939     {50, "Stage"},
940     {60, "Publish"},
941     {70, "Return"},
942     {80, "Deliver"},
943     {90, "Ack"},
944     {100, "Reject"},
945     {0, NULL}
946 };
947
948 static const value_string amqp_method_stream_methods [] = {
949     {10, "Qos"},
950     {11, "Qos-Ok"},
951     {20, "Consume"},
952     {21, "Consume-Ok"},
953     {30, "Cancel"},
954     {31, "Cancel-Ok"},
955     {40, "Publish"},
956     {50, "Return"},
957     {60, "Deliver"},
958     {0, NULL}
959 };
960
961 static const value_string amqp_method_tx_methods [] = {
962     {10, "Select"},
963     {11, "Select-Ok"},
964     {20, "Commit"},
965     {21, "Commit-Ok"},
966     {30, "Rollback"},
967     {31, "Rollback-Ok"},
968     {0, NULL}
969 };
970
971 static const value_string amqp_method_dtx_methods [] = {
972     {10, "Select"},
973     {11, "Select-Ok"},
974     {20, "Start"},
975     {21, "Start-Ok"},
976     {0, NULL}
977 };
978
979 static const value_string amqp_method_tunnel_methods [] = {
980     {10, "Request"},
981     {0, NULL}
982 };
983
984 /*  Main dissection routine  */
985
986 static void
987 dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
988 {
989     /*  Minimal frame size is 8 bytes - smaller frames are malformed  */
990     DISSECTOR_ASSERT (tvb_length (tvb) >= 8);
991
992     tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 7,
993         get_amqp_message_len, dissect_amqp_frame);
994 }
995
996 static guint
997 get_amqp_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
998 {
999     /*  Heuristic - protocol initialisation frame starts with 'AMQP'  */
1000     if (tvb_get_guint8(tvb, 0) == 'A' &&
1001           tvb_get_guint8(tvb, 1) == 'M' &&
1002           tvb_get_guint8(tvb, 2) == 'Q' &&
1003           tvb_get_guint8(tvb, 3) == 'P')
1004         return 8;
1005
1006     return (guint) tvb_get_ntohl(tvb, offset + 3) + 8;
1007 }
1008
1009 /*  Dissection routine for AMQP field tables  */
1010
1011 static void
1012 dissect_amqp_field_table(tvbuff_t *tvb, int offset, int bound, size_t length, proto_item *item)
1013 {
1014     proto_item *field_table_tree;
1015     char *buff;
1016     size_t namelen, vallen;
1017     guint8 type;
1018     const char *name;
1019     const char *typename;
1020     const char *value;
1021     size_t field_start;
1022
1023     buff = ep_alloc(64);
1024
1025     field_table_tree = proto_item_add_subtree(item, ett_amqp);
1026
1027     while (length > 0) {
1028         field_start = offset;
1029         namelen = tvb_get_guint8(tvb, offset);
1030         AMQP_INCREMENT(offset, 1, bound);
1031         length -= 1;
1032         name = (char*) tvb_get_ephemeral_string(tvb, offset, namelen);
1033         AMQP_INCREMENT(offset, namelen, bound);
1034         length -= namelen;
1035         type = tvb_get_guint8(tvb, offset);
1036         AMQP_INCREMENT(offset, 1, bound);
1037         length -= 1;
1038         switch (type) {
1039         case 'S':
1040             typename = "string";
1041             vallen = tvb_get_ntohl(tvb, offset);
1042             AMQP_INCREMENT(offset, 4, bound);
1043             length -= 4;
1044             value = (char*) tvb_get_ephemeral_string(tvb, offset, vallen);
1045             AMQP_INCREMENT(offset, vallen, bound);
1046             length -= vallen;
1047             break;
1048         case 'I':
1049             typename = "integer";
1050             g_snprintf(buff, 64, "%ld", (long) tvb_get_ntohl(tvb, offset));
1051             value = buff;
1052             AMQP_INCREMENT(offset, 4, bound);
1053             length -= 4;  
1054             break;
1055         case 'D':
1056             typename = "decimal";
1057             value = "...";
1058             AMQP_INCREMENT(offset, 5, bound);
1059             length -= 5; 
1060             break;
1061         case 'T':
1062             typename =  "timestamp";
1063             value = "...";
1064             AMQP_INCREMENT(offset, 8, bound);
1065             length -= 8; 
1066             break;
1067         case 'F':
1068             /*  TODO: make it recursive here  */
1069             typename =  "field table";
1070             vallen = tvb_get_ntohl(tvb, offset);
1071             AMQP_INCREMENT(offset, 4, bound);
1072             length -= 4;
1073             value = "...";
1074             AMQP_INCREMENT(offset, vallen, bound);
1075             length -= vallen;
1076             break;
1077         case 'V':
1078             typename = "void";
1079             value = "";
1080         default:
1081             typename = "";
1082             value = "";
1083             DISSECTOR_ASSERT(FALSE);
1084         }
1085
1086         proto_tree_add_none_format(field_table_tree, hf_amqp_field, tvb,
1087             field_start, offset - field_start, "%s (%s): %s", name, typename,
1088             value);
1089     }
1090 }
1091
1092 /*  Dissection routine for AMQP frames  */
1093
1094 static void
1095 dissect_amqp_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1096 {
1097     proto_item *ti;
1098     proto_item *amqp_tree;
1099     proto_item *args_tree;
1100     proto_item *prop_tree;
1101     size_t length;
1102     int offset;
1103
1104     if (check_col(pinfo->cinfo, COL_PROTOCOL))
1105         col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMQP");
1106     if (check_col(pinfo->cinfo, COL_INFO)) {
1107         col_clear(pinfo->cinfo, COL_INFO);
1108     }
1109
1110     if (tree) {
1111
1112         /*  Heuristic - protocol initialisation frame starts with 'AMQP'  */
1113         if (tvb_get_guint8(tvb, 0) == 'A' &&
1114               tvb_get_guint8(tvb, 1) == 'M' &&
1115               tvb_get_guint8(tvb, 2) == 'Q' &&
1116               tvb_get_guint8(tvb, 3) == 'P') {
1117
1118             if (check_col(pinfo->cinfo, COL_INFO)) {
1119                 col_append_str(pinfo->cinfo, COL_INFO, "Protocol-Header ");
1120                 col_set_fence(pinfo->cinfo, COL_INFO);
1121             }
1122
1123             ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, FALSE);
1124             amqp_tree = proto_item_add_subtree(ti, ett_amqp_init);
1125             proto_tree_add_item(amqp_tree, hf_amqp_init_protocol, tvb, 0, 4, FALSE);
1126             proto_tree_add_item(amqp_tree, hf_amqp_init_id_major, tvb, 4, 1, FALSE);
1127             proto_tree_add_item(amqp_tree, hf_amqp_init_id_minor, tvb, 5, 1, FALSE);
1128             proto_tree_add_item(amqp_tree, hf_amqp_init_version_major, tvb, 6, 1, FALSE);
1129             proto_tree_add_item(amqp_tree, hf_amqp_init_version_minor, tvb, 7, 1, FALSE);
1130
1131             return;
1132         }
1133         
1134         ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, FALSE);
1135         amqp_tree = proto_item_add_subtree(ti, ett_amqp);
1136         proto_tree_add_item(amqp_tree, hf_amqp_type, tvb, 0, 1, FALSE);
1137         proto_tree_add_item(amqp_tree, hf_amqp_channel, tvb, 1, 2, FALSE);
1138         proto_tree_add_item(amqp_tree, hf_amqp_length, tvb, 3, 4, FALSE);
1139         length = tvb_get_ntohl(tvb, 3);
1140         switch (tvb_get_guint8(tvb, 0)) {
1141         case AMQP_FRAME_TYPE_METHOD:
1142             proto_tree_add_item(amqp_tree, hf_amqp_method_class_id,
1143                 tvb, 7, 2, FALSE);
1144             switch (tvb_get_ntohs(tvb, 7)) {
1145             case AMQP_CLASS_CONNECTION:
1146                 proto_tree_add_item(amqp_tree, hf_amqp_method_connection_method_id,
1147                     tvb, 9, 2, FALSE);              
1148                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1149                     tvb, 11, length - 4, FALSE);
1150                 args_tree = proto_item_add_subtree(ti, ett_args);
1151                 switch (tvb_get_ntohs(tvb, 9)) {
1152                 case AMQP_METHOD_CONNECTION_START:
1153                     offset = dissect_amqp_method_connection_start(tvb,
1154                         11, tvb_length (tvb), args_tree);
1155                     if (check_col(pinfo->cinfo, COL_INFO)) {
1156                         col_append_str(pinfo->cinfo, COL_INFO,
1157                             "Connection.Start ");
1158                         col_set_fence(pinfo->cinfo, COL_INFO);
1159                     }
1160                     break;
1161                 case AMQP_METHOD_CONNECTION_START_OK:
1162                     offset = dissect_amqp_method_connection_start_ok(tvb,
1163                         11, tvb_length (tvb), args_tree);
1164                     if (check_col(pinfo->cinfo, COL_INFO)) {
1165                         col_append_str(pinfo->cinfo, COL_INFO,
1166                             "Connection.Start-Ok ");
1167                         col_set_fence(pinfo->cinfo, COL_INFO);
1168                     }
1169                     break;
1170                 case AMQP_METHOD_CONNECTION_SECURE:
1171                     offset = dissect_amqp_method_connection_secure(tvb,
1172                         11, tvb_length (tvb), args_tree);
1173                     if (check_col(pinfo->cinfo, COL_INFO)) {
1174                         col_append_str(pinfo->cinfo, COL_INFO,
1175                             "Connection.Secure ");
1176                         col_set_fence(pinfo->cinfo, COL_INFO);
1177                     }
1178                     break;
1179                 case AMQP_METHOD_CONNECTION_SECURE_OK:
1180                     offset = dissect_amqp_method_connection_secure_ok(tvb,
1181                         11, tvb_length (tvb), args_tree);
1182                     if (check_col(pinfo->cinfo, COL_INFO)) {
1183                         col_append_str(pinfo->cinfo, COL_INFO,
1184                             "Connection.Secure-Ok ");
1185                         col_set_fence(pinfo->cinfo, COL_INFO);
1186                     }
1187                     break;
1188                 case AMQP_METHOD_CONNECTION_TUNE:
1189                     offset = dissect_amqp_method_connection_tune(tvb,
1190                         11, tvb_length (tvb), args_tree);
1191                     if (check_col(pinfo->cinfo, COL_INFO)) {
1192                         col_append_str(pinfo->cinfo, COL_INFO,
1193                             "Connection.Tune ");
1194                         col_set_fence(pinfo->cinfo, COL_INFO);
1195                     }
1196                     break;
1197                 case AMQP_METHOD_CONNECTION_TUNE_OK:
1198                     offset = dissect_amqp_method_connection_tune_ok(tvb,
1199                         11, tvb_length (tvb), args_tree);
1200                     if (check_col(pinfo->cinfo, COL_INFO)) {
1201                         col_append_str(pinfo->cinfo, COL_INFO,
1202                             "Connection.Tune-Ok ");
1203                         col_set_fence(pinfo->cinfo, COL_INFO);
1204                     }
1205                     break;
1206                 case AMQP_METHOD_CONNECTION_OPEN:
1207                     offset = dissect_amqp_method_connection_open(tvb,
1208                         11, tvb_length (tvb), args_tree);
1209                     if (check_col(pinfo->cinfo, COL_INFO)) {
1210                         col_append_str(pinfo->cinfo, COL_INFO,
1211                             "Connection.Open ");
1212                         col_set_fence(pinfo->cinfo, COL_INFO);
1213                     }
1214                     break;
1215                 case AMQP_METHOD_CONNECTION_OPEN_OK:
1216                     offset = dissect_amqp_method_connection_open_ok(tvb,
1217                         11, tvb_length (tvb), args_tree);
1218                     if (check_col(pinfo->cinfo, COL_INFO)) {
1219                         col_append_str(pinfo->cinfo, COL_INFO,
1220                             "Connection.Open-Ok ");
1221                         col_set_fence(pinfo->cinfo, COL_INFO);
1222                     }
1223                     break;
1224                 case AMQP_METHOD_CONNECTION_REDIRECT:
1225                     offset = dissect_amqp_method_connection_redirect(tvb,
1226                         11, tvb_length (tvb), args_tree);
1227                     if (check_col(pinfo->cinfo, COL_INFO)) {
1228                         col_append_str(pinfo->cinfo, COL_INFO,
1229                             "Connection.Redirect ");
1230                         col_set_fence(pinfo->cinfo, COL_INFO);
1231                     }
1232                     break;
1233                 case AMQP_METHOD_CONNECTION_CLOSE:
1234                     offset = dissect_amqp_method_connection_close(tvb,
1235                         11, tvb_length (tvb), args_tree);
1236                     if (check_col(pinfo->cinfo, COL_INFO)) {
1237                         col_append_str(pinfo->cinfo, COL_INFO,
1238                             "Connection.Close ");
1239                         col_set_fence(pinfo->cinfo, COL_INFO);
1240                     }
1241                     break;
1242                 case AMQP_METHOD_CONNECTION_CLOSE_OK:
1243                     offset = dissect_amqp_method_connection_close_ok(tvb,
1244                         11, tvb_length (tvb), args_tree);
1245                     if (check_col(pinfo->cinfo, COL_INFO)) {
1246                         col_append_str(pinfo->cinfo, COL_INFO,
1247                             "Connection.Close-Ok ");
1248                         col_set_fence(pinfo->cinfo, COL_INFO);
1249                     }
1250                     break;
1251                 default:
1252                     DISSECTOR_ASSERT(FALSE);
1253                 }
1254                 break;
1255             case AMQP_CLASS_CHANNEL:
1256                 proto_tree_add_item(amqp_tree, hf_amqp_method_channel_method_id,
1257                     tvb, 9, 2, FALSE);              
1258                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1259                     tvb, 11, length - 4, FALSE);
1260                 args_tree = proto_item_add_subtree(ti, ett_args);
1261                 switch (tvb_get_ntohs(tvb, 9)) {
1262                 case AMQP_METHOD_CHANNEL_OPEN:
1263                     offset = dissect_amqp_method_channel_open(tvb,
1264                         11, tvb_length (tvb), args_tree);
1265                     if (check_col(pinfo->cinfo, COL_INFO)) {
1266                         col_append_str(pinfo->cinfo, COL_INFO,
1267                             "Channel.Open ");
1268                         col_set_fence(pinfo->cinfo, COL_INFO);
1269                     }
1270                     break;
1271                 case AMQP_METHOD_CHANNEL_OPEN_OK:
1272                     offset = dissect_amqp_method_channel_open_ok(tvb,
1273                         11, tvb_length (tvb), args_tree);
1274                     if (check_col(pinfo->cinfo, COL_INFO)) {
1275                         col_append_str(pinfo->cinfo, COL_INFO,
1276                             "Channel.Open-Ok ");
1277                         col_set_fence(pinfo->cinfo, COL_INFO);
1278                     }
1279                     break;
1280                 case AMQP_METHOD_CHANNEL_FLOW:
1281                     offset = dissect_amqp_method_channel_flow(tvb,
1282                         11, tvb_length (tvb), args_tree);
1283                     if (check_col(pinfo->cinfo, COL_INFO)) {
1284                         col_append_str(pinfo->cinfo, COL_INFO,
1285                             "Channel.Flow ");
1286                         col_set_fence(pinfo->cinfo, COL_INFO);
1287                     }
1288                     break;
1289                 case AMQP_METHOD_CHANNEL_FLOW_OK:
1290                     offset = dissect_amqp_method_channel_flow_ok(tvb,
1291                         11, tvb_length (tvb), args_tree);
1292                     if (check_col(pinfo->cinfo, COL_INFO)) {
1293                         col_append_str(pinfo->cinfo, COL_INFO,
1294                             "Channel.Flow-Ok ");
1295                         col_set_fence(pinfo->cinfo, COL_INFO);
1296                     }
1297                     break;
1298                 case AMQP_METHOD_CHANNEL_CLOSE:
1299                     offset = dissect_amqp_method_channel_close(tvb,
1300                         11, tvb_length (tvb), args_tree);
1301                     if (check_col(pinfo->cinfo, COL_INFO)) {
1302                         col_append_str(pinfo->cinfo, COL_INFO,
1303                             "Channel.Close ");
1304                         col_set_fence(pinfo->cinfo, COL_INFO);
1305                     }
1306                     break;
1307                 case AMQP_METHOD_CHANNEL_CLOSE_OK:
1308                     offset = dissect_amqp_method_channel_close_ok(tvb,
1309                         11, tvb_length (tvb), args_tree);
1310                     if (check_col(pinfo->cinfo, COL_INFO)) {
1311                         col_append_str(pinfo->cinfo, COL_INFO,
1312                             "Channel.Close-Ok ");
1313                         col_set_fence(pinfo->cinfo, COL_INFO);
1314                     }
1315                     break;
1316                 case AMQP_METHOD_CHANNEL_RESUME:
1317                     offset = dissect_amqp_method_channel_resume(tvb,
1318                         11, tvb_length (tvb), args_tree);
1319                     if (check_col(pinfo->cinfo, COL_INFO)) {
1320                         col_append_str(pinfo->cinfo, COL_INFO,
1321                             "Channel.Resume ");
1322                         col_set_fence(pinfo->cinfo, COL_INFO);
1323                     }
1324                     break;
1325                 case AMQP_METHOD_CHANNEL_PING:
1326                     offset = dissect_amqp_method_channel_ping(tvb,
1327                         11, tvb_length (tvb), args_tree);
1328                     if (check_col(pinfo->cinfo, COL_INFO)) {
1329                         col_append_str(pinfo->cinfo, COL_INFO,
1330                             "Channel.Ping ");
1331                         col_set_fence(pinfo->cinfo, COL_INFO);
1332                     }
1333                     break;
1334                 case AMQP_METHOD_CHANNEL_PONG:
1335                     offset = dissect_amqp_method_channel_pong(tvb,
1336                         11, tvb_length (tvb), args_tree);
1337                     if (check_col(pinfo->cinfo, COL_INFO)) {
1338                         col_append_str(pinfo->cinfo, COL_INFO,
1339                             "Channel.Pong ");
1340                         col_set_fence(pinfo->cinfo, COL_INFO);
1341                     }
1342                     break;
1343                 case AMQP_METHOD_CHANNEL_OK:
1344                     offset = dissect_amqp_method_channel_ok(tvb,
1345                         11, tvb_length (tvb), args_tree);
1346                     if (check_col(pinfo->cinfo, COL_INFO)) {
1347                         col_append_str(pinfo->cinfo, COL_INFO,
1348                             "Channel.Ok ");
1349                         col_set_fence(pinfo->cinfo, COL_INFO);
1350                     }
1351                     break;
1352                 default:
1353                     DISSECTOR_ASSERT(FALSE);
1354                 }
1355                 break;
1356             case AMQP_CLASS_ACCESS:
1357                 proto_tree_add_item(amqp_tree, hf_amqp_method_access_method_id,
1358                     tvb, 9, 2, FALSE);              
1359                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1360                     tvb, 11, length - 4, FALSE);
1361                 args_tree = proto_item_add_subtree(ti, ett_args);
1362                 switch (tvb_get_ntohs(tvb, 9)) {
1363                 case AMQP_METHOD_ACCESS_REQUEST:
1364                     offset = dissect_amqp_method_access_request(tvb,
1365                         11, tvb_length (tvb), args_tree);
1366                     if (check_col(pinfo->cinfo, COL_INFO)) {
1367                         col_append_str(pinfo->cinfo, COL_INFO,
1368                             "Access.Request ");
1369                         col_set_fence(pinfo->cinfo, COL_INFO);
1370                     }
1371                     break;
1372                 case AMQP_METHOD_ACCESS_REQUEST_OK:
1373                     offset = dissect_amqp_method_access_request_ok(tvb,
1374                         11, tvb_length (tvb), args_tree);
1375                     if (check_col(pinfo->cinfo, COL_INFO)) {
1376                         col_append_str(pinfo->cinfo, COL_INFO,
1377                             "Access.Request-Ok ");
1378                         col_set_fence(pinfo->cinfo, COL_INFO);
1379                     }
1380                     break;
1381                 default:
1382                     DISSECTOR_ASSERT(FALSE);
1383                 }
1384                 break;
1385             case AMQP_CLASS_EXCHANGE:
1386                 proto_tree_add_item(amqp_tree, hf_amqp_method_exchange_method_id,
1387                     tvb, 9, 2, FALSE);              
1388                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1389                     tvb, 11, length - 4, FALSE);
1390                 args_tree = proto_item_add_subtree(ti, ett_args);
1391                 switch (tvb_get_ntohs(tvb, 9)) {
1392                 case AMQP_METHOD_EXCHANGE_DECLARE:
1393                     offset = dissect_amqp_method_exchange_declare(tvb,
1394                         11, tvb_length (tvb), args_tree);
1395                     if (check_col(pinfo->cinfo, COL_INFO)) {
1396                         col_append_str(pinfo->cinfo, COL_INFO,
1397                             "Exchange.Declare ");
1398                         col_set_fence(pinfo->cinfo, COL_INFO);
1399                     }
1400                     break;
1401                 case AMQP_METHOD_EXCHANGE_DECLARE_OK:
1402                     offset = dissect_amqp_method_exchange_declare_ok(tvb,
1403                         11, tvb_length (tvb), args_tree);
1404                     if (check_col(pinfo->cinfo, COL_INFO)) {
1405                         col_append_str(pinfo->cinfo, COL_INFO,
1406                             "Exchange.Declare-Ok ");
1407                         col_set_fence(pinfo->cinfo, COL_INFO);
1408                     }
1409                     break;
1410                 case AMQP_METHOD_EXCHANGE_DELETE:
1411                     offset = dissect_amqp_method_exchange_delete(tvb,
1412                         11, tvb_length (tvb), args_tree);
1413                     if (check_col(pinfo->cinfo, COL_INFO)) {
1414                         col_append_str(pinfo->cinfo, COL_INFO,
1415                             "Exchange.Delete ");
1416                         col_set_fence(pinfo->cinfo, COL_INFO);
1417                     }
1418                     break;
1419                 case AMQP_METHOD_EXCHANGE_DELETE_OK:
1420                     offset = dissect_amqp_method_exchange_delete_ok(tvb,
1421                         11, tvb_length (tvb), args_tree);
1422                     if (check_col(pinfo->cinfo, COL_INFO)) {
1423                         col_append_str(pinfo->cinfo, COL_INFO,
1424                             "Exchange.Delete-Ok ");
1425                         col_set_fence(pinfo->cinfo, COL_INFO);
1426                     }
1427                     break;
1428                 default:
1429                     DISSECTOR_ASSERT(FALSE);
1430                 }
1431                 break;
1432             case AMQP_CLASS_QUEUE:
1433                 proto_tree_add_item(amqp_tree, hf_amqp_method_queue_method_id,
1434                     tvb, 9, 2, FALSE);              
1435                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1436                     tvb, 11, length - 4, FALSE);
1437                 args_tree = proto_item_add_subtree(ti, ett_args);
1438                 switch (tvb_get_ntohs(tvb, 9)) {
1439                 case AMQP_METHOD_QUEUE_DECLARE:
1440                     offset = dissect_amqp_method_queue_declare(tvb,
1441                         11, tvb_length (tvb), args_tree);
1442                     if (check_col(pinfo->cinfo, COL_INFO)) {
1443                         col_append_str(pinfo->cinfo, COL_INFO,
1444                             "Queue.Declare ");
1445                         col_set_fence(pinfo->cinfo, COL_INFO);
1446                     }
1447                     break;
1448                 case AMQP_METHOD_QUEUE_DECLARE_OK:
1449                     offset = dissect_amqp_method_queue_declare_ok(tvb,
1450                         11, tvb_length (tvb), args_tree);
1451                     if (check_col(pinfo->cinfo, COL_INFO)) {
1452                         col_append_str(pinfo->cinfo, COL_INFO,
1453                             "Queue.Declare-Ok ");
1454                         col_set_fence(pinfo->cinfo, COL_INFO);
1455                     }
1456                     break;
1457                 case AMQP_METHOD_QUEUE_BIND:
1458                     offset = dissect_amqp_method_queue_bind(tvb,
1459                         11, tvb_length (tvb), args_tree);
1460                     if (check_col(pinfo->cinfo, COL_INFO)) {
1461                         col_append_str(pinfo->cinfo, COL_INFO,
1462                             "Queue.Bind ");
1463                         col_set_fence(pinfo->cinfo, COL_INFO);
1464                     }
1465                     break;
1466                 case AMQP_METHOD_QUEUE_BIND_OK:
1467                     offset = dissect_amqp_method_queue_bind_ok(tvb,
1468                         11, tvb_length (tvb), args_tree);
1469                     if (check_col(pinfo->cinfo, COL_INFO)) {
1470                         col_append_str(pinfo->cinfo, COL_INFO,
1471                             "Queue.Bind-Ok ");
1472                         col_set_fence(pinfo->cinfo, COL_INFO);
1473                     }
1474                     break;
1475                 case AMQP_METHOD_QUEUE_UNBIND:
1476                     offset = dissect_amqp_method_queue_unbind(tvb,
1477                         11, tvb_length (tvb), args_tree);
1478                     if (check_col(pinfo->cinfo, COL_INFO)) {
1479                         col_append_str(pinfo->cinfo, COL_INFO,
1480                             "Queue.Unbind ");
1481                         col_set_fence(pinfo->cinfo, COL_INFO);
1482                     }
1483                     break;
1484                 case AMQP_METHOD_QUEUE_UNBIND_OK:
1485                     offset = dissect_amqp_method_queue_unbind_ok(tvb,
1486                         11, tvb_length (tvb), args_tree);
1487                     if (check_col(pinfo->cinfo, COL_INFO)) {
1488                         col_append_str(pinfo->cinfo, COL_INFO,
1489                             "Queue.Unbind-Ok ");
1490                         col_set_fence(pinfo->cinfo, COL_INFO);
1491                     }
1492                     break;
1493                 case AMQP_METHOD_QUEUE_PURGE:
1494                     offset = dissect_amqp_method_queue_purge(tvb,
1495                         11, tvb_length (tvb), args_tree);
1496                     if (check_col(pinfo->cinfo, COL_INFO)) {
1497                         col_append_str(pinfo->cinfo, COL_INFO,
1498                             "Queue.Purge ");
1499                         col_set_fence(pinfo->cinfo, COL_INFO);
1500                     }
1501                     break;
1502                 case AMQP_METHOD_QUEUE_PURGE_OK:
1503                     offset = dissect_amqp_method_queue_purge_ok(tvb,
1504                         11, tvb_length (tvb), args_tree);
1505                     if (check_col(pinfo->cinfo, COL_INFO)) {
1506                         col_append_str(pinfo->cinfo, COL_INFO,
1507                             "Queue.Purge-Ok ");
1508                         col_set_fence(pinfo->cinfo, COL_INFO);
1509                     }
1510                     break;
1511                 case AMQP_METHOD_QUEUE_DELETE:
1512                     offset = dissect_amqp_method_queue_delete(tvb,
1513                         11, tvb_length (tvb), args_tree);
1514                     if (check_col(pinfo->cinfo, COL_INFO)) {
1515                         col_append_str(pinfo->cinfo, COL_INFO,
1516                             "Queue.Delete ");
1517                         col_set_fence(pinfo->cinfo, COL_INFO);
1518                     }
1519                     break;
1520                 case AMQP_METHOD_QUEUE_DELETE_OK:
1521                     offset = dissect_amqp_method_queue_delete_ok(tvb,
1522                         11, tvb_length (tvb), args_tree);
1523                     if (check_col(pinfo->cinfo, COL_INFO)) {
1524                         col_append_str(pinfo->cinfo, COL_INFO,
1525                             "Queue.Delete-Ok ");
1526                         col_set_fence(pinfo->cinfo, COL_INFO);
1527                     }
1528                     break;
1529                 default:
1530                     DISSECTOR_ASSERT(FALSE);
1531                 }
1532                 break;
1533             case AMQP_CLASS_BASIC:
1534                 proto_tree_add_item(amqp_tree, hf_amqp_method_basic_method_id,
1535                     tvb, 9, 2, FALSE);              
1536                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1537                     tvb, 11, length - 4, FALSE);
1538                 args_tree = proto_item_add_subtree(ti, ett_args);
1539                 switch (tvb_get_ntohs(tvb, 9)) {
1540                 case AMQP_METHOD_BASIC_QOS:
1541                     offset = dissect_amqp_method_basic_qos(tvb,
1542                         11, tvb_length (tvb), args_tree);
1543                     if (check_col(pinfo->cinfo, COL_INFO)) {
1544                         col_append_str(pinfo->cinfo, COL_INFO,
1545                             "Basic.Qos ");
1546                         col_set_fence(pinfo->cinfo, COL_INFO);
1547                     }
1548                     break;
1549                 case AMQP_METHOD_BASIC_QOS_OK:
1550                     offset = dissect_amqp_method_basic_qos_ok(tvb,
1551                         11, tvb_length (tvb), args_tree);
1552                     if (check_col(pinfo->cinfo, COL_INFO)) {
1553                         col_append_str(pinfo->cinfo, COL_INFO,
1554                             "Basic.Qos-Ok ");
1555                         col_set_fence(pinfo->cinfo, COL_INFO);
1556                     }
1557                     break;
1558                 case AMQP_METHOD_BASIC_CONSUME:
1559                     offset = dissect_amqp_method_basic_consume(tvb,
1560                         11, tvb_length (tvb), args_tree);
1561                     if (check_col(pinfo->cinfo, COL_INFO)) {
1562                         col_append_str(pinfo->cinfo, COL_INFO,
1563                             "Basic.Consume ");
1564                         col_set_fence(pinfo->cinfo, COL_INFO);
1565                     }
1566                     break;
1567                 case AMQP_METHOD_BASIC_CONSUME_OK:
1568                     offset = dissect_amqp_method_basic_consume_ok(tvb,
1569                         11, tvb_length (tvb), args_tree);
1570                     if (check_col(pinfo->cinfo, COL_INFO)) {
1571                         col_append_str(pinfo->cinfo, COL_INFO,
1572                             "Basic.Consume-Ok ");
1573                         col_set_fence(pinfo->cinfo, COL_INFO);
1574                     }
1575                     break;
1576                 case AMQP_METHOD_BASIC_CANCEL:
1577                     offset = dissect_amqp_method_basic_cancel(tvb,
1578                         11, tvb_length (tvb), args_tree);
1579                     if (check_col(pinfo->cinfo, COL_INFO)) {
1580                         col_append_str(pinfo->cinfo, COL_INFO,
1581                             "Basic.Cancel ");
1582                         col_set_fence(pinfo->cinfo, COL_INFO);
1583                     }
1584                     break;
1585                 case AMQP_METHOD_BASIC_CANCEL_OK:
1586                     offset = dissect_amqp_method_basic_cancel_ok(tvb,
1587                         11, tvb_length (tvb), args_tree);
1588                     if (check_col(pinfo->cinfo, COL_INFO)) {
1589                         col_append_str(pinfo->cinfo, COL_INFO,
1590                             "Basic.Cancel-Ok ");
1591                         col_set_fence(pinfo->cinfo, COL_INFO);
1592                     }
1593                     break;
1594                 case AMQP_METHOD_BASIC_PUBLISH:
1595                     offset = dissect_amqp_method_basic_publish(tvb,
1596                         11, tvb_length (tvb), args_tree);
1597                     if (check_col(pinfo->cinfo, COL_INFO)) {
1598                         col_append_str(pinfo->cinfo, COL_INFO,
1599                             "Basic.Publish ");
1600                         col_set_fence(pinfo->cinfo, COL_INFO);
1601                     }
1602                     break;
1603                 case AMQP_METHOD_BASIC_RETURN:
1604                     offset = dissect_amqp_method_basic_return(tvb,
1605                         11, tvb_length (tvb), args_tree);
1606                     if (check_col(pinfo->cinfo, COL_INFO)) {
1607                         col_append_str(pinfo->cinfo, COL_INFO,
1608                             "Basic.Return ");
1609                         col_set_fence(pinfo->cinfo, COL_INFO);
1610                     }
1611                     break;
1612                 case AMQP_METHOD_BASIC_DELIVER:
1613                     offset = dissect_amqp_method_basic_deliver(tvb,
1614                         11, tvb_length (tvb), args_tree);
1615                     if (check_col(pinfo->cinfo, COL_INFO)) {
1616                         col_append_str(pinfo->cinfo, COL_INFO,
1617                             "Basic.Deliver ");
1618                         col_set_fence(pinfo->cinfo, COL_INFO);
1619                     }
1620                     break;
1621                 case AMQP_METHOD_BASIC_GET:
1622                     offset = dissect_amqp_method_basic_get(tvb,
1623                         11, tvb_length (tvb), args_tree);
1624                     if (check_col(pinfo->cinfo, COL_INFO)) {
1625                         col_append_str(pinfo->cinfo, COL_INFO,
1626                             "Basic.Get ");
1627                         col_set_fence(pinfo->cinfo, COL_INFO);
1628                     }
1629                     break;
1630                 case AMQP_METHOD_BASIC_GET_OK:
1631                     offset = dissect_amqp_method_basic_get_ok(tvb,
1632                         11, tvb_length (tvb), args_tree);
1633                     if (check_col(pinfo->cinfo, COL_INFO)) {
1634                         col_append_str(pinfo->cinfo, COL_INFO,
1635                             "Basic.Get-Ok ");
1636                         col_set_fence(pinfo->cinfo, COL_INFO);
1637                     }
1638                     break;
1639                 case AMQP_METHOD_BASIC_GET_EMPTY:
1640                     offset = dissect_amqp_method_basic_get_empty(tvb,
1641                         11, tvb_length (tvb), args_tree);
1642                     if (check_col(pinfo->cinfo, COL_INFO)) {
1643                         col_append_str(pinfo->cinfo, COL_INFO,
1644                             "Basic.Get-Empty ");
1645                         col_set_fence(pinfo->cinfo, COL_INFO);
1646                     }
1647                     break;
1648                 case AMQP_METHOD_BASIC_ACK:
1649                     offset = dissect_amqp_method_basic_ack(tvb,
1650                         11, tvb_length (tvb), args_tree);
1651                     if (check_col(pinfo->cinfo, COL_INFO)) {
1652                         col_append_str(pinfo->cinfo, COL_INFO,
1653                             "Basic.Ack ");
1654                         col_set_fence(pinfo->cinfo, COL_INFO);
1655                     }
1656                     break;
1657                 case AMQP_METHOD_BASIC_REJECT:
1658                     offset = dissect_amqp_method_basic_reject(tvb,
1659                         11, tvb_length (tvb), args_tree);
1660                     if (check_col(pinfo->cinfo, COL_INFO)) {
1661                         col_append_str(pinfo->cinfo, COL_INFO,
1662                             "Basic.Reject ");
1663                         col_set_fence(pinfo->cinfo, COL_INFO);
1664                     }
1665                     break;
1666                 case AMQP_METHOD_BASIC_RECOVER:
1667                     offset = dissect_amqp_method_basic_recover(tvb,
1668                         11, tvb_length (tvb), args_tree);
1669                     if (check_col(pinfo->cinfo, COL_INFO)) {
1670                         col_append_str(pinfo->cinfo, COL_INFO,
1671                             "Basic.Recover ");
1672                         col_set_fence(pinfo->cinfo, COL_INFO);
1673                     }
1674                     break;
1675                 default:
1676                     DISSECTOR_ASSERT(FALSE);
1677                 }
1678                 break;
1679             case AMQP_CLASS_FILE:
1680                 proto_tree_add_item(amqp_tree, hf_amqp_method_file_method_id,
1681                     tvb, 9, 2, FALSE);              
1682                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1683                     tvb, 11, length - 4, FALSE);
1684                 args_tree = proto_item_add_subtree(ti, ett_args);
1685                 switch (tvb_get_ntohs(tvb, 9)) {
1686                 case AMQP_METHOD_FILE_QOS:
1687                     offset = dissect_amqp_method_file_qos(tvb,
1688                         11, tvb_length (tvb), args_tree);
1689                     if (check_col(pinfo->cinfo, COL_INFO)) {
1690                         col_append_str(pinfo->cinfo, COL_INFO,
1691                             "File.Qos ");
1692                         col_set_fence(pinfo->cinfo, COL_INFO);
1693                     }
1694                     break;
1695                 case AMQP_METHOD_FILE_QOS_OK:
1696                     offset = dissect_amqp_method_file_qos_ok(tvb,
1697                         11, tvb_length (tvb), args_tree);
1698                     if (check_col(pinfo->cinfo, COL_INFO)) {
1699                         col_append_str(pinfo->cinfo, COL_INFO,
1700                             "File.Qos-Ok ");
1701                         col_set_fence(pinfo->cinfo, COL_INFO);
1702                     }
1703                     break;
1704                 case AMQP_METHOD_FILE_CONSUME:
1705                     offset = dissect_amqp_method_file_consume(tvb,
1706                         11, tvb_length (tvb), args_tree);
1707                     if (check_col(pinfo->cinfo, COL_INFO)) {
1708                         col_append_str(pinfo->cinfo, COL_INFO,
1709                             "File.Consume ");
1710                         col_set_fence(pinfo->cinfo, COL_INFO);
1711                     }
1712                     break;
1713                 case AMQP_METHOD_FILE_CONSUME_OK:
1714                     offset = dissect_amqp_method_file_consume_ok(tvb,
1715                         11, tvb_length (tvb), args_tree);
1716                     if (check_col(pinfo->cinfo, COL_INFO)) {
1717                         col_append_str(pinfo->cinfo, COL_INFO,
1718                             "File.Consume-Ok ");
1719                         col_set_fence(pinfo->cinfo, COL_INFO);
1720                     }
1721                     break;
1722                 case AMQP_METHOD_FILE_CANCEL:
1723                     offset = dissect_amqp_method_file_cancel(tvb,
1724                         11, tvb_length (tvb), args_tree);
1725                     if (check_col(pinfo->cinfo, COL_INFO)) {
1726                         col_append_str(pinfo->cinfo, COL_INFO,
1727                             "File.Cancel ");
1728                         col_set_fence(pinfo->cinfo, COL_INFO);
1729                     }
1730                     break;
1731                 case AMQP_METHOD_FILE_CANCEL_OK:
1732                     offset = dissect_amqp_method_file_cancel_ok(tvb,
1733                         11, tvb_length (tvb), args_tree);
1734                     if (check_col(pinfo->cinfo, COL_INFO)) {
1735                         col_append_str(pinfo->cinfo, COL_INFO,
1736                             "File.Cancel-Ok ");
1737                         col_set_fence(pinfo->cinfo, COL_INFO);
1738                     }
1739                     break;
1740                 case AMQP_METHOD_FILE_OPEN:
1741                     offset = dissect_amqp_method_file_open(tvb,
1742                         11, tvb_length (tvb), args_tree);
1743                     if (check_col(pinfo->cinfo, COL_INFO)) {
1744                         col_append_str(pinfo->cinfo, COL_INFO,
1745                             "File.Open ");
1746                         col_set_fence(pinfo->cinfo, COL_INFO);
1747                     }
1748                     break;
1749                 case AMQP_METHOD_FILE_OPEN_OK:
1750                     offset = dissect_amqp_method_file_open_ok(tvb,
1751                         11, tvb_length (tvb), args_tree);
1752                     if (check_col(pinfo->cinfo, COL_INFO)) {
1753                         col_append_str(pinfo->cinfo, COL_INFO,
1754                             "File.Open-Ok ");
1755                         col_set_fence(pinfo->cinfo, COL_INFO);
1756                     }
1757                     break;
1758                 case AMQP_METHOD_FILE_STAGE:
1759                     offset = dissect_amqp_method_file_stage(tvb,
1760                         11, tvb_length (tvb), args_tree);
1761                     if (check_col(pinfo->cinfo, COL_INFO)) {
1762                         col_append_str(pinfo->cinfo, COL_INFO,
1763                             "File.Stage ");
1764                         col_set_fence(pinfo->cinfo, COL_INFO);
1765                     }
1766                     break;
1767                 case AMQP_METHOD_FILE_PUBLISH:
1768                     offset = dissect_amqp_method_file_publish(tvb,
1769                         11, tvb_length (tvb), args_tree);
1770                     if (check_col(pinfo->cinfo, COL_INFO)) {
1771                         col_append_str(pinfo->cinfo, COL_INFO,
1772                             "File.Publish ");
1773                         col_set_fence(pinfo->cinfo, COL_INFO);
1774                     }
1775                     break;
1776                 case AMQP_METHOD_FILE_RETURN:
1777                     offset = dissect_amqp_method_file_return(tvb,
1778                         11, tvb_length (tvb), args_tree);
1779                     if (check_col(pinfo->cinfo, COL_INFO)) {
1780                         col_append_str(pinfo->cinfo, COL_INFO,
1781                             "File.Return ");
1782                         col_set_fence(pinfo->cinfo, COL_INFO);
1783                     }
1784                     break;
1785                 case AMQP_METHOD_FILE_DELIVER:
1786                     offset = dissect_amqp_method_file_deliver(tvb,
1787                         11, tvb_length (tvb), args_tree);
1788                     if (check_col(pinfo->cinfo, COL_INFO)) {
1789                         col_append_str(pinfo->cinfo, COL_INFO,
1790                             "File.Deliver ");
1791                         col_set_fence(pinfo->cinfo, COL_INFO);
1792                     }
1793                     break;
1794                 case AMQP_METHOD_FILE_ACK:
1795                     offset = dissect_amqp_method_file_ack(tvb,
1796                         11, tvb_length (tvb), args_tree);
1797                     if (check_col(pinfo->cinfo, COL_INFO)) {
1798                         col_append_str(pinfo->cinfo, COL_INFO,
1799                             "File.Ack ");
1800                         col_set_fence(pinfo->cinfo, COL_INFO);
1801                     }
1802                     break;
1803                 case AMQP_METHOD_FILE_REJECT:
1804                     offset = dissect_amqp_method_file_reject(tvb,
1805                         11, tvb_length (tvb), args_tree);
1806                     if (check_col(pinfo->cinfo, COL_INFO)) {
1807                         col_append_str(pinfo->cinfo, COL_INFO,
1808                             "File.Reject ");
1809                         col_set_fence(pinfo->cinfo, COL_INFO);
1810                     }
1811                     break;
1812                 default:
1813                     DISSECTOR_ASSERT(FALSE);
1814                 }
1815                 break;
1816             case AMQP_CLASS_STREAM:
1817                 proto_tree_add_item(amqp_tree, hf_amqp_method_stream_method_id,
1818                     tvb, 9, 2, FALSE);              
1819                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1820                     tvb, 11, length - 4, FALSE);
1821                 args_tree = proto_item_add_subtree(ti, ett_args);
1822                 switch (tvb_get_ntohs(tvb, 9)) {
1823                 case AMQP_METHOD_STREAM_QOS:
1824                     offset = dissect_amqp_method_stream_qos(tvb,
1825                         11, tvb_length (tvb), args_tree);
1826                     if (check_col(pinfo->cinfo, COL_INFO)) {
1827                         col_append_str(pinfo->cinfo, COL_INFO,
1828                             "Stream.Qos ");
1829                         col_set_fence(pinfo->cinfo, COL_INFO);
1830                     }
1831                     break;
1832                 case AMQP_METHOD_STREAM_QOS_OK:
1833                     offset = dissect_amqp_method_stream_qos_ok(tvb,
1834                         11, tvb_length (tvb), args_tree);
1835                     if (check_col(pinfo->cinfo, COL_INFO)) {
1836                         col_append_str(pinfo->cinfo, COL_INFO,
1837                             "Stream.Qos-Ok ");
1838                         col_set_fence(pinfo->cinfo, COL_INFO);
1839                     }
1840                     break;
1841                 case AMQP_METHOD_STREAM_CONSUME:
1842                     offset = dissect_amqp_method_stream_consume(tvb,
1843                         11, tvb_length (tvb), args_tree);
1844                     if (check_col(pinfo->cinfo, COL_INFO)) {
1845                         col_append_str(pinfo->cinfo, COL_INFO,
1846                             "Stream.Consume ");
1847                         col_set_fence(pinfo->cinfo, COL_INFO);
1848                     }
1849                     break;
1850                 case AMQP_METHOD_STREAM_CONSUME_OK:
1851                     offset = dissect_amqp_method_stream_consume_ok(tvb,
1852                         11, tvb_length (tvb), args_tree);
1853                     if (check_col(pinfo->cinfo, COL_INFO)) {
1854                         col_append_str(pinfo->cinfo, COL_INFO,
1855                             "Stream.Consume-Ok ");
1856                         col_set_fence(pinfo->cinfo, COL_INFO);
1857                     }
1858                     break;
1859                 case AMQP_METHOD_STREAM_CANCEL:
1860                     offset = dissect_amqp_method_stream_cancel(tvb,
1861                         11, tvb_length (tvb), args_tree);
1862                     if (check_col(pinfo->cinfo, COL_INFO)) {
1863                         col_append_str(pinfo->cinfo, COL_INFO,
1864                             "Stream.Cancel ");
1865                         col_set_fence(pinfo->cinfo, COL_INFO);
1866                     }
1867                     break;
1868                 case AMQP_METHOD_STREAM_CANCEL_OK:
1869                     offset = dissect_amqp_method_stream_cancel_ok(tvb,
1870                         11, tvb_length (tvb), args_tree);
1871                     if (check_col(pinfo->cinfo, COL_INFO)) {
1872                         col_append_str(pinfo->cinfo, COL_INFO,
1873                             "Stream.Cancel-Ok ");
1874                         col_set_fence(pinfo->cinfo, COL_INFO);
1875                     }
1876                     break;
1877                 case AMQP_METHOD_STREAM_PUBLISH:
1878                     offset = dissect_amqp_method_stream_publish(tvb,
1879                         11, tvb_length (tvb), args_tree);
1880                     if (check_col(pinfo->cinfo, COL_INFO)) {
1881                         col_append_str(pinfo->cinfo, COL_INFO,
1882                             "Stream.Publish ");
1883                         col_set_fence(pinfo->cinfo, COL_INFO);
1884                     }
1885                     break;
1886                 case AMQP_METHOD_STREAM_RETURN:
1887                     offset = dissect_amqp_method_stream_return(tvb,
1888                         11, tvb_length (tvb), args_tree);
1889                     if (check_col(pinfo->cinfo, COL_INFO)) {
1890                         col_append_str(pinfo->cinfo, COL_INFO,
1891                             "Stream.Return ");
1892                         col_set_fence(pinfo->cinfo, COL_INFO);
1893                     }
1894                     break;
1895                 case AMQP_METHOD_STREAM_DELIVER:
1896                     offset = dissect_amqp_method_stream_deliver(tvb,
1897                         11, tvb_length (tvb), args_tree);
1898                     if (check_col(pinfo->cinfo, COL_INFO)) {
1899                         col_append_str(pinfo->cinfo, COL_INFO,
1900                             "Stream.Deliver ");
1901                         col_set_fence(pinfo->cinfo, COL_INFO);
1902                     }
1903                     break;
1904                 default:
1905                     DISSECTOR_ASSERT(FALSE);
1906                 }
1907                 break;
1908             case AMQP_CLASS_TX:
1909                 proto_tree_add_item(amqp_tree, hf_amqp_method_tx_method_id,
1910                     tvb, 9, 2, FALSE);              
1911                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1912                     tvb, 11, length - 4, FALSE);
1913                 args_tree = proto_item_add_subtree(ti, ett_args);
1914                 switch (tvb_get_ntohs(tvb, 9)) {
1915                 case AMQP_METHOD_TX_SELECT:
1916                     offset = dissect_amqp_method_tx_select(tvb,
1917                         11, tvb_length (tvb), args_tree);
1918                     if (check_col(pinfo->cinfo, COL_INFO)) {
1919                         col_append_str(pinfo->cinfo, COL_INFO,
1920                             "Tx.Select ");
1921                         col_set_fence(pinfo->cinfo, COL_INFO);
1922                     }
1923                     break;
1924                 case AMQP_METHOD_TX_SELECT_OK:
1925                     offset = dissect_amqp_method_tx_select_ok(tvb,
1926                         11, tvb_length (tvb), args_tree);
1927                     if (check_col(pinfo->cinfo, COL_INFO)) {
1928                         col_append_str(pinfo->cinfo, COL_INFO,
1929                             "Tx.Select-Ok ");
1930                         col_set_fence(pinfo->cinfo, COL_INFO);
1931                     }
1932                     break;
1933                 case AMQP_METHOD_TX_COMMIT:
1934                     offset = dissect_amqp_method_tx_commit(tvb,
1935                         11, tvb_length (tvb), args_tree);
1936                     if (check_col(pinfo->cinfo, COL_INFO)) {
1937                         col_append_str(pinfo->cinfo, COL_INFO,
1938                             "Tx.Commit ");
1939                         col_set_fence(pinfo->cinfo, COL_INFO);
1940                     }
1941                     break;
1942                 case AMQP_METHOD_TX_COMMIT_OK:
1943                     offset = dissect_amqp_method_tx_commit_ok(tvb,
1944                         11, tvb_length (tvb), args_tree);
1945                     if (check_col(pinfo->cinfo, COL_INFO)) {
1946                         col_append_str(pinfo->cinfo, COL_INFO,
1947                             "Tx.Commit-Ok ");
1948                         col_set_fence(pinfo->cinfo, COL_INFO);
1949                     }
1950                     break;
1951                 case AMQP_METHOD_TX_ROLLBACK:
1952                     offset = dissect_amqp_method_tx_rollback(tvb,
1953                         11, tvb_length (tvb), args_tree);
1954                     if (check_col(pinfo->cinfo, COL_INFO)) {
1955                         col_append_str(pinfo->cinfo, COL_INFO,
1956                             "Tx.Rollback ");
1957                         col_set_fence(pinfo->cinfo, COL_INFO);
1958                     }
1959                     break;
1960                 case AMQP_METHOD_TX_ROLLBACK_OK:
1961                     offset = dissect_amqp_method_tx_rollback_ok(tvb,
1962                         11, tvb_length (tvb), args_tree);
1963                     if (check_col(pinfo->cinfo, COL_INFO)) {
1964                         col_append_str(pinfo->cinfo, COL_INFO,
1965                             "Tx.Rollback-Ok ");
1966                         col_set_fence(pinfo->cinfo, COL_INFO);
1967                     }
1968                     break;
1969                 default:
1970                     DISSECTOR_ASSERT(FALSE);
1971                 }
1972                 break;
1973             case AMQP_CLASS_DTX:
1974                 proto_tree_add_item(amqp_tree, hf_amqp_method_dtx_method_id,
1975                     tvb, 9, 2, FALSE);              
1976                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
1977                     tvb, 11, length - 4, FALSE);
1978                 args_tree = proto_item_add_subtree(ti, ett_args);
1979                 switch (tvb_get_ntohs(tvb, 9)) {
1980                 case AMQP_METHOD_DTX_SELECT:
1981                     offset = dissect_amqp_method_dtx_select(tvb,
1982                         11, tvb_length (tvb), args_tree);
1983                     if (check_col(pinfo->cinfo, COL_INFO)) {
1984                         col_append_str(pinfo->cinfo, COL_INFO,
1985                             "Dtx.Select ");
1986                         col_set_fence(pinfo->cinfo, COL_INFO);
1987                     }
1988                     break;
1989                 case AMQP_METHOD_DTX_SELECT_OK:
1990                     offset = dissect_amqp_method_dtx_select_ok(tvb,
1991                         11, tvb_length (tvb), args_tree);
1992                     if (check_col(pinfo->cinfo, COL_INFO)) {
1993                         col_append_str(pinfo->cinfo, COL_INFO,
1994                             "Dtx.Select-Ok ");
1995                         col_set_fence(pinfo->cinfo, COL_INFO);
1996                     }
1997                     break;
1998                 case AMQP_METHOD_DTX_START:
1999                     offset = dissect_amqp_method_dtx_start(tvb,
2000                         11, tvb_length (tvb), args_tree);
2001                     if (check_col(pinfo->cinfo, COL_INFO)) {
2002                         col_append_str(pinfo->cinfo, COL_INFO,
2003                             "Dtx.Start ");
2004                         col_set_fence(pinfo->cinfo, COL_INFO);
2005                     }
2006                     break;
2007                 case AMQP_METHOD_DTX_START_OK:
2008                     offset = dissect_amqp_method_dtx_start_ok(tvb,
2009                         11, tvb_length (tvb), args_tree);
2010                     if (check_col(pinfo->cinfo, COL_INFO)) {
2011                         col_append_str(pinfo->cinfo, COL_INFO,
2012                             "Dtx.Start-Ok ");
2013                         col_set_fence(pinfo->cinfo, COL_INFO);
2014                     }
2015                     break;
2016                 default:
2017                     DISSECTOR_ASSERT(FALSE);
2018                 }
2019                 break;
2020             case AMQP_CLASS_TUNNEL:
2021                 proto_tree_add_item(amqp_tree, hf_amqp_method_tunnel_method_id,
2022                     tvb, 9, 2, FALSE);              
2023                 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
2024                     tvb, 11, length - 4, FALSE);
2025                 args_tree = proto_item_add_subtree(ti, ett_args);
2026                 switch (tvb_get_ntohs(tvb, 9)) {
2027                 case AMQP_METHOD_TUNNEL_REQUEST:
2028                     offset = dissect_amqp_method_tunnel_request(tvb,
2029                         11, tvb_length (tvb), args_tree);
2030                     if (check_col(pinfo->cinfo, COL_INFO)) {
2031                         col_append_str(pinfo->cinfo, COL_INFO,
2032                             "Tunnel.Request ");
2033                         col_set_fence(pinfo->cinfo, COL_INFO);
2034                     }
2035                     break;
2036                 default:
2037                     DISSECTOR_ASSERT(FALSE);
2038                 }
2039                 break;
2040             default:
2041                 DISSECTOR_ASSERT(FALSE);
2042             }
2043             break;
2044         case AMQP_FRAME_TYPE_CONTENT_HEADER:
2045             proto_tree_add_item(amqp_tree, hf_amqp_header_class_id,
2046                 tvb, 7, 2, FALSE);
2047             proto_tree_add_item(amqp_tree, hf_amqp_header_weight,
2048                 tvb, 9, 2, FALSE);
2049             proto_tree_add_item(amqp_tree, hf_amqp_header_body_size,
2050                 tvb, 11, 8, FALSE);
2051             proto_tree_add_item(amqp_tree, hf_amqp_header_property_flags,
2052                 tvb, 19, 2, FALSE);
2053             ti = proto_tree_add_item(amqp_tree, hf_amqp_header_properties,
2054                 tvb, 21, length - 14, FALSE);
2055             prop_tree = proto_item_add_subtree(ti, ett_props);
2056             offset = 21;
2057             switch (tvb_get_ntohs(tvb, 7)) {
2058             case AMQP_CLASS_BASIC:
2059                 offset = dissect_amqp_content_header_basic(tvb,
2060                     offset, tvb_length (tvb), prop_tree);
2061                 break;
2062             case AMQP_CLASS_FILE:
2063                 offset = dissect_amqp_content_header_file(tvb,
2064                     offset, tvb_length (tvb), prop_tree);
2065                 break;
2066             case AMQP_CLASS_STREAM:
2067                 offset = dissect_amqp_content_header_stream(tvb,
2068                     offset, tvb_length (tvb), prop_tree);
2069                 break;
2070             case AMQP_CLASS_TUNNEL:
2071                 offset = dissect_amqp_content_header_tunnel(tvb,
2072                     offset, tvb_length (tvb), prop_tree);
2073                 break;
2074             default:
2075                 DISSECTOR_ASSERT(FALSE);
2076             }
2077             if (check_col(pinfo->cinfo, COL_INFO)) {
2078                 col_append_str(pinfo->cinfo, COL_INFO, "Content-Header ");
2079                 col_set_fence(pinfo->cinfo, COL_INFO);
2080             }
2081             break;
2082         case AMQP_FRAME_TYPE_CONTENT_BODY:
2083             proto_tree_add_item(amqp_tree, hf_amqp_payload,
2084                 tvb, 7, length, FALSE);
2085             if (check_col(pinfo->cinfo, COL_INFO)) {
2086                 col_append_str(pinfo->cinfo, COL_INFO, "Content-Body ");
2087                 col_set_fence(pinfo->cinfo, COL_INFO);
2088             }
2089             break;
2090         default:
2091             DISSECTOR_ASSERT(FALSE);
2092         }
2093     }
2094 }
2095
2096 /*  Dissection routine for method Connection.Start                        */
2097
2098 static size_t
2099 dissect_amqp_method_connection_start(tvbuff_t *tvb _U_,
2100     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2101 {
2102     proto_item *ti;
2103     /*  version-major (octet)    */
2104     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_major,
2105         tvb, offset, 1, FALSE);
2106     AMQP_INCREMENT(offset, 1, bound);
2107
2108     /*  version-minor (octet)    */
2109     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_minor,
2110         tvb, offset, 1, FALSE);
2111     AMQP_INCREMENT(offset, 1, bound);
2112
2113     /*  server-properties (table)  */
2114     ti = proto_tree_add_item(
2115         args_tree, hf_amqp_method_connection_start_server_properties,
2116         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2117     dissect_amqp_field_table (tvb, offset + 4,
2118         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2119     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2120
2121     /*  mechanisms (longstr)     */
2122     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_mechanisms,
2123         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2124     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2125
2126     /*  locales (longstr)        */
2127     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_locales,
2128         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2129     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2130
2131     return offset;
2132 }
2133
2134 /*  Dissection routine for method Connection.Start-Ok                     */
2135
2136 static size_t
2137 dissect_amqp_method_connection_start_ok(tvbuff_t *tvb _U_,
2138     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2139 {
2140     proto_item *ti;
2141     /*  client-properties (table)  */
2142     ti = proto_tree_add_item(
2143         args_tree, hf_amqp_method_connection_start_ok_client_properties,
2144         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2145     dissect_amqp_field_table (tvb, offset + 4,
2146         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2147     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2148
2149     /*  mechanism (shortstr)     */
2150     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_mechanism,
2151         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2152     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2153
2154     /*  response (longstr)       */
2155     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_response,
2156         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2157     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2158
2159     /*  locale (shortstr)        */
2160     proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_locale,
2161         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2162     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2163
2164     return offset;
2165 }
2166
2167 /*  Dissection routine for method Connection.Secure                       */
2168
2169 static size_t
2170 dissect_amqp_method_connection_secure(tvbuff_t *tvb _U_,
2171     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2172 {
2173     /*  challenge (longstr)      */
2174     proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_challenge,
2175         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2176     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2177
2178     return offset;
2179 }
2180
2181 /*  Dissection routine for method Connection.Secure-Ok                    */
2182
2183 static size_t
2184 dissect_amqp_method_connection_secure_ok(tvbuff_t *tvb _U_,
2185     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2186 {
2187     /*  response (longstr)       */
2188     proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_ok_response,
2189         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2190     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2191
2192     return offset;
2193 }
2194
2195 /*  Dissection routine for method Connection.Tune                         */
2196
2197 static size_t
2198 dissect_amqp_method_connection_tune(tvbuff_t *tvb _U_,
2199     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2200 {
2201     /*  channel-max (short)      */
2202     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_channel_max,
2203         tvb, offset, 2, FALSE);
2204     AMQP_INCREMENT(offset, 2, bound);
2205
2206     /*  frame-max (long)         */
2207     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_frame_max,
2208         tvb, offset, 4, FALSE);
2209     AMQP_INCREMENT(offset, 4, bound);
2210
2211     /*  heartbeat (short)        */
2212     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_heartbeat,
2213         tvb, offset, 2, FALSE);
2214     AMQP_INCREMENT(offset, 2, bound);
2215
2216     return offset;
2217 }
2218
2219 /*  Dissection routine for method Connection.Tune-Ok                      */
2220
2221 static size_t
2222 dissect_amqp_method_connection_tune_ok(tvbuff_t *tvb _U_,
2223     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2224 {
2225     /*  channel-max (short)      */
2226     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_ok_channel_max,
2227         tvb, offset, 2, FALSE);
2228     AMQP_INCREMENT(offset, 2, bound);
2229
2230     /*  frame-max (long)         */
2231     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_ok_frame_max,
2232         tvb, offset, 4, FALSE);
2233     AMQP_INCREMENT(offset, 4, bound);
2234
2235     /*  heartbeat (short)        */
2236     proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_ok_heartbeat,
2237         tvb, offset, 2, FALSE);
2238     AMQP_INCREMENT(offset, 2, bound);
2239
2240     return offset;
2241 }
2242
2243 /*  Dissection routine for method Connection.Open                         */
2244
2245 static size_t
2246 dissect_amqp_method_connection_open(tvbuff_t *tvb _U_,
2247     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2248 {
2249     /*  virtual-host (shortstr)  */
2250     proto_tree_add_item(args_tree, hf_amqp_method_connection_open_virtual_host,
2251         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2252     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2253
2254     /*  capabilities (shortstr)  */
2255     proto_tree_add_item(args_tree, hf_amqp_method_connection_open_capabilities,
2256         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2257     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2258
2259     /*  insist (bit)             */
2260     proto_tree_add_item(args_tree, hf_amqp_method_connection_open_insist,
2261         tvb, offset, 1, FALSE);
2262
2263     return offset;
2264 }
2265
2266 /*  Dissection routine for method Connection.Open-Ok                      */
2267
2268 static size_t
2269 dissect_amqp_method_connection_open_ok(tvbuff_t *tvb _U_,
2270     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2271 {
2272     /*  known-hosts (shortstr)   */
2273     proto_tree_add_item(args_tree, hf_amqp_method_connection_open_ok_known_hosts,
2274         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2275     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2276
2277     return offset;
2278 }
2279
2280 /*  Dissection routine for method Connection.Redirect                     */
2281
2282 static size_t
2283 dissect_amqp_method_connection_redirect(tvbuff_t *tvb _U_,
2284     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2285 {
2286     /*  host (shortstr)          */
2287     proto_tree_add_item(args_tree, hf_amqp_method_connection_redirect_host,
2288         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2289     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2290
2291     /*  known-hosts (shortstr)   */
2292     proto_tree_add_item(args_tree, hf_amqp_method_connection_redirect_known_hosts,
2293         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2294     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2295
2296     return offset;
2297 }
2298
2299 /*  Dissection routine for method Connection.Close                        */
2300
2301 static size_t
2302 dissect_amqp_method_connection_close(tvbuff_t *tvb _U_,
2303     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2304 {
2305     /*  reply-code (short)       */
2306     proto_tree_add_item(args_tree, hf_amqp_method_connection_close_reply_code,
2307         tvb, offset, 2, FALSE);
2308     AMQP_INCREMENT(offset, 2, bound);
2309
2310     /*  reply-text (shortstr)    */
2311     proto_tree_add_item(args_tree, hf_amqp_method_connection_close_reply_text,
2312         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2313     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2314
2315     /*  class-id (short)         */
2316     proto_tree_add_item(args_tree, hf_amqp_method_connection_close_class_id,
2317         tvb, offset, 2, FALSE);
2318     AMQP_INCREMENT(offset, 2, bound);
2319
2320     /*  method-id (short)        */
2321     proto_tree_add_item(args_tree, hf_amqp_method_connection_close_method_id,
2322         tvb, offset, 2, FALSE);
2323     AMQP_INCREMENT(offset, 2, bound);
2324
2325     return offset;
2326 }
2327
2328 /*  Dissection routine for method Connection.Close-Ok                     */
2329
2330 static size_t
2331 dissect_amqp_method_connection_close_ok(tvbuff_t *tvb _U_,
2332     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2333 {
2334     return offset;
2335 }
2336
2337 /*  Dissection routine for method Channel.Open                            */
2338
2339 static size_t
2340 dissect_amqp_method_channel_open(tvbuff_t *tvb _U_,
2341     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2342 {
2343     /*  out-of-band (shortstr)   */
2344     proto_tree_add_item(args_tree, hf_amqp_method_channel_open_out_of_band,
2345         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2346     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2347
2348     return offset;
2349 }
2350
2351 /*  Dissection routine for method Channel.Open-Ok                         */
2352
2353 static size_t
2354 dissect_amqp_method_channel_open_ok(tvbuff_t *tvb _U_,
2355     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2356 {
2357     /*  channel-id (longstr)     */
2358     proto_tree_add_item(args_tree, hf_amqp_method_channel_open_ok_channel_id,
2359         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2360     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2361
2362     return offset;
2363 }
2364
2365 /*  Dissection routine for method Channel.Flow                            */
2366
2367 static size_t
2368 dissect_amqp_method_channel_flow(tvbuff_t *tvb _U_,
2369     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2370 {
2371     /*  active (bit)             */
2372     proto_tree_add_item(args_tree, hf_amqp_method_channel_flow_active,
2373         tvb, offset, 1, FALSE);
2374
2375     return offset;
2376 }
2377
2378 /*  Dissection routine for method Channel.Flow-Ok                         */
2379
2380 static size_t
2381 dissect_amqp_method_channel_flow_ok(tvbuff_t *tvb _U_,
2382     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2383 {
2384     /*  active (bit)             */
2385     proto_tree_add_item(args_tree, hf_amqp_method_channel_flow_ok_active,
2386         tvb, offset, 1, FALSE);
2387
2388     return offset;
2389 }
2390
2391 /*  Dissection routine for method Channel.Close                           */
2392
2393 static size_t
2394 dissect_amqp_method_channel_close(tvbuff_t *tvb _U_,
2395     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2396 {
2397     /*  reply-code (short)       */
2398     proto_tree_add_item(args_tree, hf_amqp_method_channel_close_reply_code,
2399         tvb, offset, 2, FALSE);
2400     AMQP_INCREMENT(offset, 2, bound);
2401
2402     /*  reply-text (shortstr)    */
2403     proto_tree_add_item(args_tree, hf_amqp_method_channel_close_reply_text,
2404         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2405     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2406
2407     /*  class-id (short)         */
2408     proto_tree_add_item(args_tree, hf_amqp_method_channel_close_class_id,
2409         tvb, offset, 2, FALSE);
2410     AMQP_INCREMENT(offset, 2, bound);
2411
2412     /*  method-id (short)        */
2413     proto_tree_add_item(args_tree, hf_amqp_method_channel_close_method_id,
2414         tvb, offset, 2, FALSE);
2415     AMQP_INCREMENT(offset, 2, bound);
2416
2417     return offset;
2418 }
2419
2420 /*  Dissection routine for method Channel.Close-Ok                        */
2421
2422 static size_t
2423 dissect_amqp_method_channel_close_ok(tvbuff_t *tvb _U_,
2424     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2425 {
2426     return offset;
2427 }
2428
2429 /*  Dissection routine for method Channel.Resume                          */
2430
2431 static size_t
2432 dissect_amqp_method_channel_resume(tvbuff_t *tvb _U_,
2433     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2434 {
2435     /*  channel-id (longstr)     */
2436     proto_tree_add_item(args_tree, hf_amqp_method_channel_resume_channel_id,
2437         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2438     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2439
2440     return offset;
2441 }
2442
2443 /*  Dissection routine for method Channel.Ping                            */
2444
2445 static size_t
2446 dissect_amqp_method_channel_ping(tvbuff_t *tvb _U_,
2447     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2448 {
2449     return offset;
2450 }
2451
2452 /*  Dissection routine for method Channel.Pong                            */
2453
2454 static size_t
2455 dissect_amqp_method_channel_pong(tvbuff_t *tvb _U_,
2456     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2457 {
2458     return offset;
2459 }
2460
2461 /*  Dissection routine for method Channel.Ok                              */
2462
2463 static size_t
2464 dissect_amqp_method_channel_ok(tvbuff_t *tvb _U_,
2465     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2466 {
2467     return offset;
2468 }
2469
2470 /*  Dissection routine for method Access.Request                          */
2471
2472 static size_t
2473 dissect_amqp_method_access_request(tvbuff_t *tvb _U_,
2474     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2475 {
2476     /*  realm (shortstr)         */
2477     proto_tree_add_item(args_tree, hf_amqp_method_access_request_realm,
2478         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2479     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2480
2481     /*  exclusive (bit)          */
2482     proto_tree_add_item(args_tree, hf_amqp_method_access_request_exclusive,
2483         tvb, offset, 1, FALSE);
2484
2485     /*  passive (bit)            */
2486     proto_tree_add_item(args_tree, hf_amqp_method_access_request_passive,
2487         tvb, offset, 1, FALSE);
2488
2489     /*  active (bit)             */
2490     proto_tree_add_item(args_tree, hf_amqp_method_access_request_active,
2491         tvb, offset, 1, FALSE);
2492
2493     /*  write (bit)              */
2494     proto_tree_add_item(args_tree, hf_amqp_method_access_request_write,
2495         tvb, offset, 1, FALSE);
2496
2497     /*  read (bit)               */
2498     proto_tree_add_item(args_tree, hf_amqp_method_access_request_read,
2499         tvb, offset, 1, FALSE);
2500
2501     return offset;
2502 }
2503
2504 /*  Dissection routine for method Access.Request-Ok                       */
2505
2506 static size_t
2507 dissect_amqp_method_access_request_ok(tvbuff_t *tvb _U_,
2508     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2509 {
2510     /*  ticket (short)           */
2511     proto_tree_add_item(args_tree, hf_amqp_method_access_request_ok_ticket,
2512         tvb, offset, 2, FALSE);
2513     AMQP_INCREMENT(offset, 2, bound);
2514
2515     return offset;
2516 }
2517
2518 /*  Dissection routine for method Exchange.Declare                        */
2519
2520 static size_t
2521 dissect_amqp_method_exchange_declare(tvbuff_t *tvb _U_,
2522     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2523 {
2524     proto_item *ti;
2525     /*  ticket (short)           */
2526     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_ticket,
2527         tvb, offset, 2, FALSE);
2528     AMQP_INCREMENT(offset, 2, bound);
2529
2530     /*  exchange (shortstr)      */
2531     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_exchange,
2532         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2533     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2534
2535     /*  type (shortstr)          */
2536     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_type,
2537         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2538     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2539
2540     /*  passive (bit)            */
2541     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_passive,
2542         tvb, offset, 1, FALSE);
2543
2544     /*  durable (bit)            */
2545     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_durable,
2546         tvb, offset, 1, FALSE);
2547
2548     /*  auto-delete (bit)        */
2549     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_auto_delete,
2550         tvb, offset, 1, FALSE);
2551
2552     /*  internal (bit)           */
2553     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_internal,
2554         tvb, offset, 1, FALSE);
2555
2556     /*  nowait (bit)             */
2557     proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_nowait,
2558         tvb, offset, 1, FALSE);
2559
2560     AMQP_INCREMENT(offset, 1, bound);
2561     /*  arguments (table)        */
2562     ti = proto_tree_add_item(
2563         args_tree, hf_amqp_method_exchange_declare_arguments,
2564         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2565     dissect_amqp_field_table (tvb, offset + 4,
2566         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2567     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2568
2569     return offset;
2570 }
2571
2572 /*  Dissection routine for method Exchange.Declare-Ok                     */
2573
2574 static size_t
2575 dissect_amqp_method_exchange_declare_ok(tvbuff_t *tvb _U_,
2576     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2577 {
2578     return offset;
2579 }
2580
2581 /*  Dissection routine for method Exchange.Delete                         */
2582
2583 static size_t
2584 dissect_amqp_method_exchange_delete(tvbuff_t *tvb _U_,
2585     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2586 {
2587     /*  ticket (short)           */
2588     proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_ticket,
2589         tvb, offset, 2, FALSE);
2590     AMQP_INCREMENT(offset, 2, bound);
2591
2592     /*  exchange (shortstr)      */
2593     proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_exchange,
2594         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2595     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2596
2597     /*  if-unused (bit)          */
2598     proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_if_unused,
2599         tvb, offset, 1, FALSE);
2600
2601     /*  nowait (bit)             */
2602     proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_nowait,
2603         tvb, offset, 1, FALSE);
2604
2605     return offset;
2606 }
2607
2608 /*  Dissection routine for method Exchange.Delete-Ok                      */
2609
2610 static size_t
2611 dissect_amqp_method_exchange_delete_ok(tvbuff_t *tvb _U_,
2612     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2613 {
2614     return offset;
2615 }
2616
2617 /*  Dissection routine for method Queue.Declare                           */
2618
2619 static size_t
2620 dissect_amqp_method_queue_declare(tvbuff_t *tvb _U_,
2621     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2622 {
2623     proto_item *ti;
2624     /*  ticket (short)           */
2625     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ticket,
2626         tvb, offset, 2, FALSE);
2627     AMQP_INCREMENT(offset, 2, bound);
2628
2629     /*  queue (shortstr)         */
2630     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_queue,
2631         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2632     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2633
2634     /*  passive (bit)            */
2635     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_passive,
2636         tvb, offset, 1, FALSE);
2637
2638     /*  durable (bit)            */
2639     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_durable,
2640         tvb, offset, 1, FALSE);
2641
2642     /*  exclusive (bit)          */
2643     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_exclusive,
2644         tvb, offset, 1, FALSE);
2645
2646     /*  auto-delete (bit)        */
2647     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_auto_delete,
2648         tvb, offset, 1, FALSE);
2649
2650     /*  nowait (bit)             */
2651     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_nowait,
2652         tvb, offset, 1, FALSE);
2653
2654     AMQP_INCREMENT(offset, 1, bound);
2655     /*  arguments (table)        */
2656     ti = proto_tree_add_item(
2657         args_tree, hf_amqp_method_queue_declare_arguments,
2658         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2659     dissect_amqp_field_table (tvb, offset + 4,
2660         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2661     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2662
2663     return offset;
2664 }
2665
2666 /*  Dissection routine for method Queue.Declare-Ok                        */
2667
2668 static size_t
2669 dissect_amqp_method_queue_declare_ok(tvbuff_t *tvb _U_,
2670     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2671 {
2672     /*  queue (shortstr)         */
2673     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_queue,
2674         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2675     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2676
2677     /*  message-count (long)     */
2678     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_message_count,
2679         tvb, offset, 4, FALSE);
2680     AMQP_INCREMENT(offset, 4, bound);
2681
2682     /*  consumer-count (long)    */
2683     proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_consumer_count,
2684         tvb, offset, 4, FALSE);
2685     AMQP_INCREMENT(offset, 4, bound);
2686
2687     return offset;
2688 }
2689
2690 /*  Dissection routine for method Queue.Bind                              */
2691
2692 static size_t
2693 dissect_amqp_method_queue_bind(tvbuff_t *tvb _U_,
2694     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2695 {
2696     proto_item *ti;
2697     /*  ticket (short)           */
2698     proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_ticket,
2699         tvb, offset, 2, FALSE);
2700     AMQP_INCREMENT(offset, 2, bound);
2701
2702     /*  queue (shortstr)         */
2703     proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_queue,
2704         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2705     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2706
2707     /*  exchange (shortstr)      */
2708     proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_exchange,
2709         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2710     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2711
2712     /*  routing-key (shortstr)   */
2713     proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_routing_key,
2714         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2715     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2716
2717     /*  nowait (bit)             */
2718     proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_nowait,
2719         tvb, offset, 1, FALSE);
2720
2721     AMQP_INCREMENT(offset, 1, bound);
2722     /*  arguments (table)        */
2723     ti = proto_tree_add_item(
2724         args_tree, hf_amqp_method_queue_bind_arguments,
2725         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2726     dissect_amqp_field_table (tvb, offset + 4,
2727         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2728     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2729
2730     return offset;
2731 }
2732
2733 /*  Dissection routine for method Queue.Bind-Ok                           */
2734
2735 static size_t
2736 dissect_amqp_method_queue_bind_ok(tvbuff_t *tvb _U_,
2737     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2738 {
2739     return offset;
2740 }
2741
2742 /*  Dissection routine for method Queue.Unbind                            */
2743
2744 static size_t
2745 dissect_amqp_method_queue_unbind(tvbuff_t *tvb _U_,
2746     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2747 {
2748     proto_item *ti;
2749     /*  ticket (short)           */
2750     proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_ticket,
2751         tvb, offset, 2, FALSE);
2752     AMQP_INCREMENT(offset, 2, bound);
2753
2754     /*  queue (shortstr)         */
2755     proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_queue,
2756         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2757     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2758
2759     /*  exchange (shortstr)      */
2760     proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_exchange,
2761         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2762     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2763
2764     /*  routing-key (shortstr)   */
2765     proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_routing_key,
2766         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2767     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2768
2769     /*  arguments (table)        */
2770     ti = proto_tree_add_item(
2771         args_tree, hf_amqp_method_queue_unbind_arguments,
2772         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2773     dissect_amqp_field_table (tvb, offset + 4,
2774         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2775     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2776
2777     return offset;
2778 }
2779
2780 /*  Dissection routine for method Queue.Unbind-Ok                         */
2781
2782 static size_t
2783 dissect_amqp_method_queue_unbind_ok(tvbuff_t *tvb _U_,
2784     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2785 {
2786     return offset;
2787 }
2788
2789 /*  Dissection routine for method Queue.Purge                             */
2790
2791 static size_t
2792 dissect_amqp_method_queue_purge(tvbuff_t *tvb _U_,
2793     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2794 {
2795     /*  ticket (short)           */
2796     proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_ticket,
2797         tvb, offset, 2, FALSE);
2798     AMQP_INCREMENT(offset, 2, bound);
2799
2800     /*  queue (shortstr)         */
2801     proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_queue,
2802         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2803     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2804
2805     /*  nowait (bit)             */
2806     proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_nowait,
2807         tvb, offset, 1, FALSE);
2808
2809     return offset;
2810 }
2811
2812 /*  Dissection routine for method Queue.Purge-Ok                          */
2813
2814 static size_t
2815 dissect_amqp_method_queue_purge_ok(tvbuff_t *tvb _U_,
2816     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2817 {
2818     /*  message-count (long)     */
2819     proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_ok_message_count,
2820         tvb, offset, 4, FALSE);
2821     AMQP_INCREMENT(offset, 4, bound);
2822
2823     return offset;
2824 }
2825
2826 /*  Dissection routine for method Queue.Delete                            */
2827
2828 static size_t
2829 dissect_amqp_method_queue_delete(tvbuff_t *tvb _U_,
2830     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2831 {
2832     /*  ticket (short)           */
2833     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_ticket,
2834         tvb, offset, 2, FALSE);
2835     AMQP_INCREMENT(offset, 2, bound);
2836
2837     /*  queue (shortstr)         */
2838     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_queue,
2839         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2840     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2841
2842     /*  if-unused (bit)          */
2843     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_if_unused,
2844         tvb, offset, 1, FALSE);
2845
2846     /*  if-empty (bit)           */
2847     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_if_empty,
2848         tvb, offset, 1, FALSE);
2849
2850     /*  nowait (bit)             */
2851     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_nowait,
2852         tvb, offset, 1, FALSE);
2853
2854     return offset;
2855 }
2856
2857 /*  Dissection routine for method Queue.Delete-Ok                         */
2858
2859 static size_t
2860 dissect_amqp_method_queue_delete_ok(tvbuff_t *tvb _U_,
2861     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2862 {
2863     /*  message-count (long)     */
2864     proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_ok_message_count,
2865         tvb, offset, 4, FALSE);
2866     AMQP_INCREMENT(offset, 4, bound);
2867
2868     return offset;
2869 }
2870
2871 /*  Dissection routine for method Basic.Qos                               */
2872
2873 static size_t
2874 dissect_amqp_method_basic_qos(tvbuff_t *tvb _U_,
2875     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2876 {
2877     /*  prefetch-size (long)     */
2878     proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_prefetch_size,
2879         tvb, offset, 4, FALSE);
2880     AMQP_INCREMENT(offset, 4, bound);
2881
2882     /*  prefetch-count (short)   */
2883     proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_prefetch_count,
2884         tvb, offset, 2, FALSE);
2885     AMQP_INCREMENT(offset, 2, bound);
2886
2887     /*  global (bit)             */
2888     proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_global,
2889         tvb, offset, 1, FALSE);
2890
2891     return offset;
2892 }
2893
2894 /*  Dissection routine for method Basic.Qos-Ok                            */
2895
2896 static size_t
2897 dissect_amqp_method_basic_qos_ok(tvbuff_t *tvb _U_,
2898     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2899 {
2900     return offset;
2901 }
2902
2903 /*  Dissection routine for method Basic.Consume                           */
2904
2905 static size_t
2906 dissect_amqp_method_basic_consume(tvbuff_t *tvb _U_,
2907     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2908 {
2909     proto_item *ti;
2910     /*  ticket (short)           */
2911     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_ticket,
2912         tvb, offset, 2, FALSE);
2913     AMQP_INCREMENT(offset, 2, bound);
2914
2915     /*  queue (shortstr)         */
2916     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_queue,
2917         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2918     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2919
2920     /*  consumer-tag (shortstr)  */
2921     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_consumer_tag,
2922         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2923     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2924
2925     /*  no-local (bit)           */
2926     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_no_local,
2927         tvb, offset, 1, FALSE);
2928
2929     /*  no-ack (bit)             */
2930     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_no_ack,
2931         tvb, offset, 1, FALSE);
2932
2933     /*  exclusive (bit)          */
2934     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_exclusive,
2935         tvb, offset, 1, FALSE);
2936
2937     /*  nowait (bit)             */
2938     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_nowait,
2939         tvb, offset, 1, FALSE);
2940
2941     AMQP_INCREMENT(offset, 1, bound);
2942     /*  filter (table)           */
2943     ti = proto_tree_add_item(
2944         args_tree, hf_amqp_method_basic_consume_filter,
2945         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
2946     dissect_amqp_field_table (tvb, offset + 4,
2947         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
2948     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
2949
2950     return offset;
2951 }
2952
2953 /*  Dissection routine for method Basic.Consume-Ok                        */
2954
2955 static size_t
2956 dissect_amqp_method_basic_consume_ok(tvbuff_t *tvb _U_,
2957     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2958 {
2959     /*  consumer-tag (shortstr)  */
2960     proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_ok_consumer_tag,
2961         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2962     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2963
2964     return offset;
2965 }
2966
2967 /*  Dissection routine for method Basic.Cancel                            */
2968
2969 static size_t
2970 dissect_amqp_method_basic_cancel(tvbuff_t *tvb _U_,
2971     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2972 {
2973     /*  consumer-tag (shortstr)  */
2974     proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_consumer_tag,
2975         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2976     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2977
2978     /*  nowait (bit)             */
2979     proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_nowait,
2980         tvb, offset, 1, FALSE);
2981
2982     return offset;
2983 }
2984
2985 /*  Dissection routine for method Basic.Cancel-Ok                         */
2986
2987 static size_t
2988 dissect_amqp_method_basic_cancel_ok(tvbuff_t *tvb _U_,
2989     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
2990 {
2991     /*  consumer-tag (shortstr)  */
2992     proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_ok_consumer_tag,
2993         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
2994     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
2995
2996     return offset;
2997 }
2998
2999 /*  Dissection routine for method Basic.Publish                           */
3000
3001 static size_t
3002 dissect_amqp_method_basic_publish(tvbuff_t *tvb _U_,
3003     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3004 {
3005     /*  ticket (short)           */
3006     proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_ticket,
3007         tvb, offset, 2, FALSE);
3008     AMQP_INCREMENT(offset, 2, bound);
3009
3010     /*  exchange (shortstr)      */
3011     proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_exchange,
3012         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3013     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3014
3015     /*  routing-key (shortstr)   */
3016     proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_routing_key,
3017         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3018     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3019
3020     /*  mandatory (bit)          */
3021     proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_mandatory,
3022         tvb, offset, 1, FALSE);
3023
3024     /*  immediate (bit)          */
3025     proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_immediate,
3026         tvb, offset, 1, FALSE);
3027
3028     return offset;
3029 }
3030
3031 /*  Dissection routine for method Basic.Return                            */
3032
3033 static size_t
3034 dissect_amqp_method_basic_return(tvbuff_t *tvb _U_,
3035     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3036 {
3037     /*  reply-code (short)       */
3038     proto_tree_add_item(args_tree, hf_amqp_method_basic_return_reply_code,
3039         tvb, offset, 2, FALSE);
3040     AMQP_INCREMENT(offset, 2, bound);
3041
3042     /*  reply-text (shortstr)    */
3043     proto_tree_add_item(args_tree, hf_amqp_method_basic_return_reply_text,
3044         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3045     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3046
3047     /*  exchange (shortstr)      */
3048     proto_tree_add_item(args_tree, hf_amqp_method_basic_return_exchange,
3049         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3050     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3051
3052     /*  routing-key (shortstr)   */
3053     proto_tree_add_item(args_tree, hf_amqp_method_basic_return_routing_key,
3054         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3055     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3056
3057     return offset;
3058 }
3059
3060 /*  Dissection routine for method Basic.Deliver                           */
3061
3062 static size_t
3063 dissect_amqp_method_basic_deliver(tvbuff_t *tvb _U_,
3064     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3065 {
3066     /*  consumer-tag (shortstr)  */
3067     proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_consumer_tag,
3068         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3069     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3070
3071     /*  delivery-tag (longlong)  */
3072     proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_delivery_tag,
3073         tvb, offset, 8, FALSE);
3074     AMQP_INCREMENT(offset, 8, bound);
3075
3076     /*  redelivered (bit)        */
3077     proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_redelivered,
3078         tvb, offset, 1, FALSE);
3079
3080     AMQP_INCREMENT(offset, 1, bound);
3081     /*  exchange (shortstr)      */
3082     proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_exchange,
3083         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3084     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3085
3086     /*  routing-key (shortstr)   */
3087     proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_routing_key,
3088         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3089     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3090
3091     return offset;
3092 }
3093
3094 /*  Dissection routine for method Basic.Get                               */
3095
3096 static size_t
3097 dissect_amqp_method_basic_get(tvbuff_t *tvb _U_,
3098     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3099 {
3100     /*  ticket (short)           */
3101     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ticket,
3102         tvb, offset, 2, FALSE);
3103     AMQP_INCREMENT(offset, 2, bound);
3104
3105     /*  queue (shortstr)         */
3106     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_queue,
3107         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3108     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3109
3110     /*  no-ack (bit)             */
3111     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_no_ack,
3112         tvb, offset, 1, FALSE);
3113
3114     return offset;
3115 }
3116
3117 /*  Dissection routine for method Basic.Get-Ok                            */
3118
3119 static size_t
3120 dissect_amqp_method_basic_get_ok(tvbuff_t *tvb _U_,
3121     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3122 {
3123     /*  delivery-tag (longlong)  */
3124     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_delivery_tag,
3125         tvb, offset, 8, FALSE);
3126     AMQP_INCREMENT(offset, 8, bound);
3127
3128     /*  redelivered (bit)        */
3129     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_redelivered,
3130         tvb, offset, 1, FALSE);
3131
3132     AMQP_INCREMENT(offset, 1, bound);
3133     /*  exchange (shortstr)      */
3134     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_exchange,
3135         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3136     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3137
3138     /*  routing-key (shortstr)   */
3139     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_routing_key,
3140         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3141     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3142
3143     /*  message-count (long)     */
3144     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_message_count,
3145         tvb, offset, 4, FALSE);
3146     AMQP_INCREMENT(offset, 4, bound);
3147
3148     return offset;
3149 }
3150
3151 /*  Dissection routine for method Basic.Get-Empty                         */
3152
3153 static size_t
3154 dissect_amqp_method_basic_get_empty(tvbuff_t *tvb _U_,
3155     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3156 {
3157     /*  cluster-id (shortstr)    */
3158     proto_tree_add_item(args_tree, hf_amqp_method_basic_get_empty_cluster_id,
3159         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3160     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3161
3162     return offset;
3163 }
3164
3165 /*  Dissection routine for method Basic.Ack                               */
3166
3167 static size_t
3168 dissect_amqp_method_basic_ack(tvbuff_t *tvb _U_,
3169     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3170 {
3171     /*  delivery-tag (longlong)  */
3172     proto_tree_add_item(args_tree, hf_amqp_method_basic_ack_delivery_tag,
3173         tvb, offset, 8, FALSE);
3174     AMQP_INCREMENT(offset, 8, bound);
3175
3176     /*  multiple (bit)           */
3177     proto_tree_add_item(args_tree, hf_amqp_method_basic_ack_multiple,
3178         tvb, offset, 1, FALSE);
3179
3180     return offset;
3181 }
3182
3183 /*  Dissection routine for method Basic.Reject                            */
3184
3185 static size_t
3186 dissect_amqp_method_basic_reject(tvbuff_t *tvb _U_,
3187     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3188 {
3189     /*  delivery-tag (longlong)  */
3190     proto_tree_add_item(args_tree, hf_amqp_method_basic_reject_delivery_tag,
3191         tvb, offset, 8, FALSE);
3192     AMQP_INCREMENT(offset, 8, bound);
3193
3194     /*  requeue (bit)            */
3195     proto_tree_add_item(args_tree, hf_amqp_method_basic_reject_requeue,
3196         tvb, offset, 1, FALSE);
3197
3198     return offset;
3199 }
3200
3201 /*  Dissection routine for method Basic.Recover                           */
3202
3203 static size_t
3204 dissect_amqp_method_basic_recover(tvbuff_t *tvb _U_,
3205     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3206 {
3207     /*  requeue (bit)            */
3208     proto_tree_add_item(args_tree, hf_amqp_method_basic_recover_requeue,
3209         tvb, offset, 1, FALSE);
3210
3211     return offset;
3212 }
3213
3214 /*  Dissection routine for method File.Qos                                */
3215
3216 static size_t
3217 dissect_amqp_method_file_qos(tvbuff_t *tvb _U_,
3218     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3219 {
3220     /*  prefetch-size (long)     */
3221     proto_tree_add_item(args_tree, hf_amqp_method_file_qos_prefetch_size,
3222         tvb, offset, 4, FALSE);
3223     AMQP_INCREMENT(offset, 4, bound);
3224
3225     /*  prefetch-count (short)   */
3226     proto_tree_add_item(args_tree, hf_amqp_method_file_qos_prefetch_count,
3227         tvb, offset, 2, FALSE);
3228     AMQP_INCREMENT(offset, 2, bound);
3229
3230     /*  global (bit)             */
3231     proto_tree_add_item(args_tree, hf_amqp_method_file_qos_global,
3232         tvb, offset, 1, FALSE);
3233
3234     return offset;
3235 }
3236
3237 /*  Dissection routine for method File.Qos-Ok                             */
3238
3239 static size_t
3240 dissect_amqp_method_file_qos_ok(tvbuff_t *tvb _U_,
3241     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3242 {
3243     return offset;
3244 }
3245
3246 /*  Dissection routine for method File.Consume                            */
3247
3248 static size_t
3249 dissect_amqp_method_file_consume(tvbuff_t *tvb _U_,
3250     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3251 {
3252     proto_item *ti;
3253     /*  ticket (short)           */
3254     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_ticket,
3255         tvb, offset, 2, FALSE);
3256     AMQP_INCREMENT(offset, 2, bound);
3257
3258     /*  queue (shortstr)         */
3259     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_queue,
3260         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3261     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3262
3263     /*  consumer-tag (shortstr)  */
3264     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_consumer_tag,
3265         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3266     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3267
3268     /*  no-local (bit)           */
3269     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_no_local,
3270         tvb, offset, 1, FALSE);
3271
3272     /*  no-ack (bit)             */
3273     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_no_ack,
3274         tvb, offset, 1, FALSE);
3275
3276     /*  exclusive (bit)          */
3277     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_exclusive,
3278         tvb, offset, 1, FALSE);
3279
3280     /*  nowait (bit)             */
3281     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_nowait,
3282         tvb, offset, 1, FALSE);
3283
3284     AMQP_INCREMENT(offset, 1, bound);
3285     /*  filter (table)           */
3286     ti = proto_tree_add_item(
3287         args_tree, hf_amqp_method_file_consume_filter,
3288         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
3289     dissect_amqp_field_table (tvb, offset + 4,
3290         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
3291     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
3292
3293     return offset;
3294 }
3295
3296 /*  Dissection routine for method File.Consume-Ok                         */
3297
3298 static size_t
3299 dissect_amqp_method_file_consume_ok(tvbuff_t *tvb _U_,
3300     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3301 {
3302     /*  consumer-tag (shortstr)  */
3303     proto_tree_add_item(args_tree, hf_amqp_method_file_consume_ok_consumer_tag,
3304         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3305     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3306
3307     return offset;
3308 }
3309
3310 /*  Dissection routine for method File.Cancel                             */
3311
3312 static size_t
3313 dissect_amqp_method_file_cancel(tvbuff_t *tvb _U_,
3314     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3315 {
3316     /*  consumer-tag (shortstr)  */
3317     proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_consumer_tag,
3318         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3319     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3320
3321     /*  nowait (bit)             */
3322     proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_nowait,
3323         tvb, offset, 1, FALSE);
3324
3325     return offset;
3326 }
3327
3328 /*  Dissection routine for method File.Cancel-Ok                          */
3329
3330 static size_t
3331 dissect_amqp_method_file_cancel_ok(tvbuff_t *tvb _U_,
3332     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3333 {
3334     /*  consumer-tag (shortstr)  */
3335     proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_ok_consumer_tag,
3336         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3337     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3338
3339     return offset;
3340 }
3341
3342 /*  Dissection routine for method File.Open                               */
3343
3344 static size_t
3345 dissect_amqp_method_file_open(tvbuff_t *tvb _U_,
3346     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3347 {
3348     /*  identifier (shortstr)    */
3349     proto_tree_add_item(args_tree, hf_amqp_method_file_open_identifier,
3350         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3351     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3352
3353     /*  content-size (longlong)  */
3354     proto_tree_add_item(args_tree, hf_amqp_method_file_open_content_size,
3355         tvb, offset, 8, FALSE);
3356     AMQP_INCREMENT(offset, 8, bound);
3357
3358     return offset;
3359 }
3360
3361 /*  Dissection routine for method File.Open-Ok                            */
3362
3363 static size_t
3364 dissect_amqp_method_file_open_ok(tvbuff_t *tvb _U_,
3365     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3366 {
3367     /*  staged-size (longlong)   */
3368     proto_tree_add_item(args_tree, hf_amqp_method_file_open_ok_staged_size,
3369         tvb, offset, 8, FALSE);
3370     AMQP_INCREMENT(offset, 8, bound);
3371
3372     return offset;
3373 }
3374
3375 /*  Dissection routine for method File.Stage                              */
3376
3377 static size_t
3378 dissect_amqp_method_file_stage(tvbuff_t *tvb _U_,
3379     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3380 {
3381     return offset;
3382 }
3383
3384 /*  Dissection routine for method File.Publish                            */
3385
3386 static size_t
3387 dissect_amqp_method_file_publish(tvbuff_t *tvb _U_,
3388     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3389 {
3390     /*  ticket (short)           */
3391     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_ticket,
3392         tvb, offset, 2, FALSE);
3393     AMQP_INCREMENT(offset, 2, bound);
3394
3395     /*  exchange (shortstr)      */
3396     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_exchange,
3397         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3398     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3399
3400     /*  routing-key (shortstr)   */
3401     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_routing_key,
3402         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3403     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3404
3405     /*  mandatory (bit)          */
3406     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_mandatory,
3407         tvb, offset, 1, FALSE);
3408
3409     /*  immediate (bit)          */
3410     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_immediate,
3411         tvb, offset, 1, FALSE);
3412
3413     AMQP_INCREMENT(offset, 1, bound);
3414     /*  identifier (shortstr)    */
3415     proto_tree_add_item(args_tree, hf_amqp_method_file_publish_identifier,
3416         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3417     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3418
3419     return offset;
3420 }
3421
3422 /*  Dissection routine for method File.Return                             */
3423
3424 static size_t
3425 dissect_amqp_method_file_return(tvbuff_t *tvb _U_,
3426     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3427 {
3428     /*  reply-code (short)       */
3429     proto_tree_add_item(args_tree, hf_amqp_method_file_return_reply_code,
3430         tvb, offset, 2, FALSE);
3431     AMQP_INCREMENT(offset, 2, bound);
3432
3433     /*  reply-text (shortstr)    */
3434     proto_tree_add_item(args_tree, hf_amqp_method_file_return_reply_text,
3435         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3436     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3437
3438     /*  exchange (shortstr)      */
3439     proto_tree_add_item(args_tree, hf_amqp_method_file_return_exchange,
3440         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3441     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3442
3443     /*  routing-key (shortstr)   */
3444     proto_tree_add_item(args_tree, hf_amqp_method_file_return_routing_key,
3445         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3446     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3447
3448     return offset;
3449 }
3450
3451 /*  Dissection routine for method File.Deliver                            */
3452
3453 static size_t
3454 dissect_amqp_method_file_deliver(tvbuff_t *tvb _U_,
3455     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3456 {
3457     /*  consumer-tag (shortstr)  */
3458     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_consumer_tag,
3459         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3460     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3461
3462     /*  delivery-tag (longlong)  */
3463     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_delivery_tag,
3464         tvb, offset, 8, FALSE);
3465     AMQP_INCREMENT(offset, 8, bound);
3466
3467     /*  redelivered (bit)        */
3468     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_redelivered,
3469         tvb, offset, 1, FALSE);
3470
3471     AMQP_INCREMENT(offset, 1, bound);
3472     /*  exchange (shortstr)      */
3473     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_exchange,
3474         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3475     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3476
3477     /*  routing-key (shortstr)   */
3478     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_routing_key,
3479         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3480     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3481
3482     /*  identifier (shortstr)    */
3483     proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_identifier,
3484         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3485     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3486
3487     return offset;
3488 }
3489
3490 /*  Dissection routine for method File.Ack                                */
3491
3492 static size_t
3493 dissect_amqp_method_file_ack(tvbuff_t *tvb _U_,
3494     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3495 {
3496     /*  delivery-tag (longlong)  */
3497     proto_tree_add_item(args_tree, hf_amqp_method_file_ack_delivery_tag,
3498         tvb, offset, 8, FALSE);
3499     AMQP_INCREMENT(offset, 8, bound);
3500
3501     /*  multiple (bit)           */
3502     proto_tree_add_item(args_tree, hf_amqp_method_file_ack_multiple,
3503         tvb, offset, 1, FALSE);
3504
3505     return offset;
3506 }
3507
3508 /*  Dissection routine for method File.Reject                             */
3509
3510 static size_t
3511 dissect_amqp_method_file_reject(tvbuff_t *tvb _U_,
3512     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3513 {
3514     /*  delivery-tag (longlong)  */
3515     proto_tree_add_item(args_tree, hf_amqp_method_file_reject_delivery_tag,
3516         tvb, offset, 8, FALSE);
3517     AMQP_INCREMENT(offset, 8, bound);
3518
3519     /*  requeue (bit)            */
3520     proto_tree_add_item(args_tree, hf_amqp_method_file_reject_requeue,
3521         tvb, offset, 1, FALSE);
3522
3523     return offset;
3524 }
3525
3526 /*  Dissection routine for method Stream.Qos                              */
3527
3528 static size_t
3529 dissect_amqp_method_stream_qos(tvbuff_t *tvb _U_,
3530     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3531 {
3532     /*  prefetch-size (long)     */
3533     proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_prefetch_size,
3534         tvb, offset, 4, FALSE);
3535     AMQP_INCREMENT(offset, 4, bound);
3536
3537     /*  prefetch-count (short)   */
3538     proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_prefetch_count,
3539         tvb, offset, 2, FALSE);
3540     AMQP_INCREMENT(offset, 2, bound);
3541
3542     /*  consume-rate (long)      */
3543     proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_consume_rate,
3544         tvb, offset, 4, FALSE);
3545     AMQP_INCREMENT(offset, 4, bound);
3546
3547     /*  global (bit)             */
3548     proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_global,
3549         tvb, offset, 1, FALSE);
3550
3551     return offset;
3552 }
3553
3554 /*  Dissection routine for method Stream.Qos-Ok                           */
3555
3556 static size_t
3557 dissect_amqp_method_stream_qos_ok(tvbuff_t *tvb _U_,
3558     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3559 {
3560     return offset;
3561 }
3562
3563 /*  Dissection routine for method Stream.Consume                          */
3564
3565 static size_t
3566 dissect_amqp_method_stream_consume(tvbuff_t *tvb _U_,
3567     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3568 {
3569     proto_item *ti;
3570     /*  ticket (short)           */
3571     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_ticket,
3572         tvb, offset, 2, FALSE);
3573     AMQP_INCREMENT(offset, 2, bound);
3574
3575     /*  queue (shortstr)         */
3576     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_queue,
3577         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3578     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3579
3580     /*  consumer-tag (shortstr)  */
3581     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_consumer_tag,
3582         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3583     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3584
3585     /*  no-local (bit)           */
3586     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_no_local,
3587         tvb, offset, 1, FALSE);
3588
3589     /*  exclusive (bit)          */
3590     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_exclusive,
3591         tvb, offset, 1, FALSE);
3592
3593     /*  nowait (bit)             */
3594     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_nowait,
3595         tvb, offset, 1, FALSE);
3596
3597     AMQP_INCREMENT(offset, 1, bound);
3598     /*  filter (table)           */
3599     ti = proto_tree_add_item(
3600         args_tree, hf_amqp_method_stream_consume_filter,
3601         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
3602     dissect_amqp_field_table (tvb, offset + 4,
3603         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
3604     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
3605
3606     return offset;
3607 }
3608
3609 /*  Dissection routine for method Stream.Consume-Ok                       */
3610
3611 static size_t
3612 dissect_amqp_method_stream_consume_ok(tvbuff_t *tvb _U_,
3613     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3614 {
3615     /*  consumer-tag (shortstr)  */
3616     proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_ok_consumer_tag,
3617         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3618     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3619
3620     return offset;
3621 }
3622
3623 /*  Dissection routine for method Stream.Cancel                           */
3624
3625 static size_t
3626 dissect_amqp_method_stream_cancel(tvbuff_t *tvb _U_,
3627     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3628 {
3629     /*  consumer-tag (shortstr)  */
3630     proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_consumer_tag,
3631         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3632     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3633
3634     /*  nowait (bit)             */
3635     proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_nowait,
3636         tvb, offset, 1, FALSE);
3637
3638     return offset;
3639 }
3640
3641 /*  Dissection routine for method Stream.Cancel-Ok                        */
3642
3643 static size_t
3644 dissect_amqp_method_stream_cancel_ok(tvbuff_t *tvb _U_,
3645     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3646 {
3647     /*  consumer-tag (shortstr)  */
3648     proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_ok_consumer_tag,
3649         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3650     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3651
3652     return offset;
3653 }
3654
3655 /*  Dissection routine for method Stream.Publish                          */
3656
3657 static size_t
3658 dissect_amqp_method_stream_publish(tvbuff_t *tvb _U_,
3659     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3660 {
3661     /*  ticket (short)           */
3662     proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_ticket,
3663         tvb, offset, 2, FALSE);
3664     AMQP_INCREMENT(offset, 2, bound);
3665
3666     /*  exchange (shortstr)      */
3667     proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_exchange,
3668         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3669     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3670
3671     /*  routing-key (shortstr)   */
3672     proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_routing_key,
3673         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3674     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3675
3676     /*  mandatory (bit)          */
3677     proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_mandatory,
3678         tvb, offset, 1, FALSE);
3679
3680     /*  immediate (bit)          */
3681     proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_immediate,
3682         tvb, offset, 1, FALSE);
3683
3684     return offset;
3685 }
3686
3687 /*  Dissection routine for method Stream.Return                           */
3688
3689 static size_t
3690 dissect_amqp_method_stream_return(tvbuff_t *tvb _U_,
3691     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3692 {
3693     /*  reply-code (short)       */
3694     proto_tree_add_item(args_tree, hf_amqp_method_stream_return_reply_code,
3695         tvb, offset, 2, FALSE);
3696     AMQP_INCREMENT(offset, 2, bound);
3697
3698     /*  reply-text (shortstr)    */
3699     proto_tree_add_item(args_tree, hf_amqp_method_stream_return_reply_text,
3700         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3701     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3702
3703     /*  exchange (shortstr)      */
3704     proto_tree_add_item(args_tree, hf_amqp_method_stream_return_exchange,
3705         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3706     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3707
3708     /*  routing-key (shortstr)   */
3709     proto_tree_add_item(args_tree, hf_amqp_method_stream_return_routing_key,
3710         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3711     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3712
3713     return offset;
3714 }
3715
3716 /*  Dissection routine for method Stream.Deliver                          */
3717
3718 static size_t
3719 dissect_amqp_method_stream_deliver(tvbuff_t *tvb _U_,
3720     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3721 {
3722     /*  consumer-tag (shortstr)  */
3723     proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_consumer_tag,
3724         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3725     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3726
3727     /*  delivery-tag (longlong)  */
3728     proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_delivery_tag,
3729         tvb, offset, 8, FALSE);
3730     AMQP_INCREMENT(offset, 8, bound);
3731
3732     /*  exchange (shortstr)      */
3733     proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_exchange,
3734         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3735     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3736
3737     /*  queue (shortstr)         */
3738     proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_queue,
3739         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3740     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3741
3742     return offset;
3743 }
3744
3745 /*  Dissection routine for method Tx.Select                               */
3746
3747 static size_t
3748 dissect_amqp_method_tx_select(tvbuff_t *tvb _U_,
3749     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3750 {
3751     return offset;
3752 }
3753
3754 /*  Dissection routine for method Tx.Select-Ok                            */
3755
3756 static size_t
3757 dissect_amqp_method_tx_select_ok(tvbuff_t *tvb _U_,
3758     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3759 {
3760     return offset;
3761 }
3762
3763 /*  Dissection routine for method Tx.Commit                               */
3764
3765 static size_t
3766 dissect_amqp_method_tx_commit(tvbuff_t *tvb _U_,
3767     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3768 {
3769     return offset;
3770 }
3771
3772 /*  Dissection routine for method Tx.Commit-Ok                            */
3773
3774 static size_t
3775 dissect_amqp_method_tx_commit_ok(tvbuff_t *tvb _U_,
3776     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3777 {
3778     return offset;
3779 }
3780
3781 /*  Dissection routine for method Tx.Rollback                             */
3782
3783 static size_t
3784 dissect_amqp_method_tx_rollback(tvbuff_t *tvb _U_,
3785     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3786 {
3787     return offset;
3788 }
3789
3790 /*  Dissection routine for method Tx.Rollback-Ok                          */
3791
3792 static size_t
3793 dissect_amqp_method_tx_rollback_ok(tvbuff_t *tvb _U_,
3794     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3795 {
3796     return offset;
3797 }
3798
3799 /*  Dissection routine for method Dtx.Select                              */
3800
3801 static size_t
3802 dissect_amqp_method_dtx_select(tvbuff_t *tvb _U_,
3803     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3804 {
3805     return offset;
3806 }
3807
3808 /*  Dissection routine for method Dtx.Select-Ok                           */
3809
3810 static size_t
3811 dissect_amqp_method_dtx_select_ok(tvbuff_t *tvb _U_,
3812     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3813 {
3814     return offset;
3815 }
3816
3817 /*  Dissection routine for method Dtx.Start                               */
3818
3819 static size_t
3820 dissect_amqp_method_dtx_start(tvbuff_t *tvb _U_,
3821     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3822 {
3823     /*  dtx-identifier (shortstr)  */
3824     proto_tree_add_item(args_tree, hf_amqp_method_dtx_start_dtx_identifier,
3825         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3826     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3827
3828     return offset;
3829 }
3830
3831 /*  Dissection routine for method Dtx.Start-Ok                            */
3832
3833 static size_t
3834 dissect_amqp_method_dtx_start_ok(tvbuff_t *tvb _U_,
3835     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3836 {
3837     return offset;
3838 }
3839
3840 /*  Dissection routine for method Tunnel.Request                          */
3841
3842 static size_t
3843 dissect_amqp_method_tunnel_request(tvbuff_t *tvb _U_,
3844     int offset _U_, int bound _U_, proto_tree *args_tree _U_)
3845 {
3846     proto_item *ti;
3847     /*  meta-data (table)        */
3848     ti = proto_tree_add_item(
3849         args_tree, hf_amqp_method_tunnel_request_meta_data,
3850         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
3851     dissect_amqp_field_table (tvb, offset + 4,
3852         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
3853     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
3854
3855     return offset;
3856 }
3857
3858
3859 /*  Dissection routine for content headers of class basic          */
3860
3861 static size_t
3862 dissect_amqp_content_header_basic(tvbuff_t *tvb,
3863     int offset, int bound, proto_tree *prop_tree)
3864 {
3865     proto_item *ti;
3866     guint16 prop_flags;
3867
3868     prop_flags = tvb_get_ntohs(tvb, 19);
3869     if (prop_flags & 0x8000) {
3870     /*  content-type (shortstr)  */
3871     proto_tree_add_item(prop_tree, hf_amqp_header_basic_content_type,
3872         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3873     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3874
3875     }
3876     prop_flags <<= 1;
3877     if (prop_flags & 0x8000) {
3878     /*  content-encoding (shortstr)  */
3879     proto_tree_add_item(prop_tree, hf_amqp_header_basic_content_encoding,
3880         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3881     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3882
3883     }
3884     prop_flags <<= 1;
3885     if (prop_flags & 0x8000) {
3886     /*  headers (table)          */
3887     ti = proto_tree_add_item(
3888         prop_tree, hf_amqp_header_basic_headers,
3889         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
3890     dissect_amqp_field_table (tvb, offset + 4,
3891         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
3892     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
3893
3894     }
3895     prop_flags <<= 1;
3896     if (prop_flags & 0x8000) {
3897     /*  delivery-mode (octet)    */
3898     proto_tree_add_item(prop_tree, hf_amqp_header_basic_delivery_mode,
3899         tvb, offset, 1, FALSE);
3900     AMQP_INCREMENT(offset, 1, bound);
3901
3902     }
3903     prop_flags <<= 1;
3904     if (prop_flags & 0x8000) {
3905     /*  priority (octet)         */
3906     proto_tree_add_item(prop_tree, hf_amqp_header_basic_priority,
3907         tvb, offset, 1, FALSE);
3908     AMQP_INCREMENT(offset, 1, bound);
3909
3910     }
3911     prop_flags <<= 1;
3912     if (prop_flags & 0x8000) {
3913     /*  correlation-id (shortstr)  */
3914     proto_tree_add_item(prop_tree, hf_amqp_header_basic_correlation_id,
3915         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3916     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3917
3918     }
3919     prop_flags <<= 1;
3920     if (prop_flags & 0x8000) {
3921     /*  reply-to (shortstr)      */
3922     proto_tree_add_item(prop_tree, hf_amqp_header_basic_reply_to,
3923         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3924     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3925
3926     }
3927     prop_flags <<= 1;
3928     if (prop_flags & 0x8000) {
3929     /*  expiration (shortstr)    */
3930     proto_tree_add_item(prop_tree, hf_amqp_header_basic_expiration,
3931         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3932     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3933
3934     }
3935     prop_flags <<= 1;
3936     if (prop_flags & 0x8000) {
3937     /*  message-id (shortstr)    */
3938     proto_tree_add_item(prop_tree, hf_amqp_header_basic_message_id,
3939         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3940     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3941
3942     }
3943     prop_flags <<= 1;
3944     if (prop_flags & 0x8000) {
3945     /*  timestamp (timestamp)    */
3946     proto_tree_add_item(prop_tree, hf_amqp_header_basic_timestamp,
3947         tvb, offset, 8, FALSE);
3948     AMQP_INCREMENT(offset, 8, bound);
3949
3950     }
3951     prop_flags <<= 1;
3952     if (prop_flags & 0x8000) {
3953     /*  type (shortstr)          */
3954     proto_tree_add_item(prop_tree, hf_amqp_header_basic_type,
3955         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3956     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3957
3958     }
3959     prop_flags <<= 1;
3960     if (prop_flags & 0x8000) {
3961     /*  user-id (shortstr)       */
3962     proto_tree_add_item(prop_tree, hf_amqp_header_basic_user_id,
3963         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3964     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3965
3966     }
3967     prop_flags <<= 1;
3968     if (prop_flags & 0x8000) {
3969     /*  app-id (shortstr)        */
3970     proto_tree_add_item(prop_tree, hf_amqp_header_basic_app_id,
3971         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3972     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3973
3974     }
3975     prop_flags <<= 1;
3976     if (prop_flags & 0x8000) {
3977     /*  cluster-id (shortstr)    */
3978     proto_tree_add_item(prop_tree, hf_amqp_header_basic_cluster_id,
3979         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
3980     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
3981
3982     }
3983     prop_flags <<= 1;
3984
3985     return offset;
3986 }
3987 /*  Dissection routine for content headers of class file           */
3988
3989 static size_t
3990 dissect_amqp_content_header_file(tvbuff_t *tvb,
3991     int offset, int bound, proto_tree *prop_tree)
3992 {
3993     proto_item *ti;
3994     guint16 prop_flags;
3995
3996     prop_flags = tvb_get_ntohs(tvb, 19);
3997     if (prop_flags & 0x8000) {
3998     /*  content-type (shortstr)  */
3999     proto_tree_add_item(prop_tree, hf_amqp_header_file_content_type,
4000         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4001     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4002
4003     }
4004     prop_flags <<= 1;
4005     if (prop_flags & 0x8000) {
4006     /*  content-encoding (shortstr)  */
4007     proto_tree_add_item(prop_tree, hf_amqp_header_file_content_encoding,
4008         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4009     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4010
4011     }
4012     prop_flags <<= 1;
4013     if (prop_flags & 0x8000) {
4014     /*  headers (table)          */
4015     ti = proto_tree_add_item(
4016         prop_tree, hf_amqp_header_file_headers,
4017         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
4018     dissect_amqp_field_table (tvb, offset + 4,
4019         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
4020     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
4021
4022     }
4023     prop_flags <<= 1;
4024     if (prop_flags & 0x8000) {
4025     /*  priority (octet)         */
4026     proto_tree_add_item(prop_tree, hf_amqp_header_file_priority,
4027         tvb, offset, 1, FALSE);
4028     AMQP_INCREMENT(offset, 1, bound);
4029
4030     }
4031     prop_flags <<= 1;
4032     if (prop_flags & 0x8000) {
4033     /*  reply-to (shortstr)      */
4034     proto_tree_add_item(prop_tree, hf_amqp_header_file_reply_to,
4035         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4036     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4037
4038     }
4039     prop_flags <<= 1;
4040     if (prop_flags & 0x8000) {
4041     /*  message-id (shortstr)    */
4042     proto_tree_add_item(prop_tree, hf_amqp_header_file_message_id,
4043         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4044     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4045
4046     }
4047     prop_flags <<= 1;
4048     if (prop_flags & 0x8000) {
4049     /*  filename (shortstr)      */
4050     proto_tree_add_item(prop_tree, hf_amqp_header_file_filename,
4051         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4052     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4053
4054     }
4055     prop_flags <<= 1;
4056     if (prop_flags & 0x8000) {
4057     /*  timestamp (timestamp)    */
4058     proto_tree_add_item(prop_tree, hf_amqp_header_file_timestamp,
4059         tvb, offset, 8, FALSE);
4060     AMQP_INCREMENT(offset, 8, bound);
4061
4062     }
4063     prop_flags <<= 1;
4064     if (prop_flags & 0x8000) {
4065     /*  cluster-id (shortstr)    */
4066     proto_tree_add_item(prop_tree, hf_amqp_header_file_cluster_id,
4067         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4068     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4069
4070     }
4071     prop_flags <<= 1;
4072
4073     return offset;
4074 }
4075 /*  Dissection routine for content headers of class stream         */
4076
4077 static size_t
4078 dissect_amqp_content_header_stream(tvbuff_t *tvb,
4079     int offset, int bound, proto_tree *prop_tree)
4080 {
4081     proto_item *ti;
4082     guint16 prop_flags;
4083
4084     prop_flags = tvb_get_ntohs(tvb, 19);
4085     if (prop_flags & 0x8000) {
4086     /*  content-type (shortstr)  */
4087     proto_tree_add_item(prop_tree, hf_amqp_header_stream_content_type,
4088         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4089     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4090
4091     }
4092     prop_flags <<= 1;
4093     if (prop_flags & 0x8000) {
4094     /*  content-encoding (shortstr)  */
4095     proto_tree_add_item(prop_tree, hf_amqp_header_stream_content_encoding,
4096         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4097     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4098
4099     }
4100     prop_flags <<= 1;
4101     if (prop_flags & 0x8000) {
4102     /*  headers (table)          */
4103     ti = proto_tree_add_item(
4104         prop_tree, hf_amqp_header_stream_headers,
4105         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
4106     dissect_amqp_field_table (tvb, offset + 4,
4107         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
4108     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
4109
4110     }
4111     prop_flags <<= 1;
4112     if (prop_flags & 0x8000) {
4113     /*  priority (octet)         */
4114     proto_tree_add_item(prop_tree, hf_amqp_header_stream_priority,
4115         tvb, offset, 1, FALSE);
4116     AMQP_INCREMENT(offset, 1, bound);
4117
4118     }
4119     prop_flags <<= 1;
4120     if (prop_flags & 0x8000) {
4121     /*  timestamp (timestamp)    */
4122     proto_tree_add_item(prop_tree, hf_amqp_header_stream_timestamp,
4123         tvb, offset, 8, FALSE);
4124     AMQP_INCREMENT(offset, 8, bound);
4125
4126     }
4127     prop_flags <<= 1;
4128
4129     return offset;
4130 }
4131 /*  Dissection routine for content headers of class tunnel         */
4132
4133 static size_t
4134 dissect_amqp_content_header_tunnel(tvbuff_t *tvb,
4135     int offset, int bound, proto_tree *prop_tree)
4136 {
4137     proto_item *ti;
4138     guint16 prop_flags;
4139
4140     prop_flags = tvb_get_ntohs(tvb, 19);
4141     if (prop_flags & 0x8000) {
4142     /*  headers (table)          */
4143     ti = proto_tree_add_item(
4144         prop_tree, hf_amqp_header_tunnel_headers,
4145         tvb, offset + 4, tvb_get_ntohl(tvb, offset), FALSE);
4146     dissect_amqp_field_table (tvb, offset + 4,
4147         offset + 4 + tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset), ti);
4148     AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), bound);
4149
4150     }
4151     prop_flags <<= 1;
4152     if (prop_flags & 0x8000) {
4153     /*  proxy-name (shortstr)    */
4154     proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_proxy_name,
4155         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4156     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4157
4158     }
4159     prop_flags <<= 1;
4160     if (prop_flags & 0x8000) {
4161     /*  data-name (shortstr)     */
4162     proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_data_name,
4163         tvb, offset + 1, tvb_get_guint8(tvb, offset), FALSE);
4164     AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), bound);
4165
4166     }
4167     prop_flags <<= 1;
4168     if (prop_flags & 0x8000) {
4169     /*  durable (octet)          */
4170     proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_durable,
4171         tvb, offset, 1, FALSE);
4172     AMQP_INCREMENT(offset, 1, bound);
4173
4174     }
4175     prop_flags <<= 1;
4176     if (prop_flags & 0x8000) {
4177     /*  broadcast (octet)        */
4178     proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_broadcast,
4179         tvb, offset, 1, FALSE);
4180     AMQP_INCREMENT(offset, 1, bound);
4181
4182     }
4183     prop_flags <<= 1;
4184
4185     return offset;
4186 }
4187
4188 /*  Setup of field format array  */
4189
4190 static hf_register_info hf[] = {
4191     {&hf_amqp_type, {
4192         "Type", "amqp.type",
4193         FT_UINT8, BASE_DEC, VALS(amqp_frame_types), 0x0,
4194         "Frame type", HFILL}},
4195     {&hf_amqp_channel,{
4196         "Channel", "amqp.channel",
4197         FT_UINT16, BASE_DEC, NULL, 0x0,
4198         "Channel ID", HFILL}},
4199     {&hf_amqp_length, {
4200         "Length", "amqp.length",
4201         FT_UINT32, BASE_DEC, NULL, 0x0,
4202         "Length of the frame", HFILL}},
4203     {&hf_amqp_method_class_id, {
4204         "Class", "amqp.method.class",
4205         FT_UINT16, BASE_DEC, VALS(amqp_method_classes), 0x0,
4206         "Class ID", HFILL}},
4207     {&hf_amqp_method_connection_method_id, {
4208         "Method", "amqp.method.method",
4209         FT_UINT16, BASE_DEC, VALS(amqp_method_connection_methods), 0x0,
4210         "Method ID", HFILL}},
4211     {&hf_amqp_method_channel_method_id, {
4212         "Method", "amqp.method.method",
4213         FT_UINT16, BASE_DEC, VALS(amqp_method_channel_methods), 0x0,
4214         "Method ID", HFILL}},
4215     {&hf_amqp_method_access_method_id, {
4216         "Method", "amqp.method.method",
4217         FT_UINT16, BASE_DEC, VALS(amqp_method_access_methods), 0x0,
4218         "Method ID", HFILL}},
4219     {&hf_amqp_method_exchange_method_id, {
4220         "Method", "amqp.method.method",
4221         FT_UINT16, BASE_DEC, VALS(amqp_method_exchange_methods), 0x0,
4222         "Method ID", HFILL}},
4223     {&hf_amqp_method_queue_method_id, {
4224         "Method", "amqp.method.method",
4225         FT_UINT16, BASE_DEC, VALS(amqp_method_queue_methods), 0x0,
4226         "Method ID", HFILL}},
4227     {&hf_amqp_method_basic_method_id, {
4228         "Method", "amqp.method.method",
4229         FT_UINT16, BASE_DEC, VALS(amqp_method_basic_methods), 0x0,
4230         "Method ID", HFILL}},
4231     {&hf_amqp_method_file_method_id, {
4232         "Method", "amqp.method.method",
4233         FT_UINT16, BASE_DEC, VALS(amqp_method_file_methods), 0x0,
4234         "Method ID", HFILL}},
4235     {&hf_amqp_method_stream_method_id, {
4236         "Method", "amqp.method.method",
4237         FT_UINT16, BASE_DEC, VALS(amqp_method_stream_methods), 0x0,
4238         "Method ID", HFILL}},
4239     {&hf_amqp_method_tx_method_id, {
4240         "Method", "amqp.method.method",
4241         FT_UINT16, BASE_DEC, VALS(amqp_method_tx_methods), 0x0,
4242         "Method ID", HFILL}},
4243     {&hf_amqp_method_dtx_method_id, {
4244         "Method", "amqp.method.method",
4245         FT_UINT16, BASE_DEC, VALS(amqp_method_dtx_methods), 0x0,
4246         "Method ID", HFILL}},
4247     {&hf_amqp_method_tunnel_method_id, {
4248         "Method", "amqp.method.method",
4249         FT_UINT16, BASE_DEC, VALS(amqp_method_tunnel_methods), 0x0,
4250         "Method ID", HFILL}},
4251     {&hf_amqp_method_arguments, {
4252         "Arguments", "amqp.method.arguments",
4253         FT_NONE, BASE_NONE, NULL, 0x0,
4254         "Method arguments", HFILL}},
4255     {&hf_amqp_method_connection_start_version_major, {
4256         "Version-Major", "amqp.method.arguments.version_major",
4257         FT_UINT8, BASE_DEC, NULL, 0,
4258         "version-major", HFILL}},
4259     {&hf_amqp_method_connection_start_version_minor, {
4260         "Version-Minor", "amqp.method.arguments.version_minor",
4261         FT_UINT8, BASE_DEC, NULL, 0,
4262         "version-minor", HFILL}},
4263     {&hf_amqp_method_connection_start_server_properties, {
4264         "Server-Properties", "amqp.method.arguments.server_properties",
4265         FT_NONE, BASE_NONE, NULL, 0,
4266         "server-properties", HFILL}},
4267     {&hf_amqp_method_connection_start_mechanisms, {
4268         "Mechanisms", "amqp.method.arguments.mechanisms",
4269         FT_BYTES, BASE_NONE, NULL, 0,
4270         "mechanisms", HFILL}},
4271     {&hf_amqp_method_connection_start_locales, {
4272         "Locales", "amqp.method.arguments.locales",
4273         FT_BYTES, BASE_NONE, NULL, 0,
4274         "locales", HFILL}},
4275     {&hf_amqp_method_connection_start_ok_client_properties, {
4276         "Client-Properties", "amqp.method.arguments.client_properties",
4277         FT_NONE, BASE_NONE, NULL, 0,
4278         "client-properties", HFILL}},
4279     {&hf_amqp_method_connection_start_ok_mechanism, {
4280         "Mechanism", "amqp.method.arguments.mechanism",
4281         FT_STRING, BASE_NONE, NULL, 0,
4282         "mechanism", HFILL}},
4283     {&hf_amqp_method_connection_start_ok_response, {
4284         "Response", "amqp.method.arguments.response",
4285         FT_BYTES, BASE_NONE, NULL, 0,
4286         "response", HFILL}},
4287     {&hf_amqp_method_connection_start_ok_locale, {
4288         "Locale", "amqp.method.arguments.locale",
4289         FT_STRING, BASE_NONE, NULL, 0,
4290         "locale", HFILL}},
4291     {&hf_amqp_method_connection_secure_challenge, {
4292         "Challenge", "amqp.method.arguments.challenge",
4293         FT_BYTES, BASE_NONE, NULL, 0,
4294         "challenge", HFILL}},
4295     {&hf_amqp_method_connection_secure_ok_response, {
4296         "Response", "amqp.method.arguments.response",
4297         FT_BYTES, BASE_NONE, NULL, 0,
4298         "response", HFILL}},
4299     {&hf_amqp_method_connection_tune_channel_max, {
4300         "Channel-Max", "amqp.method.arguments.channel_max",
4301          FT_UINT16, BASE_DEC, NULL, 0,
4302         "channel-max", HFILL}},
4303     {&hf_amqp_method_connection_tune_frame_max, {
4304         "Frame-Max", "amqp.method.arguments.frame_max",
4305         FT_UINT32, BASE_DEC, NULL, 0,
4306         "frame-max", HFILL}},
4307     {&hf_amqp_method_connection_tune_heartbeat, {
4308         "Heartbeat", "amqp.method.arguments.heartbeat",
4309          FT_UINT16, BASE_DEC, NULL, 0,
4310         "heartbeat", HFILL}},
4311     {&hf_amqp_method_connection_tune_ok_channel_max, {
4312         "Channel-Max", "amqp.method.arguments.channel_max",
4313          FT_UINT16, BASE_DEC, NULL, 0,
4314         "channel-max", HFILL}},
4315     {&hf_amqp_method_connection_tune_ok_frame_max, {
4316         "Frame-Max", "amqp.method.arguments.frame_max",
4317         FT_UINT32, BASE_DEC, NULL, 0,
4318         "frame-max", HFILL}},
4319     {&hf_amqp_method_connection_tune_ok_heartbeat, {
4320         "Heartbeat", "amqp.method.arguments.heartbeat",
4321          FT_UINT16, BASE_DEC, NULL, 0,
4322         "heartbeat", HFILL}},
4323     {&hf_amqp_method_connection_open_virtual_host, {
4324         "Virtual-Host", "amqp.method.arguments.virtual_host",
4325         FT_STRING, BASE_NONE, NULL, 0,
4326         "virtual-host", HFILL}},
4327     {&hf_amqp_method_connection_open_capabilities, {
4328         "Capabilities", "amqp.method.arguments.capabilities",
4329         FT_STRING, BASE_NONE, NULL, 0,
4330         "capabilities", HFILL}},
4331     {&hf_amqp_method_connection_open_insist, {
4332         "Insist", "amqp.method.arguments.insist",
4333         FT_BOOLEAN, 8, NULL, 0x01,
4334         "insist", HFILL}},
4335     {&hf_amqp_method_connection_open_ok_known_hosts, {
4336         "Known-Hosts", "amqp.method.arguments.known_hosts",
4337         FT_STRING, BASE_NONE, NULL, 0,
4338         "known-hosts", HFILL}},
4339     {&hf_amqp_method_connection_redirect_host, {
4340         "Host", "amqp.method.arguments.host",
4341         FT_STRING, BASE_NONE, NULL, 0,
4342         "host", HFILL}},
4343     {&hf_amqp_method_connection_redirect_known_hosts, {
4344         "Known-Hosts", "amqp.method.arguments.known_hosts",
4345         FT_STRING, BASE_NONE, NULL, 0,
4346         "known-hosts", HFILL}},
4347     {&hf_amqp_method_connection_close_reply_code, {
4348         "Reply-Code", "amqp.method.arguments.reply_code",
4349          FT_UINT16, BASE_DEC, NULL, 0,
4350         "reply-code", HFILL}},
4351     {&hf_amqp_method_connection_close_reply_text, {
4352         "Reply-Text", "amqp.method.arguments.reply_text",
4353         FT_STRING, BASE_NONE, NULL, 0,
4354         "reply-text", HFILL}},
4355     {&hf_amqp_method_connection_close_class_id, {
4356         "Class-Id", "amqp.method.arguments.class_id",
4357          FT_UINT16, BASE_DEC, NULL, 0,
4358         "class-id", HFILL}},
4359     {&hf_amqp_method_connection_close_method_id, {
4360         "Method-Id", "amqp.method.arguments.method_id",
4361          FT_UINT16, BASE_DEC, NULL, 0,
4362         "method-id", HFILL}},
4363     {&hf_amqp_method_channel_open_out_of_band, {
4364         "Out-Of-Band", "amqp.method.arguments.out_of_band",
4365         FT_STRING, BASE_NONE, NULL, 0,
4366         "out-of-band", HFILL}},
4367     {&hf_amqp_method_channel_open_ok_channel_id, {
4368         "Channel-Id", "amqp.method.arguments.channel_id",
4369         FT_BYTES, BASE_NONE, NULL, 0,
4370         "channel-id", HFILL}},
4371     {&hf_amqp_method_channel_flow_active, {
4372         "Active", "amqp.method.arguments.active",
4373         FT_BOOLEAN, 8, NULL, 0x01,
4374         "active", HFILL}},
4375     {&hf_amqp_method_channel_flow_ok_active, {
4376         "Active", "amqp.method.arguments.active",
4377         FT_BOOLEAN, 8, NULL, 0x01,
4378         "active", HFILL}},
4379     {&hf_amqp_method_channel_close_reply_code, {
4380         "Reply-Code", "amqp.method.arguments.reply_code",
4381          FT_UINT16, BASE_DEC, NULL, 0,
4382         "reply-code", HFILL}},
4383     {&hf_amqp_method_channel_close_reply_text, {
4384         "Reply-Text", "amqp.method.arguments.reply_text",
4385         FT_STRING, BASE_NONE, NULL, 0,
4386         "reply-text", HFILL}},
4387     {&hf_amqp_method_channel_close_class_id, {
4388         "Class-Id", "amqp.method.arguments.class_id",
4389          FT_UINT16, BASE_DEC, NULL, 0,
4390         "class-id", HFILL}},
4391     {&hf_amqp_method_channel_close_method_id, {
4392         "Method-Id", "amqp.method.arguments.method_id",
4393          FT_UINT16, BASE_DEC, NULL, 0,
4394         "method-id", HFILL}},
4395     {&hf_amqp_method_channel_resume_channel_id, {
4396         "Channel-Id", "amqp.method.arguments.channel_id",
4397         FT_BYTES, BASE_NONE, NULL, 0,
4398         "channel-id", HFILL}},
4399     {&hf_amqp_method_access_request_realm, {
4400         "Realm", "amqp.method.arguments.realm",
4401         FT_STRING, BASE_NONE, NULL, 0,
4402         "realm", HFILL}},
4403     {&hf_amqp_method_access_request_exclusive, {
4404         "Exclusive", "amqp.method.arguments.exclusive",
4405         FT_BOOLEAN, 8, NULL, 0x01,
4406         "exclusive", HFILL}},
4407     {&hf_amqp_method_access_request_passive, {
4408         "Passive", "amqp.method.arguments.passive",
4409         FT_BOOLEAN, 8, NULL, 0x02,
4410         "passive", HFILL}},
4411     {&hf_amqp_method_access_request_active, {
4412         "Active", "amqp.method.arguments.active",
4413         FT_BOOLEAN, 8, NULL, 0x04,
4414         "active", HFILL}},
4415     {&hf_amqp_method_access_request_write, {
4416         "Write", "amqp.method.arguments.write",
4417         FT_BOOLEAN, 8, NULL, 0x08,
4418         "write", HFILL}},
4419     {&hf_amqp_method_access_request_read, {
4420         "Read", "amqp.method.arguments.read",
4421         FT_BOOLEAN, 8, NULL, 0x10,
4422         "read", HFILL}},
4423     {&hf_amqp_method_access_request_ok_ticket, {
4424         "Ticket", "amqp.method.arguments.ticket",
4425          FT_UINT16, BASE_DEC, NULL, 0,
4426         "ticket", HFILL}},
4427     {&hf_amqp_method_exchange_declare_ticket, {
4428         "Ticket", "amqp.method.arguments.ticket",
4429          FT_UINT16, BASE_DEC, NULL, 0,
4430         "ticket", HFILL}},
4431     {&hf_amqp_method_exchange_declare_exchange, {
4432         "Exchange", "amqp.method.arguments.exchange",
4433         FT_STRING, BASE_NONE, NULL, 0,
4434         "exchange", HFILL}},
4435     {&hf_amqp_method_exchange_declare_type, {
4436         "Type", "amqp.method.arguments.type",
4437         FT_STRING, BASE_NONE, NULL, 0,
4438         "type", HFILL}},
4439     {&hf_amqp_method_exchange_declare_passive, {
4440         "Passive", "amqp.method.arguments.passive",
4441         FT_BOOLEAN, 8, NULL, 0x01,
4442         "passive", HFILL}},
4443     {&hf_amqp_method_exchange_declare_durable, {
4444         "Durable", "amqp.method.arguments.durable",
4445         FT_BOOLEAN, 8, NULL, 0x02,
4446         "durable", HFILL}},
4447     {&hf_amqp_method_exchange_declare_auto_delete, {
4448         "Auto-Delete", "amqp.method.arguments.auto_delete",
4449         FT_BOOLEAN, 8, NULL, 0x04,
4450         "auto-delete", HFILL}},
4451     {&hf_amqp_method_exchange_declare_internal, {
4452         "Internal", "amqp.method.arguments.internal",
4453         FT_BOOLEAN, 8, NULL, 0x08,
4454         "internal", HFILL}},
4455     {&hf_amqp_method_exchange_declare_nowait, {
4456         "Nowait", "amqp.method.arguments.nowait",
4457         FT_BOOLEAN, 8, NULL, 0x10,
4458         "nowait", HFILL}},
4459     {&hf_amqp_method_exchange_declare_arguments, {
4460         "Arguments", "amqp.method.arguments.arguments",
4461         FT_NONE, BASE_NONE, NULL, 0,
4462         "arguments", HFILL}},
4463     {&hf_amqp_method_exchange_delete_ticket, {
4464         "Ticket", "amqp.method.arguments.ticket",
4465          FT_UINT16, BASE_DEC, NULL, 0,
4466         "ticket", HFILL}},
4467     {&hf_amqp_method_exchange_delete_exchange, {
4468         "Exchange", "amqp.method.arguments.exchange",
4469         FT_STRING, BASE_NONE, NULL, 0,
4470         "exchange", HFILL}},
4471     {&hf_amqp_method_exchange_delete_if_unused, {
4472         "If-Unused", "amqp.method.arguments.if_unused",
4473         FT_BOOLEAN, 8, NULL, 0x01,
4474         "if-unused", HFILL}},
4475     {&hf_amqp_method_exchange_delete_nowait, {
4476         "Nowait", "amqp.method.arguments.nowait",
4477         FT_BOOLEAN, 8, NULL, 0x02,
4478         "nowait", HFILL}},
4479     {&hf_amqp_method_queue_declare_ticket, {
4480         "Ticket", "amqp.method.arguments.ticket",
4481          FT_UINT16, BASE_DEC, NULL, 0,
4482         "ticket", HFILL}},
4483     {&hf_amqp_method_queue_declare_queue, {
4484         "Queue", "amqp.method.arguments.queue",
4485         FT_STRING, BASE_NONE, NULL, 0,
4486         "queue", HFILL}},
4487     {&hf_amqp_method_queue_declare_passive, {
4488         "Passive", "amqp.method.arguments.passive",
4489         FT_BOOLEAN, 8, NULL, 0x01,
4490         "passive", HFILL}},
4491     {&hf_amqp_method_queue_declare_durable, {
4492         "Durable", "amqp.method.arguments.durable",
4493         FT_BOOLEAN, 8, NULL, 0x02,
4494         "durable", HFILL}},
4495     {&hf_amqp_method_queue_declare_exclusive, {
4496         "Exclusive", "amqp.method.arguments.exclusive",
4497         FT_BOOLEAN, 8, NULL, 0x04,
4498         "exclusive", HFILL}},
4499     {&hf_amqp_method_queue_declare_auto_delete, {
4500         "Auto-Delete", "amqp.method.arguments.auto_delete",
4501         FT_BOOLEAN, 8, NULL, 0x08,
4502         "auto-delete", HFILL}},
4503     {&hf_amqp_method_queue_declare_nowait, {
4504         "Nowait", "amqp.method.arguments.nowait",
4505         FT_BOOLEAN, 8, NULL, 0x10,
4506         "nowait", HFILL}},
4507     {&hf_amqp_method_queue_declare_arguments, {
4508         "Arguments", "amqp.method.arguments.arguments",
4509         FT_NONE, BASE_NONE, NULL, 0,
4510         "arguments", HFILL}},
4511     {&hf_amqp_method_queue_declare_ok_queue, {
4512         "Queue", "amqp.method.arguments.queue",
4513         FT_STRING, BASE_NONE, NULL, 0,
4514         "queue", HFILL}},
4515     {&hf_amqp_method_queue_declare_ok_message_count, {
4516         "Message-Count", "amqp.method.arguments.message_count",
4517         FT_UINT32, BASE_DEC, NULL, 0,
4518         "message-count", HFILL}},
4519     {&hf_amqp_method_queue_declare_ok_consumer_count, {
4520         "Consumer-Count", "amqp.method.arguments.consumer_count",
4521         FT_UINT32, BASE_DEC, NULL, 0,
4522         "consumer-count", HFILL}},
4523     {&hf_amqp_method_queue_bind_ticket, {
4524         "Ticket", "amqp.method.arguments.ticket",
4525          FT_UINT16, BASE_DEC, NULL, 0,
4526         "ticket", HFILL}},
4527     {&hf_amqp_method_queue_bind_queue, {
4528         "Queue", "amqp.method.arguments.queue",
4529         FT_STRING, BASE_NONE, NULL, 0,
4530         "queue", HFILL}},
4531     {&hf_amqp_method_queue_bind_exchange, {
4532         "Exchange", "amqp.method.arguments.exchange",
4533         FT_STRING, BASE_NONE, NULL, 0,
4534         "exchange", HFILL}},
4535     {&hf_amqp_method_queue_bind_routing_key, {
4536         "Routing-Key", "amqp.method.arguments.routing_key",
4537         FT_STRING, BASE_NONE, NULL, 0,
4538         "routing-key", HFILL}},
4539     {&hf_amqp_method_queue_bind_nowait, {
4540         "Nowait", "amqp.method.arguments.nowait",
4541         FT_BOOLEAN, 8, NULL, 0x01,
4542         "nowait", HFILL}},
4543     {&hf_amqp_method_queue_bind_arguments, {
4544         "Arguments", "amqp.method.arguments.arguments",
4545         FT_NONE, BASE_NONE, NULL, 0,
4546         "arguments", HFILL}},
4547     {&hf_amqp_method_queue_unbind_ticket, {
4548         "Ticket", "amqp.method.arguments.ticket",
4549          FT_UINT16, BASE_DEC, NULL, 0,
4550         "ticket", HFILL}},
4551     {&hf_amqp_method_queue_unbind_queue, {
4552         "Queue", "amqp.method.arguments.queue",
4553         FT_STRING, BASE_NONE, NULL, 0,
4554         "queue", HFILL}},
4555     {&hf_amqp_method_queue_unbind_exchange, {
4556         "Exchange", "amqp.method.arguments.exchange",
4557         FT_STRING, BASE_NONE, NULL, 0,
4558         "exchange", HFILL}},
4559     {&hf_amqp_method_queue_unbind_routing_key, {
4560         "Routing-Key", "amqp.method.arguments.routing_key",
4561         FT_STRING, BASE_NONE, NULL, 0,
4562         "routing-key", HFILL}},
4563     {&hf_amqp_method_queue_unbind_arguments, {
4564         "Arguments", "amqp.method.arguments.arguments",
4565         FT_NONE, BASE_NONE, NULL, 0,
4566         "arguments", HFILL}},
4567     {&hf_amqp_method_queue_purge_ticket, {
4568         "Ticket", "amqp.method.arguments.ticket",
4569          FT_UINT16, BASE_DEC, NULL, 0,
4570         "ticket", HFILL}},
4571     {&hf_amqp_method_queue_purge_queue, {
4572         "Queue", "amqp.method.arguments.queue",
4573         FT_STRING, BASE_NONE, NULL, 0,
4574         "queue", HFILL}},
4575     {&hf_amqp_method_queue_purge_nowait, {
4576         "Nowait", "amqp.method.arguments.nowait",
4577         FT_BOOLEAN, 8, NULL, 0x01,
4578         "nowait", HFILL}},
4579     {&hf_amqp_method_queue_purge_ok_message_count, {
4580         "Message-Count", "amqp.method.arguments.message_count",
4581         FT_UINT32, BASE_DEC, NULL, 0,
4582         "message-count", HFILL}},
4583     {&hf_amqp_method_queue_delete_ticket, {
4584         "Ticket", "amqp.method.arguments.ticket",
4585          FT_UINT16, BASE_DEC, NULL, 0,
4586         "ticket", HFILL}},
4587     {&hf_amqp_method_queue_delete_queue, {
4588         "Queue", "amqp.method.arguments.queue",
4589         FT_STRING, BASE_NONE, NULL, 0,
4590         "queue", HFILL}},
4591     {&hf_amqp_method_queue_delete_if_unused, {
4592         "If-Unused", "amqp.method.arguments.if_unused",
4593         FT_BOOLEAN, 8, NULL, 0x01,
4594         "if-unused", HFILL}},
4595     {&hf_amqp_method_queue_delete_if_empty, {
4596         "If-Empty", "amqp.method.arguments.if_empty",
4597         FT_BOOLEAN, 8, NULL, 0x02,
4598         "if-empty", HFILL}},
4599     {&hf_amqp_method_queue_delete_nowait, {
4600         "Nowait", "amqp.method.arguments.nowait",
4601         FT_BOOLEAN, 8, NULL, 0x04,
4602         "nowait", HFILL}},
4603     {&hf_amqp_method_queue_delete_ok_message_count, {
4604         "Message-Count", "amqp.method.arguments.message_count",
4605         FT_UINT32, BASE_DEC, NULL, 0,
4606         "message-count", HFILL}},
4607     {&hf_amqp_method_basic_qos_prefetch_size, {
4608         "Prefetch-Size", "amqp.method.arguments.prefetch_size",
4609         FT_UINT32, BASE_DEC, NULL, 0,
4610         "prefetch-size", HFILL}},
4611     {&hf_amqp_method_basic_qos_prefetch_count, {
4612         "Prefetch-Count", "amqp.method.arguments.prefetch_count",
4613          FT_UINT16, BASE_DEC, NULL, 0,
4614         "prefetch-count", HFILL}},
4615     {&hf_amqp_method_basic_qos_global, {
4616         "Global", "amqp.method.arguments.global",
4617         FT_BOOLEAN, 8, NULL, 0x01,
4618         "global", HFILL}},
4619     {&hf_amqp_method_basic_consume_ticket, {
4620         "Ticket", "amqp.method.arguments.ticket",
4621          FT_UINT16, BASE_DEC, NULL, 0,
4622         "ticket", HFILL}},
4623     {&hf_amqp_method_basic_consume_queue, {
4624         "Queue", "amqp.method.arguments.queue",
4625         FT_STRING, BASE_NONE, NULL, 0,
4626         "queue", HFILL}},
4627     {&hf_amqp_method_basic_consume_consumer_tag, {
4628         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4629         FT_STRING, BASE_NONE, NULL, 0,
4630         "consumer-tag", HFILL}},
4631     {&hf_amqp_method_basic_consume_no_local, {
4632         "No-Local", "amqp.method.arguments.no_local",
4633         FT_BOOLEAN, 8, NULL, 0x01,
4634         "no-local", HFILL}},
4635     {&hf_amqp_method_basic_consume_no_ack, {
4636         "No-Ack", "amqp.method.arguments.no_ack",
4637         FT_BOOLEAN, 8, NULL, 0x02,
4638         "no-ack", HFILL}},
4639     {&hf_amqp_method_basic_consume_exclusive, {
4640         "Exclusive", "amqp.method.arguments.exclusive",
4641         FT_BOOLEAN, 8, NULL, 0x04,
4642         "exclusive", HFILL}},
4643     {&hf_amqp_method_basic_consume_nowait, {
4644         "Nowait", "amqp.method.arguments.nowait",
4645         FT_BOOLEAN, 8, NULL, 0x08,
4646         "nowait", HFILL}},
4647     {&hf_amqp_method_basic_consume_filter, {
4648         "Filter", "amqp.method.arguments.filter",
4649         FT_NONE, BASE_NONE, NULL, 0,
4650         "filter", HFILL}},
4651     {&hf_amqp_method_basic_consume_ok_consumer_tag, {
4652         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4653         FT_STRING, BASE_NONE, NULL, 0,
4654         "consumer-tag", HFILL}},
4655     {&hf_amqp_method_basic_cancel_consumer_tag, {
4656         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4657         FT_STRING, BASE_NONE, NULL, 0,
4658         "consumer-tag", HFILL}},
4659     {&hf_amqp_method_basic_cancel_nowait, {
4660         "Nowait", "amqp.method.arguments.nowait",
4661         FT_BOOLEAN, 8, NULL, 0x01,
4662         "nowait", HFILL}},
4663     {&hf_amqp_method_basic_cancel_ok_consumer_tag, {
4664         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4665         FT_STRING, BASE_NONE, NULL, 0,
4666         "consumer-tag", HFILL}},
4667     {&hf_amqp_method_basic_publish_ticket, {
4668         "Ticket", "amqp.method.arguments.ticket",
4669          FT_UINT16, BASE_DEC, NULL, 0,
4670         "ticket", HFILL}},
4671     {&hf_amqp_method_basic_publish_exchange, {
4672         "Exchange", "amqp.method.arguments.exchange",
4673         FT_STRING, BASE_NONE, NULL, 0,
4674         "exchange", HFILL}},
4675     {&hf_amqp_method_basic_publish_routing_key, {
4676         "Routing-Key", "amqp.method.arguments.routing_key",
4677         FT_STRING, BASE_NONE, NULL, 0,
4678         "routing-key", HFILL}},
4679     {&hf_amqp_method_basic_publish_mandatory, {
4680         "Mandatory", "amqp.method.arguments.mandatory",
4681         FT_BOOLEAN, 8, NULL, 0x01,
4682         "mandatory", HFILL}},
4683     {&hf_amqp_method_basic_publish_immediate, {
4684         "Immediate", "amqp.method.arguments.immediate",
4685         FT_BOOLEAN, 8, NULL, 0x02,
4686         "immediate", HFILL}},
4687     {&hf_amqp_method_basic_return_reply_code, {
4688         "Reply-Code", "amqp.method.arguments.reply_code",
4689          FT_UINT16, BASE_DEC, NULL, 0,
4690         "reply-code", HFILL}},
4691     {&hf_amqp_method_basic_return_reply_text, {
4692         "Reply-Text", "amqp.method.arguments.reply_text",
4693         FT_STRING, BASE_NONE, NULL, 0,
4694         "reply-text", HFILL}},
4695     {&hf_amqp_method_basic_return_exchange, {
4696         "Exchange", "amqp.method.arguments.exchange",
4697         FT_STRING, BASE_NONE, NULL, 0,
4698         "exchange", HFILL}},
4699     {&hf_amqp_method_basic_return_routing_key, {
4700         "Routing-Key", "amqp.method.arguments.routing_key",
4701         FT_STRING, BASE_NONE, NULL, 0,
4702         "routing-key", HFILL}},
4703     {&hf_amqp_method_basic_deliver_consumer_tag, {
4704         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4705         FT_STRING, BASE_NONE, NULL, 0,
4706         "consumer-tag", HFILL}},
4707     {&hf_amqp_method_basic_deliver_delivery_tag, {
4708         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4709         FT_UINT64, BASE_DEC, NULL, 0,
4710         "delivery-tag", HFILL}},
4711     {&hf_amqp_method_basic_deliver_redelivered, {
4712         "Redelivered", "amqp.method.arguments.redelivered",
4713         FT_BOOLEAN, 8, NULL, 0x01,
4714         "redelivered", HFILL}},
4715     {&hf_amqp_method_basic_deliver_exchange, {
4716         "Exchange", "amqp.method.arguments.exchange",
4717         FT_STRING, BASE_NONE, NULL, 0,
4718         "exchange", HFILL}},
4719     {&hf_amqp_method_basic_deliver_routing_key, {
4720         "Routing-Key", "amqp.method.arguments.routing_key",
4721         FT_STRING, BASE_NONE, NULL, 0,
4722         "routing-key", HFILL}},
4723     {&hf_amqp_method_basic_get_ticket, {
4724         "Ticket", "amqp.method.arguments.ticket",
4725          FT_UINT16, BASE_DEC, NULL, 0,
4726         "ticket", HFILL}},
4727     {&hf_amqp_method_basic_get_queue, {
4728         "Queue", "amqp.method.arguments.queue",
4729         FT_STRING, BASE_NONE, NULL, 0,
4730         "queue", HFILL}},
4731     {&hf_amqp_method_basic_get_no_ack, {
4732         "No-Ack", "amqp.method.arguments.no_ack",
4733         FT_BOOLEAN, 8, NULL, 0x01,
4734         "no-ack", HFILL}},
4735     {&hf_amqp_method_basic_get_ok_delivery_tag, {
4736         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4737         FT_UINT64, BASE_DEC, NULL, 0,
4738         "delivery-tag", HFILL}},
4739     {&hf_amqp_method_basic_get_ok_redelivered, {
4740         "Redelivered", "amqp.method.arguments.redelivered",
4741         FT_BOOLEAN, 8, NULL, 0x01,
4742         "redelivered", HFILL}},
4743     {&hf_amqp_method_basic_get_ok_exchange, {
4744         "Exchange", "amqp.method.arguments.exchange",
4745         FT_STRING, BASE_NONE, NULL, 0,
4746         "exchange", HFILL}},
4747     {&hf_amqp_method_basic_get_ok_routing_key, {
4748         "Routing-Key", "amqp.method.arguments.routing_key",
4749         FT_STRING, BASE_NONE, NULL, 0,
4750         "routing-key", HFILL}},
4751     {&hf_amqp_method_basic_get_ok_message_count, {
4752         "Message-Count", "amqp.method.arguments.message_count",
4753         FT_UINT32, BASE_DEC, NULL, 0,
4754         "message-count", HFILL}},
4755     {&hf_amqp_method_basic_get_empty_cluster_id, {
4756         "Cluster-Id", "amqp.method.arguments.cluster_id",
4757         FT_STRING, BASE_NONE, NULL, 0,
4758         "cluster-id", HFILL}},
4759     {&hf_amqp_method_basic_ack_delivery_tag, {
4760         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4761         FT_UINT64, BASE_DEC, NULL, 0,
4762         "delivery-tag", HFILL}},
4763     {&hf_amqp_method_basic_ack_multiple, {
4764         "Multiple", "amqp.method.arguments.multiple",
4765         FT_BOOLEAN, 8, NULL, 0x01,
4766         "multiple", HFILL}},
4767     {&hf_amqp_method_basic_reject_delivery_tag, {
4768         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4769         FT_UINT64, BASE_DEC, NULL, 0,
4770         "delivery-tag", HFILL}},
4771     {&hf_amqp_method_basic_reject_requeue, {
4772         "Requeue", "amqp.method.arguments.requeue",
4773         FT_BOOLEAN, 8, NULL, 0x01,
4774         "requeue", HFILL}},
4775     {&hf_amqp_method_basic_recover_requeue, {
4776         "Requeue", "amqp.method.arguments.requeue",
4777         FT_BOOLEAN, 8, NULL, 0x01,
4778         "requeue", HFILL}},
4779     {&hf_amqp_method_file_qos_prefetch_size, {
4780         "Prefetch-Size", "amqp.method.arguments.prefetch_size",
4781         FT_UINT32, BASE_DEC, NULL, 0,
4782         "prefetch-size", HFILL}},
4783     {&hf_amqp_method_file_qos_prefetch_count, {
4784         "Prefetch-Count", "amqp.method.arguments.prefetch_count",
4785          FT_UINT16, BASE_DEC, NULL, 0,
4786         "prefetch-count", HFILL}},
4787     {&hf_amqp_method_file_qos_global, {
4788         "Global", "amqp.method.arguments.global",
4789         FT_BOOLEAN, 8, NULL, 0x01,
4790         "global", HFILL}},
4791     {&hf_amqp_method_file_consume_ticket, {
4792         "Ticket", "amqp.method.arguments.ticket",
4793          FT_UINT16, BASE_DEC, NULL, 0,
4794         "ticket", HFILL}},
4795     {&hf_amqp_method_file_consume_queue, {
4796         "Queue", "amqp.method.arguments.queue",
4797         FT_STRING, BASE_NONE, NULL, 0,
4798         "queue", HFILL}},
4799     {&hf_amqp_method_file_consume_consumer_tag, {
4800         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4801         FT_STRING, BASE_NONE, NULL, 0,
4802         "consumer-tag", HFILL}},
4803     {&hf_amqp_method_file_consume_no_local, {
4804         "No-Local", "amqp.method.arguments.no_local",
4805         FT_BOOLEAN, 8, NULL, 0x01,
4806         "no-local", HFILL}},
4807     {&hf_amqp_method_file_consume_no_ack, {
4808         "No-Ack", "amqp.method.arguments.no_ack",
4809         FT_BOOLEAN, 8, NULL, 0x02,
4810         "no-ack", HFILL}},
4811     {&hf_amqp_method_file_consume_exclusive, {
4812         "Exclusive", "amqp.method.arguments.exclusive",
4813         FT_BOOLEAN, 8, NULL, 0x04,
4814         "exclusive", HFILL}},
4815     {&hf_amqp_method_file_consume_nowait, {
4816         "Nowait", "amqp.method.arguments.nowait",
4817         FT_BOOLEAN, 8, NULL, 0x08,
4818         "nowait", HFILL}},
4819     {&hf_amqp_method_file_consume_filter, {
4820         "Filter", "amqp.method.arguments.filter",
4821         FT_NONE, BASE_NONE, NULL, 0,
4822         "filter", HFILL}},
4823     {&hf_amqp_method_file_consume_ok_consumer_tag, {
4824         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4825         FT_STRING, BASE_NONE, NULL, 0,
4826         "consumer-tag", HFILL}},
4827     {&hf_amqp_method_file_cancel_consumer_tag, {
4828         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4829         FT_STRING, BASE_NONE, NULL, 0,
4830         "consumer-tag", HFILL}},
4831     {&hf_amqp_method_file_cancel_nowait, {
4832         "Nowait", "amqp.method.arguments.nowait",
4833         FT_BOOLEAN, 8, NULL, 0x01,
4834         "nowait", HFILL}},
4835     {&hf_amqp_method_file_cancel_ok_consumer_tag, {
4836         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4837         FT_STRING, BASE_NONE, NULL, 0,
4838         "consumer-tag", HFILL}},
4839     {&hf_amqp_method_file_open_identifier, {
4840         "Identifier", "amqp.method.arguments.identifier",
4841         FT_STRING, BASE_NONE, NULL, 0,
4842         "identifier", HFILL}},
4843     {&hf_amqp_method_file_open_content_size, {
4844         "Content-Size", "amqp.method.arguments.content_size",
4845         FT_UINT64, BASE_DEC, NULL, 0,
4846         "content-size", HFILL}},
4847     {&hf_amqp_method_file_open_ok_staged_size, {
4848         "Staged-Size", "amqp.method.arguments.staged_size",
4849         FT_UINT64, BASE_DEC, NULL, 0,
4850         "staged-size", HFILL}},
4851     {&hf_amqp_method_file_publish_ticket, {
4852         "Ticket", "amqp.method.arguments.ticket",
4853          FT_UINT16, BASE_DEC, NULL, 0,
4854         "ticket", HFILL}},
4855     {&hf_amqp_method_file_publish_exchange, {
4856         "Exchange", "amqp.method.arguments.exchange",
4857         FT_STRING, BASE_NONE, NULL, 0,
4858         "exchange", HFILL}},
4859     {&hf_amqp_method_file_publish_routing_key, {
4860         "Routing-Key", "amqp.method.arguments.routing_key",
4861         FT_STRING, BASE_NONE, NULL, 0,
4862         "routing-key", HFILL}},
4863     {&hf_amqp_method_file_publish_mandatory, {
4864         "Mandatory", "amqp.method.arguments.mandatory",
4865         FT_BOOLEAN, 8, NULL, 0x01,
4866         "mandatory", HFILL}},
4867     {&hf_amqp_method_file_publish_immediate, {
4868         "Immediate", "amqp.method.arguments.immediate",
4869         FT_BOOLEAN, 8, NULL, 0x02,
4870         "immediate", HFILL}},
4871     {&hf_amqp_method_file_publish_identifier, {
4872         "Identifier", "amqp.method.arguments.identifier",
4873         FT_STRING, BASE_NONE, NULL, 0,
4874         "identifier", HFILL}},
4875     {&hf_amqp_method_file_return_reply_code, {
4876         "Reply-Code", "amqp.method.arguments.reply_code",
4877          FT_UINT16, BASE_DEC, NULL, 0,
4878         "reply-code", HFILL}},
4879     {&hf_amqp_method_file_return_reply_text, {
4880         "Reply-Text", "amqp.method.arguments.reply_text",
4881         FT_STRING, BASE_NONE, NULL, 0,
4882         "reply-text", HFILL}},
4883     {&hf_amqp_method_file_return_exchange, {
4884         "Exchange", "amqp.method.arguments.exchange",
4885         FT_STRING, BASE_NONE, NULL, 0,
4886         "exchange", HFILL}},
4887     {&hf_amqp_method_file_return_routing_key, {
4888         "Routing-Key", "amqp.method.arguments.routing_key",
4889         FT_STRING, BASE_NONE, NULL, 0,
4890         "routing-key", HFILL}},
4891     {&hf_amqp_method_file_deliver_consumer_tag, {
4892         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4893         FT_STRING, BASE_NONE, NULL, 0,
4894         "consumer-tag", HFILL}},
4895     {&hf_amqp_method_file_deliver_delivery_tag, {
4896         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4897         FT_UINT64, BASE_DEC, NULL, 0,
4898         "delivery-tag", HFILL}},
4899     {&hf_amqp_method_file_deliver_redelivered, {
4900         "Redelivered", "amqp.method.arguments.redelivered",
4901         FT_BOOLEAN, 8, NULL, 0x01,
4902         "redelivered", HFILL}},
4903     {&hf_amqp_method_file_deliver_exchange, {
4904         "Exchange", "amqp.method.arguments.exchange",
4905         FT_STRING, BASE_NONE, NULL, 0,
4906         "exchange", HFILL}},
4907     {&hf_amqp_method_file_deliver_routing_key, {
4908         "Routing-Key", "amqp.method.arguments.routing_key",
4909         FT_STRING, BASE_NONE, NULL, 0,
4910         "routing-key", HFILL}},
4911     {&hf_amqp_method_file_deliver_identifier, {
4912         "Identifier", "amqp.method.arguments.identifier",
4913         FT_STRING, BASE_NONE, NULL, 0,
4914         "identifier", HFILL}},
4915     {&hf_amqp_method_file_ack_delivery_tag, {
4916         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4917         FT_UINT64, BASE_DEC, NULL, 0,
4918         "delivery-tag", HFILL}},
4919     {&hf_amqp_method_file_ack_multiple, {
4920         "Multiple", "amqp.method.arguments.multiple",
4921         FT_BOOLEAN, 8, NULL, 0x01,
4922         "multiple", HFILL}},
4923     {&hf_amqp_method_file_reject_delivery_tag, {
4924         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
4925         FT_UINT64, BASE_DEC, NULL, 0,
4926         "delivery-tag", HFILL}},
4927     {&hf_amqp_method_file_reject_requeue, {
4928         "Requeue", "amqp.method.arguments.requeue",
4929         FT_BOOLEAN, 8, NULL, 0x01,
4930         "requeue", HFILL}},
4931     {&hf_amqp_method_stream_qos_prefetch_size, {
4932         "Prefetch-Size", "amqp.method.arguments.prefetch_size",
4933         FT_UINT32, BASE_DEC, NULL, 0,
4934         "prefetch-size", HFILL}},
4935     {&hf_amqp_method_stream_qos_prefetch_count, {
4936         "Prefetch-Count", "amqp.method.arguments.prefetch_count",
4937          FT_UINT16, BASE_DEC, NULL, 0,
4938         "prefetch-count", HFILL}},
4939     {&hf_amqp_method_stream_qos_consume_rate, {
4940         "Consume-Rate", "amqp.method.arguments.consume_rate",
4941         FT_UINT32, BASE_DEC, NULL, 0,
4942         "consume-rate", HFILL}},
4943     {&hf_amqp_method_stream_qos_global, {
4944         "Global", "amqp.method.arguments.global",
4945         FT_BOOLEAN, 8, NULL, 0x01,
4946         "global", HFILL}},
4947     {&hf_amqp_method_stream_consume_ticket, {
4948         "Ticket", "amqp.method.arguments.ticket",
4949          FT_UINT16, BASE_DEC, NULL, 0,
4950         "ticket", HFILL}},
4951     {&hf_amqp_method_stream_consume_queue, {
4952         "Queue", "amqp.method.arguments.queue",
4953         FT_STRING, BASE_NONE, NULL, 0,
4954         "queue", HFILL}},
4955     {&hf_amqp_method_stream_consume_consumer_tag, {
4956         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4957         FT_STRING, BASE_NONE, NULL, 0,
4958         "consumer-tag", HFILL}},
4959     {&hf_amqp_method_stream_consume_no_local, {
4960         "No-Local", "amqp.method.arguments.no_local",
4961         FT_BOOLEAN, 8, NULL, 0x01,
4962         "no-local", HFILL}},
4963     {&hf_amqp_method_stream_consume_exclusive, {
4964         "Exclusive", "amqp.method.arguments.exclusive",
4965         FT_BOOLEAN, 8, NULL, 0x02,
4966         "exclusive", HFILL}},
4967     {&hf_amqp_method_stream_consume_nowait, {
4968         "Nowait", "amqp.method.arguments.nowait",
4969         FT_BOOLEAN, 8, NULL, 0x04,
4970         "nowait", HFILL}},
4971     {&hf_amqp_method_stream_consume_filter, {
4972         "Filter", "amqp.method.arguments.filter",
4973         FT_NONE, BASE_NONE, NULL, 0,
4974         "filter", HFILL}},
4975     {&hf_amqp_method_stream_consume_ok_consumer_tag, {
4976         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4977         FT_STRING, BASE_NONE, NULL, 0,
4978         "consumer-tag", HFILL}},
4979     {&hf_amqp_method_stream_cancel_consumer_tag, {
4980         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4981         FT_STRING, BASE_NONE, NULL, 0,
4982         "consumer-tag", HFILL}},
4983     {&hf_amqp_method_stream_cancel_nowait, {
4984         "Nowait", "amqp.method.arguments.nowait",
4985         FT_BOOLEAN, 8, NULL, 0x01,
4986         "nowait", HFILL}},
4987     {&hf_amqp_method_stream_cancel_ok_consumer_tag, {
4988         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
4989         FT_STRING, BASE_NONE, NULL, 0,
4990         "consumer-tag", HFILL}},
4991     {&hf_amqp_method_stream_publish_ticket, {
4992         "Ticket", "amqp.method.arguments.ticket",
4993          FT_UINT16, BASE_DEC, NULL, 0,
4994         "ticket", HFILL}},
4995     {&hf_amqp_method_stream_publish_exchange, {
4996         "Exchange", "amqp.method.arguments.exchange",
4997         FT_STRING, BASE_NONE, NULL, 0,
4998         "exchange", HFILL}},
4999     {&hf_amqp_method_stream_publish_routing_key, {
5000         "Routing-Key", "amqp.method.arguments.routing_key",
5001         FT_STRING, BASE_NONE, NULL, 0,
5002         "routing-key", HFILL}},
5003     {&hf_amqp_method_stream_publish_mandatory, {
5004         "Mandatory", "amqp.method.arguments.mandatory",
5005         FT_BOOLEAN, 8, NULL, 0x01,
5006         "mandatory", HFILL}},
5007     {&hf_amqp_method_stream_publish_immediate, {
5008         "Immediate", "amqp.method.arguments.immediate",
5009         FT_BOOLEAN, 8, NULL, 0x02,
5010         "immediate", HFILL}},
5011     {&hf_amqp_method_stream_return_reply_code, {
5012         "Reply-Code", "amqp.method.arguments.reply_code",
5013          FT_UINT16, BASE_DEC, NULL, 0,
5014         "reply-code", HFILL}},
5015     {&hf_amqp_method_stream_return_reply_text, {
5016         "Reply-Text", "amqp.method.arguments.reply_text",
5017         FT_STRING, BASE_NONE, NULL, 0,
5018         "reply-text", HFILL}},
5019     {&hf_amqp_method_stream_return_exchange, {
5020         "Exchange", "amqp.method.arguments.exchange",
5021         FT_STRING, BASE_NONE, NULL, 0,
5022         "exchange", HFILL}},
5023     {&hf_amqp_method_stream_return_routing_key, {
5024         "Routing-Key", "amqp.method.arguments.routing_key",
5025         FT_STRING, BASE_NONE, NULL, 0,
5026         "routing-key", HFILL}},
5027     {&hf_amqp_method_stream_deliver_consumer_tag, {
5028         "Consumer-Tag", "amqp.method.arguments.consumer_tag",
5029         FT_STRING, BASE_NONE, NULL, 0,
5030         "consumer-tag", HFILL}},
5031     {&hf_amqp_method_stream_deliver_delivery_tag, {
5032         "Delivery-Tag", "amqp.method.arguments.delivery_tag",
5033         FT_UINT64, BASE_DEC, NULL, 0,
5034         "delivery-tag", HFILL}},
5035     {&hf_amqp_method_stream_deliver_exchange, {
5036         "Exchange", "amqp.method.arguments.exchange",
5037         FT_STRING, BASE_NONE, NULL, 0,
5038         "exchange", HFILL}},
5039     {&hf_amqp_method_stream_deliver_queue, {
5040         "Queue", "amqp.method.arguments.queue",
5041         FT_STRING, BASE_NONE, NULL, 0,
5042         "queue", HFILL}},
5043     {&hf_amqp_method_dtx_start_dtx_identifier, {
5044         "Dtx-Identifier", "amqp.method.arguments.dtx_identifier",
5045         FT_STRING, BASE_NONE, NULL, 0,
5046         "dtx-identifier", HFILL}},
5047     {&hf_amqp_method_tunnel_request_meta_data, {
5048         "Meta-Data", "amqp.method.arguments.meta_data",
5049         FT_NONE, BASE_NONE, NULL, 0,
5050         "meta-data", HFILL}},
5051     {&hf_amqp_field, {
5052         "AMQP", "amqp",
5053         FT_NONE, BASE_NONE, NULL, 0,
5054         "AMQP", HFILL}},
5055     {&hf_amqp_header_class_id, {
5056         "Class ID", "amqp.header.class",
5057         FT_UINT16, BASE_DEC, VALS(amqp_method_classes), 0,
5058         "Class ID", HFILL}},
5059     {&hf_amqp_header_weight, {
5060         "Weight", "amqp.header.weight",
5061         FT_UINT16, BASE_DEC, NULL, 0,
5062         "Weight", HFILL}},
5063     {&hf_amqp_header_body_size, {
5064         "Body size", "amqp.header.body-size",
5065         FT_UINT64, BASE_DEC, NULL, 0,
5066         "Body size", HFILL}},
5067     {&hf_amqp_header_property_flags, {
5068         "Property flags", "amqp.header.property-flags",
5069         FT_UINT16, BASE_HEX, NULL, 0,
5070         "Property flags", HFILL}},
5071     {&hf_amqp_header_properties, {
5072         "Properties", "amqp.header.properties",
5073         FT_NONE, BASE_NONE, NULL, 0x0,
5074         "Message properties", HFILL}},
5075     {&hf_amqp_header_basic_content_type, {
5076         "Content-Type", "amqp.method.properties.content_type",
5077         FT_STRING, BASE_NONE, NULL, 0,
5078         "content-type", HFILL}},
5079     {&hf_amqp_header_basic_content_encoding, {
5080         "Content-Encoding", "amqp.method.properties.content_encoding",
5081         FT_STRING, BASE_NONE, NULL, 0,
5082         "content-encoding", HFILL}},
5083     {&hf_amqp_header_basic_headers, {
5084         "Headers", "amqp.method.properties.headers",
5085         FT_NONE, BASE_NONE, NULL, 0,
5086         "headers", HFILL}},
5087     {&hf_amqp_header_basic_delivery_mode, {
5088         "Delivery-Mode", "amqp.method.properties.delivery_mode",
5089         FT_UINT8, BASE_DEC, NULL, 0,
5090         "delivery-mode", HFILL}},
5091     {&hf_amqp_header_basic_priority, {
5092         "Priority", "amqp.method.properties.priority",
5093         FT_UINT8, BASE_DEC, NULL, 0,
5094         "priority", HFILL}},
5095     {&hf_amqp_header_basic_correlation_id, {
5096         "Correlation-Id", "amqp.method.properties.correlation_id",
5097         FT_STRING, BASE_NONE, NULL, 0,
5098         "correlation-id", HFILL}},
5099     {&hf_amqp_header_basic_reply_to, {
5100         "Reply-To", "amqp.method.properties.reply_to",
5101         FT_STRING, BASE_NONE, NULL, 0,
5102         "reply-to", HFILL}},
5103     {&hf_amqp_header_basic_expiration, {
5104         "Expiration", "amqp.method.properties.expiration",
5105         FT_STRING, BASE_NONE, NULL, 0,
5106         "expiration", HFILL}},
5107     {&hf_amqp_header_basic_message_id, {
5108         "Message-Id", "amqp.method.properties.message_id",
5109         FT_STRING, BASE_NONE, NULL, 0,
5110         "message-id", HFILL}},
5111     {&hf_amqp_header_basic_timestamp, {
5112         "Timestamp", "amqp.method.properties.timestamp",
5113         FT_UINT64, BASE_DEC, NULL, 0,
5114         "timestamp", HFILL}},
5115     {&hf_amqp_header_basic_type, {
5116         "Type", "amqp.method.properties.type",
5117         FT_STRING, BASE_NONE, NULL, 0,
5118         "type", HFILL}},
5119     {&hf_amqp_header_basic_user_id, {
5120         "User-Id", "amqp.method.properties.user_id",
5121         FT_STRING, BASE_NONE, NULL, 0,
5122         "user-id", HFILL}},
5123     {&hf_amqp_header_basic_app_id, {
5124         "App-Id", "amqp.method.properties.app_id",
5125         FT_STRING, BASE_NONE, NULL, 0,
5126         "app-id", HFILL}},
5127     {&hf_amqp_header_basic_cluster_id, {
5128         "Cluster-Id", "amqp.method.properties.cluster_id",
5129         FT_STRING, BASE_NONE, NULL, 0,
5130         "cluster-id", HFILL}},
5131     {&hf_amqp_header_file_content_type, {
5132         "Content-Type", "amqp.method.properties.content_type",
5133         FT_STRING, BASE_NONE, NULL, 0,
5134         "content-type", HFILL}},
5135     {&hf_amqp_header_file_content_encoding, {
5136         "Content-Encoding", "amqp.method.properties.content_encoding",
5137         FT_STRING, BASE_NONE, NULL, 0,
5138         "content-encoding", HFILL}},
5139     {&hf_amqp_header_file_headers, {
5140         "Headers", "amqp.method.properties.headers",
5141         FT_NONE, BASE_NONE, NULL, 0,
5142         "headers", HFILL}},
5143     {&hf_amqp_header_file_priority, {
5144         "Priority", "amqp.method.properties.priority",
5145         FT_UINT8, BASE_DEC, NULL, 0,
5146         "priority", HFILL}},
5147     {&hf_amqp_header_file_reply_to, {
5148         "Reply-To", "amqp.method.properties.reply_to",
5149         FT_STRING, BASE_NONE, NULL, 0,
5150         "reply-to", HFILL}},
5151     {&hf_amqp_header_file_message_id, {
5152         "Message-Id", "amqp.method.properties.message_id",
5153         FT_STRING, BASE_NONE, NULL, 0,
5154         "message-id", HFILL}},
5155     {&hf_amqp_header_file_filename, {
5156         "Filename", "amqp.method.properties.filename",
5157         FT_STRING, BASE_NONE, NULL, 0,
5158         "filename", HFILL}},
5159     {&hf_amqp_header_file_timestamp, {
5160         "Timestamp", "amqp.method.properties.timestamp",
5161         FT_UINT64, BASE_DEC, NULL, 0,
5162         "timestamp", HFILL}},
5163     {&hf_amqp_header_file_cluster_id, {
5164         "Cluster-Id", "amqp.method.properties.cluster_id",
5165         FT_STRING, BASE_NONE, NULL, 0,
5166         "cluster-id", HFILL}},
5167     {&hf_amqp_header_stream_content_type, {
5168         "Content-Type", "amqp.method.properties.content_type",
5169         FT_STRING, BASE_NONE, NULL, 0,
5170         "content-type", HFILL}},
5171     {&hf_amqp_header_stream_content_encoding, {
5172         "Content-Encoding", "amqp.method.properties.content_encoding",
5173         FT_STRING, BASE_NONE, NULL, 0,
5174         "content-encoding", HFILL}},
5175     {&hf_amqp_header_stream_headers, {
5176         "Headers", "amqp.method.properties.headers",
5177         FT_NONE, BASE_NONE, NULL, 0,
5178         "headers", HFILL}},
5179     {&hf_amqp_header_stream_priority, {
5180         "Priority", "amqp.method.properties.priority",
5181         FT_UINT8, BASE_DEC, NULL, 0,
5182         "priority", HFILL}},
5183     {&hf_amqp_header_stream_timestamp, {
5184         "Timestamp", "amqp.method.properties.timestamp",
5185         FT_UINT64, BASE_DEC, NULL, 0,
5186         "timestamp", HFILL}},
5187     {&hf_amqp_header_tunnel_headers, {
5188         "Headers", "amqp.method.properties.headers",
5189         FT_NONE, BASE_NONE, NULL, 0,
5190         "headers", HFILL}},
5191     {&hf_amqp_header_tunnel_proxy_name, {
5192         "Proxy-Name", "amqp.method.properties.proxy_name",
5193         FT_STRING, BASE_NONE, NULL, 0,
5194         "proxy-name", HFILL}},
5195     {&hf_amqp_header_tunnel_data_name, {
5196         "Data-Name", "amqp.method.properties.data_name",
5197         FT_STRING, BASE_NONE, NULL, 0,
5198         "data-name", HFILL}},
5199     {&hf_amqp_header_tunnel_durable, {
5200         "Durable", "amqp.method.properties.durable",
5201         FT_UINT8, BASE_DEC, NULL, 0,
5202         "durable", HFILL}},
5203     {&hf_amqp_header_tunnel_broadcast, {
5204         "Broadcast", "amqp.method.properties.broadcast",
5205         FT_UINT8, BASE_DEC, NULL, 0,
5206         "broadcast", HFILL}},
5207     {&hf_amqp_payload, {
5208         "Payload", "amqp.payload",
5209         FT_BYTES, BASE_NONE, NULL, 0,
5210         "Message payload", HFILL}},
5211     {&hf_amqp_init_protocol, {
5212         "Protocol", "amqp.init.protocol",
5213         FT_STRING, BASE_NONE, NULL, 0,
5214         "Protocol name", HFILL}},
5215     {&hf_amqp_init_id_major, {
5216         "Protocol ID Major", "amqp.init.id_major",
5217         FT_UINT8, BASE_DEC, NULL, 0,
5218         "Protocol ID major", HFILL}},
5219     {&hf_amqp_init_id_minor, {
5220         "Protocol ID Minor", "amqp.init.id_minor",
5221         FT_UINT8, BASE_DEC, NULL, 0,
5222         "Protocol ID minor", HFILL}},
5223     {&hf_amqp_init_version_major, {
5224         "Version Major", "amqp.init.version_major",
5225         FT_UINT8, BASE_DEC, NULL, 0,
5226         "Protocol version major", HFILL}},
5227     {&hf_amqp_init_version_minor, {
5228         "Version Minor", "amqp.init.version_minor",
5229         FT_UINT8, BASE_DEC, NULL, 0,
5230         "Protocol version minor", HFILL}}
5231 };
5232
5233 /*  Setup of protocol subtree array  */
5234
5235 static gint *ett [] = {
5236      &ett_amqp,
5237      &ett_args,
5238      &ett_props,
5239      &ett_field_table,
5240      &ett_amqp_init
5241 };
5242
5243 /*  Basic registration functions  */
5244
5245 void
5246 proto_register_amqp(void)
5247 {
5248     proto_amqp = proto_register_protocol(
5249         "Advanced Message Queueing Protocol", "AMQP", "amqp");
5250     proto_register_field_array(proto_amqp, hf, array_length(hf));
5251     proto_register_subtree_array(ett, array_length(ett));
5252     prefs_register_protocol(proto_amqp, proto_reg_handoff_amqp);
5253 }
5254
5255 void
5256 proto_reg_handoff_amqp(void)
5257 {
5258     dissector_add("tcp.port", amqp_port,
5259         create_dissector_handle(dissect_amqp, proto_amqp));
5260 }