MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-amqp.c
blob03dc18a7904dac48cfb68985e2726b593888b911
1 /* packet-amqp.c
3 * AMQP v0-9, 0-10 Wireshark dissector
5 * Author: Martin Sustrik <sustrik@imatix.com> (AMQP 0-9)
6 * Author: Steve Huston <shuston@riverace.com> (extended for AMQP 0-10)
8 * Copyright (c) 1996-2007 iMatix Corporation
10 * $Id$
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 * See
34 * http://www.amqp.org/confluence/display/AMQP/AMQP+Specification
36 * for specifications for various versions of the AMQP protocol.
39 #include "config.h"
41 #include <glib.h>
42 #include <epan/packet.h>
43 #include <epan/exceptions.h>
44 #include <epan/expert.h>
45 #include <epan/wmem/wmem.h>
46 #include "packet-tcp.h"
48 /* Generic data */
50 static int amqp_port = 5672;
52 /* Generic defines */
54 #define AMQP_INCREMENT(offset, addend, bound) {\
55 offset += (addend);\
56 THROW_ON((offset > bound), ReportedBoundsError); \
60 * This dissector handles AMQP 0-9 and 0-10. The conversation structure
61 * contains the version being run - it's only really reliably detected at
62 * protocol init. If this dissector starts in the middle of a conversation
63 * it will try to figure it out, but conversation start is the best.
66 /* #define AMQP_V0_8 1 */
67 #define AMQP_V0_9 2
68 /* #define AMQP_V0_91 3 */
69 #define AMQP_V0_10 4
70 typedef struct {
71 guint8 version;
72 } amqp_conv;
74 /* 0-9 defines */
76 #define AMQP_0_9_FRAME_TYPE_METHOD 1
77 #define AMQP_0_9_FRAME_TYPE_CONTENT_HEADER 2
78 #define AMQP_0_9_FRAME_TYPE_CONTENT_BODY 3
79 #define AMQP_0_9_FRAME_TYPE_OOB_METHOD 4
80 #define AMQP_0_9_FRAME_TYPE_OOB_CONTENT_HEADER 5
81 #define AMQP_0_9_FRAME_TYPE_OOB_CONTENT_BODY 6
82 #define AMQP_0_9_FRAME_TYPE_TRACE 7
83 #define AMQP_0_9_FRAME_TYPE_HEARTBEAT 8
85 #define AMQP_0_9_CLASS_CONNECTION 10
86 #define AMQP_0_9_CLASS_CHANNEL 20
87 #define AMQP_0_9_CLASS_ACCESS 30
88 #define AMQP_0_9_CLASS_EXCHANGE 40
89 #define AMQP_0_9_CLASS_QUEUE 50
90 #define AMQP_0_9_CLASS_BASIC 60
91 #define AMQP_0_9_CLASS_FILE 70
92 #define AMQP_0_9_CLASS_STREAM 80
93 #define AMQP_0_9_CLASS_TX 90
94 #define AMQP_0_9_CLASS_DTX 100
95 #define AMQP_0_9_CLASS_TUNNEL 110
97 #define AMQP_0_9_METHOD_CONNECTION_START 10
98 #define AMQP_0_9_METHOD_CONNECTION_START_OK 11
99 #define AMQP_0_9_METHOD_CONNECTION_SECURE 20
100 #define AMQP_0_9_METHOD_CONNECTION_SECURE_OK 21
101 #define AMQP_0_9_METHOD_CONNECTION_TUNE 30
102 #define AMQP_0_9_METHOD_CONNECTION_TUNE_OK 31
103 #define AMQP_0_9_METHOD_CONNECTION_OPEN 40
104 #define AMQP_0_9_METHOD_CONNECTION_OPEN_OK 41
105 #define AMQP_0_9_METHOD_CONNECTION_REDIRECT 42
106 #define AMQP_0_9_METHOD_CONNECTION_CLOSE 50
107 #define AMQP_0_9_METHOD_CONNECTION_CLOSE_OK 51
109 #define AMQP_0_9_METHOD_CHANNEL_OPEN 10
110 #define AMQP_0_9_METHOD_CHANNEL_OPEN_OK 11
111 #define AMQP_0_9_METHOD_CHANNEL_FLOW 20
112 #define AMQP_0_9_METHOD_CHANNEL_FLOW_OK 21
113 #define AMQP_0_9_METHOD_CHANNEL_CLOSE 40
114 #define AMQP_0_9_METHOD_CHANNEL_CLOSE_OK 41
115 #define AMQP_0_9_METHOD_CHANNEL_RESUME 50
116 #define AMQP_0_9_METHOD_CHANNEL_PING 60
117 #define AMQP_0_9_METHOD_CHANNEL_PONG 70
118 #define AMQP_0_9_METHOD_CHANNEL_OK 80
120 #define AMQP_0_9_METHOD_ACCESS_REQUEST 10
121 #define AMQP_0_9_METHOD_ACCESS_REQUEST_OK 11
123 #define AMQP_0_9_METHOD_EXCHANGE_DECLARE 10
124 #define AMQP_0_9_METHOD_EXCHANGE_DECLARE_OK 11
125 #define AMQP_0_9_METHOD_EXCHANGE_DELETE 20
126 #define AMQP_0_9_METHOD_EXCHANGE_DELETE_OK 21
127 #define AMQP_0_9_METHOD_EXCHANGE_BIND 30
128 #define AMQP_0_9_METHOD_EXCHANGE_BIND_OK 31
130 #define AMQP_0_9_METHOD_QUEUE_DECLARE 10
131 #define AMQP_0_9_METHOD_QUEUE_DECLARE_OK 11
132 #define AMQP_0_9_METHOD_QUEUE_BIND 20
133 #define AMQP_0_9_METHOD_QUEUE_BIND_OK 21
134 #define AMQP_0_9_METHOD_QUEUE_UNBIND 50
135 #define AMQP_0_9_METHOD_QUEUE_UNBIND_OK 51
136 #define AMQP_0_9_METHOD_QUEUE_PURGE 30
137 #define AMQP_0_9_METHOD_QUEUE_PURGE_OK 31
138 #define AMQP_0_9_METHOD_QUEUE_DELETE 40
139 #define AMQP_0_9_METHOD_QUEUE_DELETE_OK 41
141 #define AMQP_0_9_METHOD_BASIC_QOS 10
142 #define AMQP_0_9_METHOD_BASIC_QOS_OK 11
143 #define AMQP_0_9_METHOD_BASIC_CONSUME 20
144 #define AMQP_0_9_METHOD_BASIC_CONSUME_OK 21
145 #define AMQP_0_9_METHOD_BASIC_CANCEL 30
146 #define AMQP_0_9_METHOD_BASIC_CANCEL_OK 31
147 #define AMQP_0_9_METHOD_BASIC_PUBLISH 40
148 #define AMQP_0_9_METHOD_BASIC_RETURN 50
149 #define AMQP_0_9_METHOD_BASIC_DELIVER 60
150 #define AMQP_0_9_METHOD_BASIC_GET 70
151 #define AMQP_0_9_METHOD_BASIC_GET_OK 71
152 #define AMQP_0_9_METHOD_BASIC_GET_EMPTY 72
153 #define AMQP_0_9_METHOD_BASIC_ACK 80
154 #define AMQP_0_9_METHOD_BASIC_REJECT 90
155 #define AMQP_0_9_METHOD_BASIC_RECOVER 100
157 #define AMQP_0_9_METHOD_FILE_QOS 10
158 #define AMQP_0_9_METHOD_FILE_QOS_OK 11
159 #define AMQP_0_9_METHOD_FILE_CONSUME 20
160 #define AMQP_0_9_METHOD_FILE_CONSUME_OK 21
161 #define AMQP_0_9_METHOD_FILE_CANCEL 30
162 #define AMQP_0_9_METHOD_FILE_CANCEL_OK 31
163 #define AMQP_0_9_METHOD_FILE_OPEN 40
164 #define AMQP_0_9_METHOD_FILE_OPEN_OK 41
165 #define AMQP_0_9_METHOD_FILE_STAGE 50
166 #define AMQP_0_9_METHOD_FILE_PUBLISH 60
167 #define AMQP_0_9_METHOD_FILE_RETURN 70
168 #define AMQP_0_9_METHOD_FILE_DELIVER 80
169 #define AMQP_0_9_METHOD_FILE_ACK 90
170 #define AMQP_0_9_METHOD_FILE_REJECT 100
172 #define AMQP_0_9_METHOD_STREAM_QOS 10
173 #define AMQP_0_9_METHOD_STREAM_QOS_OK 11
174 #define AMQP_0_9_METHOD_STREAM_CONSUME 20
175 #define AMQP_0_9_METHOD_STREAM_CONSUME_OK 21
176 #define AMQP_0_9_METHOD_STREAM_CANCEL 30
177 #define AMQP_0_9_METHOD_STREAM_CANCEL_OK 31
178 #define AMQP_0_9_METHOD_STREAM_PUBLISH 40
179 #define AMQP_0_9_METHOD_STREAM_RETURN 50
180 #define AMQP_0_9_METHOD_STREAM_DELIVER 60
182 #define AMQP_0_9_METHOD_TX_SELECT 10
183 #define AMQP_0_9_METHOD_TX_SELECT_OK 11
184 #define AMQP_0_9_METHOD_TX_COMMIT 20
185 #define AMQP_0_9_METHOD_TX_COMMIT_OK 21
186 #define AMQP_0_9_METHOD_TX_ROLLBACK 30
187 #define AMQP_0_9_METHOD_TX_ROLLBACK_OK 31
189 #define AMQP_0_9_METHOD_DTX_SELECT 10
190 #define AMQP_0_9_METHOD_DTX_SELECT_OK 11
191 #define AMQP_0_9_METHOD_DTX_START 20
192 #define AMQP_0_9_METHOD_DTX_START_OK 21
194 #define AMQP_0_9_METHOD_TUNNEL_REQUEST 10
196 /* AMQP 0-10 values */
198 #define AMQP_0_10_FRAME_CONTROL 0
199 #define AMQP_0_10_FRAME_COMMAND 1
200 #define AMQP_0_10_FRAME_HEADER 2
201 #define AMQP_0_10_FRAME_BODY 3
203 #define AMQP_0_10_TYPE_STR16 0x95
204 #define AMQP_0_10_TYPE_MAP 0xa8
205 #define AMQP_0_10_TYPE_LIST 0xa9
206 #define AMQP_0_10_TYPE_ARRAY 0xaa
207 #define AMQP_0_10_TYPE_STRUCT32 0xab
209 #define AMQP_0_10_CLASS_CONNECTION 0x01
210 #define AMQP_0_10_METHOD_CONNECTION_START 0x01
211 #define AMQP_0_10_METHOD_CONNECTION_START_OK 0x02
212 #define AMQP_0_10_METHOD_CONNECTION_SECURE 0x03
213 #define AMQP_0_10_METHOD_CONNECTION_SECURE_OK 0x04
214 #define AMQP_0_10_METHOD_CONNECTION_TUNE 0x05
215 #define AMQP_0_10_METHOD_CONNECTION_TUNE_OK 0x06
216 #define AMQP_0_10_METHOD_CONNECTION_OPEN 0x07
217 #define AMQP_0_10_METHOD_CONNECTION_OPEN_OK 0x08
218 #define AMQP_0_10_METHOD_CONNECTION_REDIRECT 0x09
219 #define AMQP_0_10_METHOD_CONNECTION_HEARTBEAT 0x0a
220 #define AMQP_0_10_METHOD_CONNECTION_CLOSE 0x0b
221 #define AMQP_0_10_METHOD_CONNECTION_CLOSE_OK 0x0c
223 #define AMQP_0_10_CLASS_SESSION 0x02
224 #define AMQP_0_10_METHOD_SESSION_ATTACH 0x01
225 #define AMQP_0_10_METHOD_SESSION_ATTACHED 0x02
226 #define AMQP_0_10_METHOD_SESSION_DETACH 0x03
227 #define AMQP_0_10_METHOD_SESSION_DETACHED 0x04
228 #define AMQP_0_10_METHOD_SESSION_REQUEST_TIMEOUT 0x05
229 #define AMQP_0_10_METHOD_SESSION_TIMEOUT 0x06
230 #define AMQP_0_10_METHOD_SESSION_COMMAND_POINT 0x07
231 #define AMQP_0_10_METHOD_SESSION_EXPECTED 0x08
232 #define AMQP_0_10_METHOD_SESSION_CONFIRMED 0x09
233 #define AMQP_0_10_METHOD_SESSION_COMPLETED 0x0a
234 #define AMQP_0_10_METHOD_SESSION_KNOWN_COMPLETED 0x0b
235 #define AMQP_0_10_METHOD_SESSION_FLUSH 0x0c
236 #define AMQP_0_10_METHOD_SESSION_GAP 0x0d
238 #define AMQP_0_10_CLASS_EXECUTION 0x03
239 #define AMQP_0_10_METHOD_EXECUTION_SYNC 0x01
240 #define AMQP_0_10_METHOD_EXECUTION_RESULT 0x02
241 #define AMQP_0_10_METHOD_EXECUTION_EXCEPTION 0x03
243 #define AMQP_0_10_CLASS_MESSAGE 0x04
244 #define AMQP_0_10_STRUCT_MESSAGE_DELIVERY_PROPERTIES 0x01
245 #define AMQP_0_10_STRUCT_MESSAGE_FRAGMENT_PROPERTIES 0x02
246 #define AMQP_0_10_STRUCT_MESSAGE_MESSAGE_PROPERTIES 0x03
247 #define AMQP_0_10_STRUCT_MESSAGE_ACQUIRED 0x04
248 #define AMQP_0_10_STRUCT_MESSAGE_RESUME_RESULT 0x05
249 #define AMQP_0_10_METHOD_MESSAGE_TRANSFER 0x01
250 #define AMQP_0_10_METHOD_MESSAGE_ACCEPT 0x02
251 #define AMQP_0_10_METHOD_MESSAGE_REJECT 0x03
252 #define AMQP_0_10_METHOD_MESSAGE_RELEASE 0x04
253 #define AMQP_0_10_METHOD_MESSAGE_ACQUIRE 0x05
254 #define AMQP_0_10_METHOD_MESSAGE_RESUME 0x06
255 #define AMQP_0_10_METHOD_MESSAGE_SUBSCRIBE 0x07
256 #define AMQP_0_10_METHOD_MESSAGE_CANCEL 0x08
257 #define AMQP_0_10_METHOD_MESSAGE_SET_FLOW_MODE 0x09
258 #define AMQP_0_10_METHOD_MESSAGE_FLOW 0x0a
259 #define AMQP_0_10_METHOD_MESSAGE_FLUSH 0x0b
260 #define AMQP_0_10_METHOD_MESSAGE_STOP 0x0c
262 #define AMQP_0_10_CLASS_TX 0x05
263 #define AMQP_0_10_METHOD_TX_SELECT 0x01
264 #define AMQP_0_10_METHOD_TX_COMMIT 0x02
265 #define AMQP_0_10_METHOD_TX_ROLLBACK 0x03
267 #define AMQP_0_10_CLASS_DTX 0x06
268 #define AMQP_0_10_STRUCT_DTX_XA_RESULT 0x01
269 #define AMQP_0_10_STRUCT_DTX_RECOVER_RESULT 0x03
270 #define AMQP_0_10_METHOD_DTX_SELECT 0x01
271 #define AMQP_0_10_METHOD_DTX_START 0x02
272 #define AMQP_0_10_METHOD_DTX_END 0x03
273 #define AMQP_0_10_METHOD_DTX_COMMIT 0x04
274 #define AMQP_0_10_METHOD_DTX_FORGET 0x05
275 #define AMQP_0_10_METHOD_DTX_GET_TIMEOUT 0x06
276 #define AMQP_0_10_METHOD_DTX_PREPARE 0x07
277 #define AMQP_0_10_METHOD_DTX_RECOVER 0x08
278 #define AMQP_0_10_METHOD_DTX_ROLLBACK 0x09
279 #define AMQP_0_10_METHOD_DTX_SET_TIMEOUT 0x0a
281 #define AMQP_0_10_CLASS_EXCHANGE 0x07
282 #define AMQP_0_10_STRUCT_EXCHANGE_QUERY_RESULT 0x01
283 #define AMQP_0_10_STRUCT_EXCHANGE_BOUND_RESULT 0x02
284 #define AMQP_0_10_METHOD_EXCHANGE_DECLARE 0x01
285 #define AMQP_0_10_METHOD_EXCHANGE_DELETE 0x02
286 #define AMQP_0_10_METHOD_EXCHANGE_QUERY 0x03
287 #define AMQP_0_10_METHOD_EXCHANGE_BIND 0x04
288 #define AMQP_0_10_METHOD_EXCHANGE_UNBIND 0x05
289 #define AMQP_0_10_METHOD_EXCHANGE_BOUND 0x06
291 #define AMQP_0_10_CLASS_QUEUE 0x08
292 #define AMQP_0_10_STRUCT_QUEUE_QUERY_RESULT 0x01
293 #define AMQP_0_10_METHOD_QUEUE_DECLARE 0x01
294 #define AMQP_0_10_METHOD_QUEUE_DELETE 0x02
295 #define AMQP_0_10_METHOD_QUEUE_PURGE 0x03
296 #define AMQP_0_10_METHOD_QUEUE_QUERY 0x04
298 #define AMQP_0_10_CLASS_FILE 0x09
299 #define AMQP_0_10_STRUCT_FILE_PROPERTIES 0x01
300 #define AMQP_0_10_METHOD_FILE_QOS 0x01
301 #define AMQP_0_10_METHOD_FILE_QOS_OK 0x02
302 #define AMQP_0_10_METHOD_FILE_CONSUME 0x03
303 #define AMQP_0_10_METHOD_FILE_CONSUME_OK 0x04
304 #define AMQP_0_10_METHOD_FILE_CANCEL 0x05
305 #define AMQP_0_10_METHOD_FILE_OPEN 0x06
306 #define AMQP_0_10_METHOD_FILE_OPEN_OK 0x07
307 #define AMQP_0_10_METHOD_FILE_STAGE 0x08
308 #define AMQP_0_10_METHOD_FILE_PUBLISH 0x09
309 #define AMQP_0_10_METHOD_FILE_RETURN 0x0a
310 #define AMQP_0_10_METHOD_FILE_DELIVER 0x0b
311 #define AMQP_0_10_METHOD_FILE_ACK 0x0c
312 #define AMQP_0_10_METHOD_FILE_REJECT 0x0d
314 #define AMQP_0_10_CLASS_STREAM 0x0a
315 #define AMQP_0_10_STRUCT_STREAM_PROPERTIES 0x01
316 #define AMQP_0_10_METHOD_STREAM_QOS 0x01
317 #define AMQP_0_10_METHOD_STREAM_QOS_OK 0x02
318 #define AMQP_0_10_METHOD_STREAM_CONSUME 0x03
319 #define AMQP_0_10_METHOD_STREAM_CONSUME_OK 0x04
320 #define AMQP_0_10_METHOD_STREAM_CANCEL 0x05
321 #define AMQP_0_10_METHOD_STREAM_PUBLISH 0x06
322 #define AMQP_0_10_METHOD_STREAM_RETURN 0x07
323 #define AMQP_0_10_METHOD_STREAM_DELIVER 0x08
325 /* Private functions */
327 static void
328 dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
330 static void
331 check_amqp_version(tvbuff_t *tvb, amqp_conv *conn);
333 static guint
334 get_amqp_0_10_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
336 static guint
337 get_amqp_0_9_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset);
339 static void
340 dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guint length, proto_item *item);
342 static void
343 dissect_amqp_0_10_map(tvbuff_t *tvb,
344 int offset,
345 int bound,
346 int length,
347 proto_item *item);
349 static void
350 dissect_amqp_0_10_xid (tvbuff_t *tvb,
351 int offset,
352 guint16 xid_length,
353 proto_item *ti);
355 static void
356 dissect_amqp_0_10_connection(tvbuff_t *tvb,
357 packet_info *pinfo,
358 proto_tree *tree,
359 int offset, guint16 length);
361 static void
362 dissect_amqp_0_10_session(tvbuff_t *tvb,
363 packet_info *pinfo,
364 proto_tree *tree,
365 int offset, guint16 length);
367 static void
368 dissect_amqp_0_10_execution(tvbuff_t *tvb,
369 packet_info *pinfo,
370 proto_tree *tree,
371 int offset, guint16 length);
373 static void
374 dissect_amqp_0_10_message(tvbuff_t *tvb,
375 packet_info *pinfo,
376 proto_tree *tree,
377 int offset, guint16 length);
379 static void
380 dissect_amqp_0_10_tx(tvbuff_t *tvb,
381 packet_info *pinfo,
382 proto_tree *tree,
383 int offset, guint16 length);
385 static void
386 dissect_amqp_0_10_dtx(tvbuff_t *tvb,
387 packet_info *pinfo,
388 proto_tree *tree,
389 int offset, guint16 length);
391 static void
392 dissect_amqp_0_10_exchange(tvbuff_t *tvb,
393 packet_info *pinfo,
394 proto_tree *tree,
395 int offset, guint16 length);
397 static void
398 dissect_amqp_0_10_queue(tvbuff_t *tvb,
399 packet_info *pinfo,
400 proto_tree *tree,
401 int offset, guint16 length);
403 static void
404 dissect_amqp_0_10_file(tvbuff_t *tvb,
405 packet_info *pinfo,
406 proto_tree *tree,
407 int offset, guint16 length);
409 static void
410 dissect_amqp_0_10_stream(tvbuff_t *tvb,
411 packet_info *pinfo,
412 proto_tree *tree,
413 int offset, guint16 length);
415 static void
416 dissect_amqp_0_10_struct32(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
417 int offset, guint32 struct_length);
419 static int
420 dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_);
422 static int
423 dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_);
425 static int
426 dissect_amqp_0_9_method_connection_start(tvbuff_t *tvb, packet_info *pinfo,
427 int offset, proto_tree *args_tree);
429 static int
430 dissect_amqp_0_9_method_connection_start_ok(tvbuff_t *tvb, packet_info *pinfo,
431 int offset, proto_tree *args_tree);
433 static int
434 dissect_amqp_0_9_method_connection_secure(tvbuff_t *tvb,
435 int offset, proto_tree *args_tree);
437 static int
438 dissect_amqp_0_9_method_connection_secure_ok(tvbuff_t *tvb,
439 int offset, proto_tree *args_tree);
441 static int
442 dissect_amqp_0_9_method_connection_tune(tvbuff_t *tvb,
443 int offset, proto_tree *args_tree);
445 static int
446 dissect_amqp_0_9_method_connection_tune_ok(tvbuff_t *tvb,
447 int offset, proto_tree *args_tree);
449 static int
450 dissect_amqp_0_9_method_connection_open(tvbuff_t *tvb,
451 int offset, proto_tree *args_tree);
453 static int
454 dissect_amqp_0_9_method_connection_open_ok(tvbuff_t *tvb,
455 int offset, proto_tree *args_tree);
457 static int
458 dissect_amqp_0_9_method_connection_redirect(tvbuff_t *tvb,
459 int offset, proto_tree *args_tree);
461 static int
462 dissect_amqp_0_9_method_connection_close(tvbuff_t *tvb,
463 int offset, proto_tree *args_tree);
465 static int
466 dissect_amqp_0_9_method_connection_close_ok(tvbuff_t *tvb,
467 int offset, proto_tree *args_tree);
469 static int
470 dissect_amqp_0_9_method_channel_open(tvbuff_t *tvb,
471 int offset, proto_tree *args_tree);
473 static int
474 dissect_amqp_0_9_method_channel_open_ok(tvbuff_t *tvb,
475 int offset, proto_tree *args_tree);
477 static int
478 dissect_amqp_0_9_method_channel_flow(tvbuff_t *tvb,
479 int offset, proto_tree *args_tree);
481 static int
482 dissect_amqp_0_9_method_channel_flow_ok(tvbuff_t *tvb,
483 int offset, proto_tree *args_tree);
485 static int
486 dissect_amqp_0_9_method_channel_close(tvbuff_t *tvb,
487 int offset, proto_tree *args_tree);
489 static int
490 dissect_amqp_0_9_method_channel_close_ok(tvbuff_t *tvb,
491 int offset, proto_tree *args_tree);
493 static int
494 dissect_amqp_0_9_method_channel_resume(tvbuff_t *tvb,
495 int offset, proto_tree *args_tree);
497 static int
498 dissect_amqp_0_9_method_channel_ping(tvbuff_t *tvb,
499 int offset, proto_tree *args_tree);
501 static int
502 dissect_amqp_0_9_method_channel_pong(tvbuff_t *tvb,
503 int offset, proto_tree *args_tree);
505 static int
506 dissect_amqp_0_9_method_channel_ok(tvbuff_t *tvb,
507 int offset, proto_tree *args_tree);
509 static int
510 dissect_amqp_0_9_method_access_request(tvbuff_t *tvb,
511 int offset, proto_tree *args_tree);
513 static int
514 dissect_amqp_0_9_method_access_request_ok(tvbuff_t *tvb,
515 int offset, proto_tree *args_tree);
517 static int
518 dissect_amqp_0_9_method_exchange_declare(tvbuff_t *tvb, packet_info *pinfo,
519 int offset, proto_tree *args_tree);
521 static int
522 dissect_amqp_0_9_method_exchange_declare_ok(tvbuff_t *tvb,
523 int offset, proto_tree *args_tree);
525 static int
526 dissect_amqp_0_9_method_exchange_bind(tvbuff_t *tvb, packet_info *pinfo,
527 int offset, proto_tree *args_tree);
529 static int
530 dissect_amqp_0_9_method_exchange_bind_ok(tvbuff_t *tvb,
531 int offset, proto_tree *args_tree);
533 static int
534 dissect_amqp_0_9_method_exchange_delete(tvbuff_t *tvb,
535 int offset, proto_tree *args_tree);
537 static int
538 dissect_amqp_0_9_method_exchange_delete_ok(tvbuff_t *tvb,
539 int offset, proto_tree *args_tree);
541 static int
542 dissect_amqp_0_9_method_queue_declare(tvbuff_t *tvb, packet_info *pinfo,
543 int offset, proto_tree *args_tree);
545 static int
546 dissect_amqp_0_9_method_queue_declare_ok(tvbuff_t *tvb,
547 int offset, proto_tree *args_tree);
549 static int
550 dissect_amqp_0_9_method_queue_bind(tvbuff_t *tvb, packet_info *pinfo,
551 int offset, proto_tree *args_tree);
553 static int
554 dissect_amqp_0_9_method_queue_bind_ok(tvbuff_t *tvb,
555 int offset, proto_tree *args_tree);
557 static int
558 dissect_amqp_0_9_method_queue_unbind(tvbuff_t *tvb, packet_info *pinfo,
559 int offset, proto_tree *args_tree);
561 static int
562 dissect_amqp_0_9_method_queue_unbind_ok(tvbuff_t *tvb,
563 int offset, proto_tree *args_tree);
565 static int
566 dissect_amqp_0_9_method_queue_purge(tvbuff_t *tvb,
567 int offset, proto_tree *args_tree);
569 static int
570 dissect_amqp_0_9_method_queue_purge_ok(tvbuff_t *tvb,
571 int offset, proto_tree *args_tree);
573 static int
574 dissect_amqp_0_9_method_queue_delete(tvbuff_t *tvb,
575 int offset, proto_tree *args_tree);
577 static int
578 dissect_amqp_0_9_method_queue_delete_ok(tvbuff_t *tvb,
579 int offset, proto_tree *args_tree);
581 static int
582 dissect_amqp_0_9_method_basic_qos(tvbuff_t *tvb,
583 int offset, proto_tree *args_tree);
585 static int
586 dissect_amqp_0_9_method_basic_qos_ok(tvbuff_t *tvb,
587 int offset, proto_tree *args_tree);
589 static int
590 dissect_amqp_0_9_method_basic_consume(tvbuff_t *tvb, packet_info *pinfo,
591 int offset, proto_tree *args_tree);
593 static int
594 dissect_amqp_0_9_method_basic_consume_ok(tvbuff_t *tvb,
595 int offset, proto_tree *args_tree);
597 static int
598 dissect_amqp_0_9_method_basic_cancel(tvbuff_t *tvb,
599 int offset, proto_tree *args_tree);
601 static int
602 dissect_amqp_0_9_method_basic_cancel_ok(tvbuff_t *tvb,
603 int offset, proto_tree *args_tree);
605 static int
606 dissect_amqp_0_9_method_basic_publish(tvbuff_t *tvb,
607 int offset, proto_tree *args_tree);
609 static int
610 dissect_amqp_0_9_method_basic_return(tvbuff_t *tvb,
611 int offset, proto_tree *args_tree);
613 static int
614 dissect_amqp_0_9_method_basic_deliver(tvbuff_t *tvb,
615 int offset, proto_tree *args_tree);
617 static int
618 dissect_amqp_0_9_method_basic_get(tvbuff_t *tvb,
619 int offset, proto_tree *args_tree);
621 static int
622 dissect_amqp_0_9_method_basic_get_ok(tvbuff_t *tvb,
623 int offset, proto_tree *args_tree);
625 static int
626 dissect_amqp_0_9_method_basic_get_empty(tvbuff_t *tvb,
627 int offset, proto_tree *args_tree);
629 static int
630 dissect_amqp_0_9_method_basic_ack(tvbuff_t *tvb,
631 int offset, proto_tree *args_tree);
633 static int
634 dissect_amqp_0_9_method_basic_reject(tvbuff_t *tvb,
635 int offset, proto_tree *args_tree);
637 static int
638 dissect_amqp_0_9_method_basic_recover(tvbuff_t *tvb,
639 int offset, proto_tree *args_tree);
641 static int
642 dissect_amqp_0_9_method_file_qos(tvbuff_t *tvb,
643 int offset, proto_tree *args_tree);
645 static int
646 dissect_amqp_0_9_method_file_qos_ok(tvbuff_t *tvb,
647 int offset, proto_tree *args_tree);
649 static int
650 dissect_amqp_0_9_method_file_consume(tvbuff_t *tvb, packet_info *pinfo,
651 int offset, proto_tree *args_tree);
653 static int
654 dissect_amqp_0_9_method_file_consume_ok(tvbuff_t *tvb,
655 int offset, proto_tree *args_tree);
657 static int
658 dissect_amqp_0_9_method_file_cancel(tvbuff_t *tvb,
659 int offset, proto_tree *args_tree);
661 static int
662 dissect_amqp_0_9_method_file_cancel_ok(tvbuff_t *tvb,
663 int offset, proto_tree *args_tree);
665 static int
666 dissect_amqp_0_9_method_file_open(tvbuff_t *tvb,
667 int offset, proto_tree *args_tree);
669 static int
670 dissect_amqp_0_9_method_file_open_ok(tvbuff_t *tvb,
671 int offset, proto_tree *args_tree);
673 static int
674 dissect_amqp_0_9_method_file_stage(tvbuff_t *tvb,
675 int offset, proto_tree *args_tree);
677 static int
678 dissect_amqp_0_9_method_file_publish(tvbuff_t *tvb,
679 int offset, proto_tree *args_tree);
681 static int
682 dissect_amqp_0_9_method_file_return(tvbuff_t *tvb,
683 int offset, proto_tree *args_tree);
685 static int
686 dissect_amqp_0_9_method_file_deliver(tvbuff_t *tvb,
687 int offset, proto_tree *args_tree);
689 static int
690 dissect_amqp_0_9_method_file_ack(tvbuff_t *tvb,
691 int offset, proto_tree *args_tree);
693 static int
694 dissect_amqp_0_9_method_file_reject(tvbuff_t *tvb,
695 int offset, proto_tree *args_tree);
697 static int
698 dissect_amqp_0_9_method_stream_qos(tvbuff_t *tvb,
699 int offset, proto_tree *args_tree);
701 static int
702 dissect_amqp_0_9_method_stream_qos_ok(tvbuff_t *tvb,
703 int offset, proto_tree *args_tree);
705 static int
706 dissect_amqp_0_9_method_stream_consume(tvbuff_t *tvb, packet_info *pinfo,
707 int offset, proto_tree *args_tree);
709 static int
710 dissect_amqp_0_9_method_stream_consume_ok(tvbuff_t *tvb,
711 int offset, proto_tree *args_tree);
713 static int
714 dissect_amqp_0_9_method_stream_cancel(tvbuff_t *tvb,
715 int offset, proto_tree *args_tree);
717 static int
718 dissect_amqp_0_9_method_stream_cancel_ok(tvbuff_t *tvb,
719 int offset, proto_tree *args_tree);
721 static int
722 dissect_amqp_0_9_method_stream_publish(tvbuff_t *tvb,
723 int offset, proto_tree *args_tree);
725 static int
726 dissect_amqp_0_9_method_stream_return(tvbuff_t *tvb,
727 int offset, proto_tree *args_tree);
729 static int
730 dissect_amqp_0_9_method_stream_deliver(tvbuff_t *tvb,
731 int offset, proto_tree *args_tree);
733 static int
734 dissect_amqp_0_9_method_tx_select(tvbuff_t *tvb,
735 int offset, proto_tree *args_tree);
737 static int
738 dissect_amqp_0_9_method_tx_select_ok(tvbuff_t *tvb,
739 int offset, proto_tree *args_tree);
741 static int
742 dissect_amqp_0_9_method_tx_commit(tvbuff_t *tvb,
743 int offset, proto_tree *args_tree);
745 static int
746 dissect_amqp_0_9_method_tx_commit_ok(tvbuff_t *tvb,
747 int offset, proto_tree *args_tree);
749 static int
750 dissect_amqp_0_9_method_tx_rollback(tvbuff_t *tvb,
751 int offset, proto_tree *args_tree);
753 static int
754 dissect_amqp_0_9_method_tx_rollback_ok(tvbuff_t *tvb,
755 int offset, proto_tree *args_tree);
757 static int
758 dissect_amqp_0_9_method_dtx_select(tvbuff_t *tvb,
759 int offset, proto_tree *args_tree);
761 static int
762 dissect_amqp_0_9_method_dtx_select_ok(tvbuff_t *tvb,
763 int offset, proto_tree *args_tree);
765 static int
766 dissect_amqp_0_9_method_dtx_start(tvbuff_t *tvb,
767 int offset, proto_tree *args_tree);
769 static int
770 dissect_amqp_0_9_method_dtx_start_ok(tvbuff_t *tvb,
771 int offset, proto_tree *args_tree);
773 static int
774 dissect_amqp_0_9_method_tunnel_request(tvbuff_t *tvb, packet_info *pinfo,
775 int offset, proto_tree *args_tree);
777 static int
778 dissect_amqp_0_9_content_header_basic(tvbuff_t *tvb, packet_info *pinfo,
779 int offset, proto_tree *prop_tree);
781 static int
782 dissect_amqp_0_9_content_header_file(tvbuff_t *tvb, packet_info *pinfo,
783 int offset, proto_tree *prop_tree);
785 static int
786 dissect_amqp_0_9_content_header_stream(tvbuff_t *tvb, packet_info *pinfo,
787 int offset, proto_tree *prop_tree);
789 static int
790 dissect_amqp_0_9_content_header_tunnel(tvbuff_t *tvb, packet_info *pifo,
791 int offset, proto_tree *prop_tree);
793 /* AMQP 0-10 type decoding information */
795 typedef int (*type_formatter)(tvbuff_t *tvb,
796 guint offset, /* In tvb where data starts */
797 guint bound, /* Last byte in tvb */
798 guint length, /* Length of data, if known */
799 const char **value); /* Receive formatted val */
800 struct amqp_typeinfo {
801 guint8 typecode; /* From AMQP 0-10 spec */
802 const char *amqp_typename;
803 type_formatter formatter;
804 guint known_size;
806 static gboolean
807 get_amqp_0_10_type_formatter(guint8 code,
808 const char **name,
809 type_formatter *decoder,
810 guint *length_size);
812 static int
813 format_amqp_0_10_bin(tvbuff_t *tvb,
814 guint offset, guint bound, guint length,
815 const char **value);
817 static int
818 format_amqp_0_10_int(tvbuff_t *tvb,
819 guint offset, guint bound, guint length,
820 const char **value);
822 static int
823 format_amqp_0_10_uint(tvbuff_t *tvb,
824 guint offset, guint bound, guint length,
825 const char **value);
827 static int
828 format_amqp_0_10_char(tvbuff_t *tvb,
829 guint offset, guint bound, guint length,
830 const char **value);
832 static int
833 format_amqp_0_10_boolean(tvbuff_t *tvb,
834 guint offset, guint bound, guint length,
835 const char **value);
837 static int
838 format_amqp_0_10_vbin(tvbuff_t *tvb,
839 guint offset, guint bound, guint length,
840 const char **value);
842 static int
843 format_amqp_0_10_str(tvbuff_t *tvb,
844 guint offset, guint bound, guint length,
845 const char **value);
847 static void
848 format_amqp_0_10_sequence_set(tvbuff_t *tvb, guint offset, guint length,
849 proto_item *item);
851 /* Various handles */
853 static int proto_amqp = -1;
855 /* 0-10 handles */
857 static int hf_amqp_0_10_format = -1;
858 static int hf_amqp_0_10_position = -1;
859 static int hf_amqp_0_10_type = -1;
860 static int hf_amqp_0_10_size = -1;
861 static int hf_amqp_0_10_track = -1;
862 static int hf_amqp_0_10_class = -1;
863 static int hf_amqp_0_10_connection_method = -1;
864 static int hf_amqp_0_10_session_method = -1;
865 static int hf_amqp_0_10_execution_method = -1;
866 static int hf_amqp_0_10_message_method = -1;
867 static int hf_amqp_0_10_tx_method = -1;
868 static int hf_amqp_0_10_dtx_method = -1;
869 static int hf_amqp_0_10_exchange_method = -1;
870 static int hf_amqp_0_10_queue_method = -1;
871 static int hf_amqp_0_10_file_method = -1;
872 static int hf_amqp_0_10_stream_method = -1;
873 static int hf_amqp_0_10_argument_packing_flags = -1;
874 static int hf_amqp_0_10_session_header_sync = -1;
875 static int hf_amqp_0_10_undissected_struct32 = -1;
876 static int hf_amqp_0_10_message_body = -1;
877 static int hf_amqp_0_10_dtx_xid = -1;
878 static int hf_amqp_0_10_dtx_xid_format = -1;
879 static int hf_amqp_0_10_dtx_xid_global_id = -1;
880 static int hf_amqp_0_10_dtx_xid_branch_id = -1;
881 static int hf_amqp_0_10_struct_delivery_properties_discard_unroutable = -1;
882 static int hf_amqp_0_10_struct_delivery_properties_immediate = -1;
883 static int hf_amqp_0_10_struct_delivery_properties_redelivered = -1;
884 static int hf_amqp_0_10_struct_delivery_properties_priority = -1;
885 static int hf_amqp_0_10_struct_delivery_properties_mode = -1;
886 static int hf_amqp_0_10_struct_delivery_properties_ttl = -1;
887 static int hf_amqp_0_10_struct_delivery_properties_timestamp = -1;
888 static int hf_amqp_0_10_struct_delivery_properties_expiration = -1;
889 static int hf_amqp_0_10_struct_delivery_properties_exchange = -1;
890 static int hf_amqp_0_10_struct_delivery_properties_routing_key = -1;
891 static int hf_amqp_0_10_struct_delivery_properties_resume_ttl = -1;
892 static int hf_amqp_0_10_struct_fragment_properties_first = -1;
893 static int hf_amqp_0_10_struct_fragment_properties_last = -1;
894 static int hf_amqp_0_10_struct_fragment_properties_size = -1;
895 /* static int hf_amqp_0_10_struct_message_properties = -1; */
896 static int hf_amqp_0_10_struct_message_properties_content_len = -1;
897 static int hf_amqp_0_10_struct_message_properties_message_id = -1;
898 static int hf_amqp_0_10_struct_message_properties_correlation = -1;
899 static int hf_amqp_0_10_struct_message_properties_reply_to = -1;
900 static int hf_amqp_0_10_struct_message_properties_content_type = -1;
901 static int hf_amqp_0_10_struct_message_properties_content_encoding = -1;
902 static int hf_amqp_0_10_struct_message_properties_user_id = -1;
903 static int hf_amqp_0_10_struct_message_properties_app_id = -1;
904 static int hf_amqp_0_10_struct_message_properties_application_headers = -1;
905 static int hf_amqp_0_10_struct_reply_to_exchange = -1;
906 static int hf_amqp_0_10_struct_reply_to_routing_key = -1;
907 static int hf_amqp_0_10_struct_acquired_transfers = -1;
908 static int hf_amqp_0_10_struct_resume_result_offset = -1;
909 static int hf_amqp_0_10_struct_exchange_query_result_durable = -1;
910 static int hf_amqp_0_10_struct_exchange_query_result_not_found = -1;
911 static int hf_amqp_0_10_struct_exchange_bound_result_exchange_not_found = -1;
912 static int hf_amqp_0_10_struct_exchange_bound_result_queue_not_found = -1;
913 static int hf_amqp_0_10_struct_exchange_bound_result_queue_not_matched = -1;
914 static int hf_amqp_0_10_struct_exchange_bound_result_key_not_matched = -1;
915 static int hf_amqp_0_10_struct_exchange_bound_result_args_not_matched = -1;
916 static int hf_amqp_0_10_struct_queue_query_result_durable = -1;
917 static int hf_amqp_0_10_struct_queue_query_result_exclusive = -1;
918 static int hf_amqp_0_10_struct_queue_query_result_auto_delete = -1;
919 static int hf_amqp_0_10_struct_queue_query_result_message_count = -1;
920 static int hf_amqp_0_10_struct_queue_query_result_subscriber_count = -1;
921 static int hf_amqp_0_10_struct_file_properties_content_type = -1;
922 static int hf_amqp_0_10_struct_file_properties_content_encoding = -1;
923 static int hf_amqp_0_10_struct_file_properties_headers = -1;
924 static int hf_amqp_0_10_struct_file_properties_priority = -1;
925 static int hf_amqp_0_10_struct_file_properties_reply_to = -1;
926 static int hf_amqp_0_10_struct_file_properties_message_id = -1;
927 static int hf_amqp_0_10_struct_file_properties_filename = -1;
928 static int hf_amqp_0_10_struct_file_properties_timestamp = -1;
929 static int hf_amqp_0_10_struct_file_properties_cluster_id = -1;
930 static int hf_amqp_0_10_struct_stream_properties_content_type = -1;
931 static int hf_amqp_0_10_struct_stream_properties_content_encoding = -1;
932 static int hf_amqp_0_10_struct_stream_properties_headers = -1;
933 static int hf_amqp_0_10_struct_stream_properties_priority = -1;
934 static int hf_amqp_0_10_struct_stream_properties_timestamp = -1;
935 static int hf_amqp_0_10_method_session_attach_name = -1;
936 static int hf_amqp_0_10_method_session_attach_force = -1;
937 static int hf_amqp_0_10_method_session_detached_code = -1;
938 static int hf_amqp_0_10_method_session_timeout = -1;
939 static int hf_amqp_0_10_method_session_completed_timely = -1;
940 static int hf_amqp_0_10_method_session_flush_expected = -1;
941 static int hf_amqp_0_10_method_session_flush_confirmed = -1;
942 static int hf_amqp_0_10_method_session_flush_completed = -1;
943 static int hf_amqp_0_10_method_session_command_point_id = -1;
944 static int hf_amqp_0_10_method_session_command_point_offset = -1;
945 static int hf_amqp_0_10_method_session_commands = -1;
946 static int hf_amqp_0_10_method_session_fragments = -1;
947 static int hf_amqp_0_10_method_execution_command_id = -1;
948 static int hf_amqp_0_10_method_execution_exception_error = -1;
949 static int hf_amqp_0_10_method_execution_field_index = -1;
950 static int hf_amqp_0_10_method_execution_description = -1;
951 static int hf_amqp_0_10_method_execution_error_info = -1;
952 static int hf_amqp_0_10_method_message_transfer_destination = -1;
953 static int hf_amqp_0_10_method_message_transfer_accept_mode = -1;
954 static int hf_amqp_0_10_method_message_transfer_acquire_mode = -1;
955 static int hf_amqp_0_10_method_message_accept_transfers = -1;
956 static int hf_amqp_0_10_method_message_transfer_reject_code = -1;
957 static int hf_amqp_0_10_method_message_reject_text = -1;
958 static int hf_amqp_0_10_method_message_release_set_redelivered = -1;
959 static int hf_amqp_0_10_method_message_dest = -1;
960 static int hf_amqp_0_10_method_message_resume_id = -1;
961 static int hf_amqp_0_10_method_message_subscribe_queue = -1;
962 static int hf_amqp_0_10_method_message_subscribe_exclusive = -1;
963 static int hf_amqp_0_10_method_message_subscribe_resume_ttl = -1;
964 static int hf_amqp_0_10_method_message_subscribe_args = -1;
965 static int hf_amqp_0_10_method_message_flow_mode = -1;
966 static int hf_amqp_0_10_method_message_credit_unit = -1;
967 static int hf_amqp_0_10_method_message_credit_value = -1;
968 static int hf_amqp_0_10_method_dtx_start_join = -1;
969 static int hf_amqp_0_10_method_dtx_start_resume = -1;
970 static int hf_amqp_0_10_method_dtx_end_fail = -1;
971 static int hf_amqp_0_10_method_dtx_end_suspend = -1;
972 static int hf_amqp_0_10_method_dtx_commit_one_phase = -1;
973 static int hf_amqp_0_10_method_dtx_set_timeout_timeout = -1;
974 static int hf_amqp_0_10_method_exchange_declare_exchange = -1;
975 static int hf_amqp_0_10_method_exchange_declare_type = -1;
976 static int hf_amqp_0_10_method_exchange_declare_alt_exchange = -1;
977 static int hf_amqp_0_10_method_exchange_declare_passive = -1;
978 static int hf_amqp_0_10_method_exchange_declare_durable = -1;
979 static int hf_amqp_0_10_method_exchange_declare_auto_delete = -1;
980 static int hf_amqp_0_10_method_exchange_declare_arguments = -1;
981 static int hf_amqp_0_10_method_exchange_delete_if_unused = -1;
982 static int hf_amqp_0_10_method_exchange_bind_queue = -1;
983 static int hf_amqp_0_10_method_exchange_binding_key = -1;
984 static int hf_amqp_0_10_method_queue_name = -1;
985 static int hf_amqp_0_10_method_queue_alt_exchange = -1;
986 static int hf_amqp_0_10_method_queue_declare_passive = -1;
987 static int hf_amqp_0_10_method_queue_declare_durable = -1;
988 static int hf_amqp_0_10_method_queue_declare_exclusive = -1;
989 static int hf_amqp_0_10_method_queue_declare_auto_delete = -1;
990 static int hf_amqp_0_10_method_queue_declare_arguments = -1;
991 static int hf_amqp_0_10_method_queue_delete_if_unused = -1;
992 static int hf_amqp_0_10_method_queue_delete_if_empty = -1;
993 static int hf_amqp_0_10_method_file_qos_prefetch_size = -1;
994 static int hf_amqp_0_10_method_file_qos_prefetch_count = -1;
995 static int hf_amqp_0_10_method_file_qos_global = -1;
996 static int hf_amqp_0_10_method_file_consumer_tag = -1;
997 static int hf_amqp_0_10_method_file_consume_no_local = -1;
998 static int hf_amqp_0_10_method_file_consume_no_ack = -1;
999 static int hf_amqp_0_10_method_file_consume_exclusive = -1;
1000 static int hf_amqp_0_10_method_file_consume_nowait = -1;
1001 static int hf_amqp_0_10_method_file_consume_arguments = -1;
1002 static int hf_amqp_0_10_method_file_identifier = -1;
1003 static int hf_amqp_0_10_method_file_open_content_size = -1;
1004 static int hf_amqp_0_10_method_file_open_ok_staged_size = -1;
1005 static int hf_amqp_0_10_method_file_publish_exchange = -1;
1006 static int hf_amqp_0_10_method_file_publish_routing_key = -1;
1007 static int hf_amqp_0_10_method_file_publish_mandatory = -1;
1008 static int hf_amqp_0_10_method_file_publish_immediate = -1;
1009 static int hf_amqp_0_10_method_file_return_reply_code = -1;
1010 static int hf_amqp_0_10_method_file_return_reply_text = -1;
1011 static int hf_amqp_0_10_method_file_return_exchange = -1;
1012 static int hf_amqp_0_10_method_file_return_routing_key = -1;
1013 static int hf_amqp_0_10_method_file_deliver_consumer_tag = -1;
1014 static int hf_amqp_0_10_method_file_deliver_delivery_tag = -1;
1015 static int hf_amqp_0_10_method_file_deliver_redelivered = -1;
1016 static int hf_amqp_0_10_method_file_deliver_exchange = -1;
1017 static int hf_amqp_0_10_method_file_deliver_routing_key = -1;
1018 static int hf_amqp_0_10_method_file_ack_delivery_tag = -1;
1019 static int hf_amqp_0_10_method_file_ack_multiple = -1;
1020 static int hf_amqp_0_10_method_file_reject_delivery_tag = -1;
1021 static int hf_amqp_0_10_method_file_reject_requeue = -1;
1022 static int hf_amqp_0_10_method_stream_qos_prefetch_size = -1;
1023 static int hf_amqp_0_10_method_stream_qos_prefetch_count = -1;
1024 /* static int hf_amqp_0_10_method_stream_qos_consume_rate = -1; */
1025 static int hf_amqp_0_10_method_stream_qos_global = -1;
1026 static int hf_amqp_0_10_method_stream_consumer_tag = -1;
1027 static int hf_amqp_0_10_method_stream_consume_no_local = -1;
1028 static int hf_amqp_0_10_method_stream_consume_exclusive = -1;
1029 static int hf_amqp_0_10_method_stream_consume_nowait = -1;
1030 static int hf_amqp_0_10_method_stream_consume_arguments = -1;
1031 static int hf_amqp_0_10_method_stream_publish_exchange = -1;
1032 static int hf_amqp_0_10_method_stream_publish_routing_key = -1;
1033 static int hf_amqp_0_10_method_stream_publish_mandatory = -1;
1034 static int hf_amqp_0_10_method_stream_publish_immediate = -1;
1035 static int hf_amqp_0_10_method_stream_return_reply_code = -1;
1036 static int hf_amqp_0_10_method_stream_return_reply_text = -1;
1037 static int hf_amqp_0_10_method_stream_return_exchange = -1;
1038 static int hf_amqp_0_10_method_stream_return_routing_key = -1;
1039 static int hf_amqp_0_10_method_stream_deliver_consumer_tag = -1;
1040 static int hf_amqp_0_10_method_stream_deliver_delivery_tag = -1;
1041 static int hf_amqp_0_10_method_stream_deliver_exchange = -1;
1042 static int hf_amqp_0_10_method_stream_deliver_queue = -1;
1043 static int hf_amqp_channel = -1;
1044 static int hf_amqp_0_9_type = -1;
1045 static int hf_amqp_0_9_length = -1;
1046 static int hf_amqp_0_9_method_class_id = -1;
1047 static int hf_amqp_method_connection_method_id = -1;
1048 static int hf_amqp_method_channel_method_id = -1;
1049 static int hf_amqp_method_access_method_id = -1;
1050 static int hf_amqp_method_exchange_method_id = -1;
1051 static int hf_amqp_method_queue_method_id = -1;
1052 static int hf_amqp_method_basic_method_id = -1;
1053 static int hf_amqp_method_file_method_id = -1;
1054 static int hf_amqp_method_stream_method_id = -1;
1055 static int hf_amqp_method_tx_method_id = -1;
1056 static int hf_amqp_method_dtx_method_id = -1;
1057 static int hf_amqp_method_tunnel_method_id = -1;
1058 static int hf_amqp_method_arguments = -1;
1059 static int hf_amqp_method_connection_start_version_major = -1;
1060 static int hf_amqp_method_connection_start_version_minor = -1;
1061 static int hf_amqp_method_connection_start_server_properties = -1;
1062 static int hf_amqp_0_9_method_connection_start_mechanisms = -1;
1063 static int hf_amqp_0_10_method_connection_start_mechanisms = -1;
1064 static int hf_amqp_0_9_method_connection_start_locales = -1;
1065 static int hf_amqp_0_10_method_connection_start_locales = -1;
1066 static int hf_amqp_method_connection_start_ok_client_properties = -1;
1067 static int hf_amqp_method_connection_start_ok_mechanism = -1;
1068 static int hf_amqp_method_connection_start_ok_response = -1;
1069 static int hf_amqp_method_connection_start_ok_locale = -1;
1070 static int hf_amqp_method_connection_secure_challenge = -1;
1071 static int hf_amqp_method_connection_secure_ok_response = -1;
1072 static int hf_amqp_method_connection_tune_channel_max = -1;
1073 static int hf_amqp_0_9_method_connection_tune_frame_max = -1;
1074 static int hf_amqp_0_10_method_connection_tune_frame_max = -1;
1075 static int hf_amqp_0_9_method_connection_tune_heartbeat = -1;
1076 static int hf_amqp_0_10_method_connection_tune_heartbeat_min = -1;
1077 static int hf_amqp_0_10_method_connection_tune_heartbeat_max = -1;
1078 static int hf_amqp_method_connection_tune_ok_channel_max = -1;
1079 static int hf_amqp_0_9_method_connection_tune_ok_frame_max = -1;
1080 static int hf_amqp_0_10_method_connection_tune_ok_frame_max = -1;
1081 static int hf_amqp_method_connection_tune_ok_heartbeat = -1;
1082 static int hf_amqp_method_connection_open_virtual_host = -1;
1083 static int hf_amqp_0_9_method_connection_open_capabilities = -1;
1084 static int hf_amqp_0_10_method_connection_open_capabilities = -1;
1085 static int hf_amqp_0_9_method_connection_open_insist = -1;
1086 static int hf_amqp_0_10_method_connection_open_insist = -1;
1087 static int hf_amqp_0_9_method_connection_open_ok_known_hosts = -1;
1088 static int hf_amqp_0_10_method_connection_open_ok_known_hosts = -1;
1089 static int hf_amqp_method_connection_redirect_host = -1;
1090 static int hf_amqp_0_9_method_connection_redirect_known_hosts = -1;
1091 static int hf_amqp_0_10_method_connection_redirect_known_hosts = -1;
1092 static int hf_amqp_0_9_method_connection_close_reply_code = -1;
1093 static int hf_amqp_0_10_method_connection_close_reply_code = -1;
1094 static int hf_amqp_method_connection_close_reply_text = -1;
1095 static int hf_amqp_method_connection_close_class_id = -1;
1096 static int hf_amqp_method_connection_close_method_id = -1;
1097 static int hf_amqp_method_channel_open_out_of_band = -1;
1098 static int hf_amqp_method_channel_open_ok_channel_id = -1;
1099 static int hf_amqp_method_channel_flow_active = -1;
1100 static int hf_amqp_method_channel_flow_ok_active = -1;
1101 static int hf_amqp_method_channel_close_reply_code = -1;
1102 static int hf_amqp_method_channel_close_reply_text = -1;
1103 static int hf_amqp_method_channel_close_class_id = -1;
1104 static int hf_amqp_method_channel_close_method_id = -1;
1105 static int hf_amqp_method_channel_resume_channel_id = -1;
1106 static int hf_amqp_method_access_request_realm = -1;
1107 static int hf_amqp_method_access_request_exclusive = -1;
1108 static int hf_amqp_method_access_request_passive = -1;
1109 static int hf_amqp_method_access_request_active = -1;
1110 static int hf_amqp_method_access_request_write = -1;
1111 static int hf_amqp_method_access_request_read = -1;
1112 static int hf_amqp_method_access_request_ok_ticket = -1;
1113 static int hf_amqp_method_exchange_declare_ticket = -1;
1114 static int hf_amqp_method_exchange_declare_exchange = -1;
1115 static int hf_amqp_method_exchange_declare_type = -1;
1116 static int hf_amqp_method_exchange_declare_passive = -1;
1117 static int hf_amqp_method_exchange_declare_durable = -1;
1118 static int hf_amqp_method_exchange_declare_auto_delete = -1;
1119 static int hf_amqp_method_exchange_declare_internal = -1;
1120 static int hf_amqp_method_exchange_declare_nowait = -1;
1121 static int hf_amqp_method_exchange_declare_arguments = -1;
1122 static int hf_amqp_method_exchange_bind_destination = -1;
1123 static int hf_amqp_method_exchange_bind_source = -1;
1124 static int hf_amqp_method_exchange_bind_routing_key = -1;
1125 static int hf_amqp_method_exchange_bind_nowait = -1;
1126 static int hf_amqp_method_exchange_bind_arguments = -1;
1127 static int hf_amqp_method_exchange_delete_ticket = -1;
1128 static int hf_amqp_method_exchange_delete_exchange = -1;
1129 static int hf_amqp_method_exchange_delete_if_unused = -1;
1130 static int hf_amqp_method_exchange_delete_nowait = -1;
1131 static int hf_amqp_method_queue_declare_ticket = -1;
1132 static int hf_amqp_method_queue_declare_queue = -1;
1133 static int hf_amqp_method_queue_declare_passive = -1;
1134 static int hf_amqp_method_queue_declare_durable = -1;
1135 static int hf_amqp_method_queue_declare_exclusive = -1;
1136 static int hf_amqp_method_queue_declare_auto_delete = -1;
1137 static int hf_amqp_method_queue_declare_nowait = -1;
1138 static int hf_amqp_method_queue_declare_arguments = -1;
1139 static int hf_amqp_method_queue_declare_ok_queue = -1;
1140 static int hf_amqp_method_queue_declare_ok_message_count = -1;
1141 static int hf_amqp_method_queue_declare_ok_consumer_count = -1;
1142 static int hf_amqp_method_queue_bind_ticket = -1;
1143 static int hf_amqp_method_queue_bind_queue = -1;
1144 static int hf_amqp_method_queue_bind_exchange = -1;
1145 static int hf_amqp_method_queue_bind_routing_key = -1;
1146 static int hf_amqp_method_queue_bind_nowait = -1;
1147 static int hf_amqp_method_queue_bind_arguments = -1;
1148 static int hf_amqp_method_queue_unbind_ticket = -1;
1149 static int hf_amqp_method_queue_unbind_queue = -1;
1150 static int hf_amqp_method_queue_unbind_exchange = -1;
1151 static int hf_amqp_method_queue_unbind_routing_key = -1;
1152 static int hf_amqp_method_queue_unbind_arguments = -1;
1153 static int hf_amqp_method_queue_purge_ticket = -1;
1154 static int hf_amqp_method_queue_purge_queue = -1;
1155 static int hf_amqp_method_queue_purge_nowait = -1;
1156 static int hf_amqp_method_queue_purge_ok_message_count = -1;
1157 static int hf_amqp_method_queue_delete_ticket = -1;
1158 static int hf_amqp_method_queue_delete_queue = -1;
1159 static int hf_amqp_method_queue_delete_if_unused = -1;
1160 static int hf_amqp_method_queue_delete_if_empty = -1;
1161 static int hf_amqp_method_queue_delete_nowait = -1;
1162 static int hf_amqp_method_queue_delete_ok_message_count = -1;
1163 static int hf_amqp_method_basic_qos_prefetch_size = -1;
1164 static int hf_amqp_method_basic_qos_prefetch_count = -1;
1165 static int hf_amqp_method_basic_qos_global = -1;
1166 static int hf_amqp_method_basic_consume_ticket = -1;
1167 static int hf_amqp_method_basic_consume_queue = -1;
1168 static int hf_amqp_method_basic_consume_consumer_tag = -1;
1169 static int hf_amqp_method_basic_consume_no_local = -1;
1170 static int hf_amqp_method_basic_consume_no_ack = -1;
1171 static int hf_amqp_method_basic_consume_exclusive = -1;
1172 static int hf_amqp_method_basic_consume_nowait = -1;
1173 static int hf_amqp_method_basic_consume_filter = -1;
1174 static int hf_amqp_method_basic_consume_ok_consumer_tag = -1;
1175 static int hf_amqp_method_basic_cancel_consumer_tag = -1;
1176 static int hf_amqp_method_basic_cancel_nowait = -1;
1177 static int hf_amqp_method_basic_cancel_ok_consumer_tag = -1;
1178 static int hf_amqp_method_basic_publish_ticket = -1;
1179 static int hf_amqp_method_basic_publish_exchange = -1;
1180 static int hf_amqp_method_basic_publish_routing_key = -1;
1181 static int hf_amqp_method_basic_publish_mandatory = -1;
1182 static int hf_amqp_method_basic_publish_immediate = -1;
1183 static int hf_amqp_method_basic_return_reply_code = -1;
1184 static int hf_amqp_method_basic_return_reply_text = -1;
1185 static int hf_amqp_method_basic_return_exchange = -1;
1186 static int hf_amqp_method_basic_return_routing_key = -1;
1187 static int hf_amqp_method_basic_deliver_consumer_tag = -1;
1188 static int hf_amqp_method_basic_deliver_delivery_tag = -1;
1189 static int hf_amqp_method_basic_deliver_redelivered = -1;
1190 static int hf_amqp_method_basic_deliver_exchange = -1;
1191 static int hf_amqp_method_basic_deliver_routing_key = -1;
1192 static int hf_amqp_method_basic_get_ticket = -1;
1193 static int hf_amqp_method_basic_get_queue = -1;
1194 static int hf_amqp_method_basic_get_no_ack = -1;
1195 static int hf_amqp_method_basic_get_ok_delivery_tag = -1;
1196 static int hf_amqp_method_basic_get_ok_redelivered = -1;
1197 static int hf_amqp_method_basic_get_ok_exchange = -1;
1198 static int hf_amqp_method_basic_get_ok_routing_key = -1;
1199 static int hf_amqp_method_basic_get_ok_message_count = -1;
1200 static int hf_amqp_method_basic_get_empty_cluster_id = -1;
1201 static int hf_amqp_method_basic_ack_delivery_tag = -1;
1202 static int hf_amqp_method_basic_ack_multiple = -1;
1203 static int hf_amqp_method_basic_reject_delivery_tag = -1;
1204 static int hf_amqp_method_basic_reject_requeue = -1;
1205 static int hf_amqp_method_basic_recover_requeue = -1;
1206 static int hf_amqp_method_file_qos_prefetch_size = -1;
1207 static int hf_amqp_method_file_qos_prefetch_count = -1;
1208 static int hf_amqp_method_file_qos_global = -1;
1209 static int hf_amqp_method_file_consume_ticket = -1;
1210 static int hf_amqp_method_file_consume_queue = -1;
1211 static int hf_amqp_method_file_consume_consumer_tag = -1;
1212 static int hf_amqp_method_file_consume_no_local = -1;
1213 static int hf_amqp_method_file_consume_no_ack = -1;
1214 static int hf_amqp_method_file_consume_exclusive = -1;
1215 static int hf_amqp_method_file_consume_nowait = -1;
1216 static int hf_amqp_method_file_consume_filter = -1;
1217 static int hf_amqp_method_file_consume_ok_consumer_tag = -1;
1218 static int hf_amqp_method_file_cancel_consumer_tag = -1;
1219 static int hf_amqp_method_file_cancel_nowait = -1;
1220 static int hf_amqp_method_file_cancel_ok_consumer_tag = -1;
1221 static int hf_amqp_method_file_open_identifier = -1;
1222 static int hf_amqp_method_file_open_content_size = -1;
1223 static int hf_amqp_method_file_open_ok_staged_size = -1;
1224 static int hf_amqp_method_file_publish_ticket = -1;
1225 static int hf_amqp_method_file_publish_exchange = -1;
1226 static int hf_amqp_method_file_publish_routing_key = -1;
1227 static int hf_amqp_method_file_publish_mandatory = -1;
1228 static int hf_amqp_method_file_publish_immediate = -1;
1229 static int hf_amqp_method_file_publish_identifier = -1;
1230 static int hf_amqp_method_file_return_reply_code = -1;
1231 static int hf_amqp_method_file_return_reply_text = -1;
1232 static int hf_amqp_method_file_return_exchange = -1;
1233 static int hf_amqp_method_file_return_routing_key = -1;
1234 static int hf_amqp_method_file_deliver_consumer_tag = -1;
1235 static int hf_amqp_method_file_deliver_delivery_tag = -1;
1236 static int hf_amqp_method_file_deliver_redelivered = -1;
1237 static int hf_amqp_method_file_deliver_exchange = -1;
1238 static int hf_amqp_method_file_deliver_routing_key = -1;
1239 static int hf_amqp_method_file_deliver_identifier = -1;
1240 static int hf_amqp_method_file_ack_delivery_tag = -1;
1241 static int hf_amqp_method_file_ack_multiple = -1;
1242 static int hf_amqp_method_file_reject_delivery_tag = -1;
1243 static int hf_amqp_method_file_reject_requeue = -1;
1244 static int hf_amqp_method_stream_qos_prefetch_size = -1;
1245 static int hf_amqp_method_stream_qos_prefetch_count = -1;
1246 static int hf_amqp_method_stream_qos_consume_rate = -1;
1247 static int hf_amqp_method_stream_qos_global = -1;
1248 static int hf_amqp_method_stream_consume_ticket = -1;
1249 static int hf_amqp_method_stream_consume_queue = -1;
1250 static int hf_amqp_method_stream_consume_consumer_tag = -1;
1251 static int hf_amqp_method_stream_consume_no_local = -1;
1252 static int hf_amqp_method_stream_consume_exclusive = -1;
1253 static int hf_amqp_method_stream_consume_nowait = -1;
1254 static int hf_amqp_method_stream_consume_filter = -1;
1255 static int hf_amqp_method_stream_consume_ok_consumer_tag = -1;
1256 static int hf_amqp_method_stream_cancel_consumer_tag = -1;
1257 static int hf_amqp_method_stream_cancel_nowait = -1;
1258 static int hf_amqp_method_stream_cancel_ok_consumer_tag = -1;
1259 static int hf_amqp_method_stream_publish_ticket = -1;
1260 static int hf_amqp_method_stream_publish_exchange = -1;
1261 static int hf_amqp_method_stream_publish_routing_key = -1;
1262 static int hf_amqp_method_stream_publish_mandatory = -1;
1263 static int hf_amqp_method_stream_publish_immediate = -1;
1264 static int hf_amqp_method_stream_return_reply_code = -1;
1265 static int hf_amqp_method_stream_return_reply_text = -1;
1266 static int hf_amqp_method_stream_return_exchange = -1;
1267 static int hf_amqp_method_stream_return_routing_key = -1;
1268 static int hf_amqp_method_stream_deliver_consumer_tag = -1;
1269 static int hf_amqp_method_stream_deliver_delivery_tag = -1;
1270 static int hf_amqp_method_stream_deliver_exchange = -1;
1271 static int hf_amqp_method_stream_deliver_queue = -1;
1272 static int hf_amqp_method_dtx_start_dtx_identifier = -1;
1273 static int hf_amqp_method_tunnel_request_meta_data = -1;
1274 static int hf_amqp_field = -1;
1275 static int hf_amqp_header_class_id = -1;
1276 static int hf_amqp_header_weight = -1;
1277 static int hf_amqp_header_body_size = -1;
1278 static int hf_amqp_header_property_flags = -1;
1279 static int hf_amqp_header_properties = -1;
1280 static int hf_amqp_header_basic_content_type = -1;
1281 static int hf_amqp_header_basic_content_encoding = -1;
1282 static int hf_amqp_header_basic_headers = -1;
1283 static int hf_amqp_header_basic_delivery_mode = -1;
1284 static int hf_amqp_header_basic_priority = -1;
1285 static int hf_amqp_header_basic_correlation_id = -1;
1286 static int hf_amqp_header_basic_reply_to = -1;
1287 static int hf_amqp_header_basic_expiration = -1;
1288 static int hf_amqp_header_basic_message_id = -1;
1289 static int hf_amqp_header_basic_timestamp = -1;
1290 static int hf_amqp_header_basic_type = -1;
1291 static int hf_amqp_header_basic_user_id = -1;
1292 static int hf_amqp_header_basic_app_id = -1;
1293 static int hf_amqp_header_basic_cluster_id = -1;
1294 static int hf_amqp_header_file_content_type = -1;
1295 static int hf_amqp_header_file_content_encoding = -1;
1296 static int hf_amqp_header_file_headers = -1;
1297 static int hf_amqp_header_file_priority = -1;
1298 static int hf_amqp_header_file_reply_to = -1;
1299 static int hf_amqp_header_file_message_id = -1;
1300 static int hf_amqp_header_file_filename = -1;
1301 static int hf_amqp_header_file_timestamp = -1;
1302 static int hf_amqp_header_file_cluster_id = -1;
1303 static int hf_amqp_header_stream_content_type = -1;
1304 static int hf_amqp_header_stream_content_encoding = -1;
1305 static int hf_amqp_header_stream_headers = -1;
1306 static int hf_amqp_header_stream_priority = -1;
1307 static int hf_amqp_header_stream_timestamp = -1;
1308 static int hf_amqp_header_tunnel_headers = -1;
1309 static int hf_amqp_header_tunnel_proxy_name = -1;
1310 static int hf_amqp_header_tunnel_data_name = -1;
1311 static int hf_amqp_header_tunnel_durable = -1;
1312 static int hf_amqp_header_tunnel_broadcast = -1;
1313 static int hf_amqp_payload = -1;
1314 static int hf_amqp_init_protocol = -1;
1315 static int hf_amqp_init_id_major = -1;
1316 static int hf_amqp_init_id_minor = -1;
1317 static int hf_amqp_init_version_major = -1;
1318 static int hf_amqp_init_version_minor = -1;
1320 static gint ett_amqp = -1;
1321 static gint ett_header = -1;
1322 static gint ett_args = -1;
1323 static gint ett_props = -1;
1324 static gint ett_field_table = -1;
1325 static gint ett_amqp_init = -1;
1326 static gint ett_amqp_0_10_map = -1;
1327 static gint ett_amqp_0_10_array = -1;
1329 static expert_field ei_amqp_bad_flag_value = EI_INIT;
1330 static expert_field ei_amqp_unknown_stream_method = EI_INIT;
1331 static expert_field ei_amqp_unknown_basic_method = EI_INIT;
1332 static expert_field ei_amqp_unknown_frame_type = EI_INIT;
1333 static expert_field ei_amqp_field_short = EI_INIT;
1334 static expert_field ei_amqp_bad_length = EI_INIT;
1335 static expert_field ei_amqp_unknown_command_class = EI_INIT;
1336 static expert_field ei_amqp_unknown_tunnel_method = EI_INIT;
1337 static expert_field ei_amqp_invalid_class_code = EI_INIT;
1338 static expert_field ei_amqp_unknown_access_method = EI_INIT;
1339 static expert_field ei_amqp_unknown_tx_method = EI_INIT;
1340 static expert_field ei_amqp_unknown_header_class = EI_INIT;
1341 static expert_field ei_amqp_unknown_connection_method = EI_INIT;
1342 static expert_field ei_amqp_unknown_queue_method = EI_INIT;
1343 static expert_field ei_amqp_unknown_channel_method = EI_INIT;
1344 static expert_field ei_amqp_unknown_dtx_method = EI_INIT;
1345 static expert_field ei_amqp_unknown_method_class = EI_INIT;
1346 static expert_field ei_amqp_unknown_file_method = EI_INIT;
1347 static expert_field ei_amqp_unknown_exchange_method = EI_INIT;
1349 /* Various enumerations */
1351 static const value_string amqp_0_10_frame_position [] = {
1352 {0x00, "----"},
1353 {0x01, "---e"},
1354 {0x02, "--b-"},
1355 {0x03, "--be"},
1356 {0x04, "-E--"},
1357 {0x05, "-E-e"},
1358 {0x06, "-Eb-"},
1359 {0x07, "-Ebe"},
1360 {0x08, "B---"},
1361 {0x09, "B--e"},
1362 {0x0a, "B-b-"},
1363 {0x0b, "B-be"},
1364 {0x0c, "BE--"},
1365 {0x0d, "BE-e"},
1366 {0x0e, "BEb-"},
1367 {0x0f, "BEbe"},
1368 {0, NULL}
1371 static const value_string amqp_0_10_frame_types [] = {
1372 {0, "Control"},
1373 {1, "Command"},
1374 {2, "Header"},
1375 {3, "Body"},
1376 {0, NULL}
1379 static const value_string amqp_0_10_frame_tracks [] = {
1380 {0, "Control"},
1381 {1, "Command"},
1382 {0, NULL}
1385 static const value_string amqp_0_10_class [] = {
1386 {AMQP_0_10_CLASS_CONNECTION, "Connection"},
1387 {AMQP_0_10_CLASS_SESSION, "Session"},
1388 {AMQP_0_10_CLASS_EXECUTION, "Execution"},
1389 {AMQP_0_10_CLASS_MESSAGE, "Message"},
1390 {AMQP_0_10_CLASS_TX, "Tx"},
1391 {AMQP_0_10_CLASS_DTX, "Dtx"},
1392 {AMQP_0_10_CLASS_EXCHANGE, "Exchange"},
1393 {AMQP_0_10_CLASS_QUEUE, "Queue"},
1394 {AMQP_0_10_CLASS_FILE, "File"},
1395 {AMQP_0_10_CLASS_STREAM, "Stream"},
1396 {0, NULL}
1399 static const value_string amqp_0_10_connection_methods [] = {
1400 {AMQP_0_10_METHOD_CONNECTION_START, "connection.start"},
1401 {AMQP_0_10_METHOD_CONNECTION_START_OK, "connection.start-ok"},
1402 {AMQP_0_10_METHOD_CONNECTION_SECURE, "connection.secure"},
1403 {AMQP_0_10_METHOD_CONNECTION_SECURE_OK, "connection.secure-ok"},
1404 {AMQP_0_10_METHOD_CONNECTION_TUNE, "connection.tune"},
1405 {AMQP_0_10_METHOD_CONNECTION_TUNE_OK, "connection.tune-ok"},
1406 {AMQP_0_10_METHOD_CONNECTION_OPEN, "connection.open"},
1407 {AMQP_0_10_METHOD_CONNECTION_OPEN_OK, "connection.open-ok"},
1408 {AMQP_0_10_METHOD_CONNECTION_REDIRECT, "connection.redirect"},
1409 {AMQP_0_10_METHOD_CONNECTION_HEARTBEAT, "connection.heartbeat"},
1410 {AMQP_0_10_METHOD_CONNECTION_CLOSE, "connection.close"},
1411 {AMQP_0_10_METHOD_CONNECTION_CLOSE_OK, "connection.close-ok"},
1412 {0, NULL}
1415 static const value_string amqp_0_10_session_methods [] = {
1416 {AMQP_0_10_METHOD_SESSION_ATTACH, "session.attach"},
1417 {AMQP_0_10_METHOD_SESSION_ATTACHED, "session.attached"},
1418 {AMQP_0_10_METHOD_SESSION_DETACH, "session.detach"},
1419 {AMQP_0_10_METHOD_SESSION_DETACHED, "session.detached"},
1420 {AMQP_0_10_METHOD_SESSION_REQUEST_TIMEOUT, "session.request-timeout"},
1421 {AMQP_0_10_METHOD_SESSION_TIMEOUT, "session.timeout"},
1422 {AMQP_0_10_METHOD_SESSION_COMMAND_POINT, "session.command-point"},
1423 {AMQP_0_10_METHOD_SESSION_EXPECTED, "session.expected"},
1424 {AMQP_0_10_METHOD_SESSION_CONFIRMED, "session.confirmed"},
1425 {AMQP_0_10_METHOD_SESSION_COMPLETED, "session.completed"},
1426 {AMQP_0_10_METHOD_SESSION_KNOWN_COMPLETED, "session.known-completed"},
1427 {AMQP_0_10_METHOD_SESSION_FLUSH, "session.flush"},
1428 {AMQP_0_10_METHOD_SESSION_GAP, "session.gap"},
1429 {0, NULL}
1432 static const value_string amqp_0_10_execution_methods [] = {
1433 {AMQP_0_10_METHOD_EXECUTION_SYNC, "execution.sync"},
1434 {AMQP_0_10_METHOD_EXECUTION_RESULT, "execution.result"},
1435 {AMQP_0_10_METHOD_EXECUTION_EXCEPTION, "execution.exception"},
1436 {0, NULL}
1439 static const value_string amqp_0_10_message_methods [] = {
1440 {AMQP_0_10_METHOD_MESSAGE_TRANSFER, "message.transfer"},
1441 {AMQP_0_10_METHOD_MESSAGE_ACCEPT, "message.accept"},
1442 {AMQP_0_10_METHOD_MESSAGE_REJECT, "message.reject"},
1443 {AMQP_0_10_METHOD_MESSAGE_RELEASE, "message.release"},
1444 {AMQP_0_10_METHOD_MESSAGE_ACQUIRE, "message.acquire"},
1445 {AMQP_0_10_METHOD_MESSAGE_RESUME, "message.resume"},
1446 {AMQP_0_10_METHOD_MESSAGE_SUBSCRIBE, "message.subscribe"},
1447 {AMQP_0_10_METHOD_MESSAGE_CANCEL, "message.cancel"},
1448 {AMQP_0_10_METHOD_MESSAGE_SET_FLOW_MODE, "message.set-flow-mode"},
1449 {AMQP_0_10_METHOD_MESSAGE_FLOW, "message.flow"},
1450 {AMQP_0_10_METHOD_MESSAGE_FLUSH, "message.flush"},
1451 {AMQP_0_10_METHOD_MESSAGE_STOP, "message.stop"},
1452 {0, NULL}
1455 static const value_string amqp_0_10_tx_methods [] = {
1456 {AMQP_0_10_METHOD_TX_SELECT, "tx.select"},
1457 {AMQP_0_10_METHOD_TX_COMMIT, "tx.commit"},
1458 {AMQP_0_10_METHOD_TX_ROLLBACK, "tx.rollback"},
1459 {0, NULL}
1462 static const value_string amqp_0_10_dtx_methods [] = {
1463 {AMQP_0_10_METHOD_DTX_SELECT, "dtx.select"},
1464 {AMQP_0_10_METHOD_DTX_START, "dtx.start"},
1465 {AMQP_0_10_METHOD_DTX_END, "dtx.end"},
1466 {AMQP_0_10_METHOD_DTX_COMMIT, "dtx.commit"},
1467 {AMQP_0_10_METHOD_DTX_FORGET, "dtx.forget"},
1468 {AMQP_0_10_METHOD_DTX_GET_TIMEOUT, "dtx.get-timeout"},
1469 {AMQP_0_10_METHOD_DTX_PREPARE, "dtx.prepare"},
1470 {AMQP_0_10_METHOD_DTX_RECOVER, "dtx.recover"},
1471 {AMQP_0_10_METHOD_DTX_ROLLBACK, "dtx.rollback"},
1472 {AMQP_0_10_METHOD_DTX_SET_TIMEOUT, "dtx.set-timeout"},
1473 {0, NULL}
1476 static const value_string amqp_0_10_exchange_methods [] = {
1477 {AMQP_0_10_METHOD_EXCHANGE_DECLARE, "exchange.declare"},
1478 {AMQP_0_10_METHOD_EXCHANGE_DELETE, "exchange.delete"},
1479 {AMQP_0_10_METHOD_EXCHANGE_QUERY, "exchange.query"},
1480 {AMQP_0_10_METHOD_EXCHANGE_BIND, "exchange.bind"},
1481 {AMQP_0_10_METHOD_EXCHANGE_UNBIND, "exchange.unbind"},
1482 {AMQP_0_10_METHOD_EXCHANGE_BOUND, "exchange.bound"},
1483 {0, NULL}
1486 static const value_string amqp_0_10_queue_methods [] = {
1487 {AMQP_0_10_METHOD_QUEUE_DECLARE, "queue.declare"},
1488 {AMQP_0_10_METHOD_QUEUE_DELETE, "queue.delete"},
1489 {AMQP_0_10_METHOD_QUEUE_PURGE, "queue.purge"},
1490 {AMQP_0_10_METHOD_QUEUE_QUERY, "queue.query"},
1491 {0, NULL}
1494 static const value_string amqp_0_10_file_methods [] = {
1495 {AMQP_0_10_METHOD_FILE_QOS, "file.qos"},
1496 {AMQP_0_10_METHOD_FILE_QOS_OK, "file.qos-ok"},
1497 {AMQP_0_10_METHOD_FILE_CONSUME, "file.consume"},
1498 {AMQP_0_10_METHOD_FILE_CONSUME_OK, "file.consume-ok"},
1499 {AMQP_0_10_METHOD_FILE_CANCEL, "file.cancel"},
1500 {AMQP_0_10_METHOD_FILE_OPEN, "file.open"},
1501 {AMQP_0_10_METHOD_FILE_OPEN_OK, "file.open-ok"},
1502 {AMQP_0_10_METHOD_FILE_STAGE, "file.stage"},
1503 {AMQP_0_10_METHOD_FILE_PUBLISH, "file.publish"},
1504 {AMQP_0_10_METHOD_FILE_RETURN, "file.return"},
1505 {AMQP_0_10_METHOD_FILE_DELIVER, "file.deliver"},
1506 {AMQP_0_10_METHOD_FILE_ACK, "file.ack"},
1507 {AMQP_0_10_METHOD_FILE_REJECT, "file.reject"},
1508 {0, NULL}
1511 static const value_string amqp_0_10_stream_methods [] = {
1512 {AMQP_0_10_METHOD_STREAM_QOS, "stream.qos"},
1513 {AMQP_0_10_METHOD_STREAM_QOS_OK, "stream.qos-ok"},
1514 {AMQP_0_10_METHOD_STREAM_CONSUME, "stream.consume"},
1515 {AMQP_0_10_METHOD_STREAM_CONSUME_OK, "stream.consume-ok"},
1516 {AMQP_0_10_METHOD_STREAM_CANCEL, "stream.cancel"},
1517 {AMQP_0_10_METHOD_STREAM_PUBLISH, "stream.publish"},
1518 {AMQP_0_10_METHOD_STREAM_RETURN, "stream.return"},
1519 {AMQP_0_10_METHOD_STREAM_DELIVER, "stream.deliver"},
1520 {0, NULL}
1523 static const value_string amqp_0_10_method_connection_close_reply_codes [] = {
1524 {200, "normal"},
1525 {320, "connection-forced"},
1526 {402, "invalid-path"},
1527 {501, "framing-error"},
1528 {0, NULL}
1531 static const true_false_string amqp_0_10_session_header_sync = {
1532 "notification requested", "notification NOT requested"
1535 static const value_string amqp_0_10_method_session_detached_codes [] = {
1536 {0, "normal"},
1537 {1, "session-busy"},
1538 {2, "transport-busy"},
1539 {3, "not-attached"},
1540 {4, "unknown-ids"},
1541 {0, NULL}
1544 static const value_string amqp_0_10_method_execution_exception_errors [] = {
1545 {403, "unauthorized-access"},
1546 {404, "not-found"},
1547 {405, "resource-locked"},
1548 {406, "precondition-failed"},
1549 {408, "resource-deleted"},
1550 {409, "illegal-state"},
1551 {503, "command-invalid"},
1552 {506, "resource-limit-exceeded"},
1553 {530, "not-allowed"},
1554 {531, "illegal-argument"},
1555 {540, "not-implemented"},
1556 {541, "internal-error"},
1557 {542, "invalid-argument"},
1558 {0, NULL}
1561 static const value_string amqp_0_10_message_transfer_accept_modes [] = {
1562 {0, "explicit"},
1563 {1, "none"},
1564 {0, NULL}
1567 static const value_string amqp_0_10_message_transfer_acquire_modes [] = {
1568 {0, "pre-acquired"},
1569 {1, "not-acquired"},
1570 {0, NULL}
1573 static const value_string amqp_0_10_message_transfer_reject_codes [] = {
1574 {0, "unspecified"},
1575 {1, "unroutable"},
1576 {2, "immediate"},
1577 {0, NULL}
1580 static const value_string amqp_0_10_message_flow_modes [] = {
1581 {0, "credit"},
1582 {1, "window"},
1583 {0, NULL}
1586 static const value_string amqp_0_10_message_credit_units [] = {
1587 {0, "message"},
1588 {1, "byte"},
1589 {0, NULL}
1592 static const value_string amqp_0_10_xa_status [] = {
1593 {0, "Normal execution completion. (xa-ok)"},
1594 {1, "The rollback was caused for an unspecified reason. (xa-rbrollback)"},
1595 {2, "A transaction branch took too long. (xa-rbtimeout)"},
1596 {3, "The transaction branch may have been heuristically completed. (xa-heurhaz)"},
1597 {4, "The transaction branch has been heuristically committed. (xa-heurcom)"},
1598 {5, "The transaction branch has been heuristically rolled back. (xa-heurrb)"},
1599 {6, "The transaction branch has been heuristically committed and rolled back. (xa-heurmix)"},
1600 {7, "The transaction branch was read-only and has been committed. (xa-rdonly)"},
1601 {0, NULL}
1604 static const value_string amqp_0_10_struct_delivery_properties_priorities [] = {
1605 {0, "lowest"},
1606 {1, "lower"},
1607 {2, "low"},
1608 {3, "below-average"},
1609 {4, "medium"},
1610 {5, "above-average"},
1611 {6, "high"},
1612 {7, "higher"},
1613 {8, "very-high"},
1614 {9, "highest"},
1615 {0, NULL}
1618 static const value_string amqp_0_10_struct_delivery_properties_modes [] = {
1619 {1, "non-persistent"},
1620 {2, "persistent"},
1621 {0, NULL}
1624 static const value_string amqp_0_10_file_return_codes [] = {
1625 {311, "content-too-large"},
1626 {312, "no-route"},
1627 {313, "no-consumers"},
1628 {0, NULL}
1631 static const value_string amqp_0_10_stream_return_codes [] = {
1632 {311, "content-too-large"},
1633 {312, "no-route"},
1634 {313, "no-consumers"},
1635 {0, NULL}
1638 static const value_string amqp_0_9_frame_types [] = {
1639 {AMQP_0_9_FRAME_TYPE_METHOD, "Method"},
1640 {AMQP_0_9_FRAME_TYPE_CONTENT_HEADER, "Content header"},
1641 {AMQP_0_9_FRAME_TYPE_CONTENT_BODY, "Content body"},
1642 {AMQP_0_9_FRAME_TYPE_OOB_METHOD, "OOB Method"},
1643 {AMQP_0_9_FRAME_TYPE_OOB_CONTENT_HEADER, "OOB Content header"},
1644 {AMQP_0_9_FRAME_TYPE_OOB_CONTENT_BODY, "OOB Content body"},
1645 {AMQP_0_9_FRAME_TYPE_TRACE , "Trace"},
1646 {AMQP_0_9_FRAME_TYPE_HEARTBEAT, "Heartbeat"},
1647 {0, NULL}
1650 static const value_string amqp_0_9_method_classes [] = {
1651 {AMQP_0_9_CLASS_CONNECTION, "Connection"},
1652 {AMQP_0_9_CLASS_CHANNEL, "Channel"},
1653 {AMQP_0_9_CLASS_ACCESS, "Access"},
1654 {AMQP_0_9_CLASS_EXCHANGE, "Exchange"},
1655 {AMQP_0_9_CLASS_QUEUE, "Queue"},
1656 {AMQP_0_9_CLASS_BASIC, "Basic"},
1657 {AMQP_0_9_CLASS_FILE, "File"},
1658 {AMQP_0_9_CLASS_STREAM, "Stream"},
1659 {AMQP_0_9_CLASS_TX, "Tx"},
1660 {AMQP_0_9_CLASS_DTX, "Dtx"},
1661 {AMQP_0_9_CLASS_TUNNEL, "Tunnel"},
1662 {0, NULL}
1665 static const value_string amqp_method_connection_methods [] = {
1666 {10, "Start"},
1667 {11, "Start-Ok"},
1668 {20, "Secure"},
1669 {21, "Secure-Ok"},
1670 {30, "Tune"},
1671 {31, "Tune-Ok"},
1672 {40, "Open"},
1673 {41, "Open-Ok"},
1674 {42, "Redirect"},
1675 {50, "Close"},
1676 {51, "Close-Ok"},
1677 {0, NULL}
1680 static const value_string amqp_method_channel_methods [] = {
1681 {10, "Open"},
1682 {11, "Open-Ok"},
1683 {20, "Flow"},
1684 {21, "Flow-Ok"},
1685 {40, "Close"},
1686 {41, "Close-Ok"},
1687 {50, "Resume"},
1688 {60, "Ping"},
1689 {70, "Pong"},
1690 {80, "Ok"},
1691 {0, NULL}
1694 static const value_string amqp_method_access_methods [] = {
1695 {10, "Request"},
1696 {11, "Request-Ok"},
1697 {0, NULL}
1700 static const value_string amqp_method_exchange_methods [] = {
1701 {10, "Declare"},
1702 {11, "Declare-Ok"},
1703 {20, "Delete"},
1704 {21, "Delete-Ok"},
1705 {30, "Bind"},
1706 {31, "Bind-Ok"},
1707 {0, NULL}
1710 static const value_string amqp_method_queue_methods [] = {
1711 {10, "Declare"},
1712 {11, "Declare-Ok"},
1713 {20, "Bind"},
1714 {21, "Bind-Ok"},
1715 {50, "Unbind"},
1716 {51, "Unbind-Ok"},
1717 {30, "Purge"},
1718 {31, "Purge-Ok"},
1719 {40, "Delete"},
1720 {41, "Delete-Ok"},
1721 {0, NULL}
1724 static const value_string amqp_method_basic_methods [] = {
1725 {10, "Qos"},
1726 {11, "Qos-Ok"},
1727 {20, "Consume"},
1728 {21, "Consume-Ok"},
1729 {30, "Cancel"},
1730 {31, "Cancel-Ok"},
1731 {40, "Publish"},
1732 {50, "Return"},
1733 {60, "Deliver"},
1734 {70, "Get"},
1735 {71, "Get-Ok"},
1736 {72, "Get-Empty"},
1737 {80, "Ack"},
1738 {90, "Reject"},
1739 {100, "Recover"},
1740 {0, NULL}
1743 static const value_string amqp_method_file_methods [] = {
1744 {10, "Qos"},
1745 {11, "Qos-Ok"},
1746 {20, "Consume"},
1747 {21, "Consume-Ok"},
1748 {30, "Cancel"},
1749 {31, "Cancel-Ok"},
1750 {40, "Open"},
1751 {41, "Open-Ok"},
1752 {50, "Stage"},
1753 {60, "Publish"},
1754 {70, "Return"},
1755 {80, "Deliver"},
1756 {90, "Ack"},
1757 {100, "Reject"},
1758 {0, NULL}
1761 static const value_string amqp_method_stream_methods [] = {
1762 {10, "Qos"},
1763 {11, "Qos-Ok"},
1764 {20, "Consume"},
1765 {21, "Consume-Ok"},
1766 {30, "Cancel"},
1767 {31, "Cancel-Ok"},
1768 {40, "Publish"},
1769 {50, "Return"},
1770 {60, "Deliver"},
1771 {0, NULL}
1774 static const value_string amqp_method_tx_methods [] = {
1775 {10, "Select"},
1776 {11, "Select-Ok"},
1777 {20, "Commit"},
1778 {21, "Commit-Ok"},
1779 {30, "Rollback"},
1780 {31, "Rollback-Ok"},
1781 {0, NULL}
1784 static const value_string amqp_method_dtx_methods [] = {
1785 {10, "Select"},
1786 {11, "Select-Ok"},
1787 {20, "Start"},
1788 {21, "Start-Ok"},
1789 {0, NULL}
1792 static const value_string amqp_method_tunnel_methods [] = {
1793 {10, "Request"},
1794 {0, NULL}
1797 /* AMQP 0-10 Type Info */
1798 static struct amqp_typeinfo amqp_0_10_fixed_types[] = {
1799 { 0x00, "bin8", format_amqp_0_10_bin, 1 },
1800 { 0x01, "int8", format_amqp_0_10_int, 1 },
1801 { 0x02, "uint8", format_amqp_0_10_uint, 1 },
1802 { 0x04, "char", format_amqp_0_10_char, 1 },
1803 { 0x08, "boolean", format_amqp_0_10_boolean, 1 },
1804 { 0x10, "bin16", format_amqp_0_10_bin, 2 },
1805 { 0x11, "int16", format_amqp_0_10_int, 2 },
1806 { 0x12, "uint16", format_amqp_0_10_uint, 2 },
1807 { 0x20, "bin32", format_amqp_0_10_bin, 4 },
1808 { 0x21, "int32", format_amqp_0_10_int, 4 },
1809 { 0x22, "uint32", format_amqp_0_10_uint, 4 },
1810 { 0xff, "end", 0, 0 }
1813 static struct amqp_typeinfo amqp_0_10_var_types[] = {
1814 { 0x80, "vbin8", format_amqp_0_10_vbin, 1 },
1815 { 0x95, "str16", format_amqp_0_10_str, 2 },
1816 { 0xff, "end", 0, 0 }
1820 /* Main dissection routine */
1822 static void
1823 dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1825 conversation_t *conv;
1826 amqp_conv *conn;
1827 guint fixed_length;
1828 guint (*length_getter)(packet_info *, tvbuff_t *, int);
1829 new_dissector_t dissector;
1831 /* Minimal frame size is 8 bytes - smaller frames are malformed */
1832 if (tvb_reported_length (tvb) < 8) {
1833 expert_add_info_format(pinfo, NULL, &ei_amqp_bad_length, "Require frame at least 8 bytes long");
1834 return;
1837 /* Find (or build) conversation to remember the protocol version */
1838 conv = find_or_create_conversation(pinfo);
1839 conn = (amqp_conv *)conversation_get_proto_data(conv, proto_amqp);
1840 if (conn == NULL) {
1841 conn = wmem_new0(wmem_file_scope(), amqp_conv);
1842 conversation_add_proto_data(conv, proto_amqp, conn);
1844 check_amqp_version(tvb, conn);
1845 switch(conn->version) {
1846 case AMQP_V0_9:
1847 length_getter = &get_amqp_0_9_message_len;
1848 dissector = dissect_amqp_0_9_frame;
1849 fixed_length = 7;
1850 break;
1851 case AMQP_V0_10:
1852 length_getter = &get_amqp_0_10_message_len;
1853 dissector = dissect_amqp_0_10_frame;
1854 fixed_length = 8;
1855 break;
1856 default:
1857 col_append_str(pinfo->cinfo, COL_INFO, "AMQP (unknown version)");
1858 col_set_fence(pinfo->cinfo, COL_INFO);
1859 return;
1861 tcp_dissect_pdus(tvb, pinfo, tree, TRUE, fixed_length,
1862 length_getter, dissector, NULL);
1865 static void
1866 check_amqp_version(tvbuff_t *tvb, amqp_conv *conn)
1868 guint32 f0_9_length;
1871 * If we already know and the version and this isn't a protocol header,
1872 * return ok. 0-10 and up can run protocol headers in each direction,
1873 * so if it looks like a protocol header, snag the version even if one
1874 * is already recorded. Multi-protocol brokers can negotiate down.
1876 if ((conn->version != 0) && (tvb_get_guint8(tvb, 0) != 'A'))
1877 return;
1879 if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) {
1880 guint8 proto_major;
1881 guint8 proto_minor;
1883 proto_major = tvb_get_guint8(tvb, 6);
1884 proto_minor = tvb_get_guint8(tvb, 7);
1885 if (proto_major == 0) {
1886 if (proto_minor == 9)
1887 conn->version = AMQP_V0_9;
1888 else if (proto_minor == 10)
1889 conn->version = AMQP_V0_10;
1891 return;
1895 * It's not a protocol header and the AMQP version isn't known. Try to
1896 * deduce it from the content. First indicator is the frame length. 0-9
1897 * has a 32-bit length in octets 3-7. If the frame length is the same
1898 * as the PDU length and there's a frame end where it should be, this
1899 * is 0-9. Else assume 0-10.
1901 f0_9_length = tvb_get_ntohl(tvb, 3) + 7 + 1; /* Add header and end */
1902 if ((f0_9_length == tvb_reported_length(tvb)) &&
1903 (tvb_get_guint8(tvb, f0_9_length - 1) == 0xCE))
1904 conn->version = AMQP_V0_9;
1905 else
1906 conn->version = AMQP_V0_10;
1907 return;
1910 static guint
1911 get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1913 /* Heuristic - protocol initialisation frame starts with 'AMQP' */
1914 if (tvb_memeql(tvb, offset, "AMQP", 4) == 0)
1915 return 8;
1917 return (guint) tvb_get_ntohs(tvb, offset + 2);
1920 static guint
1921 get_amqp_0_9_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1923 guint32 length;
1925 /* Heuristic - protocol initialisation frame starts with 'AMQP' */
1926 if (tvb_memeql(tvb, offset, "AMQP", 4) == 0)
1927 return 8;
1930 * XXX - the location of the length differs from protocol version to
1931 * protocol version; for now, we only handle version 0-9, and we
1932 * clamp the length at 1MB so we don't go nuts if we get a bogus
1933 * length due to dissecting the wrong version (or getting a malformed
1934 * packet).
1936 length = tvb_get_ntohl(tvb, offset + 3);
1937 if (length > 1048576)
1938 length = 1048576;
1939 return length + 8;
1942 /* Dissection routine for AMQP 0-9 field tables */
1944 static void
1945 dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guint length, proto_item *item)
1947 proto_tree *field_table_tree;
1948 guint namelen, vallen;
1949 guint8 type;
1950 const char *name;
1951 const char *amqp_typename;
1952 const char *value;
1953 int field_start;
1955 field_table_tree = proto_item_add_subtree(item, ett_amqp);
1957 while (length != 0) {
1958 field_start = offset;
1959 namelen = tvb_get_guint8(tvb, offset);
1960 offset += 1;
1961 length -= 1;
1962 if (length < namelen)
1963 goto too_short;
1964 name = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, namelen);
1965 offset += namelen;
1966 length -= namelen;
1967 if (length < 1)
1968 goto too_short;
1969 type = tvb_get_guint8(tvb, offset);
1970 offset += 1;
1971 length -= 1;
1972 switch (type) {
1973 case 'S':
1974 amqp_typename = "string";
1975 if (length < 4)
1976 goto too_short;
1977 vallen = tvb_get_ntohl(tvb, offset);
1978 offset += 4;
1979 length -= 4;
1980 if (length < vallen)
1981 goto too_short;
1982 value = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, vallen);
1983 offset += vallen;
1984 length -= vallen;
1985 break;
1986 case 'I':
1987 amqp_typename = "integer";
1988 if (length < 4)
1989 goto too_short;
1990 value = wmem_strdup_printf(wmem_packet_scope(), "%d", tvb_get_ntohl(tvb, offset));
1991 offset += 4;
1992 length -= 4;
1993 break;
1994 case 'D':
1995 amqp_typename = "decimal";
1996 if (length < 5)
1997 goto too_short;
1998 value = "...";
1999 offset += 5;
2000 length -= 5;
2001 break;
2002 case 'T':
2003 amqp_typename = "timestamp";
2004 if (length < 8)
2005 goto too_short;
2006 value = "...";
2007 offset += 8;
2008 length -= 8;
2009 break;
2010 case 'F':
2011 /* TODO: make it recursive here */
2012 amqp_typename = "field table";
2013 if (length < 4)
2014 goto too_short;
2015 vallen = tvb_get_ntohl(tvb, offset);
2016 offset += 4;
2017 length -= 4;
2018 value = "...";
2019 if (length < vallen)
2020 goto too_short;
2021 offset += vallen;
2022 length -= vallen;
2023 break;
2024 case 'V':
2025 amqp_typename = "void";
2026 value = "";
2027 break;
2028 case 'A':
2029 /* TODO: make it recursive here */
2030 amqp_typename = "array";
2031 if (length < 4)
2032 goto too_short;
2033 vallen = tvb_get_ntohl(tvb, offset);
2034 offset += 4;
2035 length -= 4;
2036 value = "...";
2037 if (length < vallen)
2038 goto too_short;
2039 offset += vallen;
2040 length -= vallen;
2041 break;
2042 default:
2043 amqp_typename = "";
2044 value = NULL;
2045 break;
2048 if (value != NULL)
2049 proto_tree_add_none_format(field_table_tree, hf_amqp_field, tvb,
2050 field_start, offset - field_start,
2051 "%s (%s): %s", name, amqp_typename,
2052 value);
2053 else
2054 proto_tree_add_none_format(field_table_tree, hf_amqp_field, tvb,
2055 field_start, offset - field_start,
2056 "%s: unknown type %x (%c)",
2057 name, type, type);
2059 return;
2061 too_short:
2062 proto_tree_add_expert(field_table_tree, pinfo, &ei_amqp_field_short, tvb, field_start, offset - field_start);
2063 return;
2066 /* Dissection routine for AMQP 0-10 maps */
2068 static void
2069 dissect_amqp_0_10_map(tvbuff_t *tvb,
2070 int offset, /* Start of map in tvb */
2071 int bound, /* How far into tvb we can go */
2072 int length, /* Length of map */
2073 proto_item *item)
2075 proto_item *map_tree;
2076 guint namelen, size;
2077 guint8 type;
2078 const char *name;
2079 const char *amqp_typename;
2080 const char *value;
2081 gint field_start, field_length;
2082 guint32 field_count;
2083 type_formatter formatter;
2085 field_length = 0;
2086 map_tree = proto_item_add_subtree(item, ett_amqp_0_10_map);
2087 field_count = tvb_get_ntohl(tvb, offset);
2088 AMQP_INCREMENT(offset, 4, bound);
2089 length -= 4;
2090 proto_item_append_text(item, " (%d entries)", field_count);
2091 while ((field_count > 0) && (length > 0)) {
2092 field_start = offset;
2093 namelen = tvb_get_guint8(tvb, offset);
2094 AMQP_INCREMENT(offset, 1, bound);
2095 length -= 1;
2096 name = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, namelen);
2097 AMQP_INCREMENT(offset, namelen, bound);
2098 length -= namelen;
2099 type = tvb_get_guint8(tvb, offset);
2100 AMQP_INCREMENT(offset, 1, bound);
2101 length -= 1;
2102 if (get_amqp_0_10_type_formatter(type, &amqp_typename, &formatter, &size)) {
2103 field_length = formatter(tvb, offset, bound, size, &value);
2104 proto_tree_add_none_format(map_tree,
2105 hf_amqp_field,
2106 tvb,
2107 field_start,
2108 field_length,
2109 "%s (%s): %s",
2110 name, amqp_typename, value);
2111 AMQP_INCREMENT(offset, field_length, bound);
2112 length -= field_length;
2114 else {
2115 switch (type) {
2116 case AMQP_0_10_TYPE_MAP:
2117 case AMQP_0_10_TYPE_LIST:
2118 case AMQP_0_10_TYPE_ARRAY:
2119 field_length = tvb_get_ntohl(tvb, offset);
2120 proto_tree_add_none_format(map_tree, hf_amqp_field,
2121 tvb, field_start, field_length,
2122 "%s (composite): %d bytes",
2123 name, field_length);
2124 AMQP_INCREMENT(offset, field_length, bound);
2125 length -= field_length;
2126 break;
2128 default:
2129 amqp_typename = "unimplemented";
2130 if ((type & 0x80) == 0) {
2131 field_length = 2 ^ ((type & 0x70) >> 4);
2133 else if ((type & 0xd0) == 0xd0) {
2134 field_length = 9;
2136 else if ((type & 0xc0) == 0xc0) {
2137 field_length = 5;
2139 else if ((type & 0x80) == 0x80) {
2140 switch (2 ^ ((type & 0x70) >> 4)) {
2141 case 1:
2142 field_length += tvb_get_guint8(tvb, offset);
2143 break;
2144 case 2:
2145 field_length += tvb_get_ntohs(tvb, offset);
2146 break;
2147 case 4:
2148 field_length += tvb_get_ntohl(tvb, offset);
2149 break;
2150 default:
2151 field_length = 1; /* Reserved... skip 1 */
2152 amqp_typename = "reserved";
2153 break;
2156 else {
2157 field_length = 1; /* Reserved... skip 1 */
2158 amqp_typename = "reserved";
2160 proto_tree_add_none_format(map_tree, hf_amqp_field,
2161 tvb, field_start, field_length,
2162 "%s (%s): %d bytes",
2163 name, amqp_typename, field_length);
2164 AMQP_INCREMENT(offset, field_length, bound);
2165 length -= field_length;
2169 field_count -= 1;
2173 /* Dissection routine for AMQP 0-10 maps */
2175 static void
2176 dissect_amqp_0_10_array(tvbuff_t *tvb,
2177 packet_info *pinfo,
2178 int offset, /* Start of array in tvb */
2179 int bound, /* How far into tvb we can go */
2180 int length, /* Length of array */
2181 proto_item *item)
2183 proto_item *array_tree;
2184 proto_item *sub;
2185 guint8 type;
2186 guint16 len16;
2187 const char *amqp_typename;
2188 const char *value;
2189 int element_start;
2190 int externally_formatted;
2191 guint32 element_count;
2192 guint32 struct_length;
2194 array_tree = 0;
2195 type = tvb_get_guint8(tvb, offset);
2196 AMQP_INCREMENT(offset, 1, bound);
2197 length -= 1;
2198 element_count = tvb_get_ntohl(tvb, offset);
2199 AMQP_INCREMENT(offset, 4, bound);
2200 length -= 4;
2201 proto_item_append_text(item, " (%d elements)", element_count);
2202 if (element_count > 1)
2203 array_tree = proto_item_add_subtree(item, ett_amqp_0_10_array);
2204 while ((element_count > 0) && (length > 0)) {
2205 element_start = offset;
2206 externally_formatted = 0;
2207 switch (type) {
2208 case AMQP_0_10_TYPE_STR16:
2209 amqp_typename = "str16";
2210 len16 = tvb_get_ntohs(tvb, offset);
2211 AMQP_INCREMENT(offset, 2, bound);
2212 length -= 2;
2213 value = (char*) tvb_get_string(wmem_packet_scope(), tvb, offset, len16);
2214 AMQP_INCREMENT(offset, len16, bound);
2215 length -= len16;
2216 break;
2218 case AMQP_0_10_TYPE_STRUCT32:
2219 amqp_typename = "struct32";
2220 value = "structure";
2221 externally_formatted = 1;
2222 struct_length = tvb_get_ntohl(tvb, offset);
2223 AMQP_INCREMENT(offset, 4, bound);
2224 length -= 4;
2226 * Always add a tree for structs - the struct formatter will
2227 * change the item text to the struct type then add elements to it.
2229 if (array_tree == 0)
2230 array_tree = proto_item_add_subtree(item, ett_amqp_0_10_array);
2231 sub = proto_tree_add_none_format(array_tree, hf_amqp_field, tvb,
2232 element_start,
2233 offset - element_start,
2234 "(%s): ", amqp_typename);
2235 dissect_amqp_0_10_struct32(tvb, pinfo, sub, offset, struct_length);
2236 AMQP_INCREMENT(offset, struct_length, bound);
2237 length -= struct_length;
2238 break;
2240 default:
2241 proto_tree_add_none_format(array_tree, hf_amqp_field, tvb,
2242 element_start,
2243 offset - element_start,
2244 "(unknown type %d)",
2245 type);
2246 /* Don't bother continuing through the loop: we don't know how
2247 * much to increment the offset by and the type doesn't change
2248 * so there's nothing interesting to do...
2250 return;
2253 element_count -= 1;
2254 if (externally_formatted)
2255 continue;
2257 if (array_tree != 0) {
2258 proto_tree_add_none_format(array_tree, hf_amqp_field, tvb,
2259 element_start,
2260 offset - element_start,
2261 "(%s): %s",
2262 amqp_typename,
2263 value);
2265 else {
2266 proto_item_append_text(item, ": (%s): %s", amqp_typename, value);
2271 static void
2272 dissect_amqp_0_10_xid (tvbuff_t *tvb,
2273 int offset,
2274 guint16 xid_length,
2275 proto_item *ti)
2277 proto_item *xid_tree;
2278 guint8 flag1/*, flag2*/;
2279 guint8 len8;
2280 int max_length;
2282 max_length = offset + xid_length;
2283 xid_tree = proto_item_add_subtree(ti, ett_args);
2284 flag1 = tvb_get_guint8(tvb, offset);
2285 /*flag2 = tvb_get_guint8(tvb, offset+1);*/
2286 proto_tree_add_item(xid_tree, hf_amqp_0_10_argument_packing_flags,
2287 tvb, offset, 2, ENC_BIG_ENDIAN);
2288 AMQP_INCREMENT(offset, 2, max_length);
2289 if (flag1 & 0x01) {
2290 /* format (uint32) */
2291 proto_tree_add_item(xid_tree,
2292 hf_amqp_0_10_dtx_xid_format,
2293 tvb, offset, 4, ENC_BIG_ENDIAN);
2294 AMQP_INCREMENT(offset, 4, max_length);
2296 if (flag1 & 0x02) {
2297 /* global-id (vbin8) */
2298 len8 = tvb_get_guint8(tvb, offset);
2299 if ((offset + 1 + len8) > max_length)
2300 THROW(ReportedBoundsError);
2301 proto_tree_add_item(xid_tree,
2302 hf_amqp_0_10_dtx_xid_global_id,
2303 tvb, offset + 1, len8, ENC_NA);
2304 AMQP_INCREMENT(offset, (1 + len8), max_length);
2306 if (flag1 & 0x04) {
2307 /* branch-id (vbin8) */
2308 len8 = tvb_get_guint8(tvb, offset);
2309 if ((offset + 1 + len8) > max_length)
2310 THROW(ReportedBoundsError);
2311 proto_tree_add_item(xid_tree,
2312 hf_amqp_0_10_dtx_xid_branch_id,
2313 tvb, offset + 1, len8, ENC_NA);
2314 AMQP_INCREMENT(offset, (1 + len8), max_length);
2318 /* Dissection routine for AMQP 0-10 frames */
2320 static void
2321 dissect_amqp_0_10_connection(tvbuff_t *tvb,
2322 packet_info *pinfo,
2323 proto_tree *tree,
2324 int offset, guint16 length)
2326 proto_item *args_tree;
2327 proto_item *ti;
2328 proto_item *flags_item;
2329 guint8 method;
2330 guint8 flag1, flag2; /* args struct packing flags */
2331 guint32 arg_length;
2332 int flags_offset;
2333 const gchar *method_name;
2335 method = tvb_get_guint8(tvb, offset+1);
2336 method_name = val_to_str_const(method, amqp_0_10_connection_methods,
2337 "<invalid connection method>");
2338 col_append_str(pinfo->cinfo, COL_INFO, method_name);
2339 col_append_str(pinfo->cinfo, COL_INFO, " ");
2340 col_set_fence(pinfo->cinfo, COL_INFO);
2342 proto_tree_add_item(tree, hf_amqp_0_10_connection_method,
2343 tvb, offset+1, 1, ENC_BIG_ENDIAN);
2344 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
2345 tvb, offset + 2, length - 2, ENC_NA);
2346 args_tree = proto_item_add_subtree(ti, ett_args);
2347 AMQP_INCREMENT(offset, 2, length);
2349 * The flag bits are a simple bit string, not a net-byte-order
2350 * field. tvb_get_bits16() doesn't know how to do little-endian
2351 * at this time, so just pick out two bytes.
2353 flags_offset = offset;
2354 flag1 = tvb_get_guint8(tvb, offset);
2355 flag2 = tvb_get_guint8(tvb, offset+1);
2356 flags_item = proto_tree_add_item(args_tree,
2357 hf_amqp_0_10_argument_packing_flags,
2358 tvb, offset, 2, ENC_BIG_ENDIAN);
2359 AMQP_INCREMENT(offset, 2, length);
2360 switch (method) {
2361 case AMQP_0_10_METHOD_CONNECTION_START:
2362 if ((flag1 & ~0x07) || (flag2 != 0))
2363 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2364 if (flag1 & 0x01) {
2365 /* server-properties (map) */
2366 arg_length = tvb_get_ntohl(tvb, offset);
2367 AMQP_INCREMENT(offset, 4, length);
2368 ti = proto_tree_add_item(args_tree,
2369 hf_amqp_method_connection_start_server_properties,
2370 tvb,
2371 offset,
2372 arg_length, ENC_NA);
2373 dissect_amqp_0_10_map (tvb,
2374 offset,
2375 offset + arg_length,
2376 arg_length,
2377 ti);
2378 AMQP_INCREMENT(offset, arg_length, length);
2380 if (flag1 & 0x02) {
2381 /* mechanisms (str16-array) */
2382 arg_length = tvb_get_ntohl(tvb, offset);
2383 AMQP_INCREMENT(offset, 4, length);
2384 ti = proto_tree_add_item(args_tree,
2385 hf_amqp_0_10_method_connection_start_mechanisms,
2386 tvb,
2387 offset,
2388 arg_length, ENC_NA);
2389 dissect_amqp_0_10_array (tvb,
2390 pinfo,
2391 offset,
2392 offset + arg_length,
2393 arg_length,
2394 ti);
2395 AMQP_INCREMENT(offset, arg_length, length);
2397 if (flag1 & 0x04) {
2398 /* locales (str16-array) */
2399 arg_length = tvb_get_ntohl(tvb, offset);
2400 AMQP_INCREMENT(offset, 4, length);
2401 ti = proto_tree_add_item(args_tree,
2402 hf_amqp_0_10_method_connection_start_locales,
2403 tvb,
2404 offset,
2405 arg_length, ENC_NA);
2406 dissect_amqp_0_10_array (tvb,
2407 pinfo,
2408 offset,
2409 offset + arg_length,
2410 arg_length,
2411 ti);
2412 AMQP_INCREMENT(offset, arg_length, length);
2414 break;
2416 case AMQP_0_10_METHOD_CONNECTION_START_OK:
2417 if ((flag1 & ~0x0f) || (flag2 != 0))
2418 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2419 if (flag1 & 0x01) {
2420 /* client-properties (map) */
2421 arg_length = tvb_get_ntohl(tvb, offset);
2422 AMQP_INCREMENT(offset, 4, length);
2423 ti = proto_tree_add_item(args_tree,
2424 hf_amqp_method_connection_start_ok_client_properties,
2425 tvb,
2426 offset,
2427 arg_length, ENC_NA);
2428 dissect_amqp_0_10_map (tvb,
2429 offset,
2430 offset + arg_length,
2431 arg_length,
2432 ti);
2433 AMQP_INCREMENT(offset, arg_length, length);
2435 if (flag1 & 0x02) {
2436 /* mechanism (str8) */
2437 proto_tree_add_item(args_tree,
2438 hf_amqp_method_connection_start_ok_mechanism,
2439 tvb, offset + 1, tvb_get_guint8(tvb, offset),
2440 ENC_ASCII|ENC_NA);
2441 AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), length);
2443 if (flag1 & 0x04) {
2444 /* response (vbin32) */
2445 proto_tree_add_item(args_tree,
2446 hf_amqp_method_connection_start_ok_response,
2447 tvb, offset + 4, tvb_get_ntohl(tvb, offset),
2448 ENC_NA);
2449 AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), length);
2451 if (flag1 & 0x08) {
2452 /* locale (str8) */
2453 proto_tree_add_item(args_tree,
2454 hf_amqp_method_connection_start_ok_locale,
2455 tvb, offset + 1, tvb_get_guint8(tvb, offset),
2456 ENC_ASCII|ENC_NA);
2457 AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), length);
2459 break;
2461 case AMQP_0_10_METHOD_CONNECTION_SECURE:
2462 if ((flag1 & ~0x01) || (flag2 != 0))
2463 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2464 if (flag1 & 0x01) {
2465 /* challenge (vbin32) */
2466 proto_tree_add_item(args_tree,
2467 hf_amqp_method_connection_secure_challenge,
2468 tvb, offset + 4, tvb_get_ntohl(tvb, offset),
2469 ENC_NA);
2470 AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), length);
2472 break;
2474 case AMQP_0_10_METHOD_CONNECTION_SECURE_OK:
2475 if ((flag1 & ~0x01) || (flag2 != 0))
2476 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2477 if (flag1 & 0x01) {
2478 /* response (vbin32) */
2479 proto_tree_add_item(args_tree,
2480 hf_amqp_method_connection_secure_ok_response,
2481 tvb, offset + 4, tvb_get_ntohl(tvb, offset),
2482 ENC_NA);
2483 AMQP_INCREMENT(offset, 4 + tvb_get_ntohl(tvb, offset), length);
2485 break;
2487 case AMQP_0_10_METHOD_CONNECTION_TUNE:
2488 if ((flag1 & ~0x0f) || (flag2 != 0))
2489 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2490 if (flag1 & 0x01) {
2491 /* channel-max (uint16) */
2492 proto_tree_add_item(args_tree,
2493 hf_amqp_method_connection_tune_channel_max,
2494 tvb, offset, 2, ENC_BIG_ENDIAN);
2495 AMQP_INCREMENT(offset, 2, length);
2497 if (flag1 & 0x02) {
2498 /* max-frame-size (uint16) */
2499 proto_tree_add_item(args_tree,
2500 hf_amqp_0_10_method_connection_tune_frame_max,
2501 tvb, offset, 2, ENC_BIG_ENDIAN);
2502 AMQP_INCREMENT(offset, 2, length);
2504 if (flag1 & 0x04) {
2505 /* heartbeat-min (uint16) */
2506 proto_tree_add_item(args_tree,
2507 hf_amqp_0_10_method_connection_tune_heartbeat_min,
2508 tvb, offset, 2, ENC_BIG_ENDIAN);
2509 AMQP_INCREMENT(offset, 2, length);
2511 if (flag1 & 0x08) {
2512 /* heartbeat-max (uint16) */
2513 proto_tree_add_item(args_tree,
2514 hf_amqp_0_10_method_connection_tune_heartbeat_max,
2515 tvb, offset, 2, ENC_BIG_ENDIAN);
2516 AMQP_INCREMENT(offset, 2, length);
2518 break;
2520 case AMQP_0_10_METHOD_CONNECTION_TUNE_OK:
2521 if ((flag1 & ~0x07) || (flag2 != 0))
2522 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2523 if (flag1 & 0x01) {
2524 /* channel-max (uint16) */
2525 proto_tree_add_item(args_tree,
2526 hf_amqp_method_connection_tune_ok_channel_max,
2527 tvb, offset, 2, ENC_BIG_ENDIAN);
2528 AMQP_INCREMENT(offset, 2, length);
2530 if (flag1 & 0x02) {
2531 /* max-frame-size (uint16) */
2532 proto_tree_add_item(args_tree,
2533 hf_amqp_0_10_method_connection_tune_ok_frame_max,
2534 tvb, offset, 2, ENC_BIG_ENDIAN);
2535 AMQP_INCREMENT(offset, 2, length);
2537 if (flag1 & 0x04) {
2538 /* heartbeat (uint16) */
2539 proto_tree_add_item(args_tree,
2540 hf_amqp_method_connection_tune_ok_heartbeat,
2541 tvb, offset, 2, ENC_BIG_ENDIAN);
2542 AMQP_INCREMENT(offset, 2, length);
2544 break;
2546 case AMQP_0_10_METHOD_CONNECTION_OPEN:
2547 if ((flag1 & ~0x07) || (flag2 != 0))
2548 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2549 if (flag1 & 0x01) {
2550 /* virtual-host (str8) */
2551 proto_tree_add_item(args_tree,
2552 hf_amqp_method_connection_open_virtual_host,
2553 tvb,
2554 offset + 1,
2555 tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
2556 AMQP_INCREMENT(offset, tvb_get_guint8(tvb, offset) + 1, length);
2558 if (flag1 & 0x02) {
2559 /* capabilities (str16-array) */
2560 arg_length = tvb_get_ntohl(tvb, offset);
2561 AMQP_INCREMENT(offset, 4, length);
2562 ti = proto_tree_add_item(args_tree,
2563 hf_amqp_0_10_method_connection_open_capabilities,
2564 tvb,
2565 offset,
2566 arg_length, ENC_NA);
2567 dissect_amqp_0_10_array (tvb,
2568 pinfo,
2569 offset,
2570 offset + arg_length,
2571 arg_length,
2572 ti);
2573 AMQP_INCREMENT(offset, arg_length, length);
2576 * 3rd argument is an optional bit, insist.
2578 proto_tree_add_item(args_tree,
2579 hf_amqp_0_10_method_connection_open_insist,
2580 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2581 break;
2583 case AMQP_0_10_METHOD_CONNECTION_OPEN_OK:
2584 if ((flag1 & ~0x01) || (flag2 != 0))
2585 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2586 if (flag1 & 0x01) {
2587 /* known-hosts (amqp-host-array) */
2588 arg_length = tvb_get_ntohl(tvb, offset);
2589 AMQP_INCREMENT(offset, 4, length);
2590 ti = proto_tree_add_item(args_tree,
2591 hf_amqp_0_10_method_connection_open_ok_known_hosts,
2592 tvb,
2593 offset,
2594 arg_length, ENC_NA);
2595 dissect_amqp_0_10_array (tvb,
2596 pinfo,
2597 offset,
2598 offset + arg_length,
2599 arg_length,
2600 ti);
2601 AMQP_INCREMENT(offset, arg_length, length);
2603 break;
2605 case AMQP_0_10_METHOD_CONNECTION_REDIRECT:
2606 if ((flag1 & ~0x03) || (flag2 != 0))
2607 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2608 if (flag1 & 0x01) {
2609 /* host (amqp-host-url [str16]) */
2610 proto_tree_add_item(args_tree,
2611 hf_amqp_method_connection_redirect_host,
2612 tvb, offset + 2, tvb_get_ntohs(tvb, offset),
2613 ENC_ASCII|ENC_NA);
2614 AMQP_INCREMENT(offset, 2 + tvb_get_ntohs(tvb, offset), length);
2616 if (flag1 & 0x02) {
2617 /* known-hosts (amqp-host-array) */
2618 arg_length = tvb_get_ntohl(tvb, offset);
2619 AMQP_INCREMENT(offset, 4, length);
2620 ti = proto_tree_add_item(args_tree,
2621 hf_amqp_0_10_method_connection_redirect_known_hosts,
2622 tvb,
2623 offset,
2624 arg_length, ENC_NA);
2625 dissect_amqp_0_10_array (tvb,
2626 pinfo,
2627 offset,
2628 offset + arg_length,
2629 arg_length,
2630 ti);
2631 AMQP_INCREMENT(offset, arg_length, length);
2633 break;
2635 case AMQP_0_10_METHOD_CONNECTION_HEARTBEAT:
2636 break;
2638 case AMQP_0_10_METHOD_CONNECTION_CLOSE:
2639 if ((flag1 & ~0x03) || (flag2 != 0))
2640 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2641 if (flag1 & 0x01) {
2642 /* reply-code (uint16) */
2643 proto_tree_add_item(args_tree,
2644 hf_amqp_0_10_method_connection_close_reply_code,
2645 tvb, offset, 2, ENC_BIG_ENDIAN);
2646 AMQP_INCREMENT(offset, 2, length);
2648 if (flag1 & 0x02) {
2649 /* reply-text (str8) */
2650 proto_tree_add_item(args_tree,
2651 hf_amqp_method_connection_close_reply_text,
2652 tvb, offset + 1, tvb_get_guint8(tvb, offset),
2653 ENC_ASCII|ENC_NA);
2654 AMQP_INCREMENT(offset, 1 + tvb_get_guint8(tvb, offset), length);
2656 break;
2658 case AMQP_0_10_METHOD_CONNECTION_CLOSE_OK:
2659 break;
2663 static void
2664 dissect_amqp_0_10_session(tvbuff_t *tvb,
2665 packet_info *pinfo,
2666 proto_tree *tree,
2667 int offset, guint16 length)
2669 proto_item *args_tree;
2670 proto_item *ti;
2671 proto_item *flags_item;
2672 guint8 method;
2673 guint8 flag1, flag2;
2674 guint16 size;
2675 guint32 array_size;
2676 int flags_offset;
2677 const gchar *method_name;
2679 method = tvb_get_guint8(tvb, offset+1);
2680 method_name = val_to_str_const(method, amqp_0_10_session_methods,
2681 "<invalid session method>");
2682 col_append_str(pinfo->cinfo, COL_INFO, method_name);
2683 col_append_str(pinfo->cinfo, COL_INFO, " ");
2684 col_set_fence(pinfo->cinfo, COL_INFO);
2686 proto_tree_add_item(tree, hf_amqp_0_10_session_method,
2687 tvb, offset+1, 1, ENC_BIG_ENDIAN);
2688 AMQP_INCREMENT(offset, 2, length);
2690 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
2691 tvb, offset, length - 2, ENC_NA);
2692 args_tree = proto_item_add_subtree(ti, ett_args);
2694 * The flag bits are a simple bit string, not a net-byte-order
2695 * field. tvb_get_bits16() doesn't know how to do little-endian
2696 * at this time, so just pick out two bytes.
2698 flags_offset = offset;
2699 flag1 = tvb_get_guint8(tvb, offset);
2700 flag2 = tvb_get_guint8(tvb, offset+1);
2701 flags_item = proto_tree_add_item(args_tree,
2702 hf_amqp_0_10_argument_packing_flags,
2703 tvb, offset, 2, ENC_BIG_ENDIAN);
2704 AMQP_INCREMENT(offset, 2, length);
2705 switch (method) {
2706 case AMQP_0_10_METHOD_SESSION_ATTACH:
2707 if ((flag1 & ~0x03) || ((flag2 != 0)))
2708 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2709 if (flag1 & 0x01) {
2710 /* name (vbin16) */
2711 size = tvb_get_ntohs(tvb, offset);
2712 AMQP_INCREMENT(offset, 2, length);
2713 proto_tree_add_item(args_tree,
2714 hf_amqp_0_10_method_session_attach_name,
2715 tvb, offset, size, ENC_NA);
2716 AMQP_INCREMENT(offset, size, length);
2719 * 2nd argument is an optional bit, force.
2721 proto_tree_add_item(args_tree,
2722 hf_amqp_0_10_method_session_attach_force,
2723 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2724 break;
2726 case AMQP_0_10_METHOD_SESSION_ATTACHED:
2727 case AMQP_0_10_METHOD_SESSION_DETACH:
2728 if ((flag1 != 0x01) || (flag2 != 0))
2729 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2730 if (flag1 & 0x01) {
2731 /* name (vbin16) */
2732 size = tvb_get_ntohs(tvb, offset);
2733 AMQP_INCREMENT(offset, 2, length);
2734 proto_tree_add_item(args_tree,
2735 hf_amqp_0_10_method_session_attach_name,
2736 tvb, offset, size, ENC_NA);
2737 AMQP_INCREMENT(offset, size, length);
2739 break;
2741 case AMQP_0_10_METHOD_SESSION_DETACHED:
2742 if ((flag1 & ~0x03) || (flag2 != 0))
2743 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2744 if (flag1 & 0x01) {
2745 /* name (vbin16) */
2746 size = tvb_get_ntohs(tvb, offset);
2747 AMQP_INCREMENT(offset, 2, length);
2748 proto_tree_add_item(args_tree,
2749 hf_amqp_0_10_method_session_attach_name,
2750 tvb, offset, size, ENC_NA);
2751 AMQP_INCREMENT(offset, size, length);
2753 if (flag1 & 0x02) {
2754 /* code (detach-code [uint8]) */
2755 proto_tree_add_item(args_tree,
2756 hf_amqp_0_10_method_session_detached_code,
2757 tvb, offset, 1, ENC_BIG_ENDIAN);
2758 AMQP_INCREMENT(offset, 1, length);
2760 break;
2762 case AMQP_0_10_METHOD_SESSION_REQUEST_TIMEOUT:
2763 case AMQP_0_10_METHOD_SESSION_TIMEOUT:
2764 if ((flag1 & ~0x01) || (flag2 != 0))
2765 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2766 if (flag1 & 0x01) {
2767 /* timeout (uint32) */
2768 proto_tree_add_item(args_tree,
2769 hf_amqp_0_10_method_session_timeout,
2770 tvb, offset, 4, ENC_BIG_ENDIAN);
2771 AMQP_INCREMENT(offset, 4, length);
2773 break;
2775 case AMQP_0_10_METHOD_SESSION_COMMAND_POINT:
2776 if ((flag1 & ~0x03) || (flag2 != 0))
2777 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2778 if (flag1 & 0x01) {
2779 /* command-id (sequence-no [uint32]) */
2780 proto_tree_add_item(args_tree,
2781 hf_amqp_0_10_method_session_command_point_id,
2782 tvb, offset, 4, ENC_BIG_ENDIAN);
2783 AMQP_INCREMENT(offset, 4, length);
2785 if (flag1 & 0x02) {
2786 /* command-offset (uint64) */
2787 proto_tree_add_item(args_tree,
2788 hf_amqp_0_10_method_session_command_point_offset,
2789 tvb, offset, 8, ENC_BIG_ENDIAN);
2790 AMQP_INCREMENT(offset, 8, length);
2792 break;
2794 case AMQP_0_10_METHOD_SESSION_EXPECTED:
2795 if ((flag1 & ~0x03) || (flag2 != 0))
2796 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2797 if (flag1 & 0x01) {
2798 /* commands (commands [sequence-set]) */
2799 size = tvb_get_ntohs(tvb, offset);
2800 if ((offset + 2 + size) > length)
2801 THROW(ReportedBoundsError);
2802 ti = proto_tree_add_item(args_tree,
2803 hf_amqp_0_10_method_session_commands,
2804 tvb, offset, size + 2, ENC_NA);
2805 AMQP_INCREMENT(offset, 2, length);
2806 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
2807 AMQP_INCREMENT(offset, size + 2, length);
2809 if (flag1 & 0x02) {
2810 /* fragments (command-fragments [array of command-fragment]) */
2811 array_size = tvb_get_ntohl(tvb, offset);
2812 if ((offset + 4 + array_size) > length)
2813 THROW(ReportedBoundsError);
2814 ti = proto_tree_add_item(args_tree,
2815 hf_amqp_0_10_method_session_fragments,
2816 tvb, offset, array_size + 4, ENC_NA);
2817 AMQP_INCREMENT(offset, 4, length);
2818 dissect_amqp_0_10_array(tvb,
2819 pinfo,
2820 offset,
2821 offset + array_size,
2822 length,
2823 ti);
2824 AMQP_INCREMENT(offset, array_size, length);
2826 break;
2828 case AMQP_0_10_METHOD_SESSION_CONFIRMED:
2829 if ((flag1 & ~0x03) || (flag2 != 0))
2830 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2831 if (flag1 & 0x01) {
2832 /* commands (commands [sequence-set]) */
2833 size = tvb_get_ntohs(tvb, offset);
2834 if ((offset + 2 + size) > length)
2835 THROW(ReportedBoundsError);
2836 ti = proto_tree_add_item(args_tree,
2837 hf_amqp_0_10_method_session_commands,
2838 tvb, offset, size + 2, ENC_NA);
2839 AMQP_INCREMENT(offset, 2, length);
2840 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
2841 AMQP_INCREMENT(offset, size + 2, length);
2843 if (flag1 & 0x02) {
2844 /* fragments (command-fragments [array of command-fragment]) */
2845 array_size = tvb_get_ntohl(tvb, offset);
2846 if ((offset + 4 + array_size) > length)
2847 THROW(ReportedBoundsError);
2848 ti = proto_tree_add_item(args_tree,
2849 hf_amqp_0_10_method_session_fragments,
2850 tvb, offset, array_size + 4, ENC_NA);
2851 AMQP_INCREMENT(offset, 4, length);
2852 dissect_amqp_0_10_array(tvb,
2853 pinfo,
2854 offset,
2855 offset + array_size,
2856 length,
2857 ti);
2858 AMQP_INCREMENT(offset, array_size, length);
2860 break;
2862 case AMQP_0_10_METHOD_SESSION_COMPLETED:
2863 if ((flag1 & ~0x03) || (flag2 != 0))
2864 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2865 if (flag1 & 0x01) {
2866 /* commands (commands [sequence-set]) */
2867 size = tvb_get_ntohs(tvb, offset);
2868 if ((offset + 2 + size) > length)
2869 THROW(ReportedBoundsError);
2870 ti = proto_tree_add_item(args_tree,
2871 hf_amqp_0_10_method_session_commands,
2872 tvb, offset, size + 2, ENC_NA);
2873 AMQP_INCREMENT(offset, 2, length);
2874 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
2875 AMQP_INCREMENT(offset, size, length);
2878 * 2nd argument is an optional bit, timely-reply.
2880 proto_tree_add_item(args_tree,
2881 hf_amqp_0_10_method_session_completed_timely,
2882 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2883 break;
2885 case AMQP_0_10_METHOD_SESSION_KNOWN_COMPLETED:
2886 if ((flag1 & ~0x01) || (flag2 != 0))
2887 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2888 if (flag1 & 0x01) {
2889 /* commands (commands [sequence-set]) */
2890 size = tvb_get_ntohs(tvb, offset);
2891 if ((offset + 2 + size) > length)
2892 THROW(ReportedBoundsError);
2893 ti = proto_tree_add_item(args_tree,
2894 hf_amqp_0_10_method_session_commands,
2895 tvb, offset, size + 2, ENC_NA);
2896 AMQP_INCREMENT(offset, 2, length);
2897 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
2898 AMQP_INCREMENT(offset, size, length);
2900 break;
2902 case AMQP_0_10_METHOD_SESSION_FLUSH:
2903 if ((flag1 & ~0x07) || (flag2 != 0))
2904 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2905 proto_tree_add_item(args_tree,
2906 hf_amqp_0_10_method_session_flush_expected,
2907 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2908 proto_tree_add_item(args_tree,
2909 hf_amqp_0_10_method_session_flush_confirmed,
2910 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2911 proto_tree_add_item(args_tree,
2912 hf_amqp_0_10_method_session_flush_completed,
2913 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
2914 break;
2916 case AMQP_0_10_METHOD_SESSION_GAP:
2917 if ((flag1 & ~0x01) || (flag2 != 0))
2918 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2919 if (flag1 & 0x01) {
2920 /* commands (commands [sequence-set]) */
2921 size = tvb_get_ntohs(tvb, offset);
2922 if ((offset + 2 + size) > length)
2923 THROW(ReportedBoundsError);
2924 ti = proto_tree_add_item(args_tree,
2925 hf_amqp_0_10_method_session_commands,
2926 tvb, offset, size + 2, ENC_NA);
2927 AMQP_INCREMENT(offset, 2, length);
2928 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
2929 AMQP_INCREMENT(offset, size + 2, length);
2931 break;
2936 static void
2937 dissect_amqp_0_10_execution(tvbuff_t *tvb,
2938 packet_info *pinfo,
2939 proto_tree *tree,
2940 int offset, guint16 length)
2942 proto_item *args_tree;
2943 proto_item *ti;
2944 proto_item *flags_item;
2945 guint8 amqp_class = 0, method;
2946 guint8 flag1, flag2;
2947 guint16 size;
2948 guint32 struct_size;
2949 int class_hf;
2950 const gchar *method_name;
2952 method = tvb_get_guint8(tvb, offset+1);
2953 method_name = val_to_str_const(method, amqp_0_10_execution_methods,
2954 "<invalid execution method>");
2955 col_append_str(pinfo->cinfo, COL_INFO, method_name);
2956 col_append_str(pinfo->cinfo, COL_INFO, " ");
2957 col_set_fence(pinfo->cinfo, COL_INFO);
2959 proto_tree_add_item(tree, hf_amqp_0_10_execution_method,
2960 tvb, offset+1, 1, ENC_BIG_ENDIAN);
2961 AMQP_INCREMENT(offset, 2, length);
2963 * Session header is 2 bytes; one that tells that it's 1 byte long, then
2964 * the byte itself. Bit 0 is sync.
2966 flag1 = tvb_get_guint8(tvb, offset);
2967 flag2 = tvb_get_guint8(tvb, offset+1);
2968 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
2969 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
2970 else
2971 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
2972 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
2973 AMQP_INCREMENT(offset, 2, length);
2975 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
2976 tvb, offset, length - 4, ENC_NA);
2977 args_tree = proto_item_add_subtree(ti, ett_args);
2979 * The flag bits are a simple bit string, not a net-byte-order
2980 * field. tvb_get_bits16() doesn't know how to do little-endian
2981 * at this time, so just pick out two bytes.
2983 flag1 = tvb_get_guint8(tvb, offset);
2984 flag2 = tvb_get_guint8(tvb, offset+1);
2985 flags_item = proto_tree_add_item(args_tree,
2986 hf_amqp_0_10_argument_packing_flags,
2987 tvb, offset, 2, ENC_BIG_ENDIAN);
2988 AMQP_INCREMENT(offset, 2, length);
2989 switch (method) {
2990 case AMQP_0_10_METHOD_EXECUTION_SYNC:
2991 if ((flag1 != 0) || (flag2 != 0))
2992 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2993 break;
2995 case AMQP_0_10_METHOD_EXECUTION_RESULT:
2996 if ((flag1 & ~0x03) || (flag2 != 0))
2997 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
2998 if (flag1 & 0x01) {
2999 /* command-id (sequence-no [uint32]) */
3000 proto_tree_add_item(args_tree,
3001 hf_amqp_0_10_method_execution_command_id,
3002 tvb, offset, 4, ENC_BIG_ENDIAN);
3003 AMQP_INCREMENT(offset, 4, length);
3005 if (flag1 & 0x02) {
3006 /* value (struct32) */
3007 struct_size = tvb_get_ntohl(tvb, offset);
3008 AMQP_INCREMENT(offset, 4, length);
3009 if ((offset + struct_size) > length)
3010 THROW(ReportedBoundsError);
3011 ti = proto_tree_add_item(args_tree,
3012 hf_amqp_0_10_undissected_struct32,
3013 tvb, offset, struct_size, ENC_NA);
3014 dissect_amqp_0_10_struct32(tvb, pinfo, ti, offset, struct_size);
3015 AMQP_INCREMENT(offset, struct_size, length);
3017 break;
3019 case AMQP_0_10_METHOD_EXECUTION_EXCEPTION:
3020 if ((flag1 & ~0x7f) || (flag2 != 0))
3021 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3022 if (flag1 & 0x01) {
3023 /* error-code (error-code [uint16]) */
3024 proto_tree_add_item(args_tree,
3025 hf_amqp_0_10_method_execution_exception_error,
3026 tvb, offset, 2, ENC_BIG_ENDIAN);
3027 AMQP_INCREMENT(offset, 2, length);
3029 if (flag1 & 0x02) {
3030 /* command-id (sequence-no [uint32]) */
3031 proto_tree_add_item(args_tree,
3032 hf_amqp_0_10_method_execution_command_id,
3033 tvb, offset, 4, ENC_BIG_ENDIAN);
3034 AMQP_INCREMENT(offset, 4, length);
3036 if (flag1 & 0x04) {
3037 /* class-code (uint8) */
3038 amqp_class = tvb_get_guint8(tvb, offset);
3039 proto_tree_add_item(args_tree, hf_amqp_0_10_class,
3040 tvb, offset, 1, ENC_BIG_ENDIAN);
3041 AMQP_INCREMENT(offset, 1, length);
3043 if (flag1 & 0x08) {
3044 /* command-code (uint8) */
3045 switch(amqp_class) {
3046 case AMQP_0_10_CLASS_CONNECTION:
3047 class_hf = hf_amqp_0_10_connection_method;
3048 break;
3049 case AMQP_0_10_CLASS_SESSION:
3050 class_hf = hf_amqp_0_10_session_method;
3051 break;
3052 case AMQP_0_10_CLASS_EXECUTION:
3053 class_hf = hf_amqp_0_10_execution_method;
3054 break;
3055 case AMQP_0_10_CLASS_MESSAGE:
3056 class_hf = hf_amqp_0_10_message_method;
3057 break;
3058 case AMQP_0_10_CLASS_TX:
3059 class_hf = hf_amqp_0_10_tx_method;
3060 break;
3061 case AMQP_0_10_CLASS_DTX:
3062 class_hf = hf_amqp_0_10_dtx_method;
3063 break;
3064 case AMQP_0_10_CLASS_EXCHANGE:
3065 class_hf = hf_amqp_0_10_exchange_method;
3066 break;
3067 case AMQP_0_10_CLASS_QUEUE:
3068 class_hf = hf_amqp_0_10_queue_method;
3069 break;
3070 case AMQP_0_10_CLASS_FILE:
3071 class_hf = hf_amqp_0_10_file_method;
3072 break;
3073 case AMQP_0_10_CLASS_STREAM:
3074 class_hf = hf_amqp_0_10_stream_method;
3075 break;
3076 default:
3077 class_hf = -1;
3078 break;
3080 if (class_hf != -1)
3081 proto_tree_add_item(args_tree, class_hf,
3082 tvb, offset, 1, ENC_BIG_ENDIAN);
3083 else
3084 expert_add_info_format(pinfo, args_tree, &ei_amqp_invalid_class_code, "Invalid class code %x", amqp_class);
3085 AMQP_INCREMENT(offset, 1, length);
3087 if (flag1 & 0x10) {
3088 /* field-index (uint8) */
3089 proto_tree_add_item(args_tree, hf_amqp_0_10_method_execution_field_index,
3090 tvb, offset, 1, ENC_BIG_ENDIAN);
3091 AMQP_INCREMENT(offset, 1, length);
3093 if (flag1 & 0x20) {
3094 /* description (str16) */
3095 size = tvb_get_ntohs(tvb, offset);
3096 if ((offset + 2 + size) > length)
3097 THROW(ReportedBoundsError);
3098 proto_tree_add_item(args_tree, hf_amqp_0_10_method_execution_description,
3099 tvb, offset + 2, size, ENC_ASCII|ENC_NA);
3100 AMQP_INCREMENT(offset, (2 + size), length);
3102 if (flag1 & 0x40) {
3103 /* error-info (map) */
3104 struct_size = tvb_get_ntohl(tvb, offset);
3105 AMQP_INCREMENT(offset, 4, length);
3106 ti = proto_tree_add_item(args_tree,
3107 hf_amqp_0_10_method_execution_error_info,
3108 tvb,
3109 offset,
3110 struct_size, ENC_NA);
3111 dissect_amqp_0_10_map (tvb,
3112 offset,
3113 offset + struct_size,
3114 struct_size,
3115 ti);
3116 AMQP_INCREMENT(offset, struct_size, length);
3118 break;
3122 static void
3123 dissect_amqp_0_10_message(tvbuff_t *tvb,
3124 packet_info *pinfo,
3125 proto_tree *tree,
3126 int offset, guint16 length)
3128 proto_item *args_tree;
3129 proto_item *ti;
3130 proto_item *flags_item;
3131 guint8 method, str_size;
3132 guint8 flag1, flag2;
3133 guint16 size;
3134 guint32 map_size;
3135 int flags_offset;
3136 const gchar *method_name;
3138 method = tvb_get_guint8(tvb, offset+1);
3139 method_name = val_to_str_const(method, amqp_0_10_message_methods,
3140 "<invalid message method>");
3141 col_append_str(pinfo->cinfo, COL_INFO, method_name);
3142 col_append_str(pinfo->cinfo, COL_INFO, " ");
3143 col_set_fence(pinfo->cinfo, COL_INFO);
3145 proto_tree_add_item(tree, hf_amqp_0_10_message_method,
3146 tvb, offset+1, 1, ENC_BIG_ENDIAN);
3147 AMQP_INCREMENT(offset, 2, length);
3149 * Session header is 2 bytes; one that tells that it's 1 byte long, then
3150 * the byte itself. Bit 0 is sync.
3152 flag1 = tvb_get_guint8(tvb, offset);
3153 flag2 = tvb_get_guint8(tvb, offset+1);
3154 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
3155 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
3156 else
3157 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
3158 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3159 AMQP_INCREMENT(offset, 2, length);
3161 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
3162 tvb, offset, length - 4, ENC_NA);
3163 args_tree = proto_item_add_subtree(ti, ett_args);
3165 * The flag bits are a simple bit string, not a net-byte-order
3166 * field. tvb_get_bits16() doesn't know how to do little-endian
3167 * at this time, so just pick out two bytes.
3169 flags_offset = offset;
3170 flag1 = tvb_get_guint8(tvb, offset);
3171 flag2 = tvb_get_guint8(tvb, offset+1);
3172 flags_item = proto_tree_add_item(args_tree,
3173 hf_amqp_0_10_argument_packing_flags,
3174 tvb, offset, 2, ENC_BIG_ENDIAN);
3175 AMQP_INCREMENT(offset, 2, length);
3176 switch (method) {
3177 case AMQP_0_10_METHOD_MESSAGE_TRANSFER:
3178 if ((flag1 & ~0x07) || (flag2 != 0))
3179 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3180 if (flag1 & 0x01) { /* destination (str8) */
3181 str_size = tvb_get_guint8(tvb, offset);
3182 if ((offset + 1 + str_size) > length)
3183 THROW(ReportedBoundsError);
3184 proto_tree_add_item(args_tree,
3185 hf_amqp_0_10_method_message_transfer_destination,
3186 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3187 AMQP_INCREMENT(offset, (1 + str_size), length);
3189 if (flag1 & 0x02) { /* accept-mode (accept-mode [uint8]) */
3190 proto_tree_add_item(args_tree,
3191 hf_amqp_0_10_method_message_transfer_accept_mode,
3192 tvb, offset, 1, ENC_BIG_ENDIAN);
3193 AMQP_INCREMENT(offset, 1, length);
3195 if (flag1 & 0x04) { /* acquire-mode (acquire-mode [uint8]) */
3196 proto_tree_add_item(args_tree,
3197 hf_amqp_0_10_method_message_transfer_acquire_mode,
3198 tvb, offset, 1, ENC_BIG_ENDIAN);
3199 AMQP_INCREMENT(offset, 1, length);
3201 break;
3203 case AMQP_0_10_METHOD_MESSAGE_ACCEPT:
3204 if ((flag1 & ~0x01) || (flag2 != 0))
3205 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3206 if (flag1 & 0x01) {
3207 /* transfers (session.commands [sequence-set]) */
3208 size = tvb_get_ntohs(tvb, offset);
3209 if ((offset + 2 + size) > length)
3210 THROW(ReportedBoundsError);
3211 ti = proto_tree_add_item(args_tree,
3212 hf_amqp_0_10_method_message_accept_transfers,
3213 tvb, offset, size + 2, ENC_NA);
3214 AMQP_INCREMENT(offset, 2, length);
3215 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
3216 AMQP_INCREMENT(offset, size, length);
3218 break;
3220 case AMQP_0_10_METHOD_MESSAGE_REJECT:
3221 if ((flag1 & ~0x07) || (flag2 != 0))
3222 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3223 if (flag1 & 0x01) {
3224 /* transfers (session.commands [sequence-set]) */
3225 size = tvb_get_ntohs(tvb, offset);
3226 THROW_ON(((offset + 2 + size) > length), ReportedBoundsError);
3227 ti = proto_tree_add_item(args_tree,
3228 hf_amqp_0_10_method_message_accept_transfers,
3229 tvb, offset, size + 2, ENC_NA);
3230 AMQP_INCREMENT(offset, 2, length);
3231 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
3232 AMQP_INCREMENT(offset, size, length);
3234 if (flag1 & 0x02) { /* reject-code (reject-code [uint16]) */
3235 proto_tree_add_item(args_tree,
3236 hf_amqp_0_10_method_message_transfer_reject_code,
3237 tvb, offset, 2, ENC_BIG_ENDIAN);
3238 AMQP_INCREMENT(offset, 2, length);
3240 if (flag1 & 0x04) { /* text (str8) */
3241 str_size = tvb_get_guint8(tvb, offset);
3242 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3243 proto_tree_add_item(args_tree,
3244 hf_amqp_0_10_method_message_reject_text,
3245 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3246 AMQP_INCREMENT(offset, (1 + str_size), length);
3248 break;
3250 case AMQP_0_10_METHOD_MESSAGE_RELEASE:
3251 if ((flag1 & ~0x03) || (flag2 != 0))
3252 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3253 if (flag1 & 0x01) {
3254 /* transfers (session.commands [sequence-set]) */
3255 size = tvb_get_ntohs(tvb, offset);
3256 THROW_ON(((offset + 2 + size) > length), ReportedBoundsError);
3257 proto_tree_add_item(args_tree,
3258 hf_amqp_0_10_method_message_accept_transfers,
3259 tvb, offset, size + 2, ENC_NA);
3260 AMQP_INCREMENT(offset, 2, length);
3261 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
3262 AMQP_INCREMENT(offset, size, length);
3265 * 2nd argument is an optional bit, set-redelivered.
3267 proto_tree_add_item(args_tree,
3268 hf_amqp_0_10_method_message_release_set_redelivered,
3269 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3270 break;
3272 case AMQP_0_10_METHOD_MESSAGE_ACQUIRE:
3273 if ((flag1 & ~0x01) || (flag2 != 0))
3274 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3275 if (flag1 & 0x01) {
3276 /* transfers (session.commands [sequence-set]) */
3277 size = tvb_get_ntohs(tvb, offset);
3278 THROW_ON(((offset + 2 + size) > length), ReportedBoundsError);
3279 proto_tree_add_item(args_tree,
3280 hf_amqp_0_10_method_message_accept_transfers,
3281 tvb, offset, size + 2, ENC_NA);
3282 AMQP_INCREMENT(offset, 2, length);
3283 format_amqp_0_10_sequence_set(tvb, offset, size, ti);
3284 AMQP_INCREMENT(offset, size, length);
3286 break;
3288 case AMQP_0_10_METHOD_MESSAGE_RESUME:
3289 if ((flag1 & ~0x03) || (flag2 != 0))
3290 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3291 if (flag1 & 0x01) {
3292 /* destination (destination [str8]) */
3293 str_size = tvb_get_guint8(tvb, offset);
3294 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3295 proto_tree_add_item(args_tree,
3296 hf_amqp_0_10_method_message_dest,
3297 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3298 AMQP_INCREMENT(offset, 1 + str_size, length);
3300 if (flag1 & 0x02) {
3301 /* resume-id (resume-id [str16]) */
3302 size = tvb_get_ntohs(tvb, offset);
3303 THROW_ON(((offset + 2 + size) > length), ReportedBoundsError);
3304 proto_tree_add_item(args_tree,
3305 hf_amqp_0_10_method_message_resume_id,
3306 tvb, offset + 2, size, ENC_ASCII|ENC_NA);
3307 AMQP_INCREMENT(offset, 2 + size, length);
3309 break;
3311 case AMQP_0_10_METHOD_MESSAGE_SUBSCRIBE:
3312 if (flag2 != 0)
3313 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3314 if (flag1 & 0x01) {
3315 /* queue (queue.name [str8]) */
3316 str_size = tvb_get_guint8(tvb, offset);
3317 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3318 proto_tree_add_item(args_tree,
3319 hf_amqp_0_10_method_message_subscribe_queue,
3320 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3321 AMQP_INCREMENT(offset, 1 + str_size, length);
3323 if (flag1 & 0x02) {
3324 /* destination (destination [str8]) */
3325 str_size = tvb_get_guint8(tvb, offset);
3326 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3327 proto_tree_add_item(args_tree,
3328 hf_amqp_0_10_method_message_dest,
3329 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3330 AMQP_INCREMENT(offset, 1 + str_size, length);
3332 if (flag1 & 0x04) { /* accept-mode (accept-mode [uint8]) */
3333 proto_tree_add_item(args_tree,
3334 hf_amqp_0_10_method_message_transfer_accept_mode,
3335 tvb, offset, 1, ENC_BIG_ENDIAN);
3336 AMQP_INCREMENT(offset, 1, length);
3338 if (flag1 & 0x08) { /* acquire-mode (acquire-mode [uint8]) */
3339 proto_tree_add_item(args_tree,
3340 hf_amqp_0_10_method_message_transfer_acquire_mode,
3341 tvb, offset, 1, ENC_BIG_ENDIAN);
3342 AMQP_INCREMENT(offset, 1, length);
3345 * 5th argument is an optional bit, exclusive.
3347 proto_tree_add_item(args_tree,
3348 hf_amqp_0_10_method_message_subscribe_exclusive,
3349 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3350 if (flag1 & 0x20) {
3351 /* resume-id (resume-id [str16]) */
3352 size = tvb_get_ntohs(tvb, offset);
3353 THROW_ON(((offset + 2 + size) > length), ReportedBoundsError);
3354 proto_tree_add_item(args_tree,
3355 hf_amqp_0_10_method_message_resume_id,
3356 tvb, offset, 2 + size, ENC_ASCII|ENC_NA);
3357 AMQP_INCREMENT(offset, 2 + size, length);
3359 if (flag1 & 0x40) {
3360 /* resume-ttl (uint64) */
3361 proto_tree_add_item(args_tree,
3362 hf_amqp_0_10_method_message_subscribe_resume_ttl,
3363 tvb, offset, 8, ENC_BIG_ENDIAN);
3364 AMQP_INCREMENT(offset, 8, length);
3366 if (flag1 & 0x80) {
3367 /* arguments (map) */
3368 map_size = tvb_get_ntohl(tvb, offset);
3369 THROW_ON(((offset + 4 + map_size) > length), ReportedBoundsError);
3370 ti = proto_tree_add_item(args_tree,
3371 hf_amqp_0_10_method_message_subscribe_args,
3372 tvb,
3373 offset,
3374 4 + map_size, ENC_NA);
3375 dissect_amqp_0_10_map (tvb,
3376 offset + 4,
3377 offset + 4 + map_size,
3378 map_size,
3379 ti);
3380 AMQP_INCREMENT(offset, 4 + map_size, length);
3382 break;
3384 case AMQP_0_10_METHOD_MESSAGE_CANCEL:
3385 if ((flag1 & ~0x01) || (flag2 != 0))
3386 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3387 if (flag1 & 0x01) {
3388 /* destination (destination [str8]) */
3389 str_size = tvb_get_guint8(tvb, offset);
3390 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3391 proto_tree_add_item(args_tree,
3392 hf_amqp_0_10_method_message_dest,
3393 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3394 AMQP_INCREMENT(offset, 1 + str_size, length);
3396 break;
3398 case AMQP_0_10_METHOD_MESSAGE_SET_FLOW_MODE:
3399 if ((flag1 & ~0x03) || (flag2 != 0))
3400 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3401 if (flag1 & 0x01) {
3402 /* destination (destination [str8]) */
3403 str_size = tvb_get_guint8(tvb, offset);
3404 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3405 proto_tree_add_item(args_tree,
3406 hf_amqp_0_10_method_message_dest,
3407 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3408 AMQP_INCREMENT(offset, 1 + str_size, length);
3410 if (flag1 & 0x02) {
3411 /* flow-mode (flow-mode [uint8]) */
3412 proto_tree_add_item(args_tree,
3413 hf_amqp_0_10_method_message_flow_mode,
3414 tvb, offset, 1, ENC_BIG_ENDIAN);
3415 AMQP_INCREMENT(offset, 1, length);
3417 break;
3419 case AMQP_0_10_METHOD_MESSAGE_FLOW:
3420 if ((flag1 & ~0x07) || (flag2 != 0))
3421 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3422 if (flag1 & 0x01) {
3423 /* destination (destination [str8]) */
3424 str_size = tvb_get_guint8(tvb, offset);
3425 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3426 proto_tree_add_item(args_tree,
3427 hf_amqp_0_10_method_message_dest,
3428 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3429 AMQP_INCREMENT(offset, 1 + str_size, length);
3431 if (flag1 & 0x02) {
3432 /* unit (credit-unit [uint8]) */
3433 proto_tree_add_item(args_tree,
3434 hf_amqp_0_10_method_message_credit_unit,
3435 tvb, offset, 1, ENC_BIG_ENDIAN);
3436 AMQP_INCREMENT(offset, 1, length);
3438 if (flag1 & 0x04) {
3439 /* value (uint32) */
3440 proto_tree_add_item(args_tree,
3441 hf_amqp_0_10_method_message_credit_value,
3442 tvb, offset, 4, ENC_BIG_ENDIAN);
3443 AMQP_INCREMENT(offset, 4, length);
3445 break;
3447 case AMQP_0_10_METHOD_MESSAGE_FLUSH:
3448 if ((flag1 & ~0x01) || (flag2 != 0))
3449 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3450 if (flag1 & 0x01) {
3451 /* destination (destination [str8]) */
3452 str_size = tvb_get_guint8(tvb, offset);
3453 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3454 proto_tree_add_item(args_tree,
3455 hf_amqp_0_10_method_message_dest,
3456 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3457 AMQP_INCREMENT(offset, 1 + str_size, length);
3459 break;
3461 case AMQP_0_10_METHOD_MESSAGE_STOP:
3462 if ((flag1 & ~0x01) || (flag2 != 0))
3463 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3464 if (flag1 & 0x01) {
3465 /* destination (destination [str8]) */
3466 str_size = tvb_get_guint8(tvb, offset);
3467 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3468 proto_tree_add_item(args_tree,
3469 hf_amqp_0_10_method_message_dest,
3470 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3471 AMQP_INCREMENT(offset, 1 + str_size, length);
3473 break;
3477 static void
3478 dissect_amqp_0_10_tx(tvbuff_t *tvb,
3479 packet_info *pinfo,
3480 proto_tree *tree,
3481 int offset, guint16 length)
3483 guint8 method;
3484 guint8 flag1, flag2;
3485 const gchar *method_name;
3487 method = tvb_get_guint8(tvb, offset+1);
3488 method_name = val_to_str_const(method, amqp_0_10_tx_methods,
3489 "<invalid tx method>");
3490 col_append_str(pinfo->cinfo, COL_INFO, method_name);
3491 col_append_str(pinfo->cinfo, COL_INFO, " ");
3492 col_set_fence(pinfo->cinfo, COL_INFO);
3494 proto_tree_add_item(tree, hf_amqp_0_10_tx_method,
3495 tvb, offset+1, 1, ENC_BIG_ENDIAN);
3496 AMQP_INCREMENT(offset, 2, length);
3498 * Session header is 2 bytes; one that tells that it's 1 byte long, then
3499 * the byte itself. Bit 0 is sync.
3501 flag1 = tvb_get_guint8(tvb, offset);
3502 flag2 = tvb_get_guint8(tvb, offset+1);
3503 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
3504 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
3505 else
3506 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
3507 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3508 AMQP_INCREMENT(offset, 2, length);
3510 /* No args on any method in this class */
3513 static void
3514 dissect_amqp_0_10_dtx(tvbuff_t *tvb,
3515 packet_info *pinfo,
3516 proto_tree *tree,
3517 int offset, guint16 length)
3519 proto_item *args_tree;
3520 proto_item *ti;
3521 proto_item *flags_item;
3522 guint8 method;
3523 guint8 flag1, flag2;
3524 guint16 xid_length;
3525 int flags_offset;
3526 const gchar *method_name;
3528 method = tvb_get_guint8(tvb, offset+1);
3529 method_name = val_to_str_const(method, amqp_0_10_dtx_methods,
3530 "<invalid dtx method>");
3531 col_append_str(pinfo->cinfo, COL_INFO, method_name);
3532 col_append_str(pinfo->cinfo, COL_INFO, " ");
3533 col_set_fence(pinfo->cinfo, COL_INFO);
3535 proto_tree_add_item(tree, hf_amqp_0_10_dtx_method,
3536 tvb, offset+1, 1, ENC_BIG_ENDIAN);
3537 AMQP_INCREMENT(offset, 2, length);
3539 * Session header is 2 bytes; one that tells that it's 1 byte long, then
3540 * the byte itself. Bit 0 is sync.
3542 flag1 = tvb_get_guint8(tvb, offset);
3543 flag2 = tvb_get_guint8(tvb, offset+1);
3544 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
3545 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
3546 else
3547 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
3548 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3549 AMQP_INCREMENT(offset, 2, length);
3551 /* No args for dtx.select or dtx.recover */
3552 if ((method == AMQP_0_10_METHOD_DTX_SELECT) ||
3553 (method == AMQP_0_10_METHOD_DTX_RECOVER))
3554 return;
3556 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
3557 tvb, offset, length - 4, ENC_NA);
3558 args_tree = proto_item_add_subtree(ti, ett_args);
3561 * The flag bits are a simple bit string, not a net-byte-order
3562 * field. tvb_get_bits16() doesn't know how to do little-endian
3563 * at this time, so just pick out two bytes.
3565 flags_offset = offset;
3566 flag1 = tvb_get_guint8(tvb, offset);
3567 flag2 = tvb_get_guint8(tvb, offset+1);
3568 flags_item = proto_tree_add_item(args_tree,
3569 hf_amqp_0_10_argument_packing_flags,
3570 tvb, offset, 2, ENC_BIG_ENDIAN);
3571 AMQP_INCREMENT(offset, 2, length);
3572 switch (method) {
3573 case AMQP_0_10_METHOD_DTX_START:
3574 if ((flag1 & ~0x07) || (flag2 != 0))
3575 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3576 if (flag1 & 0x01) { /* xid (xid) */
3577 xid_length = tvb_get_ntohs(tvb, offset);
3578 AMQP_INCREMENT(offset, 2, length);
3579 THROW_ON(((offset + xid_length) > length), ReportedBoundsError);
3580 ti = proto_tree_add_item(args_tree,
3581 hf_amqp_0_10_dtx_xid,
3582 tvb,
3583 offset - 2,
3584 xid_length + 2, ENC_NA);
3585 dissect_amqp_0_10_xid (tvb,
3586 offset,
3587 xid_length,
3588 ti);
3589 AMQP_INCREMENT(offset, xid_length, length);
3592 * 2nd, 3rd arguments are optional bits.
3594 proto_tree_add_item(args_tree,
3595 hf_amqp_0_10_method_dtx_start_join,
3596 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3597 proto_tree_add_item(args_tree,
3598 hf_amqp_0_10_method_dtx_start_resume,
3599 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3601 break;
3603 case AMQP_0_10_METHOD_DTX_END:
3604 if ((flag1 & ~0x07) || (flag2 != 0))
3605 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3606 if (flag1 & 0x01) { /* xid (xid) */
3607 xid_length = tvb_get_ntohs(tvb, offset);
3608 AMQP_INCREMENT(offset, 2, length);
3609 THROW_ON(((offset + xid_length) > length), ReportedBoundsError);
3610 ti = proto_tree_add_item(args_tree,
3611 hf_amqp_0_10_dtx_xid,
3612 tvb,
3613 offset - 2,
3614 xid_length + 2, ENC_NA);
3615 dissect_amqp_0_10_xid (tvb,
3616 offset,
3617 xid_length,
3618 ti);
3619 AMQP_INCREMENT(offset, xid_length, length);
3622 * 2nd, 3rd arguments are optional bits.
3624 proto_tree_add_item(args_tree,
3625 hf_amqp_0_10_method_dtx_end_fail,
3626 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3627 proto_tree_add_item(args_tree,
3628 hf_amqp_0_10_method_dtx_end_suspend,
3629 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3630 break;
3632 case AMQP_0_10_METHOD_DTX_COMMIT:
3633 if ((flag1 & ~0x03) || (flag2 != 0))
3634 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3635 if (flag1 & 0x01) { /* xid (xid) */
3636 xid_length = tvb_get_ntohs(tvb, offset);
3637 AMQP_INCREMENT(offset, 2, length);
3638 THROW_ON(((offset + xid_length) > length), ReportedBoundsError);
3639 ti = proto_tree_add_item(args_tree,
3640 hf_amqp_0_10_dtx_xid,
3641 tvb,
3642 offset - 2,
3643 xid_length + 2, ENC_NA);
3644 dissect_amqp_0_10_xid (tvb,
3645 offset,
3646 xid_length,
3647 ti);
3648 AMQP_INCREMENT(offset, xid_length, length);
3651 * 2nd argument is an optional bit.
3653 proto_tree_add_item(args_tree,
3654 hf_amqp_0_10_method_dtx_commit_one_phase,
3655 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3656 break;
3658 case AMQP_0_10_METHOD_DTX_FORGET:
3659 case AMQP_0_10_METHOD_DTX_GET_TIMEOUT:
3660 case AMQP_0_10_METHOD_DTX_PREPARE:
3661 case AMQP_0_10_METHOD_DTX_ROLLBACK:
3662 if ((flag1 & ~0x01) || (flag2 != 0))
3663 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3664 if (flag1 & 0x01) { /* xid (xid) */
3665 xid_length = tvb_get_ntohs(tvb, offset);
3666 AMQP_INCREMENT(offset, 2, length);
3667 THROW_ON(((offset + xid_length) > length), ReportedBoundsError);
3668 ti = proto_tree_add_item(args_tree,
3669 hf_amqp_0_10_dtx_xid,
3670 tvb,
3671 offset - 2,
3672 xid_length + 2, ENC_NA);
3673 dissect_amqp_0_10_xid (tvb,
3674 offset,
3675 xid_length,
3676 ti);
3677 AMQP_INCREMENT(offset, xid_length, length);
3679 break;
3681 case AMQP_0_10_METHOD_DTX_SET_TIMEOUT:
3682 if ((flag1 & ~0x03) || (flag2 != 0))
3683 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3684 if (flag1 & 0x01) { /* xid (xid) */
3685 xid_length = tvb_get_ntohs(tvb, offset);
3686 AMQP_INCREMENT(offset, 2, length);
3687 THROW_ON(((offset + xid_length) > length), ReportedBoundsError);
3688 ti = proto_tree_add_item(args_tree,
3689 hf_amqp_0_10_dtx_xid,
3690 tvb,
3691 offset - 2,
3692 xid_length + 2, ENC_NA);
3693 dissect_amqp_0_10_xid (tvb,
3694 offset,
3695 xid_length,
3696 ti);
3697 AMQP_INCREMENT(offset, xid_length, length);
3699 if (flag1 & 0x02) { /* timeout (uint32) */
3700 proto_tree_add_item(args_tree,
3701 hf_amqp_0_10_method_dtx_set_timeout_timeout,
3702 tvb, offset, 4, ENC_BIG_ENDIAN);
3703 AMQP_INCREMENT(offset, 4, length);
3705 break;
3710 static void
3711 dissect_amqp_0_10_exchange(tvbuff_t *tvb,
3712 packet_info *pinfo,
3713 proto_tree *tree,
3714 int offset, guint16 length)
3716 proto_item *args_tree;
3717 proto_item *ti;
3718 proto_item *flags_item;
3719 guint8 method;
3720 guint8 flag1, flag2;
3721 guint8 str_size;
3722 guint32 map_length;
3723 int flags_offset;
3724 const gchar *method_name;
3726 method = tvb_get_guint8(tvb, offset+1);
3727 method_name = val_to_str_const(method, amqp_0_10_exchange_methods,
3728 "<invalid exchange method>");
3729 col_append_str(pinfo->cinfo, COL_INFO, method_name);
3730 col_append_str(pinfo->cinfo, COL_INFO, " ");
3731 col_set_fence(pinfo->cinfo, COL_INFO);
3733 proto_tree_add_item(tree, hf_amqp_0_10_exchange_method,
3734 tvb, offset+1, 1, ENC_BIG_ENDIAN);
3735 AMQP_INCREMENT(offset, 2, length);
3737 * Session header is 2 bytes; one that tells that it's 1 byte long, then
3738 * the byte itself. Bit 0 is sync.
3740 flag1 = tvb_get_guint8(tvb, offset);
3741 flag2 = tvb_get_guint8(tvb, offset+1);
3742 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
3743 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
3744 else
3745 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
3746 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3747 AMQP_INCREMENT(offset, 2, length);
3749 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
3750 tvb, offset, length - 4, ENC_NA);
3751 args_tree = proto_item_add_subtree(ti, ett_args);
3754 * The flag bits are a simple bit string, not a net-byte-order
3755 * field. tvb_get_bits16() doesn't know how to do little-endian
3756 * at this time, so just pick out two bytes.
3758 flags_offset = offset;
3759 flag1 = tvb_get_guint8(tvb, offset);
3760 flag2 = tvb_get_guint8(tvb, offset+1);
3761 flags_item = proto_tree_add_item(args_tree,
3762 hf_amqp_0_10_argument_packing_flags,
3763 tvb, offset, 2, ENC_BIG_ENDIAN);
3764 AMQP_INCREMENT(offset, 2, length);
3765 switch (method) {
3766 case AMQP_0_10_METHOD_EXCHANGE_DECLARE:
3767 if ((flag1 & ~0x7f) || (flag2 != 0))
3768 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3769 if (flag1 & 0x01) { /* exchange (name [str8]) */
3770 str_size = tvb_get_guint8(tvb, offset);
3771 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3772 proto_tree_add_item(args_tree,
3773 hf_amqp_0_10_method_exchange_declare_exchange,
3774 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3775 AMQP_INCREMENT(offset, (1 + str_size), length);
3777 if (flag1 & 0x02) { /* type (str8) */
3778 str_size = tvb_get_guint8(tvb, offset);
3779 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3780 proto_tree_add_item(args_tree,
3781 hf_amqp_0_10_method_exchange_declare_type,
3782 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3783 AMQP_INCREMENT(offset, (1 + str_size), length);
3785 if (flag1 & 0x04) { /* alternate-exchange (name [str8]) */
3786 str_size = tvb_get_guint8(tvb, offset);
3787 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3788 proto_tree_add_item(args_tree,
3789 hf_amqp_0_10_method_exchange_declare_alt_exchange,
3790 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3791 AMQP_INCREMENT(offset, (1 + str_size), length);
3794 * 4th-6th arguments are optional bits.
3796 proto_tree_add_item(args_tree,
3797 hf_amqp_0_10_method_exchange_declare_passive,
3798 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3799 proto_tree_add_item(args_tree,
3800 hf_amqp_0_10_method_exchange_declare_durable,
3801 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3802 proto_tree_add_item(args_tree,
3803 hf_amqp_0_10_method_exchange_declare_auto_delete,
3804 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3805 if (flag1 & 0x40) { /* arguments (map) */
3806 map_length = tvb_get_ntohl(tvb, offset);
3807 AMQP_INCREMENT(offset, 4, length);
3808 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
3809 ti = proto_tree_add_item(args_tree,
3810 hf_amqp_0_10_method_exchange_declare_arguments,
3811 tvb,
3812 offset - 4,
3813 map_length + 4, ENC_NA);
3814 dissect_amqp_0_10_map (tvb,
3815 offset,
3816 offset + map_length,
3817 map_length,
3818 ti);
3819 AMQP_INCREMENT(offset, map_length, length);
3821 break;
3823 case AMQP_0_10_METHOD_EXCHANGE_DELETE:
3824 if ((flag1 & ~0x03) || (flag2 != 0))
3825 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3826 if (flag1 & 0x01) { /* exchange (name [str8]) */
3827 str_size = tvb_get_guint8(tvb, offset);
3828 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3829 proto_tree_add_item(args_tree,
3830 hf_amqp_0_10_method_exchange_declare_exchange,
3831 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3832 AMQP_INCREMENT(offset, (1 + str_size), length);
3835 * 2nd argument is an optional bit.
3837 proto_tree_add_item(args_tree,
3838 hf_amqp_0_10_method_exchange_delete_if_unused,
3839 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
3840 break;
3842 case AMQP_0_10_METHOD_EXCHANGE_QUERY:
3843 if ((flag1 & ~0x01) || (flag2 != 0))
3844 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3845 if (flag1 & 0x01) { /* exchange (name [str8]) */
3846 str_size = tvb_get_guint8(tvb, offset);
3847 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3848 proto_tree_add_item(args_tree,
3849 hf_amqp_0_10_method_exchange_declare_exchange,
3850 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3851 AMQP_INCREMENT(offset, (1 + str_size), length);
3853 break;
3855 case AMQP_0_10_METHOD_EXCHANGE_BIND:
3856 if ((flag1 & ~0x0f) || (flag2 != 0))
3857 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3858 if (flag1 & 0x01) { /* queue (queue.name [str8]) */
3859 str_size = tvb_get_guint8(tvb, offset);
3860 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3861 proto_tree_add_item(args_tree,
3862 hf_amqp_0_10_method_exchange_bind_queue,
3863 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3864 AMQP_INCREMENT(offset, (1 + str_size), length);
3866 if (flag1 & 0x02) { /* exchange (name [str8]) */
3867 str_size = tvb_get_guint8(tvb, offset);
3868 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3869 proto_tree_add_item(args_tree,
3870 hf_amqp_0_10_method_exchange_declare_exchange,
3871 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3872 AMQP_INCREMENT(offset, (1 + str_size), length);
3874 if (flag1 & 0x04) { /* binding-key (str8) */
3875 str_size = tvb_get_guint8(tvb, offset);
3876 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3877 proto_tree_add_item(args_tree,
3878 hf_amqp_0_10_method_exchange_binding_key,
3879 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3880 AMQP_INCREMENT(offset, (1 + str_size), length);
3882 if (flag1 & 0x08) { /* arguments (map) */
3883 map_length = tvb_get_ntohl(tvb, offset);
3884 AMQP_INCREMENT(offset, 4, length);
3885 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
3886 ti = proto_tree_add_item(args_tree,
3887 hf_amqp_0_10_method_exchange_declare_arguments,
3888 tvb,
3889 offset - 4,
3890 map_length + 4, ENC_NA);
3891 dissect_amqp_0_10_map (tvb,
3892 offset,
3893 offset + map_length,
3894 map_length,
3895 ti);
3896 AMQP_INCREMENT(offset, map_length, length);
3898 break;
3900 case AMQP_0_10_METHOD_EXCHANGE_UNBIND:
3901 if ((flag1 & ~0x07) || (flag2 != 0))
3902 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3903 if (flag1 & 0x01) { /* queue (queue.name [str8]) */
3904 str_size = tvb_get_guint8(tvb, offset);
3905 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3906 proto_tree_add_item(args_tree,
3907 hf_amqp_0_10_method_exchange_bind_queue,
3908 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3909 AMQP_INCREMENT(offset, (1 + str_size), length);
3911 if (flag1 & 0x02) { /* exchange (name [str8]) */
3912 str_size = tvb_get_guint8(tvb, offset);
3913 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3914 proto_tree_add_item(args_tree,
3915 hf_amqp_0_10_method_exchange_declare_exchange,
3916 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3917 AMQP_INCREMENT(offset, (1 + str_size), length);
3919 if (flag1 & 0x04) { /* binding-key (str8) */
3920 str_size = tvb_get_guint8(tvb, offset);
3921 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3922 proto_tree_add_item(args_tree,
3923 hf_amqp_0_10_method_exchange_binding_key,
3924 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3925 AMQP_INCREMENT(offset, (1 + str_size), length);
3927 break;
3929 case AMQP_0_10_METHOD_EXCHANGE_BOUND:
3930 if ((flag1 & ~0x0f) || (flag2 != 0))
3931 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
3932 if (flag1 & 0x01) { /* exchange (name [str8]) */
3933 str_size = tvb_get_guint8(tvb, offset);
3934 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3935 proto_tree_add_item(args_tree,
3936 hf_amqp_0_10_method_exchange_declare_exchange,
3937 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3938 AMQP_INCREMENT(offset, (1 + str_size), length);
3940 if (flag1 & 0x02) { /* queue (queue.name [str8]) */
3941 str_size = tvb_get_guint8(tvb, offset);
3942 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3943 proto_tree_add_item(args_tree,
3944 hf_amqp_0_10_method_exchange_bind_queue,
3945 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3946 AMQP_INCREMENT(offset, (1 + str_size), length);
3948 if (flag1 & 0x04) { /* binding-key (str8) */
3949 str_size = tvb_get_guint8(tvb, offset);
3950 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
3951 proto_tree_add_item(args_tree,
3952 hf_amqp_0_10_method_exchange_binding_key,
3953 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
3954 AMQP_INCREMENT(offset, (1 + str_size), length);
3956 if (flag1 & 0x08) { /* arguments (map) */
3957 map_length = tvb_get_ntohl(tvb, offset);
3958 AMQP_INCREMENT(offset, 4, length);
3959 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
3960 ti = proto_tree_add_item(args_tree,
3961 hf_amqp_0_10_method_exchange_declare_arguments,
3962 tvb,
3963 offset - 4,
3964 map_length + 4, ENC_NA);
3965 dissect_amqp_0_10_map (tvb,
3966 offset,
3967 offset + map_length,
3968 map_length,
3969 ti);
3970 AMQP_INCREMENT(offset, map_length, length);
3972 break;
3976 static void
3977 dissect_amqp_0_10_queue(tvbuff_t *tvb,
3978 packet_info *pinfo,
3979 proto_tree *tree,
3980 int offset, guint16 length)
3982 proto_item *args_tree;
3983 proto_item *ti;
3984 proto_item *flags_item;
3985 guint8 method;
3986 guint8 flag1, flag2;
3987 guint8 str_size;
3988 guint32 map_length;
3989 int flags_offset;
3990 const gchar *method_name;
3992 method = tvb_get_guint8(tvb, offset+1);
3993 method_name = val_to_str_const(method, amqp_0_10_queue_methods,
3994 "<invalid queue method>");
3995 col_append_str(pinfo->cinfo, COL_INFO, method_name);
3996 col_append_str(pinfo->cinfo, COL_INFO, " ");
3997 col_set_fence(pinfo->cinfo, COL_INFO);
3999 proto_tree_add_item(tree, hf_amqp_0_10_queue_method,
4000 tvb, offset+1, 1, ENC_BIG_ENDIAN);
4001 AMQP_INCREMENT(offset, 2, length);
4003 * Session header is 2 bytes; one that tells that it's 1 byte long, then
4004 * the byte itself. Bit 0 is sync.
4006 flag1 = tvb_get_guint8(tvb, offset);
4007 flag2 = tvb_get_guint8(tvb, offset+1);
4008 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
4009 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
4010 else
4011 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
4012 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4013 AMQP_INCREMENT(offset, 2, length);
4015 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
4016 tvb, offset, length - 4, ENC_NA);
4017 args_tree = proto_item_add_subtree(ti, ett_args);
4020 * The flag bits are a simple bit string, not a net-byte-order
4021 * field. tvb_get_bits16() doesn't know how to do little-endian
4022 * at this time, so just pick out two bytes.
4024 flags_offset = offset;
4025 flag1 = tvb_get_guint8(tvb, offset);
4026 flag2 = tvb_get_guint8(tvb, offset+1);
4027 flags_item = proto_tree_add_item(args_tree,
4028 hf_amqp_0_10_argument_packing_flags,
4029 tvb, offset, 2, ENC_BIG_ENDIAN);
4030 AMQP_INCREMENT(offset, 2, length);
4031 switch (method) {
4032 case AMQP_0_10_METHOD_QUEUE_DECLARE:
4033 if ((flag1 & ~0x7f) || (flag2 != 0))
4034 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4035 if (flag1 & 0x01) { /* queue (name [str8]) */
4036 str_size = tvb_get_guint8(tvb, offset);
4037 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4038 proto_tree_add_item(args_tree,
4039 hf_amqp_0_10_method_queue_name,
4040 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4041 AMQP_INCREMENT(offset, (1 + str_size), length);
4043 if (flag1 & 0x02) { /* alternate-exchange (exchange.name [str8]) */
4044 str_size = tvb_get_guint8(tvb, offset);
4045 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4046 proto_tree_add_item(args_tree,
4047 hf_amqp_0_10_method_queue_alt_exchange,
4048 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4049 AMQP_INCREMENT(offset, (1 + str_size), length);
4052 * 3rd-6th arguments are optional bits.
4054 proto_tree_add_item(args_tree,
4055 hf_amqp_0_10_method_queue_declare_passive,
4056 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4057 proto_tree_add_item(args_tree,
4058 hf_amqp_0_10_method_queue_declare_durable,
4059 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4060 proto_tree_add_item(args_tree,
4061 hf_amqp_0_10_method_queue_declare_exclusive,
4062 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4063 proto_tree_add_item(args_tree,
4064 hf_amqp_0_10_method_queue_declare_auto_delete,
4065 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4066 if (flag1 & 0x40) { /* arguments (map) */
4067 map_length = tvb_get_ntohl(tvb, offset);
4068 AMQP_INCREMENT(offset, 4, length);
4069 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
4070 ti = proto_tree_add_item(args_tree,
4071 hf_amqp_0_10_method_queue_declare_arguments,
4072 tvb,
4073 offset - 4,
4074 map_length + 4, ENC_NA);
4075 dissect_amqp_0_10_map (tvb,
4076 offset,
4077 offset + map_length,
4078 map_length,
4079 ti);
4080 AMQP_INCREMENT(offset, map_length, length);
4082 break;
4084 case AMQP_0_10_METHOD_QUEUE_DELETE:
4085 if ((flag1 & ~0x07) || (flag2 != 0))
4086 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4087 if (flag1 & 0x01) { /* queue (name [str8]) */
4088 str_size = tvb_get_guint8(tvb, offset);
4089 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4090 proto_tree_add_item(args_tree,
4091 hf_amqp_0_10_method_queue_name,
4092 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4093 AMQP_INCREMENT(offset, (1 + str_size), length);
4096 * 2nd-3rd arguments are optional bits.
4098 proto_tree_add_item(args_tree,
4099 hf_amqp_0_10_method_queue_delete_if_unused,
4100 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4101 proto_tree_add_item(args_tree,
4102 hf_amqp_0_10_method_queue_delete_if_empty,
4103 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4104 break;
4106 case AMQP_0_10_METHOD_QUEUE_PURGE:
4107 if ((flag1 & ~0x01) || (flag2 != 0))
4108 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4109 if (flag1 & 0x01) { /* queue (name [str8]) */
4110 str_size = tvb_get_guint8(tvb, offset);
4111 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4112 proto_tree_add_item(args_tree,
4113 hf_amqp_0_10_method_queue_name,
4114 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4115 AMQP_INCREMENT(offset, (1 + str_size), length);
4117 break;
4119 case AMQP_0_10_METHOD_QUEUE_QUERY:
4120 if ((flag1 & ~0x01) || (flag2 != 0))
4121 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4122 if (flag1 & 0x01) { /* queue (name [str8]) */
4123 str_size = tvb_get_guint8(tvb, offset);
4124 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4125 proto_tree_add_item(args_tree,
4126 hf_amqp_0_10_method_queue_name,
4127 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4128 AMQP_INCREMENT(offset, (1 + str_size), length);
4130 break;
4134 static void
4135 dissect_amqp_0_10_file(tvbuff_t *tvb,
4136 packet_info *pinfo,
4137 proto_tree *tree,
4138 int offset, guint16 length)
4140 proto_item *args_tree;
4141 proto_item *ti;
4142 proto_item *flags_item;
4143 guint8 method;
4144 guint8 flag1, flag2;
4145 guint8 str_size;
4146 guint32 map_length;
4147 int flags_offset;
4148 const gchar *method_name;
4150 method = tvb_get_guint8(tvb, offset+1);
4151 method_name = val_to_str_const(method, amqp_0_10_file_methods,
4152 "<invalid file method>");
4153 col_append_str(pinfo->cinfo, COL_INFO, method_name);
4154 col_append_str(pinfo->cinfo, COL_INFO, " ");
4155 col_set_fence(pinfo->cinfo, COL_INFO);
4157 proto_tree_add_item(tree, hf_amqp_0_10_file_method,
4158 tvb, offset+1, 1, ENC_BIG_ENDIAN);
4159 AMQP_INCREMENT(offset, 2, length);
4161 * Session header is 2 bytes; one that tells that it's 1 byte long, then
4162 * the byte itself. Bit 0 is sync.
4164 flag1 = tvb_get_guint8(tvb, offset);
4165 flag2 = tvb_get_guint8(tvb, offset+1);
4166 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
4167 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
4168 else
4169 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
4170 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4171 AMQP_INCREMENT(offset, 2, length);
4173 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
4174 tvb, offset, length - 4, ENC_NA);
4175 args_tree = proto_item_add_subtree(ti, ett_args);
4178 * The flag bits are a simple bit string, not a net-byte-order
4179 * field. tvb_get_bits16() doesn't know how to do little-endian
4180 * at this time, so just pick out two bytes.
4182 flags_offset = offset;
4183 flag1 = tvb_get_guint8(tvb, offset);
4184 flag2 = tvb_get_guint8(tvb, offset+1);
4185 flags_item = proto_tree_add_item(args_tree,
4186 hf_amqp_0_10_argument_packing_flags,
4187 tvb, offset, 2, ENC_BIG_ENDIAN);
4188 AMQP_INCREMENT(offset, 2, length);
4189 switch (method) {
4190 case AMQP_0_10_METHOD_FILE_QOS:
4191 if ((flag1 & ~0x07) || (flag2 != 0))
4192 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4193 if (flag1 & 0x01) { /* prefetch-size (uint32) */
4194 proto_tree_add_item(args_tree,
4195 hf_amqp_0_10_method_file_qos_prefetch_size,
4196 tvb, offset, 4, ENC_BIG_ENDIAN);
4197 AMQP_INCREMENT(offset, 4, length);
4199 if (flag1 & 0x02) { /* prefetch-count (uint16) */
4200 proto_tree_add_item(args_tree,
4201 hf_amqp_0_10_method_file_qos_prefetch_count,
4202 tvb, offset, 2, ENC_BIG_ENDIAN);
4203 AMQP_INCREMENT(offset, 2, length);
4206 * 3rd argument is an optional bit.
4208 proto_tree_add_item(args_tree,
4209 hf_amqp_0_10_method_file_qos_global,
4210 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4211 break;
4213 case AMQP_0_10_METHOD_FILE_QOS_OK:
4214 case AMQP_0_10_METHOD_FILE_STAGE:
4215 /* No args */
4216 break;
4218 case AMQP_0_10_METHOD_FILE_CONSUME:
4219 if ((flag1 & ~0x7f) || (flag2 != 0))
4220 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4221 if (flag1 & 0x01) { /* queue (queue.name [str8]) */
4222 str_size = tvb_get_guint8(tvb, offset);
4223 THROW_ON(((offset + 1 + str_size) <= length), ReportedBoundsError);
4224 proto_tree_add_item(args_tree,
4225 hf_amqp_0_10_method_queue_name,
4226 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4227 AMQP_INCREMENT(offset, (1 + str_size), length);
4229 if (flag1 & 0x02) { /* consumer-tag (str8) */
4230 str_size = tvb_get_guint8(tvb, offset);
4231 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4232 proto_tree_add_item(args_tree,
4233 hf_amqp_0_10_method_file_consumer_tag,
4234 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4235 AMQP_INCREMENT(offset, (1 + str_size), length);
4238 * 3rd-6th arguments are optional bits.
4240 proto_tree_add_item(args_tree,
4241 hf_amqp_0_10_method_file_consume_no_local,
4242 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4243 proto_tree_add_item(args_tree,
4244 hf_amqp_0_10_method_file_consume_no_ack,
4245 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4246 proto_tree_add_item(args_tree,
4247 hf_amqp_0_10_method_file_consume_exclusive,
4248 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4249 proto_tree_add_item(args_tree,
4250 hf_amqp_0_10_method_file_consume_nowait,
4251 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4252 if (flag1 & 0x40) { /* arguments (map) */
4253 map_length = tvb_get_ntohl(tvb, offset);
4254 AMQP_INCREMENT(offset, 4, length);
4255 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
4256 ti = proto_tree_add_item(args_tree,
4257 hf_amqp_0_10_method_file_consume_arguments,
4258 tvb,
4259 offset - 4,
4260 map_length + 4, ENC_NA);
4261 dissect_amqp_0_10_map (tvb,
4262 offset,
4263 offset + map_length,
4264 map_length,
4265 ti);
4266 AMQP_INCREMENT(offset, map_length, length);
4268 break;
4270 case AMQP_0_10_METHOD_FILE_CONSUME_OK:
4271 case AMQP_0_10_METHOD_FILE_CANCEL:
4272 if ((flag1 & ~0x01) || (flag2 != 0))
4273 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4274 if (flag1 & 0x01) { /* consumer-tag (str8) */
4275 str_size = tvb_get_guint8(tvb, offset);
4276 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4277 proto_tree_add_item(args_tree,
4278 hf_amqp_0_10_method_file_consumer_tag,
4279 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4280 AMQP_INCREMENT(offset, (1 + str_size), length);
4282 break;
4284 case AMQP_0_10_METHOD_FILE_OPEN:
4285 if ((flag1 & ~0x03) || (flag2 != 0))
4286 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4287 if (flag1 & 0x01) { /* identifier (str8) */
4288 str_size = tvb_get_guint8(tvb, offset);
4289 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4290 proto_tree_add_item(args_tree,
4291 hf_amqp_0_10_method_file_identifier,
4292 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4293 AMQP_INCREMENT(offset, (1 + str_size), length);
4295 if (flag1 & 0x02) { /* content-size (uint64) */
4296 proto_tree_add_item(args_tree,
4297 hf_amqp_0_10_method_file_open_content_size,
4298 tvb, offset, 8, ENC_BIG_ENDIAN);
4299 AMQP_INCREMENT(offset, 8, length);
4301 break;
4303 case AMQP_0_10_METHOD_FILE_OPEN_OK:
4304 if ((flag1 & ~0x01) || (flag2 != 0))
4305 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4306 if (flag1 & 0x01) { /* staged-size (uint64) */
4307 proto_tree_add_item(args_tree,
4308 hf_amqp_0_10_method_file_open_ok_staged_size,
4309 tvb, offset, 8, ENC_BIG_ENDIAN);
4310 AMQP_INCREMENT(offset, 8, length);
4312 break;
4314 case AMQP_0_10_METHOD_FILE_PUBLISH:
4315 if ((flag1 & ~0x1f) || (flag2 != 0))
4316 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4317 if (flag1 & 0x01) { /* exchange (exchange.name [str8]) */
4318 str_size = tvb_get_guint8(tvb, offset);
4319 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4320 proto_tree_add_item(args_tree,
4321 hf_amqp_0_10_method_file_publish_exchange,
4322 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4323 AMQP_INCREMENT(offset, (1 + str_size), length);
4325 if (flag1 & 0x02) { /* routing-key (str8) */
4326 str_size = tvb_get_guint8(tvb, offset);
4327 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4328 proto_tree_add_item(args_tree,
4329 hf_amqp_0_10_method_file_publish_routing_key,
4330 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4331 AMQP_INCREMENT(offset, (1 + str_size), length);
4334 * 3rd-4th arguments are optional bits.
4336 proto_tree_add_item(args_tree,
4337 hf_amqp_0_10_method_file_publish_mandatory,
4338 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4339 proto_tree_add_item(args_tree,
4340 hf_amqp_0_10_method_file_publish_immediate,
4341 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4342 if (flag1 & 0x10) { /* identifier (str8) */
4343 str_size = tvb_get_guint8(tvb, offset);
4344 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4345 proto_tree_add_item(args_tree,
4346 hf_amqp_0_10_method_file_identifier,
4347 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4348 AMQP_INCREMENT(offset, (1 + str_size), length);
4350 break;
4352 case AMQP_0_10_METHOD_FILE_RETURN:
4353 if ((flag1 & ~0x0f) || (flag2 != 0))
4354 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4355 if (flag1 & 0x01) { /* reply-code (return-code [uint16]) */
4356 proto_tree_add_item(args_tree,
4357 hf_amqp_0_10_method_file_return_reply_code,
4358 tvb, offset, 2, ENC_BIG_ENDIAN);
4359 AMQP_INCREMENT(offset, 2, length);
4361 if (flag1 & 0x02) { /* reply-text (str8) */
4362 str_size = tvb_get_guint8(tvb, offset);
4363 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4364 proto_tree_add_item(args_tree,
4365 hf_amqp_0_10_method_file_return_reply_text,
4366 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4367 AMQP_INCREMENT(offset, (1 + str_size), length);
4369 if (flag1 & 0x04) { /* exchange (exchange.name [str8]) */
4370 str_size = tvb_get_guint8(tvb, offset);
4371 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4372 proto_tree_add_item(args_tree,
4373 hf_amqp_0_10_method_file_return_exchange,
4374 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4375 AMQP_INCREMENT(offset, (1 + str_size), length);
4377 if (flag1 & 0x08) { /* routing-key (str8) */
4378 str_size = tvb_get_guint8(tvb, offset);
4379 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4380 proto_tree_add_item(args_tree,
4381 hf_amqp_0_10_method_file_return_routing_key,
4382 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4383 AMQP_INCREMENT(offset, (1 + str_size), length);
4385 break;
4387 case AMQP_0_10_METHOD_FILE_DELIVER:
4388 if ((flag1 & ~0x3f) || (flag2 != 0))
4389 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4390 if (flag1 & 0x01) { /* consumer-tag (str8) */
4391 str_size = tvb_get_guint8(tvb, offset);
4392 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4393 proto_tree_add_item(args_tree,
4394 hf_amqp_0_10_method_file_deliver_consumer_tag,
4395 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4396 AMQP_INCREMENT(offset, (1 + str_size), length);
4398 if (flag1 & 0x02) { /* delivery-tag (uint64) */
4399 proto_tree_add_item(args_tree,
4400 hf_amqp_0_10_method_file_deliver_delivery_tag,
4401 tvb, offset, 8, ENC_BIG_ENDIAN);
4402 AMQP_INCREMENT(offset, 8, length);
4405 * 3rd argument is an optional bit.
4407 proto_tree_add_item(args_tree,
4408 hf_amqp_0_10_method_file_deliver_redelivered,
4409 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4410 if (flag1 & 0x08) { /* exchange (exchange.name [str8]) */
4411 str_size = tvb_get_guint8(tvb, offset);
4412 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4413 proto_tree_add_item(args_tree,
4414 hf_amqp_0_10_method_file_deliver_exchange,
4415 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4416 AMQP_INCREMENT(offset, (1 + str_size), length);
4418 if (flag1 & 0x10) { /* routing-key (str8) */
4419 str_size = tvb_get_guint8(tvb, offset);
4420 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4421 proto_tree_add_item(args_tree,
4422 hf_amqp_0_10_method_file_deliver_routing_key,
4423 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4424 AMQP_INCREMENT(offset, (1 + str_size), length);
4426 if (flag1 & 0x20) { /* identifier (str8) */
4427 str_size = tvb_get_guint8(tvb, offset);
4428 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4429 proto_tree_add_item(args_tree,
4430 hf_amqp_0_10_method_file_identifier,
4431 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4432 AMQP_INCREMENT(offset, (1 + str_size), length);
4434 break;
4436 case AMQP_0_10_METHOD_FILE_ACK:
4437 if ((flag1 & ~0x03) || (flag2 != 0))
4438 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4439 if (flag1 & 0x01) { /* delivery-tag (uint64) */
4440 proto_tree_add_item(args_tree,
4441 hf_amqp_0_10_method_file_ack_delivery_tag,
4442 tvb, offset, 8, ENC_BIG_ENDIAN);
4443 AMQP_INCREMENT(offset, 8, length);
4446 * 2nd argument is an optional bit.
4448 proto_tree_add_item(args_tree,
4449 hf_amqp_0_10_method_file_ack_multiple,
4450 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4451 break;
4453 case AMQP_0_10_METHOD_FILE_REJECT:
4454 if ((flag1 & ~0x03) || (flag2 != 0))
4455 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4456 if (flag1 & 0x01) { /* delivery-tag (uint64) */
4457 proto_tree_add_item(args_tree,
4458 hf_amqp_0_10_method_file_reject_delivery_tag,
4459 tvb, offset, 8, ENC_BIG_ENDIAN);
4460 AMQP_INCREMENT(offset, 8, length);
4463 * 2nd argument is an optional bit.
4465 proto_tree_add_item(args_tree,
4466 hf_amqp_0_10_method_file_reject_requeue,
4467 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4468 break;
4472 static void
4473 dissect_amqp_0_10_stream(tvbuff_t *tvb,
4474 packet_info *pinfo,
4475 proto_tree *tree,
4476 int offset, guint16 length)
4478 proto_item *args_tree;
4479 proto_item *ti;
4480 proto_item *flags_item;
4481 guint8 method;
4482 guint8 flag1, flag2;
4483 guint8 str_size;
4484 guint32 map_length;
4485 int flags_offset;
4486 const gchar *method_name;
4488 method = tvb_get_guint8(tvb, offset+1);
4489 method_name = val_to_str_const(method, amqp_0_10_stream_methods,
4490 "<invalid stream method>");
4491 col_append_str(pinfo->cinfo, COL_INFO, method_name);
4492 col_append_str(pinfo->cinfo, COL_INFO, " ");
4493 col_set_fence(pinfo->cinfo, COL_INFO);
4495 proto_tree_add_item(tree, hf_amqp_0_10_stream_method,
4496 tvb, offset+1, 1, ENC_BIG_ENDIAN);
4497 AMQP_INCREMENT(offset, 2, length);
4499 * Session header is 2 bytes; one that tells that it's 1 byte long, then
4500 * the byte itself. Bit 0 is sync.
4502 flag1 = tvb_get_guint8(tvb, offset);
4503 flag2 = tvb_get_guint8(tvb, offset+1);
4504 if ((flag1 != 1) || ((flag2 & 0xfe) != 0))
4505 proto_tree_add_text(tree, tvb, offset, 2, "Invalid session header");
4506 else
4507 proto_tree_add_item(tree, hf_amqp_0_10_session_header_sync,
4508 tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4509 AMQP_INCREMENT(offset, 2, length);
4511 ti = proto_tree_add_item(tree, hf_amqp_method_arguments,
4512 tvb, offset, length - 4, ENC_NA);
4513 args_tree = proto_item_add_subtree(ti, ett_args);
4516 * The flag bits are a simple bit string, not a net-byte-order
4517 * field. tvb_get_bits16() doesn't know how to do little-endian
4518 * at this time, so just pick out two bytes.
4520 flags_offset = offset;
4521 flag1 = tvb_get_guint8(tvb, offset);
4522 flag2 = tvb_get_guint8(tvb, offset+1);
4523 flags_item = proto_tree_add_item(args_tree,
4524 hf_amqp_0_10_argument_packing_flags,
4525 tvb, offset, 2, ENC_BIG_ENDIAN);
4526 AMQP_INCREMENT(offset, 2, length);
4527 switch (method) {
4528 case AMQP_0_10_METHOD_STREAM_QOS:
4529 if ((flag1 & ~0x0f) || (flag2 != 0))
4530 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4531 if (flag1 & 0x01) { /* prefetch-size (uint32) */
4532 proto_tree_add_item(args_tree,
4533 hf_amqp_0_10_method_stream_qos_prefetch_size,
4534 tvb, offset, 4, ENC_BIG_ENDIAN);
4535 AMQP_INCREMENT(offset, 4, length);
4537 if (flag1 & 0x02) { /* prefetch-count (uint16) */
4538 proto_tree_add_item(args_tree,
4539 hf_amqp_0_10_method_stream_qos_prefetch_count,
4540 tvb, offset, 2, ENC_BIG_ENDIAN);
4541 AMQP_INCREMENT(offset, 2, length);
4543 if (flag1 & 0x04) { /* consume-rate (uint32) */
4544 proto_tree_add_item(args_tree,
4545 hf_amqp_0_10_method_stream_qos_prefetch_size,
4546 tvb, offset, 4, ENC_BIG_ENDIAN);
4547 AMQP_INCREMENT(offset, 4, length);
4550 * 4th argument is an optional bit.
4552 proto_tree_add_item(args_tree,
4553 hf_amqp_0_10_method_stream_qos_global,
4554 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4555 break;
4557 case AMQP_0_10_METHOD_STREAM_QOS_OK:
4558 /* No args */
4559 break;
4561 case AMQP_0_10_METHOD_STREAM_CONSUME:
4562 if ((flag1 & ~0x3f) || (flag2 != 0))
4563 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4564 if (flag1 & 0x01) { /* queue (queue.name [str8]) */
4565 str_size = tvb_get_guint8(tvb, offset);
4566 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4567 proto_tree_add_item(args_tree,
4568 hf_amqp_0_10_method_queue_name,
4569 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4570 AMQP_INCREMENT(offset, (1 + str_size), length);
4572 if (flag1 & 0x02) { /* consumer-tag (str8) */
4573 str_size = tvb_get_guint8(tvb, offset);
4574 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4575 proto_tree_add_item(args_tree,
4576 hf_amqp_0_10_method_stream_consumer_tag,
4577 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4578 AMQP_INCREMENT(offset, (1 + str_size), length);
4581 * 3rd-5th arguments are optional bits.
4583 proto_tree_add_item(args_tree,
4584 hf_amqp_0_10_method_stream_consume_no_local,
4585 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4586 proto_tree_add_item(args_tree,
4587 hf_amqp_0_10_method_stream_consume_exclusive,
4588 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4589 proto_tree_add_item(args_tree,
4590 hf_amqp_0_10_method_stream_consume_nowait,
4591 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4592 if (flag1 & 0x20) { /* arguments (map) */
4593 map_length = tvb_get_ntohl(tvb, offset);
4594 AMQP_INCREMENT(offset, 4, length);
4595 THROW_ON(((offset + map_length) > length), ReportedBoundsError);
4596 ti = proto_tree_add_item(args_tree,
4597 hf_amqp_0_10_method_stream_consume_arguments,
4598 tvb,
4599 offset - 4,
4600 map_length + 4, ENC_NA);
4601 dissect_amqp_0_10_map (tvb,
4602 offset,
4603 offset + map_length,
4604 map_length,
4605 ti);
4606 AMQP_INCREMENT(offset, map_length, length);
4608 break;
4610 case AMQP_0_10_METHOD_STREAM_CONSUME_OK:
4611 case AMQP_0_10_METHOD_STREAM_CANCEL:
4612 if ((flag1 & ~0x01) || (flag2 != 0))
4613 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4614 if (flag1 & 0x01) { /* consumer-tag (str8) */
4615 str_size = tvb_get_guint8(tvb, offset);
4616 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4617 proto_tree_add_item(args_tree,
4618 hf_amqp_0_10_method_stream_consumer_tag,
4619 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4620 AMQP_INCREMENT(offset, (1 + str_size), length);
4622 break;
4624 case AMQP_0_10_METHOD_STREAM_PUBLISH:
4625 if ((flag1 & ~0x0f) || (flag2 != 0))
4626 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4627 if (flag1 & 0x01) { /* exchange (exchange.name [str8]) */
4628 str_size = tvb_get_guint8(tvb, offset);
4629 THROW_ON(((offset + 1 + str_size) <= length), ReportedBoundsError);
4630 proto_tree_add_item(args_tree,
4631 hf_amqp_0_10_method_stream_publish_exchange,
4632 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4633 AMQP_INCREMENT(offset, (1 + str_size), length);
4635 if (flag1 & 0x02) { /* routing-key (str8) */
4636 str_size = tvb_get_guint8(tvb, offset);
4637 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4638 proto_tree_add_item(args_tree,
4639 hf_amqp_0_10_method_stream_publish_routing_key,
4640 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4641 AMQP_INCREMENT(offset, (1 + str_size), length);
4644 * 3rd-4th arguments are optional bits.
4646 proto_tree_add_item(args_tree,
4647 hf_amqp_0_10_method_stream_publish_mandatory,
4648 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4649 proto_tree_add_item(args_tree,
4650 hf_amqp_0_10_method_stream_publish_immediate,
4651 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4652 break;
4654 case AMQP_0_10_METHOD_STREAM_RETURN:
4655 if ((flag1 & ~0x0f) || (flag2 != 0))
4656 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4657 if (flag1 & 0x01) { /* reply-code (return-code [uint16]) */
4658 proto_tree_add_item(args_tree,
4659 hf_amqp_0_10_method_stream_return_reply_code,
4660 tvb, offset, 2, ENC_BIG_ENDIAN);
4661 AMQP_INCREMENT(offset, 2, length);
4663 if (flag1 & 0x02) { /* reply-text (str8) */
4664 str_size = tvb_get_guint8(tvb, offset);
4665 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4666 proto_tree_add_item(args_tree,
4667 hf_amqp_0_10_method_stream_return_reply_text,
4668 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4669 AMQP_INCREMENT(offset, (1 + str_size), length);
4671 if (flag1 & 0x04) { /* exchange (exchange.name [str8]) */
4672 str_size = tvb_get_guint8(tvb, offset);
4673 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4674 proto_tree_add_item(args_tree,
4675 hf_amqp_0_10_method_stream_return_exchange,
4676 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4677 AMQP_INCREMENT(offset, (1 + str_size), length);
4679 if (flag1 & 0x08) { /* routing-key (str8) */
4680 str_size = tvb_get_guint8(tvb, offset);
4681 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4682 proto_tree_add_item(args_tree,
4683 hf_amqp_0_10_method_stream_return_routing_key,
4684 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4685 AMQP_INCREMENT(offset, (1 + str_size), length);
4687 break;
4689 case AMQP_0_10_METHOD_STREAM_DELIVER:
4690 if ((flag1 & ~0x0f) || (flag2 != 0))
4691 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4692 if (flag1 & 0x01) { /* consumer-tag (str8) */
4693 str_size = tvb_get_guint8(tvb, offset);
4694 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4695 proto_tree_add_item(args_tree,
4696 hf_amqp_0_10_method_stream_deliver_consumer_tag,
4697 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4698 AMQP_INCREMENT(offset, (1 + str_size), length);
4700 if (flag1 & 0x02) { /* delivery-tag (uint64) */
4701 proto_tree_add_item(args_tree,
4702 hf_amqp_0_10_method_stream_deliver_delivery_tag,
4703 tvb, offset, 8, ENC_BIG_ENDIAN);
4704 AMQP_INCREMENT(offset, 8, length);
4706 if (flag1 & 0x04) { /* exchange (exchange.name [str8]) */
4707 str_size = tvb_get_guint8(tvb, offset);
4708 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4709 proto_tree_add_item(args_tree,
4710 hf_amqp_0_10_method_stream_deliver_exchange,
4711 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4712 AMQP_INCREMENT(offset, (1 + str_size), length);
4714 if (flag1 & 0x08) { /* queue (queue.name [str8]) */
4715 str_size = tvb_get_guint8(tvb, offset);
4716 THROW_ON(((offset + 1 + str_size) > length), ReportedBoundsError);
4717 proto_tree_add_item(args_tree,
4718 hf_amqp_0_10_method_stream_deliver_queue,
4719 tvb, offset + 1, str_size, ENC_ASCII|ENC_NA);
4720 AMQP_INCREMENT(offset, (1 + str_size), length);
4722 break;
4726 static void
4727 dissect_amqp_0_10_struct_delivery_properties(tvbuff_t *tvb,
4728 packet_info *pinfo,
4729 proto_tree *tree,
4730 int offset,
4731 guint32 struct_length)
4733 proto_item *args_tree;
4734 proto_item *flags_item;
4735 guint8 flag1, flag2;
4736 guint8 len8;
4737 guint16 len16;
4738 guint64 timestamp;
4739 int flags_offset;
4740 int max_length;
4741 nstime_t tv;
4743 max_length = offset + struct_length;
4744 args_tree = proto_item_add_subtree(tree, ett_args);
4745 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
4746 flags_offset = offset;
4747 flag1 = tvb_get_guint8(tvb, offset);
4748 flag2 = tvb_get_guint8(tvb, offset+1);
4749 flags_item = proto_tree_add_item(args_tree,
4750 hf_amqp_0_10_argument_packing_flags,
4751 tvb, offset, 2, ENC_BIG_ENDIAN);
4752 if (flag2 & ~0x0f)
4753 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4754 AMQP_INCREMENT(offset, 2, max_length);
4756 /* First 3 fields are bits */
4757 proto_tree_add_item(args_tree,
4758 hf_amqp_0_10_struct_delivery_properties_discard_unroutable,
4759 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4760 proto_tree_add_item(args_tree,
4761 hf_amqp_0_10_struct_delivery_properties_immediate,
4762 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4763 proto_tree_add_item(args_tree,
4764 hf_amqp_0_10_struct_delivery_properties_redelivered,
4765 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4766 if (flag1 & 0x08) {
4767 /* delivery-priority (delivery-priority [uint8]) */
4768 proto_tree_add_item(args_tree,
4769 hf_amqp_0_10_struct_delivery_properties_priority,
4770 tvb, offset, 1, ENC_BIG_ENDIAN);
4771 AMQP_INCREMENT(offset, 1, max_length);
4773 if (flag1 & 0x10) {
4774 /* delivery-mode (delivery-mode [uint8]) */
4775 proto_tree_add_item(args_tree,
4776 hf_amqp_0_10_struct_delivery_properties_mode,
4777 tvb, offset, 1, ENC_BIG_ENDIAN);
4778 AMQP_INCREMENT(offset, 1, max_length);
4780 if (flag1 & 0x20) {
4781 /* ttl (uint64) */
4782 proto_tree_add_item(args_tree,
4783 hf_amqp_0_10_struct_delivery_properties_ttl,
4784 tvb, offset, 8, ENC_BIG_ENDIAN);
4785 AMQP_INCREMENT(offset, 8, max_length);
4787 if (flag1 & 0x40) {
4788 /* timestamp (datetime [uint64]) */
4789 timestamp = tvb_get_ntoh64(tvb, offset);
4790 tv.secs = (time_t)timestamp;
4791 tv.nsecs = 0;
4792 proto_tree_add_time(args_tree,
4793 hf_amqp_0_10_struct_delivery_properties_timestamp,
4794 tvb, offset, 8, &tv);
4795 AMQP_INCREMENT(offset, 8, max_length);
4797 if (flag1 & 0x80) {
4798 /* expiration (datetime [uint64]) */
4799 timestamp = tvb_get_ntoh64(tvb, offset);
4800 tv.secs = (time_t)timestamp;
4801 tv.nsecs = 0;
4802 proto_tree_add_time(args_tree,
4803 hf_amqp_0_10_struct_delivery_properties_expiration,
4804 tvb, offset, 8, &tv);
4805 AMQP_INCREMENT(offset, 8, max_length);
4807 if (flag2 & 0x01) {
4808 /* exchange (exchange.name [str8]) */
4809 len8 = tvb_get_guint8(tvb, offset);
4810 proto_tree_add_item(args_tree,
4811 hf_amqp_0_10_struct_delivery_properties_exchange,
4812 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4813 AMQP_INCREMENT(offset, (1 + len8), max_length);
4815 if (flag2 & 0x02) {
4816 /* routing-key (str8) */
4817 len8 = tvb_get_guint8(tvb, offset);
4818 proto_tree_add_item(args_tree,
4819 hf_amqp_0_10_struct_delivery_properties_routing_key,
4820 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4821 AMQP_INCREMENT(offset, (1 + len8), max_length);
4823 if (flag2 & 0x04) {
4824 /* resume-id (resume-id [str16]) */
4825 len16 = tvb_get_ntohs(tvb, offset);
4826 THROW_ON(((offset + 2 + len16) > max_length), ReportedBoundsError);
4827 proto_tree_add_item(args_tree,
4828 hf_amqp_0_10_method_message_resume_id,
4829 tvb, offset + 2, len16, ENC_ASCII|ENC_NA);
4830 AMQP_INCREMENT(offset, (2 + len16), max_length);
4832 if (flag2 & 0x08) {
4833 /* resume-ttl (uint64) */
4834 proto_tree_add_item(args_tree,
4835 hf_amqp_0_10_struct_delivery_properties_resume_ttl,
4836 tvb, offset, 8, ENC_BIG_ENDIAN);
4837 AMQP_INCREMENT(offset, 8, max_length);
4841 static void
4842 dissect_amqp_0_10_struct_fragment_properties(tvbuff_t *tvb,
4843 packet_info *pinfo,
4844 proto_tree *tree,
4845 int offset,
4846 guint32 struct_length)
4848 proto_item *args_tree;
4849 proto_item *flags_item;
4850 guint8 flag1, flag2;
4851 int flags_offset;
4852 int max_length;
4854 max_length = offset + struct_length;
4855 args_tree = proto_item_add_subtree(tree, ett_args);
4856 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
4857 flags_offset = offset;
4858 flag1 = tvb_get_guint8(tvb, offset);
4859 flag2 = tvb_get_guint8(tvb, offset+1);
4860 flags_item = proto_tree_add_item(args_tree,
4861 hf_amqp_0_10_argument_packing_flags,
4862 tvb, offset, 2, ENC_BIG_ENDIAN);
4863 if ((flag1 & ~0x07) || (flag2 != 0))
4864 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4865 AMQP_INCREMENT(offset, 2, max_length);
4867 /* First 2 fields are bits */
4868 proto_tree_add_item(args_tree,
4869 hf_amqp_0_10_struct_fragment_properties_first,
4870 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4871 proto_tree_add_item(args_tree,
4872 hf_amqp_0_10_struct_fragment_properties_last,
4873 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
4874 if (flag1 & 0x04) {
4875 /* fragment-size (uint64) */
4876 proto_tree_add_item(args_tree,
4877 hf_amqp_0_10_struct_fragment_properties_size,
4878 tvb, offset, 8, ENC_BIG_ENDIAN);
4879 AMQP_INCREMENT(offset, 8, max_length);
4883 static void
4884 dissect_amqp_0_10_struct_message_properties(tvbuff_t *tvb,
4885 packet_info *pinfo,
4886 proto_tree *tree,
4887 int offset,
4888 guint32 struct_length)
4890 proto_item *ti;
4891 proto_item *frag;
4892 proto_item *args_tree;
4893 proto_item *flags_item, *subflags_item;
4894 guint8 flag1, flag2;
4895 guint8 subflag1, subflag2;
4896 guint8 len8;
4897 guint16 len16;
4898 guint32 map_length;
4899 e_guid_t uuid;
4900 int max_length;
4902 max_length = offset + struct_length;
4903 frag = proto_item_add_subtree(tree, ett_args);
4904 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
4905 flag1 = tvb_get_guint8(tvb, offset);
4906 flag2 = tvb_get_guint8(tvb, offset+1);
4907 flags_item = proto_tree_add_item(frag,
4908 hf_amqp_0_10_argument_packing_flags,
4909 tvb, offset, 2, ENC_BIG_ENDIAN);
4910 if (flag2 & ~0x01)
4911 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
4912 AMQP_INCREMENT(offset, 2, max_length);
4913 if (flag1 & 0x01) {
4914 /* content-length (uint64) */
4915 proto_tree_add_item(frag,
4916 hf_amqp_0_10_struct_message_properties_content_len,
4917 tvb, offset, 8, ENC_BIG_ENDIAN);
4918 AMQP_INCREMENT(offset, 8, max_length);
4920 if (flag1 & 0x02) {
4921 /* message-id (uuid) */
4922 tvb_get_guid(tvb, offset, &uuid, ENC_BIG_ENDIAN);
4923 proto_tree_add_guid(frag,
4924 hf_amqp_0_10_struct_message_properties_message_id,
4925 tvb, offset, 16, &uuid);
4926 AMQP_INCREMENT(offset, 16, max_length);
4928 if (flag1 & 0x04) {
4929 /* correlation-id (vbin16) */
4930 len16 = tvb_get_ntohs(tvb, offset);
4931 proto_tree_add_item(frag,
4932 hf_amqp_0_10_struct_message_properties_correlation,
4933 tvb, offset + 2, len16, ENC_NA);
4934 AMQP_INCREMENT(offset, (2 + len16), max_length);
4936 if (flag1 & 0x08) {
4937 /* reply-to (reply-to) */
4938 /* This is another struct, length 2, packing 2 */
4939 len16 = tvb_get_ntohs(tvb, offset);
4940 AMQP_INCREMENT(offset, 2, max_length);
4941 ti = proto_tree_add_item(frag,
4942 hf_amqp_0_10_struct_message_properties_reply_to,
4943 tvb, offset, len16, ENC_NA);
4944 args_tree = proto_item_add_subtree(ti, ett_args);
4945 subflags_item = proto_tree_add_item(args_tree,
4946 hf_amqp_0_10_argument_packing_flags,
4947 tvb, offset, 2, ENC_BIG_ENDIAN);
4948 subflag1 = tvb_get_guint8(tvb, offset);
4949 subflag2 = tvb_get_guint8(tvb, offset + 1);
4950 if ((subflag1 & ~0x03) || (subflag2 != 0))
4951 expert_add_info(pinfo, subflags_item, &ei_amqp_bad_flag_value);
4952 AMQP_INCREMENT(offset, 2, max_length);
4953 if (subflag1 & 0x01) {
4954 /* exchange (str8) */
4955 len8 = tvb_get_guint8(tvb, offset);
4956 proto_tree_add_item(args_tree,
4957 hf_amqp_0_10_struct_reply_to_exchange,
4958 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4959 AMQP_INCREMENT(offset, (1 + len8), max_length);
4961 if (subflag1 & 0x02) {
4962 /* routing-key (str8) */
4963 len8 = tvb_get_guint8(tvb, offset);
4964 proto_tree_add_item(args_tree,
4965 hf_amqp_0_10_struct_reply_to_routing_key,
4966 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4967 AMQP_INCREMENT(offset, (1 + len8), max_length);
4970 if (flag1 & 0x10) {
4971 /* content-type (str8) */
4972 len8 = tvb_get_guint8(tvb, offset);
4973 proto_tree_add_item(frag,
4974 hf_amqp_0_10_struct_message_properties_content_type,
4975 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4976 AMQP_INCREMENT(offset, (1 + len8), max_length);
4978 if (flag1 & 0x20) {
4979 /* content-encoding (str8) */
4980 len8 = tvb_get_guint8(tvb, offset);
4981 proto_tree_add_item(frag,
4982 hf_amqp_0_10_struct_message_properties_content_encoding,
4983 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
4984 AMQP_INCREMENT(offset, (1 + len8), max_length);
4986 if (flag1 & 0x40) {
4987 /* user-id (vbin16 ) */
4988 len16 = tvb_get_ntohs(tvb, offset);
4989 proto_tree_add_item(frag,
4990 hf_amqp_0_10_struct_message_properties_user_id,
4991 tvb, offset + 2, len16, ENC_NA);
4992 AMQP_INCREMENT(offset, (2 + len16), max_length);
4994 if (flag1 & 0x80) {
4995 /* app-id (vbin16 ) */
4996 len16 = tvb_get_ntohs(tvb, offset);
4997 proto_tree_add_item(frag,
4998 hf_amqp_0_10_struct_message_properties_app_id,
4999 tvb, offset + 2, len16, ENC_NA);
5000 AMQP_INCREMENT(offset, (2 + len16), max_length);
5002 if (flag2 & 0x01) {
5003 /* application-headers (map) */
5004 map_length = tvb_get_ntohl(tvb, offset);
5005 AMQP_INCREMENT(offset, 4, max_length);
5006 ti = proto_tree_add_item(frag,
5007 hf_amqp_0_10_struct_message_properties_application_headers,
5008 tvb,
5009 offset,
5010 map_length, ENC_NA);
5011 dissect_amqp_0_10_map (tvb,
5012 offset,
5013 offset + map_length,
5014 map_length,
5015 ti);
5016 AMQP_INCREMENT(offset, map_length, max_length);
5020 static void
5021 dissect_amqp_0_10_struct_exchange_query_result(tvbuff_t *tvb,
5022 packet_info *pinfo,
5023 proto_item *tree,
5024 int offset,
5025 guint32 struct_length)
5027 proto_item *ti;
5028 proto_item *result;
5029 proto_item *flags_item;
5030 guint8 flag1, flag2;
5031 guint8 len8;
5032 guint32 map_length;
5033 int flags_offset;
5034 int max_length;
5036 max_length = offset + struct_length;
5037 result = proto_item_add_subtree(tree, ett_args);
5038 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
5039 flags_offset = offset;
5040 flag1 = tvb_get_guint8(tvb, offset);
5041 flag2 = tvb_get_guint8(tvb, offset+1);
5042 flags_item = proto_tree_add_item(result,
5043 hf_amqp_0_10_argument_packing_flags,
5044 tvb, offset, 2, ENC_BIG_ENDIAN);
5045 if (flag2 & ~0x0f)
5046 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
5047 AMQP_INCREMENT(offset, 2, max_length);
5048 if (flag1 & 0x01) {
5049 /* type (str8) */
5050 len8 = tvb_get_guint8(tvb, offset);
5051 THROW_ON(((offset + 1 + len8) > max_length), ReportedBoundsError);
5052 proto_tree_add_item(result,
5053 hf_amqp_0_10_method_exchange_declare_type,
5054 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5055 AMQP_INCREMENT(offset, (1 + len8), max_length);
5057 proto_tree_add_item(result,
5058 hf_amqp_0_10_struct_exchange_query_result_durable,
5059 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
5060 proto_tree_add_item(result,
5061 hf_amqp_0_10_struct_exchange_query_result_not_found,
5062 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
5063 if (flag1 & 0x08) {
5064 /* arguments (map) */
5065 map_length = tvb_get_ntohl(tvb, offset);
5066 AMQP_INCREMENT(offset, 4, max_length);
5067 THROW_ON(((offset + (int)map_length) > max_length), ReportedBoundsError);
5068 ti = proto_tree_add_item(result,
5069 hf_amqp_0_10_method_exchange_declare_arguments,
5070 tvb,
5071 offset - 4,
5072 map_length + 4, ENC_NA);
5073 dissect_amqp_0_10_map (tvb,
5074 offset,
5075 offset + map_length,
5076 map_length,
5077 ti);
5078 AMQP_INCREMENT(offset, map_length, max_length);
5082 static void
5083 dissect_amqp_0_10_struct_queue_query_result(tvbuff_t *tvb,
5084 packet_info *pinfo,
5085 proto_item *tree,
5086 int offset,
5087 guint32 struct_length)
5089 proto_item *ti;
5090 proto_item *result;
5091 proto_item *flags_item;
5092 guint8 flag1, flag2;
5093 guint8 len8;
5094 guint32 map_length;
5095 int flags_offset;
5096 int max_length;
5098 max_length = offset + struct_length;
5099 result = proto_item_add_subtree(tree, ett_args);
5100 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
5101 flags_offset = offset;
5102 flag1 = tvb_get_guint8(tvb, offset);
5103 flag2 = tvb_get_guint8(tvb, offset+1);
5104 flags_item = proto_tree_add_item(result,
5105 hf_amqp_0_10_argument_packing_flags,
5106 tvb, offset, 2, ENC_BIG_ENDIAN);
5108 if (flag2 != 0)
5109 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
5110 AMQP_INCREMENT(offset, 2, max_length);
5111 if (flag1 & 0x01) {
5112 /* queue (name [str8]) */
5113 len8 = tvb_get_guint8(tvb, offset);
5114 THROW_ON(((offset + 1 + len8) > max_length), ReportedBoundsError);
5115 proto_tree_add_item(result,
5116 hf_amqp_0_10_method_queue_name,
5117 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5118 AMQP_INCREMENT(offset, (1 + len8), max_length);
5120 if (flag1 & 0x02) { /* alternate-exchange (exchange.name [str8]) */
5121 len8 = tvb_get_guint8(tvb, offset);
5122 THROW_ON(((offset + 1 + len8) > max_length), ReportedBoundsError);
5123 proto_tree_add_item(result,
5124 hf_amqp_0_10_method_queue_alt_exchange,
5125 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5126 AMQP_INCREMENT(offset, (1 + len8), max_length);
5129 * 3rd-5th arguments are optional bits.
5131 proto_tree_add_item(result,
5132 hf_amqp_0_10_struct_queue_query_result_durable,
5133 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
5134 proto_tree_add_item(result,
5135 hf_amqp_0_10_struct_queue_query_result_exclusive,
5136 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
5137 proto_tree_add_item(result,
5138 hf_amqp_0_10_struct_queue_query_result_auto_delete,
5139 tvb, flags_offset, 1, ENC_BIG_ENDIAN);
5140 if (flag1 & 0x20) { /* arguments (map) */
5141 map_length = tvb_get_ntohl(tvb, offset);
5142 AMQP_INCREMENT(offset, 4, max_length);
5143 THROW_ON(((offset + (int)map_length) > max_length), ReportedBoundsError);
5144 ti = proto_tree_add_item(result,
5145 hf_amqp_0_10_method_queue_declare_arguments,
5146 tvb,
5147 offset - 4,
5148 map_length + 4, ENC_NA);
5149 dissect_amqp_0_10_map (tvb,
5150 offset,
5151 offset + map_length,
5152 map_length,
5153 ti);
5154 AMQP_INCREMENT(offset, (int)map_length, max_length);
5156 if (flag1 & 0x40) { /* message-count (uint32) */
5157 proto_tree_add_item(result,
5158 hf_amqp_0_10_struct_queue_query_result_message_count,
5159 tvb, offset, 4, ENC_BIG_ENDIAN);
5160 AMQP_INCREMENT(offset, 4, max_length);
5162 if (flag1 & 0x80) { /* subscriber-count (uint32) */
5163 proto_tree_add_item(result,
5164 hf_amqp_0_10_struct_queue_query_result_subscriber_count,
5165 tvb, offset, 4, ENC_BIG_ENDIAN);
5166 AMQP_INCREMENT(offset, 4, max_length);
5170 static void
5171 dissect_amqp_0_10_struct_file_properties(tvbuff_t *tvb,
5172 packet_info *pinfo,
5173 proto_tree *tree,
5174 int offset,
5175 guint32 struct_length)
5177 proto_item *ti;
5178 proto_item *props;
5179 proto_item *flags_item;
5180 guint8 flag1, flag2;
5181 guint8 len8;
5182 guint32 map_length;
5183 guint64 timestamp;
5184 int max_length;
5185 nstime_t tv;
5187 max_length = offset + struct_length;
5188 props = proto_item_add_subtree(tree, ett_args);
5189 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
5190 flag1 = tvb_get_guint8(tvb, offset);
5191 flag2 = tvb_get_guint8(tvb, offset+1);
5192 flags_item = proto_tree_add_item(props,
5193 hf_amqp_0_10_argument_packing_flags,
5194 tvb, offset, 2, ENC_BIG_ENDIAN);
5195 if (flag2 & ~0x01)
5196 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
5197 AMQP_INCREMENT(offset, 2, max_length);
5198 if (flag1 & 0x01) {
5199 /* content-type (str8) */
5200 len8 = tvb_get_guint8(tvb, offset);
5201 proto_tree_add_item(props,
5202 hf_amqp_0_10_struct_file_properties_content_type,
5203 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5204 AMQP_INCREMENT(offset, (1 + len8), max_length);
5206 if (flag1 & 0x02) {
5207 /* content-encoding (str8) */
5208 len8 = tvb_get_guint8(tvb, offset);
5209 proto_tree_add_item(props,
5210 hf_amqp_0_10_struct_file_properties_content_encoding,
5211 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5212 AMQP_INCREMENT(offset, (1 + len8), max_length);
5214 if (flag1 & 0x04) {
5215 /* headers (map) */
5216 map_length = tvb_get_ntohl(tvb, offset);
5217 AMQP_INCREMENT(offset, 4, max_length);
5218 ti = proto_tree_add_item(props,
5219 hf_amqp_0_10_struct_file_properties_headers,
5220 tvb,
5221 offset,
5222 map_length, ENC_NA);
5223 dissect_amqp_0_10_map (tvb,
5224 offset,
5225 offset + map_length,
5226 map_length,
5227 ti);
5228 AMQP_INCREMENT(offset, map_length, max_length);
5230 if (flag1 & 0x08) {
5231 /* priority (uint8) */
5232 proto_tree_add_item(props,
5233 hf_amqp_0_10_struct_file_properties_priority,
5234 tvb, offset, 1, ENC_BIG_ENDIAN);
5235 AMQP_INCREMENT(offset, 1, max_length);
5237 if (flag1 & 0x10) {
5238 /* reply-to (str8) */
5239 len8 = tvb_get_guint8(tvb, offset);
5240 proto_tree_add_item(props,
5241 hf_amqp_0_10_struct_file_properties_reply_to,
5242 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5243 AMQP_INCREMENT(offset, (1 + len8), max_length);
5245 if (flag1 & 0x20) {
5246 /* message-id (str8) */
5247 len8 = tvb_get_guint8(tvb, offset);
5248 proto_tree_add_item(props,
5249 hf_amqp_0_10_struct_file_properties_message_id,
5250 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5251 AMQP_INCREMENT(offset, (1 + len8), max_length);
5253 if (flag1 & 0x40) {
5254 /* filename (str8) */
5255 len8 = tvb_get_guint8(tvb, offset);
5256 proto_tree_add_item(props,
5257 hf_amqp_0_10_struct_file_properties_filename,
5258 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5259 AMQP_INCREMENT(offset, (1 + len8), max_length);
5261 if (flag1 & 0x80) {
5262 /* timestamp (datetime [uint64]) */
5263 timestamp = tvb_get_ntoh64(tvb, offset);
5264 tv.secs = (time_t)timestamp;
5265 tv.nsecs = 0;
5266 proto_tree_add_time(props,
5267 hf_amqp_0_10_struct_file_properties_timestamp,
5268 tvb, offset, 8, &tv);
5269 AMQP_INCREMENT(offset, 8, max_length);
5271 if (flag2 & 0x01) {
5272 /* cluster-id (str8) */
5273 len8 = tvb_get_guint8(tvb, offset);
5274 proto_tree_add_item(props,
5275 hf_amqp_0_10_struct_file_properties_cluster_id,
5276 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5277 AMQP_INCREMENT(offset, (1 + len8), max_length);
5281 static void
5282 dissect_amqp_0_10_struct_stream_properties(tvbuff_t *tvb,
5283 packet_info *pinfo,
5284 proto_tree *tree,
5285 int offset,
5286 guint32 struct_length)
5288 proto_item *ti;
5289 proto_item *props;
5290 proto_item *flags_item;
5291 guint8 flag1, flag2;
5292 guint8 len8;
5293 guint32 map_length;
5294 guint64 timestamp;
5295 int max_length;
5296 nstime_t tv;
5298 max_length = offset + struct_length;
5299 props = proto_item_add_subtree(tree, ett_args);
5300 AMQP_INCREMENT(offset, 2, max_length); /* Skip class and struct codes */
5301 flag1 = tvb_get_guint8(tvb, offset);
5302 flag2 = tvb_get_guint8(tvb, offset+1);
5303 flags_item = proto_tree_add_item(props,
5304 hf_amqp_0_10_argument_packing_flags,
5305 tvb, offset, 2, ENC_BIG_ENDIAN);
5306 if ((flag1 & ~0x1f) || (flag2 != 0))
5307 expert_add_info(pinfo, flags_item, &ei_amqp_bad_flag_value);
5308 AMQP_INCREMENT(offset, 2, max_length);
5309 if (flag1 & 0x01) {
5310 /* content-type (str8) */
5311 len8 = tvb_get_guint8(tvb, offset);
5312 proto_tree_add_item(props,
5313 hf_amqp_0_10_struct_stream_properties_content_type,
5314 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5315 AMQP_INCREMENT(offset, (1 + len8), max_length);
5317 if (flag1 & 0x02) {
5318 /* content-encoding (str8) */
5319 len8 = tvb_get_guint8(tvb, offset);
5320 proto_tree_add_item(props,
5321 hf_amqp_0_10_struct_stream_properties_content_encoding,
5322 tvb, offset + 1, len8, ENC_ASCII|ENC_NA);
5323 AMQP_INCREMENT(offset, (1 + len8), max_length);
5325 if (flag1 & 0x04) {
5326 /* headers (map) */
5327 map_length = tvb_get_ntohl(tvb, offset);
5328 AMQP_INCREMENT(offset, 4, max_length);
5329 ti = proto_tree_add_item(props,
5330 hf_amqp_0_10_struct_stream_properties_headers,
5331 tvb,
5332 offset,
5333 map_length, ENC_NA);
5334 dissect_amqp_0_10_map (tvb,
5335 offset,
5336 offset + map_length,
5337 map_length,
5338 ti);
5339 AMQP_INCREMENT(offset, map_length, max_length);
5341 if (flag1 & 0x08) {
5342 /* priority (uint8) */
5343 proto_tree_add_item(props,
5344 hf_amqp_0_10_struct_stream_properties_priority,
5345 tvb, offset, 1, ENC_BIG_ENDIAN);
5346 AMQP_INCREMENT(offset, 1, max_length);
5348 if (flag1 & 0x10) {
5349 /* timestamp (datetime [uint64]) */
5350 timestamp = tvb_get_ntoh64(tvb, offset);
5351 tv.secs = (time_t)timestamp;
5352 tv.nsecs = 0;
5353 proto_tree_add_time(props,
5354 hf_amqp_0_10_struct_stream_properties_timestamp,
5355 tvb, offset, 8, &tv);
5356 AMQP_INCREMENT(offset, 8, max_length);
5360 static void
5361 dissect_amqp_0_10_struct32(tvbuff_t *tvb,
5362 packet_info *pinfo,
5363 proto_tree *tree,
5364 int offset,
5365 guint32 struct_length)
5367 guint8 class_code;
5368 guint8 struct_code;
5369 guint8 flag1;
5370 guint16 size;
5371 guint16 value;
5372 guint32 array_length;
5373 guint32 consumed;
5374 proto_tree *ti;
5375 proto_tree *result;
5377 consumed = 0;
5378 class_code = tvb_get_guint8(tvb, offset);
5379 struct_code = tvb_get_guint8(tvb, offset + 1);
5381 switch(class_code) {
5382 case AMQP_0_10_CLASS_MESSAGE:
5383 switch (struct_code) {
5384 case AMQP_0_10_STRUCT_MESSAGE_DELIVERY_PROPERTIES:
5385 proto_item_set_text(tree, "message.delivery-properties");
5386 dissect_amqp_0_10_struct_delivery_properties(tvb,
5387 pinfo,
5388 tree,
5389 offset,
5390 struct_length);
5391 break;
5392 case AMQP_0_10_STRUCT_MESSAGE_FRAGMENT_PROPERTIES:
5393 proto_item_set_text(tree, "message.fragment-properties");
5394 dissect_amqp_0_10_struct_fragment_properties(tvb,
5395 pinfo,
5396 tree,
5397 offset,
5398 struct_length);
5399 break;
5400 case AMQP_0_10_STRUCT_MESSAGE_MESSAGE_PROPERTIES:
5401 proto_item_set_text(tree, "message.message-properties");
5402 dissect_amqp_0_10_struct_message_properties(tvb,
5403 pinfo,
5404 tree,
5405 offset,
5406 struct_length);
5407 break;
5408 case AMQP_0_10_STRUCT_MESSAGE_ACQUIRED:
5409 proto_item_set_text(tree, "message.acquired");
5410 result = proto_item_add_subtree(tree, ett_args);
5411 AMQP_INCREMENT(consumed, 2, struct_length); /* Class/type codes */
5412 offset += 2;
5413 flag1 = tvb_get_guint8(tvb, offset);
5414 proto_tree_add_item(result, hf_amqp_0_10_argument_packing_flags,
5415 tvb, offset, 2, ENC_BIG_ENDIAN);
5416 AMQP_INCREMENT(consumed, 2, struct_length);
5417 offset += 2;
5418 if (flag1 & 0x01) {
5419 /* transfers (commands [sequence-set]) */
5420 size = tvb_get_ntohs(tvb, offset);
5421 THROW_ON(((consumed + size) > struct_length), ReportedBoundsError);
5422 ti = proto_tree_add_item(result,
5423 hf_amqp_0_10_struct_acquired_transfers,
5424 tvb, offset, size + 2, ENC_NA);
5425 format_amqp_0_10_sequence_set(tvb, offset + 2, size, ti);
5427 break;
5428 case AMQP_0_10_STRUCT_MESSAGE_RESUME_RESULT:
5429 proto_item_set_text(tree, "message.resume-result");
5430 result = proto_item_add_subtree(tree, ett_args);
5431 AMQP_INCREMENT(consumed, 2, struct_length); /* Class/type codes */
5432 offset += 2;
5433 flag1 = tvb_get_guint8(tvb, offset);
5434 proto_tree_add_item(result, hf_amqp_0_10_argument_packing_flags,
5435 tvb, offset, 2, ENC_BIG_ENDIAN);
5436 AMQP_INCREMENT(consumed, 2, struct_length);
5437 offset += 2;
5438 if (flag1 & 0x01) {
5439 /* offset (uint64) */
5440 proto_tree_add_item(result,
5441 hf_amqp_0_10_struct_resume_result_offset,
5442 tvb, offset, 8, ENC_BIG_ENDIAN);
5444 break;
5446 break;
5448 case AMQP_0_10_CLASS_DTX:
5449 switch (struct_code) {
5450 case AMQP_0_10_STRUCT_DTX_XA_RESULT:
5451 AMQP_INCREMENT(consumed, 2, struct_length); /* Class/type codes */
5452 offset += 2;
5453 /*flag1 = tvb_get_guint8(tvb, offset);*/
5454 AMQP_INCREMENT(consumed, 2, struct_length); /* Packing bytes */
5455 offset += 2;
5456 value = tvb_get_ntohs(tvb, offset);
5457 AMQP_INCREMENT(consumed, 2, struct_length); /* xa status value */
5458 /*offset += 2;*/
5459 proto_item_set_text(tree, "dtx.xa-status: %s",
5460 val_to_str(value,
5461 amqp_0_10_xa_status,
5462 "Invalid xa-status %d"));
5463 break;
5465 case AMQP_0_10_STRUCT_DTX_RECOVER_RESULT:
5466 proto_item_set_text(tree, "dtx.recover-result");
5467 AMQP_INCREMENT(consumed, 2, struct_length); /* Class/type codes */
5468 offset += 2;
5469 /*flag1 = tvb_get_guint8(tvb, offset);*/
5470 AMQP_INCREMENT(consumed, 2, struct_length); /* Packing bytes */
5471 offset += 2;
5472 array_length = tvb_get_ntohl(tvb, offset);
5473 AMQP_INCREMENT(consumed, 4, struct_length);
5474 offset += 4;
5475 dissect_amqp_0_10_array(tvb,
5476 pinfo,
5477 offset,
5478 offset + array_length,
5479 array_length,
5480 tree);
5481 break;
5483 break;
5485 case AMQP_0_10_CLASS_EXCHANGE:
5486 switch (struct_code) {
5487 case AMQP_0_10_STRUCT_EXCHANGE_QUERY_RESULT:
5488 proto_item_set_text(tree, "exchange.exchange-query-result");
5489 dissect_amqp_0_10_struct_exchange_query_result(tvb,
5490 pinfo,
5491 tree,
5492 offset,
5493 struct_length);
5494 break;
5496 case AMQP_0_10_STRUCT_EXCHANGE_BOUND_RESULT:
5497 proto_item_set_text(tree, "exchange.exchange-bound-result");
5498 result = proto_item_add_subtree(tree, ett_args);
5499 AMQP_INCREMENT(consumed, 2, struct_length); /* Class/type codes */
5500 offset += 2;
5501 proto_tree_add_item(result,
5502 hf_amqp_0_10_struct_exchange_bound_result_exchange_not_found,
5503 tvb, offset, 1, ENC_BIG_ENDIAN);
5504 proto_tree_add_item(result,
5505 hf_amqp_0_10_struct_exchange_bound_result_queue_not_found,
5506 tvb, offset, 1, ENC_BIG_ENDIAN);
5507 proto_tree_add_item(result,
5508 hf_amqp_0_10_struct_exchange_bound_result_queue_not_matched,
5509 tvb, offset, 1, ENC_BIG_ENDIAN);
5510 proto_tree_add_item(result,
5511 hf_amqp_0_10_struct_exchange_bound_result_key_not_matched,
5512 tvb, offset, 1, ENC_BIG_ENDIAN);
5513 proto_tree_add_item(result,
5514 hf_amqp_0_10_struct_exchange_bound_result_args_not_matched,
5515 tvb, offset, 1, ENC_BIG_ENDIAN);
5516 break;
5518 break;
5520 case AMQP_0_10_CLASS_QUEUE:
5521 switch (struct_code) {
5522 case AMQP_0_10_STRUCT_QUEUE_QUERY_RESULT:
5523 proto_item_set_text(tree, "queue.queue-query-result");
5524 dissect_amqp_0_10_struct_queue_query_result(tvb,
5525 pinfo,
5526 tree,
5527 offset,
5528 struct_length);
5529 break;
5531 break;
5533 case AMQP_0_10_CLASS_FILE:
5534 switch (struct_code) {
5535 case AMQP_0_10_STRUCT_FILE_PROPERTIES:
5536 proto_item_set_text(tree, "file.file-properties");
5537 dissect_amqp_0_10_struct_file_properties(tvb,
5538 pinfo,
5539 tree,
5540 offset,
5541 struct_length);
5542 break;
5544 break;
5546 case AMQP_0_10_CLASS_STREAM:
5547 switch (struct_code) {
5548 case AMQP_0_10_STRUCT_STREAM_PROPERTIES:
5549 proto_item_set_text(tree, "stream.stream-properties");
5550 dissect_amqp_0_10_struct_stream_properties(tvb,
5551 pinfo,
5552 tree,
5553 offset,
5554 struct_length);
5555 break;
5557 break;
5561 static int
5562 dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5564 proto_item *ti;
5565 proto_item *amqp_tree = NULL;
5566 guint8 frame_type;
5567 guint16 length;
5568 guint32 struct_length;
5569 guint offset;
5571 #if 0 /* XXX: Not currently used ?? */
5572 conversation_t *conv;
5573 amqp_conv *conn;
5575 /* Find (or build) conversation to remember the protocol version */
5576 conv = find_or_create_conversation(pinfo);
5577 conn = conversation_get_proto_data(conv, proto_amqp);
5578 #endif
5580 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMQP");
5581 col_clear(pinfo->cinfo, COL_INFO);
5583 /* Heuristic - protocol initialisation frame starts with 'AMQP' */
5584 if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) {
5585 guint8 proto_major;
5586 guint8 proto_minor;
5587 wmem_strbuf_t *strbuf;
5589 proto_major = tvb_get_guint8(tvb, 6);
5590 proto_minor = tvb_get_guint8(tvb, 7);
5591 strbuf = wmem_strbuf_new_label(wmem_packet_scope());
5592 wmem_strbuf_append_printf(strbuf,
5593 "Protocol-Header %d-%d ",
5594 proto_major,
5595 proto_minor);
5596 col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(strbuf));
5597 col_set_fence(pinfo->cinfo, COL_INFO);
5599 if (tree) {
5600 ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA);
5601 amqp_tree = proto_item_add_subtree(ti, ett_amqp_init);
5602 proto_tree_add_item(amqp_tree, hf_amqp_init_protocol, tvb, 0, 4, ENC_ASCII|ENC_NA);
5603 proto_tree_add_item(amqp_tree, hf_amqp_init_id_major, tvb, 4, 1, ENC_BIG_ENDIAN);
5604 proto_tree_add_item(amqp_tree, hf_amqp_init_id_minor, tvb, 5, 1, ENC_BIG_ENDIAN);
5605 proto_tree_add_item(amqp_tree, hf_amqp_init_version_major, tvb, 6, 1, ENC_BIG_ENDIAN);
5606 proto_tree_add_item(amqp_tree, hf_amqp_init_version_minor, tvb, 7, 1, ENC_BIG_ENDIAN);
5608 return 8;
5611 /* Protocol frame */
5612 if (tree) {
5613 ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA);
5614 amqp_tree = proto_item_add_subtree(ti, ett_amqp);
5615 proto_tree_add_item(amqp_tree, hf_amqp_0_10_format, tvb, 0, 1, ENC_BIG_ENDIAN);
5616 proto_tree_add_item(amqp_tree, hf_amqp_0_10_position, tvb, 0, 1, ENC_BIG_ENDIAN);
5617 proto_tree_add_item(amqp_tree, hf_amqp_0_10_type, tvb, 1, 1, ENC_BIG_ENDIAN);
5618 proto_tree_add_item(amqp_tree, hf_amqp_0_10_size, tvb, 2, 2, ENC_BIG_ENDIAN);
5619 proto_tree_add_item(amqp_tree, hf_amqp_0_10_track, tvb, 5, 1, ENC_BIG_ENDIAN);
5620 proto_tree_add_item(amqp_tree, hf_amqp_channel, tvb, 6, 2, ENC_BIG_ENDIAN);
5623 frame_type = tvb_get_guint8(tvb, 1);
5624 length = tvb_get_ntohs(tvb, 2);
5625 offset = 12;
5626 THROW_ON((length <= 13), ReportedBoundsError);
5628 switch(frame_type) {
5629 case AMQP_0_10_FRAME_COMMAND:
5630 /* Fall through */
5631 case AMQP_0_10_FRAME_CONTROL:
5632 proto_tree_add_item(amqp_tree, hf_amqp_0_10_class, tvb, offset+0, 1, ENC_BIG_ENDIAN);
5633 switch(tvb_get_guint8(tvb, offset + 0)) {
5634 case AMQP_0_10_CLASS_CONNECTION:
5635 dissect_amqp_0_10_connection(tvb, pinfo, amqp_tree,
5636 offset, length);
5637 break;
5638 case AMQP_0_10_CLASS_SESSION:
5639 dissect_amqp_0_10_session(tvb, pinfo, amqp_tree,
5640 offset, length);
5641 break;
5642 case AMQP_0_10_CLASS_EXECUTION:
5643 dissect_amqp_0_10_execution(tvb, pinfo, amqp_tree,
5644 offset, length);
5645 break;
5646 case AMQP_0_10_CLASS_MESSAGE:
5647 dissect_amqp_0_10_message(tvb, pinfo, amqp_tree,
5648 offset, length);
5649 break;
5650 case AMQP_0_10_CLASS_TX:
5651 dissect_amqp_0_10_tx(tvb, pinfo, amqp_tree,
5652 offset, length);
5653 break;
5654 case AMQP_0_10_CLASS_DTX:
5655 dissect_amqp_0_10_dtx(tvb, pinfo, amqp_tree,
5656 offset, length);
5657 break;
5658 case AMQP_0_10_CLASS_EXCHANGE:
5659 dissect_amqp_0_10_exchange(tvb, pinfo, amqp_tree,
5660 offset, length);
5661 break;
5662 case AMQP_0_10_CLASS_QUEUE:
5663 dissect_amqp_0_10_queue(tvb, pinfo, amqp_tree,
5664 offset, length);
5665 break;
5666 case AMQP_0_10_CLASS_FILE:
5667 dissect_amqp_0_10_file(tvb, pinfo, amqp_tree,
5668 offset, length);
5669 break;
5670 case AMQP_0_10_CLASS_STREAM:
5671 dissect_amqp_0_10_stream(tvb, pinfo, amqp_tree,
5672 offset, length);
5673 break;
5674 default:
5675 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_command_class, "Unknown command/control class %d", tvb_get_guint8(tvb, offset + 0));
5677 break;
5679 case AMQP_0_10_FRAME_HEADER:
5680 col_append_str(pinfo->cinfo, COL_INFO, "header ");
5681 col_set_fence(pinfo->cinfo, COL_INFO);
5682 do {
5683 struct_length = tvb_get_ntohl(tvb, offset);
5684 AMQP_INCREMENT(offset, 4, length);
5685 THROW_ON((offset + struct_length > length), ReportedBoundsError);
5686 THROW_ON((offset + struct_length < offset), ReportedBoundsError);
5688 ti = proto_tree_add_item(amqp_tree,
5689 hf_amqp_0_10_undissected_struct32,
5690 tvb, offset, struct_length, ENC_NA);
5691 dissect_amqp_0_10_struct32(tvb, pinfo, ti, offset, struct_length);
5692 AMQP_INCREMENT(offset, struct_length, length);
5693 } while (offset < length);
5694 break;
5696 case AMQP_0_10_FRAME_BODY:
5697 col_append_str(pinfo->cinfo, COL_INFO, "message-body ");
5698 col_set_fence(pinfo->cinfo, COL_INFO);
5699 proto_tree_add_item(amqp_tree,
5700 hf_amqp_0_10_message_body,
5701 tvb, offset, length - 12, ENC_NA);
5702 break;
5704 default:
5705 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %d", frame_type);
5708 return tvb_length(tvb);
5711 /* Dissection routine for AMQP 0-9 frames */
5713 static int
5714 dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5716 proto_item *ti;
5717 proto_item *amqp_tree = NULL;
5718 proto_item *args_tree;
5719 proto_item *prop_tree;
5720 guint length;
5721 guint8 frame_type;
5722 guint16 class_id, method_id;
5724 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMQP");
5725 col_clear(pinfo->cinfo, COL_INFO);
5727 /* Heuristic - protocol initialisation frame starts with 'AMQP' */
5728 if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) {
5729 guint8 proto_major;
5730 guint8 proto_minor;
5731 wmem_strbuf_t *strbuf;
5733 proto_major = tvb_get_guint8(tvb, 6);
5734 proto_minor = tvb_get_guint8(tvb, 7);
5735 strbuf = wmem_strbuf_new_label(wmem_packet_scope());
5736 wmem_strbuf_append_printf(strbuf,
5737 "Protocol-Header %u-%u",
5738 proto_major,
5739 proto_minor);
5740 col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(strbuf));
5741 col_set_fence(pinfo->cinfo, COL_INFO);
5743 if (tree) {
5744 ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA);
5745 amqp_tree = proto_item_add_subtree(ti, ett_amqp_init);
5746 proto_tree_add_item(amqp_tree, hf_amqp_init_protocol, tvb, 0, 4, ENC_ASCII|ENC_NA);
5747 proto_tree_add_item(amqp_tree, hf_amqp_init_id_major, tvb, 4, 1, ENC_BIG_ENDIAN);
5748 proto_tree_add_item(amqp_tree, hf_amqp_init_id_minor, tvb, 5, 1, ENC_BIG_ENDIAN);
5749 proto_tree_add_item(amqp_tree, hf_amqp_init_version_major, tvb, 6, 1, ENC_BIG_ENDIAN);
5750 proto_tree_add_item(amqp_tree, hf_amqp_init_version_minor, tvb, 7, 1, ENC_BIG_ENDIAN);
5752 return 8;
5755 if (tree) {
5756 ti = proto_tree_add_item(tree, proto_amqp, tvb, 0, -1, ENC_NA);
5757 amqp_tree = proto_item_add_subtree(ti, ett_amqp);
5758 proto_tree_add_item(amqp_tree, hf_amqp_0_9_type, tvb, 0, 1, ENC_BIG_ENDIAN);
5759 proto_tree_add_item(amqp_tree, hf_amqp_channel, tvb, 1, 2, ENC_BIG_ENDIAN);
5760 proto_tree_add_item(amqp_tree, hf_amqp_0_9_length, tvb, 3, 4, ENC_BIG_ENDIAN);
5763 frame_type = tvb_get_guint8(tvb, 0);
5764 length = tvb_get_ntohl(tvb, 3);
5766 switch (frame_type) {
5767 case AMQP_0_9_FRAME_TYPE_METHOD:
5768 class_id = tvb_get_ntohs(tvb, 7);
5769 proto_tree_add_item(amqp_tree, hf_amqp_0_9_method_class_id,
5770 tvb, 7, 2, ENC_BIG_ENDIAN);
5771 switch (class_id) {
5772 case AMQP_0_9_CLASS_CONNECTION:
5773 method_id = tvb_get_ntohs(tvb, 9);
5774 proto_tree_add_item(amqp_tree, hf_amqp_method_connection_method_id,
5775 tvb, 9, 2, ENC_BIG_ENDIAN);
5776 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
5777 tvb, 11, length - 4, ENC_NA);
5778 args_tree = proto_item_add_subtree(ti, ett_args);
5779 col_append_fstr(pinfo->cinfo, COL_INFO, "Connection.%s",
5780 val_to_str( method_id, amqp_method_connection_methods, "Unknown (%u)"));
5781 col_set_fence(pinfo->cinfo, COL_INFO);
5782 switch (method_id) {
5783 case AMQP_0_9_METHOD_CONNECTION_START:
5784 dissect_amqp_0_9_method_connection_start(tvb,
5785 pinfo, 11, args_tree);
5786 break;
5787 case AMQP_0_9_METHOD_CONNECTION_START_OK:
5788 dissect_amqp_0_9_method_connection_start_ok(tvb,
5789 pinfo, 11, args_tree);
5790 break;
5791 case AMQP_0_9_METHOD_CONNECTION_SECURE:
5792 dissect_amqp_0_9_method_connection_secure(tvb,
5793 11, args_tree);
5794 break;
5795 case AMQP_0_9_METHOD_CONNECTION_SECURE_OK:
5796 dissect_amqp_0_9_method_connection_secure_ok(tvb,
5797 11, args_tree);
5798 break;
5799 case AMQP_0_9_METHOD_CONNECTION_TUNE:
5800 dissect_amqp_0_9_method_connection_tune(tvb,
5801 11, args_tree);
5802 break;
5803 case AMQP_0_9_METHOD_CONNECTION_TUNE_OK:
5804 dissect_amqp_0_9_method_connection_tune_ok(tvb,
5805 11, args_tree);
5806 break;
5807 case AMQP_0_9_METHOD_CONNECTION_OPEN:
5808 dissect_amqp_0_9_method_connection_open(tvb,
5809 11, args_tree);
5810 break;
5811 case AMQP_0_9_METHOD_CONNECTION_OPEN_OK:
5812 dissect_amqp_0_9_method_connection_open_ok(tvb,
5813 11, args_tree);
5814 break;
5815 case AMQP_0_9_METHOD_CONNECTION_REDIRECT:
5816 dissect_amqp_0_9_method_connection_redirect(tvb,
5817 11, args_tree);
5818 break;
5819 case AMQP_0_9_METHOD_CONNECTION_CLOSE:
5820 dissect_amqp_0_9_method_connection_close(tvb,
5821 11, args_tree);
5822 break;
5823 case AMQP_0_9_METHOD_CONNECTION_CLOSE_OK:
5824 dissect_amqp_0_9_method_connection_close_ok(tvb,
5825 11, args_tree);
5826 break;
5827 default:
5828 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_connection_method, "Unknown connection method %u", method_id);
5830 break;
5831 case AMQP_0_9_CLASS_CHANNEL:
5832 method_id = tvb_get_ntohs(tvb, 9);
5833 proto_tree_add_item(amqp_tree, hf_amqp_method_channel_method_id,
5834 tvb, 9, 2, ENC_BIG_ENDIAN);
5835 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
5836 tvb, 11, length - 4, ENC_NA);
5837 args_tree = proto_item_add_subtree(ti, ett_args);
5839 col_append_fstr(pinfo->cinfo, COL_INFO, "Channel.%s",
5840 val_to_str( method_id, amqp_method_channel_methods, "Unknown (%u)"));
5841 col_set_fence(pinfo->cinfo, COL_INFO);
5843 switch (method_id) {
5844 case AMQP_0_9_METHOD_CHANNEL_OPEN:
5845 dissect_amqp_0_9_method_channel_open(tvb,
5846 11, args_tree);
5847 break;
5848 case AMQP_0_9_METHOD_CHANNEL_OPEN_OK:
5849 dissect_amqp_0_9_method_channel_open_ok(tvb,
5850 11, args_tree);
5851 break;
5852 case AMQP_0_9_METHOD_CHANNEL_FLOW:
5853 dissect_amqp_0_9_method_channel_flow(tvb,
5854 11, args_tree);
5855 break;
5856 case AMQP_0_9_METHOD_CHANNEL_FLOW_OK:
5857 dissect_amqp_0_9_method_channel_flow_ok(tvb,
5858 11, args_tree);
5859 break;
5860 case AMQP_0_9_METHOD_CHANNEL_CLOSE:
5861 dissect_amqp_0_9_method_channel_close(tvb,
5862 11, args_tree);
5863 break;
5864 case AMQP_0_9_METHOD_CHANNEL_CLOSE_OK:
5865 dissect_amqp_0_9_method_channel_close_ok(tvb,
5866 11, args_tree);
5867 break;
5868 case AMQP_0_9_METHOD_CHANNEL_RESUME:
5869 dissect_amqp_0_9_method_channel_resume(tvb,
5870 11, args_tree);
5871 break;
5872 case AMQP_0_9_METHOD_CHANNEL_PING:
5873 dissect_amqp_0_9_method_channel_ping(tvb,
5874 11, args_tree);
5875 break;
5876 case AMQP_0_9_METHOD_CHANNEL_PONG:
5877 dissect_amqp_0_9_method_channel_pong(tvb,
5878 11, args_tree);
5879 break;
5880 case AMQP_0_9_METHOD_CHANNEL_OK:
5881 dissect_amqp_0_9_method_channel_ok(tvb,
5882 11, args_tree);
5883 break;
5884 default:
5885 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_channel_method, "Unknown channel method %u", method_id);
5887 break;
5888 case AMQP_0_9_CLASS_ACCESS:
5889 method_id = tvb_get_ntohs(tvb, 9);
5890 proto_tree_add_item(amqp_tree, hf_amqp_method_access_method_id,
5891 tvb, 9, 2, ENC_BIG_ENDIAN);
5892 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
5893 tvb, 11, length - 4, ENC_NA);
5894 args_tree = proto_item_add_subtree(ti, ett_args);
5895 switch (method_id) {
5896 case AMQP_0_9_METHOD_ACCESS_REQUEST:
5897 dissect_amqp_0_9_method_access_request(tvb,
5898 11, args_tree);
5899 col_append_str(pinfo->cinfo, COL_INFO,
5900 "Access.Request ");
5901 col_set_fence(pinfo->cinfo, COL_INFO);
5902 break;
5903 case AMQP_0_9_METHOD_ACCESS_REQUEST_OK:
5904 dissect_amqp_0_9_method_access_request_ok(tvb,
5905 11, args_tree);
5906 col_append_str(pinfo->cinfo, COL_INFO,
5907 "Access.Request-Ok ");
5908 col_set_fence(pinfo->cinfo, COL_INFO);
5909 break;
5910 default:
5911 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_access_method, "Unknown access method %u", method_id);
5913 break;
5914 case AMQP_0_9_CLASS_EXCHANGE:
5915 method_id = tvb_get_ntohs(tvb, 9);
5916 proto_tree_add_item(amqp_tree, hf_amqp_method_exchange_method_id,
5917 tvb, 9, 2, ENC_BIG_ENDIAN);
5918 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
5919 tvb, 11, length - 4, ENC_NA);
5920 args_tree = proto_item_add_subtree(ti, ett_args);
5921 col_append_fstr(pinfo->cinfo, COL_INFO, "Exchange.%s",
5922 val_to_str( method_id, amqp_method_exchange_methods, "Unknown (%u)"));
5923 col_set_fence(pinfo->cinfo, COL_INFO);
5924 switch (method_id) {
5925 case AMQP_0_9_METHOD_EXCHANGE_DECLARE:
5926 dissect_amqp_0_9_method_exchange_declare(tvb,
5927 pinfo, 11, args_tree);
5928 break;
5929 case AMQP_0_9_METHOD_EXCHANGE_DECLARE_OK:
5930 dissect_amqp_0_9_method_exchange_declare_ok(tvb,
5931 11, args_tree);
5932 break;
5933 case AMQP_0_9_METHOD_EXCHANGE_BIND:
5934 dissect_amqp_0_9_method_exchange_bind(tvb,
5935 pinfo, 11, args_tree);
5936 break;
5937 case AMQP_0_9_METHOD_EXCHANGE_BIND_OK:
5938 dissect_amqp_0_9_method_exchange_bind_ok(tvb,
5939 11, args_tree);
5940 break;
5941 case AMQP_0_9_METHOD_EXCHANGE_DELETE:
5942 dissect_amqp_0_9_method_exchange_delete(tvb,
5943 11, args_tree);
5944 break;
5945 case AMQP_0_9_METHOD_EXCHANGE_DELETE_OK:
5946 dissect_amqp_0_9_method_exchange_delete_ok(tvb,
5947 11, args_tree);
5948 break;
5949 default:
5950 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_exchange_method, "Unknown exchange method %u", method_id);
5952 break;
5953 case AMQP_0_9_CLASS_QUEUE:
5954 method_id = tvb_get_ntohs(tvb, 9);
5955 proto_tree_add_item(amqp_tree, hf_amqp_method_queue_method_id,
5956 tvb, 9, 2, ENC_BIG_ENDIAN);
5957 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
5958 tvb, 11, length - 4, ENC_NA);
5959 args_tree = proto_item_add_subtree(ti, ett_args);
5960 col_append_fstr(pinfo->cinfo, COL_INFO, "Queue.%s",
5961 val_to_str( method_id, amqp_method_queue_methods, "Unknown (%u)"));
5962 col_set_fence(pinfo->cinfo, COL_INFO);
5964 switch (method_id) {
5965 case AMQP_0_9_METHOD_QUEUE_DECLARE:
5966 dissect_amqp_0_9_method_queue_declare(tvb,
5967 pinfo, 11, args_tree);
5968 break;
5969 case AMQP_0_9_METHOD_QUEUE_DECLARE_OK:
5970 dissect_amqp_0_9_method_queue_declare_ok(tvb,
5971 11, args_tree);
5972 break;
5973 case AMQP_0_9_METHOD_QUEUE_BIND:
5974 dissect_amqp_0_9_method_queue_bind(tvb,
5975 pinfo, 11, args_tree);
5976 break;
5977 case AMQP_0_9_METHOD_QUEUE_BIND_OK:
5978 dissect_amqp_0_9_method_queue_bind_ok(tvb,
5979 11, args_tree);
5980 break;
5981 case AMQP_0_9_METHOD_QUEUE_UNBIND:
5982 dissect_amqp_0_9_method_queue_unbind(tvb,
5983 pinfo, 11, args_tree);
5984 break;
5985 case AMQP_0_9_METHOD_QUEUE_UNBIND_OK:
5986 dissect_amqp_0_9_method_queue_unbind_ok(tvb,
5987 11, args_tree);
5988 break;
5989 case AMQP_0_9_METHOD_QUEUE_PURGE:
5990 dissect_amqp_0_9_method_queue_purge(tvb,
5991 11, args_tree);
5992 break;
5993 case AMQP_0_9_METHOD_QUEUE_PURGE_OK:
5994 dissect_amqp_0_9_method_queue_purge_ok(tvb,
5995 11, args_tree);
5996 break;
5997 case AMQP_0_9_METHOD_QUEUE_DELETE:
5998 dissect_amqp_0_9_method_queue_delete(tvb,
5999 11, args_tree);
6000 break;
6001 case AMQP_0_9_METHOD_QUEUE_DELETE_OK:
6002 dissect_amqp_0_9_method_queue_delete_ok(tvb,
6003 11, args_tree);
6004 break;
6005 default:
6006 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_queue_method, "Unknown queue method %u", method_id);
6008 break;
6009 case AMQP_0_9_CLASS_BASIC:
6010 method_id = tvb_get_ntohs(tvb, 9);
6011 proto_tree_add_item(amqp_tree, hf_amqp_method_basic_method_id,
6012 tvb, 9, 2, ENC_BIG_ENDIAN);
6013 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6014 tvb, 11, length - 4, ENC_NA);
6015 args_tree = proto_item_add_subtree(ti, ett_args);
6017 col_append_fstr(pinfo->cinfo, COL_INFO, "Basic.%s",
6018 val_to_str( method_id, amqp_method_basic_methods, "Unknown (%u)"));
6019 col_set_fence(pinfo->cinfo, COL_INFO);
6021 switch (method_id) {
6022 case AMQP_0_9_METHOD_BASIC_QOS:
6023 dissect_amqp_0_9_method_basic_qos(tvb,
6024 11, args_tree);
6025 break;
6026 case AMQP_0_9_METHOD_BASIC_QOS_OK:
6027 dissect_amqp_0_9_method_basic_qos_ok(tvb,
6028 11, args_tree);
6029 break;
6030 case AMQP_0_9_METHOD_BASIC_CONSUME:
6031 dissect_amqp_0_9_method_basic_consume(tvb,
6032 pinfo, 11, args_tree);
6033 break;
6034 case AMQP_0_9_METHOD_BASIC_CONSUME_OK:
6035 dissect_amqp_0_9_method_basic_consume_ok(tvb,
6036 11, args_tree);
6037 break;
6038 case AMQP_0_9_METHOD_BASIC_CANCEL:
6039 dissect_amqp_0_9_method_basic_cancel(tvb,
6040 11, args_tree);
6041 break;
6042 case AMQP_0_9_METHOD_BASIC_CANCEL_OK:
6043 dissect_amqp_0_9_method_basic_cancel_ok(tvb,
6044 11, args_tree);
6045 break;
6046 case AMQP_0_9_METHOD_BASIC_PUBLISH:
6047 dissect_amqp_0_9_method_basic_publish(tvb,
6048 11, args_tree);
6049 break;
6050 case AMQP_0_9_METHOD_BASIC_RETURN:
6051 dissect_amqp_0_9_method_basic_return(tvb,
6052 11, args_tree);
6053 break;
6054 case AMQP_0_9_METHOD_BASIC_DELIVER:
6055 dissect_amqp_0_9_method_basic_deliver(tvb,
6056 11, args_tree);
6057 break;
6058 case AMQP_0_9_METHOD_BASIC_GET:
6059 dissect_amqp_0_9_method_basic_get(tvb,
6060 11, args_tree);
6061 break;
6062 case AMQP_0_9_METHOD_BASIC_GET_OK:
6063 dissect_amqp_0_9_method_basic_get_ok(tvb,
6064 11, args_tree);
6065 break;
6066 case AMQP_0_9_METHOD_BASIC_GET_EMPTY:
6067 dissect_amqp_0_9_method_basic_get_empty(tvb,
6068 11, args_tree);
6069 break;
6070 case AMQP_0_9_METHOD_BASIC_ACK:
6071 dissect_amqp_0_9_method_basic_ack(tvb,
6072 11, args_tree);
6073 break;
6074 case AMQP_0_9_METHOD_BASIC_REJECT:
6075 dissect_amqp_0_9_method_basic_reject(tvb,
6076 11, args_tree);
6077 break;
6078 case AMQP_0_9_METHOD_BASIC_RECOVER:
6079 dissect_amqp_0_9_method_basic_recover(tvb,
6080 11, args_tree);
6081 break;
6082 default:
6083 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_basic_method, "Unknown basic method %u", method_id);
6085 break;
6086 case AMQP_0_9_CLASS_FILE:
6087 method_id = tvb_get_ntohs(tvb, 9);
6088 proto_tree_add_item(amqp_tree, hf_amqp_method_file_method_id,
6089 tvb, 9, 2, ENC_BIG_ENDIAN);
6090 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6091 tvb, 11, length - 4, ENC_NA);
6092 args_tree = proto_item_add_subtree(ti, ett_args);
6094 col_append_fstr(pinfo->cinfo, COL_INFO, "File.%s",
6095 val_to_str( method_id, amqp_method_file_methods, "Unknown (%u)"));
6096 col_set_fence(pinfo->cinfo, COL_INFO);
6098 switch (method_id) {
6099 case AMQP_0_9_METHOD_FILE_QOS:
6100 dissect_amqp_0_9_method_file_qos(tvb,
6101 11, args_tree);
6102 break;
6103 case AMQP_0_9_METHOD_FILE_QOS_OK:
6104 dissect_amqp_0_9_method_file_qos_ok(tvb,
6105 11, args_tree);
6106 break;
6107 case AMQP_0_9_METHOD_FILE_CONSUME:
6108 dissect_amqp_0_9_method_file_consume(tvb,
6109 pinfo, 11, args_tree);
6110 break;
6111 case AMQP_0_9_METHOD_FILE_CONSUME_OK:
6112 dissect_amqp_0_9_method_file_consume_ok(tvb,
6113 11, args_tree);
6114 break;
6115 case AMQP_0_9_METHOD_FILE_CANCEL:
6116 dissect_amqp_0_9_method_file_cancel(tvb,
6117 11, args_tree);
6118 break;
6119 case AMQP_0_9_METHOD_FILE_CANCEL_OK:
6120 dissect_amqp_0_9_method_file_cancel_ok(tvb,
6121 11, args_tree);
6122 break;
6123 case AMQP_0_9_METHOD_FILE_OPEN:
6124 dissect_amqp_0_9_method_file_open(tvb,
6125 11, args_tree);
6126 break;
6127 case AMQP_0_9_METHOD_FILE_OPEN_OK:
6128 dissect_amqp_0_9_method_file_open_ok(tvb,
6129 11, args_tree);
6130 break;
6131 case AMQP_0_9_METHOD_FILE_STAGE:
6132 dissect_amqp_0_9_method_file_stage(tvb,
6133 11, args_tree);
6134 break;
6135 case AMQP_0_9_METHOD_FILE_PUBLISH:
6136 dissect_amqp_0_9_method_file_publish(tvb,
6137 11, args_tree);
6138 break;
6139 case AMQP_0_9_METHOD_FILE_RETURN:
6140 dissect_amqp_0_9_method_file_return(tvb,
6141 11, args_tree);
6142 break;
6143 case AMQP_0_9_METHOD_FILE_DELIVER:
6144 dissect_amqp_0_9_method_file_deliver(tvb,
6145 11, args_tree);
6146 break;
6147 case AMQP_0_9_METHOD_FILE_ACK:
6148 dissect_amqp_0_9_method_file_ack(tvb,
6149 11, args_tree);
6150 break;
6151 case AMQP_0_9_METHOD_FILE_REJECT:
6152 dissect_amqp_0_9_method_file_reject(tvb,
6153 11, args_tree);
6154 break;
6155 default:
6156 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_file_method, "Unknown file method %u", method_id);
6158 break;
6159 case AMQP_0_9_CLASS_STREAM:
6160 method_id = tvb_get_ntohs(tvb, 9);
6161 proto_tree_add_item(amqp_tree, hf_amqp_method_stream_method_id,
6162 tvb, 9, 2, ENC_BIG_ENDIAN);
6163 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6164 tvb, 11, length - 4, ENC_NA);
6165 args_tree = proto_item_add_subtree(ti, ett_args);
6167 col_append_fstr(pinfo->cinfo, COL_INFO, "Stream.%s",
6168 val_to_str( method_id, amqp_method_stream_methods, "Unknown (%u)"));
6169 col_set_fence(pinfo->cinfo, COL_INFO);
6171 switch (method_id) {
6172 case AMQP_0_9_METHOD_STREAM_QOS:
6173 dissect_amqp_0_9_method_stream_qos(tvb,
6174 11, args_tree);
6175 break;
6176 case AMQP_0_9_METHOD_STREAM_QOS_OK:
6177 dissect_amqp_0_9_method_stream_qos_ok(tvb,
6178 11, args_tree);
6179 break;
6180 case AMQP_0_9_METHOD_STREAM_CONSUME:
6181 dissect_amqp_0_9_method_stream_consume(tvb,
6182 pinfo, 11, args_tree);
6183 break;
6184 case AMQP_0_9_METHOD_STREAM_CONSUME_OK:
6185 dissect_amqp_0_9_method_stream_consume_ok(tvb,
6186 11, args_tree);
6187 break;
6188 case AMQP_0_9_METHOD_STREAM_CANCEL:
6189 dissect_amqp_0_9_method_stream_cancel(tvb,
6190 11, args_tree);
6191 break;
6192 case AMQP_0_9_METHOD_STREAM_CANCEL_OK:
6193 dissect_amqp_0_9_method_stream_cancel_ok(tvb,
6194 11, args_tree);
6195 break;
6196 case AMQP_0_9_METHOD_STREAM_PUBLISH:
6197 dissect_amqp_0_9_method_stream_publish(tvb,
6198 11, args_tree);
6199 break;
6200 case AMQP_0_9_METHOD_STREAM_RETURN:
6201 dissect_amqp_0_9_method_stream_return(tvb,
6202 11, args_tree);
6203 break;
6204 case AMQP_0_9_METHOD_STREAM_DELIVER:
6205 dissect_amqp_0_9_method_stream_deliver(tvb,
6206 11, args_tree);
6207 break;
6208 default:
6209 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_stream_method, "Unknown stream method %u", method_id);
6211 break;
6212 case AMQP_0_9_CLASS_TX:
6213 method_id = tvb_get_ntohs(tvb, 9);
6214 proto_tree_add_item(amqp_tree, hf_amqp_method_tx_method_id,
6215 tvb, 9, 2, ENC_BIG_ENDIAN);
6216 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6217 tvb, 11, length - 4, ENC_NA);
6218 args_tree = proto_item_add_subtree(ti, ett_args);
6220 col_append_fstr(pinfo->cinfo, COL_INFO, "Tx.%s",
6221 val_to_str( method_id, amqp_method_tx_methods, "Unknown (%u)"));
6222 col_set_fence(pinfo->cinfo, COL_INFO);
6224 switch (method_id) {
6225 case AMQP_0_9_METHOD_TX_SELECT:
6226 dissect_amqp_0_9_method_tx_select(tvb,
6227 11, args_tree);
6228 break;
6229 case AMQP_0_9_METHOD_TX_SELECT_OK:
6230 dissect_amqp_0_9_method_tx_select_ok(tvb,
6231 11, args_tree);
6232 break;
6233 case AMQP_0_9_METHOD_TX_COMMIT:
6234 dissect_amqp_0_9_method_tx_commit(tvb,
6235 11, args_tree);
6236 break;
6237 case AMQP_0_9_METHOD_TX_COMMIT_OK:
6238 dissect_amqp_0_9_method_tx_commit_ok(tvb,
6239 11, args_tree);
6240 break;
6241 case AMQP_0_9_METHOD_TX_ROLLBACK:
6242 dissect_amqp_0_9_method_tx_rollback(tvb,
6243 11, args_tree);
6244 break;
6245 case AMQP_0_9_METHOD_TX_ROLLBACK_OK:
6246 dissect_amqp_0_9_method_tx_rollback_ok(tvb,
6247 11, args_tree);
6248 break;
6249 default:
6250 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_tx_method, "Unknown tx method %u", method_id);
6252 break;
6253 case AMQP_0_9_CLASS_DTX:
6254 method_id = tvb_get_ntohs(tvb, 9);
6255 proto_tree_add_item(amqp_tree, hf_amqp_method_dtx_method_id,
6256 tvb, 9, 2, ENC_BIG_ENDIAN);
6257 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6258 tvb, 11, length - 4, ENC_NA);
6259 args_tree = proto_item_add_subtree(ti, ett_args);
6261 col_append_fstr(pinfo->cinfo, COL_INFO, "Dtx.%s",
6262 val_to_str( method_id, amqp_method_dtx_methods, "Unknown (%u)"));
6263 col_set_fence(pinfo->cinfo, COL_INFO);
6265 switch (method_id) {
6266 case AMQP_0_9_METHOD_DTX_SELECT:
6267 dissect_amqp_0_9_method_dtx_select(tvb,
6268 11, args_tree);
6269 break;
6270 case AMQP_0_9_METHOD_DTX_SELECT_OK:
6271 dissect_amqp_0_9_method_dtx_select_ok(tvb,
6272 11, args_tree);
6273 break;
6274 case AMQP_0_9_METHOD_DTX_START:
6275 dissect_amqp_0_9_method_dtx_start(tvb,
6276 11, args_tree);
6277 break;
6278 case AMQP_0_9_METHOD_DTX_START_OK:
6279 dissect_amqp_0_9_method_dtx_start_ok(tvb,
6280 11, args_tree);
6281 break;
6282 default:
6283 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_dtx_method, "Unknown dtx method %u", method_id);
6285 break;
6286 case AMQP_0_9_CLASS_TUNNEL:
6287 method_id = tvb_get_ntohs(tvb, 9);
6288 proto_tree_add_item(amqp_tree, hf_amqp_method_tunnel_method_id,
6289 tvb, 9, 2, ENC_BIG_ENDIAN);
6290 ti = proto_tree_add_item(amqp_tree, hf_amqp_method_arguments,
6291 tvb, 11, length - 4, ENC_NA);
6292 args_tree = proto_item_add_subtree(ti, ett_args);
6293 switch (method_id) {
6294 case AMQP_0_9_METHOD_TUNNEL_REQUEST:
6295 dissect_amqp_0_9_method_tunnel_request(tvb,
6296 pinfo, 11, args_tree);
6297 col_append_str(pinfo->cinfo, COL_INFO,
6298 "Tunnel.Request ");
6299 col_set_fence(pinfo->cinfo, COL_INFO);
6300 break;
6301 default:
6302 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_tunnel_method, "Unknown tunnel method %u", method_id);
6304 break;
6305 default:
6306 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_method_class, "Unknown method class %u", class_id);
6308 break;
6309 case AMQP_0_9_FRAME_TYPE_CONTENT_HEADER:
6310 class_id = tvb_get_ntohs(tvb, 7);
6311 proto_tree_add_item(amqp_tree, hf_amqp_header_class_id,
6312 tvb, 7, 2, ENC_BIG_ENDIAN);
6313 proto_tree_add_item(amqp_tree, hf_amqp_header_weight,
6314 tvb, 9, 2, ENC_BIG_ENDIAN);
6315 proto_tree_add_item(amqp_tree, hf_amqp_header_body_size,
6316 tvb, 11, 8, ENC_BIG_ENDIAN);
6317 proto_tree_add_item(amqp_tree, hf_amqp_header_property_flags,
6318 tvb, 19, 2, ENC_BIG_ENDIAN);
6319 ti = proto_tree_add_item(amqp_tree, hf_amqp_header_properties,
6320 tvb, 21, length - 14, ENC_NA);
6321 prop_tree = proto_item_add_subtree(ti, ett_props);
6322 switch (class_id) {
6323 case AMQP_0_9_CLASS_BASIC:
6324 dissect_amqp_0_9_content_header_basic(tvb,
6325 pinfo, 21, prop_tree);
6326 break;
6327 case AMQP_0_9_CLASS_FILE:
6328 dissect_amqp_0_9_content_header_file(tvb,
6329 pinfo, 21, prop_tree);
6330 break;
6331 case AMQP_0_9_CLASS_STREAM:
6332 dissect_amqp_0_9_content_header_stream(tvb,
6333 pinfo, 21, prop_tree);
6334 break;
6335 case AMQP_0_9_CLASS_TUNNEL:
6336 dissect_amqp_0_9_content_header_tunnel(tvb,
6337 pinfo, 21, prop_tree);
6338 break;
6339 default:
6340 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_header_class, "Unknown header class %u", class_id);
6342 col_append_str(pinfo->cinfo, COL_INFO, "Content-Header ");
6343 col_set_fence(pinfo->cinfo, COL_INFO);
6344 break;
6345 case AMQP_0_9_FRAME_TYPE_CONTENT_BODY:
6346 proto_tree_add_item(amqp_tree, hf_amqp_payload,
6347 tvb, 7, length, ENC_NA);
6348 col_append_str(pinfo->cinfo, COL_INFO, "Content-Body ");
6349 col_set_fence(pinfo->cinfo, COL_INFO);
6350 break;
6351 default:
6352 expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %u", frame_type);
6355 return tvb_length(tvb);
6358 /* Dissection routine for method Connection.Start */
6360 static int
6361 dissect_amqp_0_9_method_connection_start(tvbuff_t *tvb, packet_info *pinfo,
6362 int offset, proto_tree *args_tree)
6364 proto_item *ti;
6366 /* version-major (octet) */
6367 proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_major,
6368 tvb, offset, 1, ENC_BIG_ENDIAN);
6369 offset += 1;
6371 /* version-minor (octet) */
6372 proto_tree_add_item(args_tree, hf_amqp_method_connection_start_version_minor,
6373 tvb, offset, 1, ENC_BIG_ENDIAN);
6374 offset += 1;
6376 /* server-properties (table) */
6377 ti = proto_tree_add_item(
6378 args_tree, hf_amqp_method_connection_start_server_properties,
6379 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6380 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
6381 offset += 4 + tvb_get_ntohl(tvb, offset);
6383 /* mechanisms (longstr) */
6384 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_mechanisms,
6385 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6386 offset += 4 + tvb_get_ntohl(tvb, offset);
6388 /* locales (longstr) */
6389 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_start_locales,
6390 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6391 offset += 4 + tvb_get_ntohl(tvb, offset);
6393 return offset;
6396 /* Dissection routine for method Connection.Start-Ok */
6398 static int
6399 dissect_amqp_0_9_method_connection_start_ok(tvbuff_t *tvb, packet_info *pinfo,
6400 int offset, proto_tree *args_tree)
6402 proto_item *ti;
6404 /* client-properties (table) */
6405 ti = proto_tree_add_item(
6406 args_tree, hf_amqp_method_connection_start_ok_client_properties,
6407 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6408 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
6409 offset += 4 + tvb_get_ntohl(tvb, offset);
6411 /* mechanism (shortstr) */
6412 proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_mechanism,
6413 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6414 offset += 1 + tvb_get_guint8(tvb, offset);
6416 /* response (longstr) */
6417 proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_response,
6418 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6419 offset += 4 + tvb_get_ntohl(tvb, offset);
6421 /* locale (shortstr) */
6422 proto_tree_add_item(args_tree, hf_amqp_method_connection_start_ok_locale,
6423 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6424 offset += 1 + tvb_get_guint8(tvb, offset);
6426 return offset;
6429 /* Dissection routine for method Connection.Secure */
6431 static int
6432 dissect_amqp_0_9_method_connection_secure(tvbuff_t *tvb,
6433 int offset, proto_tree *args_tree)
6435 /* challenge (longstr) */
6436 proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_challenge,
6437 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6438 offset += 4 + tvb_get_ntohl(tvb, offset);
6440 return offset;
6443 /* Dissection routine for method Connection.Secure-Ok */
6445 static int
6446 dissect_amqp_0_9_method_connection_secure_ok(tvbuff_t *tvb,
6447 int offset, proto_tree *args_tree)
6449 /* response (longstr) */
6450 proto_tree_add_item(args_tree, hf_amqp_method_connection_secure_ok_response,
6451 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6452 offset += 4 + tvb_get_ntohl(tvb, offset);
6454 return offset;
6457 /* Dissection routine for method Connection.Tune */
6459 static int
6460 dissect_amqp_0_9_method_connection_tune(tvbuff_t *tvb,
6461 int offset, proto_tree *args_tree)
6463 /* channel-max (short) */
6464 proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_channel_max,
6465 tvb, offset, 2, ENC_BIG_ENDIAN);
6466 offset += 2;
6468 /* frame-max (long) */
6469 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_tune_frame_max,
6470 tvb, offset, 4, ENC_BIG_ENDIAN);
6471 offset += 4;
6473 /* heartbeat (short) */
6474 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_tune_heartbeat,
6475 tvb, offset, 2, ENC_BIG_ENDIAN);
6476 offset += 2;
6478 return offset;
6481 /* Dissection routine for method Connection.Tune-Ok */
6483 static int
6484 dissect_amqp_0_9_method_connection_tune_ok(tvbuff_t *tvb,
6485 int offset, proto_tree *args_tree)
6487 /* channel-max (short) */
6488 proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_ok_channel_max,
6489 tvb, offset, 2, ENC_BIG_ENDIAN);
6490 offset += 2;
6492 /* frame-max (long) */
6493 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_tune_ok_frame_max,
6494 tvb, offset, 4, ENC_BIG_ENDIAN);
6495 offset += 4;
6497 /* heartbeat (short) */
6498 proto_tree_add_item(args_tree, hf_amqp_method_connection_tune_ok_heartbeat,
6499 tvb, offset, 2, ENC_BIG_ENDIAN);
6500 offset += 2;
6502 return offset;
6505 /* Dissection routine for method Connection.Open */
6507 static int
6508 dissect_amqp_0_9_method_connection_open(tvbuff_t *tvb,
6509 int offset, proto_tree *args_tree)
6511 /* virtual-host (shortstr) */
6512 proto_tree_add_item(args_tree, hf_amqp_method_connection_open_virtual_host,
6513 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6514 offset += 1 + tvb_get_guint8(tvb, offset);
6516 /* capabilities (shortstr) */
6517 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_open_capabilities,
6518 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6519 offset += 1 + tvb_get_guint8(tvb, offset);
6521 /* insist (bit) */
6522 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_open_insist,
6523 tvb, offset, 1, ENC_BIG_ENDIAN);
6525 return offset;
6528 /* Dissection routine for method Connection.Open-Ok */
6530 static int
6531 dissect_amqp_0_9_method_connection_open_ok(tvbuff_t *tvb,
6532 int offset, proto_tree *args_tree)
6534 /* known-hosts (shortstr) */
6535 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_open_ok_known_hosts,
6536 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6537 offset += 1 + tvb_get_guint8(tvb, offset);
6539 return offset;
6542 /* Dissection routine for method Connection.Redirect */
6544 static int
6545 dissect_amqp_0_9_method_connection_redirect(tvbuff_t *tvb,
6546 int offset, proto_tree *args_tree)
6548 /* host (shortstr) */
6549 proto_tree_add_item(args_tree, hf_amqp_method_connection_redirect_host,
6550 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6551 offset += 1 + tvb_get_guint8(tvb, offset);
6553 /* known-hosts (shortstr) */
6554 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_redirect_known_hosts,
6555 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6556 offset += 1 + tvb_get_guint8(tvb, offset);
6558 return offset;
6561 /* Dissection routine for method Connection.Close */
6563 static int
6564 dissect_amqp_0_9_method_connection_close(tvbuff_t *tvb,
6565 int offset, proto_tree *args_tree)
6567 /* reply-code (short) */
6568 proto_tree_add_item(args_tree, hf_amqp_0_9_method_connection_close_reply_code,
6569 tvb, offset, 2, ENC_BIG_ENDIAN);
6570 offset += 2;
6572 /* reply-text (shortstr) */
6573 proto_tree_add_item(args_tree, hf_amqp_method_connection_close_reply_text,
6574 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6575 offset += 1 + tvb_get_guint8(tvb, offset);
6577 /* class-id (short) */
6578 proto_tree_add_item(args_tree, hf_amqp_method_connection_close_class_id,
6579 tvb, offset, 2, ENC_BIG_ENDIAN);
6580 offset += 2;
6582 /* method-id (short) */
6583 proto_tree_add_item(args_tree, hf_amqp_method_connection_close_method_id,
6584 tvb, offset, 2, ENC_BIG_ENDIAN);
6585 offset += 2;
6587 return offset;
6590 /* Dissection routine for method Connection.Close-Ok */
6592 static int
6593 dissect_amqp_0_9_method_connection_close_ok(tvbuff_t *tvb _U_,
6594 int offset, proto_tree *args_tree _U_)
6596 return offset;
6599 /* Dissection routine for method Channel.Open */
6601 static int
6602 dissect_amqp_0_9_method_channel_open(tvbuff_t *tvb,
6603 int offset, proto_tree *args_tree)
6605 /* out-of-band (shortstr) */
6606 proto_tree_add_item(args_tree, hf_amqp_method_channel_open_out_of_band,
6607 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6608 offset += 1 + tvb_get_guint8(tvb, offset);
6610 return offset;
6613 /* Dissection routine for method Channel.Open-Ok */
6615 static int
6616 dissect_amqp_0_9_method_channel_open_ok(tvbuff_t *tvb,
6617 int offset, proto_tree *args_tree)
6619 /* channel-id (longstr) */
6620 proto_tree_add_item(args_tree, hf_amqp_method_channel_open_ok_channel_id,
6621 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6622 offset += 4 + tvb_get_ntohl(tvb, offset);
6624 return offset;
6627 /* Dissection routine for method Channel.Flow */
6629 static int
6630 dissect_amqp_0_9_method_channel_flow(tvbuff_t *tvb,
6631 int offset, proto_tree *args_tree)
6633 /* active (bit) */
6634 proto_tree_add_item(args_tree, hf_amqp_method_channel_flow_active,
6635 tvb, offset, 1, ENC_BIG_ENDIAN);
6637 return offset;
6640 /* Dissection routine for method Channel.Flow-Ok */
6642 static int
6643 dissect_amqp_0_9_method_channel_flow_ok(tvbuff_t *tvb,
6644 int offset, proto_tree *args_tree)
6646 /* active (bit) */
6647 proto_tree_add_item(args_tree, hf_amqp_method_channel_flow_ok_active,
6648 tvb, offset, 1, ENC_BIG_ENDIAN);
6650 return offset;
6653 /* Dissection routine for method Channel.Close */
6655 static int
6656 dissect_amqp_0_9_method_channel_close(tvbuff_t *tvb,
6657 int offset, proto_tree *args_tree)
6659 /* reply-code (short) */
6660 proto_tree_add_item(args_tree, hf_amqp_method_channel_close_reply_code,
6661 tvb, offset, 2, ENC_BIG_ENDIAN);
6662 offset += 2;
6664 /* reply-text (shortstr) */
6665 proto_tree_add_item(args_tree, hf_amqp_method_channel_close_reply_text,
6666 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6667 offset += 1 + tvb_get_guint8(tvb, offset);
6669 /* class-id (short) */
6670 proto_tree_add_item(args_tree, hf_amqp_method_channel_close_class_id,
6671 tvb, offset, 2, ENC_BIG_ENDIAN);
6672 offset += 2;
6674 /* method-id (short) */
6675 proto_tree_add_item(args_tree, hf_amqp_method_channel_close_method_id,
6676 tvb, offset, 2, ENC_BIG_ENDIAN);
6677 offset += 2;
6679 return offset;
6682 /* Dissection routine for method Channel.Close-Ok */
6684 static int
6685 dissect_amqp_0_9_method_channel_close_ok(tvbuff_t *tvb _U_,
6686 int offset, proto_tree *args_tree _U_)
6688 return offset;
6691 /* Dissection routine for method Channel.Resume */
6693 static int
6694 dissect_amqp_0_9_method_channel_resume(tvbuff_t *tvb,
6695 int offset, proto_tree *args_tree)
6697 /* channel-id (longstr) */
6698 proto_tree_add_item(args_tree, hf_amqp_method_channel_resume_channel_id,
6699 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6700 offset += 4 + tvb_get_ntohl(tvb, offset);
6702 return offset;
6705 /* Dissection routine for method Channel.Ping */
6707 static int
6708 dissect_amqp_0_9_method_channel_ping(tvbuff_t *tvb _U_,
6709 int offset, proto_tree *args_tree _U_)
6711 return offset;
6714 /* Dissection routine for method Channel.Pong */
6716 static int
6717 dissect_amqp_0_9_method_channel_pong(tvbuff_t *tvb _U_,
6718 int offset, proto_tree *args_tree _U_)
6720 return offset;
6723 /* Dissection routine for method Channel.Ok */
6725 static int
6726 dissect_amqp_0_9_method_channel_ok(tvbuff_t *tvb _U_,
6727 int offset, proto_tree *args_tree _U_)
6729 return offset;
6732 /* Dissection routine for method Access.Request */
6734 static int
6735 dissect_amqp_0_9_method_access_request(tvbuff_t *tvb,
6736 int offset, proto_tree *args_tree)
6738 /* realm (shortstr) */
6739 proto_tree_add_item(args_tree, hf_amqp_method_access_request_realm,
6740 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6741 offset += 1 + tvb_get_guint8(tvb, offset);
6743 /* exclusive (bit) */
6744 proto_tree_add_item(args_tree, hf_amqp_method_access_request_exclusive,
6745 tvb, offset, 1, ENC_BIG_ENDIAN);
6747 /* passive (bit) */
6748 proto_tree_add_item(args_tree, hf_amqp_method_access_request_passive,
6749 tvb, offset, 1, ENC_BIG_ENDIAN);
6751 /* active (bit) */
6752 proto_tree_add_item(args_tree, hf_amqp_method_access_request_active,
6753 tvb, offset, 1, ENC_BIG_ENDIAN);
6755 /* write (bit) */
6756 proto_tree_add_item(args_tree, hf_amqp_method_access_request_write,
6757 tvb, offset, 1, ENC_BIG_ENDIAN);
6759 /* read (bit) */
6760 proto_tree_add_item(args_tree, hf_amqp_method_access_request_read,
6761 tvb, offset, 1, ENC_BIG_ENDIAN);
6763 return offset;
6766 /* Dissection routine for method Access.Request-Ok */
6768 static int
6769 dissect_amqp_0_9_method_access_request_ok(tvbuff_t *tvb,
6770 int offset, proto_tree *args_tree)
6772 /* ticket (short) */
6773 proto_tree_add_item(args_tree, hf_amqp_method_access_request_ok_ticket,
6774 tvb, offset, 2, ENC_BIG_ENDIAN);
6775 offset += 2;
6777 return offset;
6780 /* Dissection routine for method Exchange.Declare */
6782 static int
6783 dissect_amqp_0_9_method_exchange_declare(tvbuff_t *tvb, packet_info *pinfo,
6784 int offset, proto_tree *args_tree)
6786 proto_item *ti;
6788 /* ticket (short) */
6789 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_ticket,
6790 tvb, offset, 2, ENC_BIG_ENDIAN);
6791 offset += 2;
6793 /* exchange (shortstr) */
6794 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_exchange,
6795 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6796 offset += 1 + tvb_get_guint8(tvb, offset);
6798 /* type (shortstr) */
6799 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_type,
6800 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6801 offset += 1 + tvb_get_guint8(tvb, offset);
6803 /* passive (bit) */
6804 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_passive,
6805 tvb, offset, 1, ENC_BIG_ENDIAN);
6807 /* durable (bit) */
6808 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_durable,
6809 tvb, offset, 1, ENC_BIG_ENDIAN);
6811 /* auto-delete (bit) */
6812 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_auto_delete,
6813 tvb, offset, 1, ENC_BIG_ENDIAN);
6815 /* internal (bit) */
6816 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_internal,
6817 tvb, offset, 1, ENC_BIG_ENDIAN);
6819 /* nowait (bit) */
6820 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_nowait,
6821 tvb, offset, 1, ENC_BIG_ENDIAN);
6823 offset += 1;
6824 /* arguments (table) */
6825 ti = proto_tree_add_item(
6826 args_tree, hf_amqp_method_exchange_declare_arguments,
6827 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6828 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
6829 offset += 4 + tvb_get_ntohl(tvb, offset);
6831 return offset;
6834 /* Dissection routine for method Exchange.Declare-Ok */
6836 static int
6837 dissect_amqp_0_9_method_exchange_declare_ok(tvbuff_t *tvb _U_,
6838 int offset, proto_tree *args_tree _U_)
6840 return offset;
6843 /* Dissection routine for method Exchange.Bind */
6845 static int
6846 dissect_amqp_0_9_method_exchange_bind(tvbuff_t *tvb, packet_info *pinfo,
6847 int offset, proto_tree *args_tree)
6849 proto_item *ti;
6851 /* ticket (short) */
6852 proto_tree_add_item(args_tree, hf_amqp_method_exchange_declare_ticket,
6853 tvb, offset, 2, ENC_BIG_ENDIAN);
6854 offset += 2;
6856 /* destination (shortstr) */
6857 proto_tree_add_item(args_tree, hf_amqp_method_exchange_bind_destination,
6858 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6859 offset += 1 + tvb_get_guint8(tvb, offset);
6861 /* source (shortstr) */
6862 proto_tree_add_item(args_tree, hf_amqp_method_exchange_bind_source,
6863 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6864 offset += 1 + tvb_get_guint8(tvb, offset);
6866 /* routing-key (shortstr) */
6867 proto_tree_add_item(args_tree, hf_amqp_method_exchange_bind_routing_key,
6868 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6869 offset += 1 + tvb_get_guint8(tvb, offset);
6871 /* nowait (bit) */
6872 proto_tree_add_item(args_tree, hf_amqp_method_exchange_bind_nowait,
6873 tvb, offset, 1, ENC_BIG_ENDIAN);
6874 offset += 1;
6876 /* arguments (table) */
6877 ti = proto_tree_add_item(
6878 args_tree, hf_amqp_method_exchange_bind_arguments,
6879 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6880 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
6881 offset += 4 + tvb_get_ntohl(tvb, offset);
6883 return offset;
6886 /* Dissection routine for method Exchange.Bind-Ok */
6888 static int
6889 dissect_amqp_0_9_method_exchange_bind_ok(tvbuff_t *tvb _U_,
6890 int offset, proto_tree *args_tree _U_)
6892 return offset;
6895 /* Dissection routine for method Exchange.Delete */
6897 static int
6898 dissect_amqp_0_9_method_exchange_delete(tvbuff_t *tvb,
6899 int offset, proto_tree *args_tree)
6901 /* ticket (short) */
6902 proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_ticket,
6903 tvb, offset, 2, ENC_BIG_ENDIAN);
6904 offset += 2;
6906 /* exchange (shortstr) */
6907 proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_exchange,
6908 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6909 offset += 1 + tvb_get_guint8(tvb, offset);
6911 /* if-unused (bit) */
6912 proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_if_unused,
6913 tvb, offset, 1, ENC_BIG_ENDIAN);
6915 /* nowait (bit) */
6916 proto_tree_add_item(args_tree, hf_amqp_method_exchange_delete_nowait,
6917 tvb, offset, 1, ENC_BIG_ENDIAN);
6919 return offset;
6922 /* Dissection routine for method Exchange.Delete-Ok */
6924 static int
6925 dissect_amqp_0_9_method_exchange_delete_ok(tvbuff_t *tvb _U_,
6926 int offset, proto_tree *args_tree _U_)
6928 return offset;
6931 /* Dissection routine for method Queue.Declare */
6933 static int
6934 dissect_amqp_0_9_method_queue_declare(tvbuff_t *tvb, packet_info *pinfo,
6935 int offset, proto_tree *args_tree)
6937 proto_item *ti;
6939 /* ticket (short) */
6940 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ticket,
6941 tvb, offset, 2, ENC_BIG_ENDIAN);
6942 offset += 2;
6944 /* queue (shortstr) */
6945 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_queue,
6946 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6947 offset += 1 + tvb_get_guint8(tvb, offset);
6949 /* passive (bit) */
6950 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_passive,
6951 tvb, offset, 1, ENC_BIG_ENDIAN);
6953 /* durable (bit) */
6954 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_durable,
6955 tvb, offset, 1, ENC_BIG_ENDIAN);
6957 /* exclusive (bit) */
6958 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_exclusive,
6959 tvb, offset, 1, ENC_BIG_ENDIAN);
6961 /* auto-delete (bit) */
6962 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_auto_delete,
6963 tvb, offset, 1, ENC_BIG_ENDIAN);
6965 /* nowait (bit) */
6966 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_nowait,
6967 tvb, offset, 1, ENC_BIG_ENDIAN);
6969 offset += 1;
6970 /* arguments (table) */
6971 ti = proto_tree_add_item(
6972 args_tree, hf_amqp_method_queue_declare_arguments,
6973 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
6974 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
6975 offset += 4 + tvb_get_ntohl(tvb, offset);
6977 return offset;
6980 /* Dissection routine for method Queue.Declare-Ok */
6982 static int
6983 dissect_amqp_0_9_method_queue_declare_ok(tvbuff_t *tvb,
6984 int offset, proto_tree *args_tree)
6986 /* queue (shortstr) */
6987 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_queue,
6988 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
6989 offset += 1 + tvb_get_guint8(tvb, offset);
6991 /* message-count (long) */
6992 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_message_count,
6993 tvb, offset, 4, ENC_BIG_ENDIAN);
6994 offset += 4;
6996 /* consumer-count (long) */
6997 proto_tree_add_item(args_tree, hf_amqp_method_queue_declare_ok_consumer_count,
6998 tvb, offset, 4, ENC_BIG_ENDIAN);
6999 offset += 4;
7001 return offset;
7004 /* Dissection routine for method Queue.Bind */
7006 static int
7007 dissect_amqp_0_9_method_queue_bind(tvbuff_t *tvb, packet_info *pinfo,
7008 int offset, proto_tree *args_tree)
7010 proto_item *ti;
7012 /* ticket (short) */
7013 proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_ticket,
7014 tvb, offset, 2, ENC_BIG_ENDIAN);
7015 offset += 2;
7017 /* queue (shortstr) */
7018 proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_queue,
7019 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7020 offset += 1 + tvb_get_guint8(tvb, offset);
7022 /* exchange (shortstr) */
7023 proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_exchange,
7024 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7025 offset += 1 + tvb_get_guint8(tvb, offset);
7027 /* routing-key (shortstr) */
7028 proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_routing_key,
7029 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7030 offset += 1 + tvb_get_guint8(tvb, offset);
7032 /* nowait (bit) */
7033 proto_tree_add_item(args_tree, hf_amqp_method_queue_bind_nowait,
7034 tvb, offset, 1, ENC_BIG_ENDIAN);
7036 offset += 1;
7037 /* arguments (table) */
7038 ti = proto_tree_add_item(
7039 args_tree, hf_amqp_method_queue_bind_arguments,
7040 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
7041 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
7042 offset += 4 + tvb_get_ntohl(tvb, offset);
7044 return offset;
7047 /* Dissection routine for method Queue.Bind-Ok */
7049 static int
7050 dissect_amqp_0_9_method_queue_bind_ok(tvbuff_t *tvb _U_,
7051 int offset, proto_tree *args_tree _U_)
7053 return offset;
7056 /* Dissection routine for method Queue.Unbind */
7058 static int
7059 dissect_amqp_0_9_method_queue_unbind(tvbuff_t *tvb, packet_info *pinfo,
7060 int offset, proto_tree *args_tree)
7062 proto_item *ti;
7064 /* ticket (short) */
7065 proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_ticket,
7066 tvb, offset, 2, ENC_BIG_ENDIAN);
7067 offset += 2;
7069 /* queue (shortstr) */
7070 proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_queue,
7071 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7072 offset += 1 + tvb_get_guint8(tvb, offset);
7074 /* exchange (shortstr) */
7075 proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_exchange,
7076 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7077 offset += 1 + tvb_get_guint8(tvb, offset);
7079 /* routing-key (shortstr) */
7080 proto_tree_add_item(args_tree, hf_amqp_method_queue_unbind_routing_key,
7081 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7082 offset += 1 + tvb_get_guint8(tvb, offset);
7084 /* arguments (table) */
7085 ti = proto_tree_add_item(
7086 args_tree, hf_amqp_method_queue_unbind_arguments,
7087 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
7088 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
7089 offset += 4 + tvb_get_ntohl(tvb, offset);
7091 return offset;
7094 /* Dissection routine for method Queue.Unbind-Ok */
7096 static int
7097 dissect_amqp_0_9_method_queue_unbind_ok(tvbuff_t *tvb _U_,
7098 int offset, proto_tree *args_tree _U_)
7100 return offset;
7103 /* Dissection routine for method Queue.Purge */
7105 static int
7106 dissect_amqp_0_9_method_queue_purge(tvbuff_t *tvb,
7107 int offset, proto_tree *args_tree)
7109 /* ticket (short) */
7110 proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_ticket,
7111 tvb, offset, 2, ENC_BIG_ENDIAN);
7112 offset += 2;
7114 /* queue (shortstr) */
7115 proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_queue,
7116 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7117 offset += 1 + tvb_get_guint8(tvb, offset);
7119 /* nowait (bit) */
7120 proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_nowait,
7121 tvb, offset, 1, ENC_BIG_ENDIAN);
7123 return offset;
7126 /* Dissection routine for method Queue.Purge-Ok */
7128 static int
7129 dissect_amqp_0_9_method_queue_purge_ok(tvbuff_t *tvb,
7130 int offset, proto_tree *args_tree)
7132 /* message-count (long) */
7133 proto_tree_add_item(args_tree, hf_amqp_method_queue_purge_ok_message_count,
7134 tvb, offset, 4, ENC_BIG_ENDIAN);
7135 offset += 4;
7137 return offset;
7140 /* Dissection routine for method Queue.Delete */
7142 static int
7143 dissect_amqp_0_9_method_queue_delete(tvbuff_t *tvb,
7144 int offset, proto_tree *args_tree)
7146 /* ticket (short) */
7147 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_ticket,
7148 tvb, offset, 2, ENC_BIG_ENDIAN);
7149 offset += 2;
7151 /* queue (shortstr) */
7152 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_queue,
7153 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7154 offset += 1 + tvb_get_guint8(tvb, offset);
7156 /* if-unused (bit) */
7157 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_if_unused,
7158 tvb, offset, 1, ENC_BIG_ENDIAN);
7160 /* if-empty (bit) */
7161 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_if_empty,
7162 tvb, offset, 1, ENC_BIG_ENDIAN);
7164 /* nowait (bit) */
7165 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_nowait,
7166 tvb, offset, 1, ENC_BIG_ENDIAN);
7168 return offset;
7171 /* Dissection routine for method Queue.Delete-Ok */
7173 static int
7174 dissect_amqp_0_9_method_queue_delete_ok(tvbuff_t *tvb,
7175 int offset, proto_tree *args_tree)
7177 /* message-count (long) */
7178 proto_tree_add_item(args_tree, hf_amqp_method_queue_delete_ok_message_count,
7179 tvb, offset, 4, ENC_BIG_ENDIAN);
7180 offset += 4;
7182 return offset;
7185 /* Dissection routine for method Basic.Qos */
7187 static int
7188 dissect_amqp_0_9_method_basic_qos(tvbuff_t *tvb,
7189 int offset, proto_tree *args_tree)
7191 /* prefetch-size (long) */
7192 proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_prefetch_size,
7193 tvb, offset, 4, ENC_BIG_ENDIAN);
7194 offset += 4;
7196 /* prefetch-count (short) */
7197 proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_prefetch_count,
7198 tvb, offset, 2, ENC_BIG_ENDIAN);
7199 offset += 2;
7201 /* global (bit) */
7202 proto_tree_add_item(args_tree, hf_amqp_method_basic_qos_global,
7203 tvb, offset, 1, ENC_BIG_ENDIAN);
7205 return offset;
7208 /* Dissection routine for method Basic.Qos-Ok */
7210 static int
7211 dissect_amqp_0_9_method_basic_qos_ok(tvbuff_t *tvb _U_,
7212 int offset, proto_tree *args_tree _U_)
7214 return offset;
7217 /* Dissection routine for method Basic.Consume */
7219 static int
7220 dissect_amqp_0_9_method_basic_consume(tvbuff_t *tvb, packet_info *pinfo,
7221 int offset, proto_tree *args_tree)
7223 proto_item *ti;
7225 /* ticket (short) */
7226 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_ticket,
7227 tvb, offset, 2, ENC_BIG_ENDIAN);
7228 offset += 2;
7230 /* queue (shortstr) */
7231 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_queue,
7232 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7233 offset += 1 + tvb_get_guint8(tvb, offset);
7235 /* consumer-tag (shortstr) */
7236 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_consumer_tag,
7237 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7238 offset += 1 + tvb_get_guint8(tvb, offset);
7240 /* no-local (bit) */
7241 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_no_local,
7242 tvb, offset, 1, ENC_BIG_ENDIAN);
7244 /* no-ack (bit) */
7245 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_no_ack,
7246 tvb, offset, 1, ENC_BIG_ENDIAN);
7248 /* exclusive (bit) */
7249 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_exclusive,
7250 tvb, offset, 1, ENC_BIG_ENDIAN);
7252 /* nowait (bit) */
7253 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_nowait,
7254 tvb, offset, 1, ENC_BIG_ENDIAN);
7256 offset += 1;
7257 /* filter (table) */
7258 ti = proto_tree_add_item(
7259 args_tree, hf_amqp_method_basic_consume_filter,
7260 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
7261 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
7262 offset += 4 + tvb_get_ntohl(tvb, offset);
7264 return offset;
7267 /* Dissection routine for method Basic.Consume-Ok */
7269 static int
7270 dissect_amqp_0_9_method_basic_consume_ok(tvbuff_t *tvb,
7271 int offset, proto_tree *args_tree)
7273 /* consumer-tag (shortstr) */
7274 proto_tree_add_item(args_tree, hf_amqp_method_basic_consume_ok_consumer_tag,
7275 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7276 offset += 1 + tvb_get_guint8(tvb, offset);
7278 return offset;
7281 /* Dissection routine for method Basic.Cancel */
7283 static int
7284 dissect_amqp_0_9_method_basic_cancel(tvbuff_t *tvb,
7285 int offset, proto_tree *args_tree)
7287 /* consumer-tag (shortstr) */
7288 proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_consumer_tag,
7289 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7290 offset += 1 + tvb_get_guint8(tvb, offset);
7292 /* nowait (bit) */
7293 proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_nowait,
7294 tvb, offset, 1, ENC_BIG_ENDIAN);
7296 return offset;
7299 /* Dissection routine for method Basic.Cancel-Ok */
7301 static int
7302 dissect_amqp_0_9_method_basic_cancel_ok(tvbuff_t *tvb,
7303 int offset, proto_tree *args_tree)
7305 /* consumer-tag (shortstr) */
7306 proto_tree_add_item(args_tree, hf_amqp_method_basic_cancel_ok_consumer_tag,
7307 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7308 offset += 1 + tvb_get_guint8(tvb, offset);
7310 return offset;
7313 /* Dissection routine for method Basic.Publish */
7315 static int
7316 dissect_amqp_0_9_method_basic_publish(tvbuff_t *tvb,
7317 int offset, proto_tree *args_tree)
7319 /* ticket (short) */
7320 proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_ticket,
7321 tvb, offset, 2, ENC_BIG_ENDIAN);
7322 offset += 2;
7324 /* exchange (shortstr) */
7325 proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_exchange,
7326 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7327 offset += 1 + tvb_get_guint8(tvb, offset);
7329 /* routing-key (shortstr) */
7330 proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_routing_key,
7331 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7332 offset += 1 + tvb_get_guint8(tvb, offset);
7334 /* mandatory (bit) */
7335 proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_mandatory,
7336 tvb, offset, 1, ENC_BIG_ENDIAN);
7338 /* immediate (bit) */
7339 proto_tree_add_item(args_tree, hf_amqp_method_basic_publish_immediate,
7340 tvb, offset, 1, ENC_BIG_ENDIAN);
7342 return offset;
7345 /* Dissection routine for method Basic.Return */
7347 static int
7348 dissect_amqp_0_9_method_basic_return(tvbuff_t *tvb,
7349 int offset, proto_tree *args_tree)
7351 /* reply-code (short) */
7352 proto_tree_add_item(args_tree, hf_amqp_method_basic_return_reply_code,
7353 tvb, offset, 2, ENC_BIG_ENDIAN);
7354 offset += 2;
7356 /* reply-text (shortstr) */
7357 proto_tree_add_item(args_tree, hf_amqp_method_basic_return_reply_text,
7358 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7359 offset += 1 + tvb_get_guint8(tvb, offset);
7361 /* exchange (shortstr) */
7362 proto_tree_add_item(args_tree, hf_amqp_method_basic_return_exchange,
7363 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7364 offset += 1 + tvb_get_guint8(tvb, offset);
7366 /* routing-key (shortstr) */
7367 proto_tree_add_item(args_tree, hf_amqp_method_basic_return_routing_key,
7368 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7369 offset += 1 + tvb_get_guint8(tvb, offset);
7371 return offset;
7374 /* Dissection routine for method Basic.Deliver */
7376 static int
7377 dissect_amqp_0_9_method_basic_deliver(tvbuff_t *tvb,
7378 int offset, proto_tree *args_tree)
7380 /* consumer-tag (shortstr) */
7381 proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_consumer_tag,
7382 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7383 offset += 1 + tvb_get_guint8(tvb, offset);
7385 /* delivery-tag (longlong) */
7386 proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_delivery_tag,
7387 tvb, offset, 8, ENC_BIG_ENDIAN);
7388 offset += 8;
7390 /* redelivered (bit) */
7391 proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_redelivered,
7392 tvb, offset, 1, ENC_BIG_ENDIAN);
7394 offset += 1;
7395 /* exchange (shortstr) */
7396 proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_exchange,
7397 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7398 offset += 1 + tvb_get_guint8(tvb, offset);
7400 /* routing-key (shortstr) */
7401 proto_tree_add_item(args_tree, hf_amqp_method_basic_deliver_routing_key,
7402 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7403 offset += 1 + tvb_get_guint8(tvb, offset);
7405 return offset;
7408 /* Dissection routine for method Basic.Get */
7410 static int
7411 dissect_amqp_0_9_method_basic_get(tvbuff_t *tvb,
7412 int offset, proto_tree *args_tree)
7414 /* ticket (short) */
7415 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ticket,
7416 tvb, offset, 2, ENC_BIG_ENDIAN);
7417 offset += 2;
7419 /* queue (shortstr) */
7420 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_queue,
7421 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7422 offset += 1 + tvb_get_guint8(tvb, offset);
7424 /* no-ack (bit) */
7425 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_no_ack,
7426 tvb, offset, 1, ENC_BIG_ENDIAN);
7428 return offset;
7431 /* Dissection routine for method Basic.Get-Ok */
7433 static int
7434 dissect_amqp_0_9_method_basic_get_ok(tvbuff_t *tvb,
7435 int offset, proto_tree *args_tree)
7437 /* delivery-tag (longlong) */
7438 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_delivery_tag,
7439 tvb, offset, 8, ENC_BIG_ENDIAN);
7440 offset += 8;
7442 /* redelivered (bit) */
7443 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_redelivered,
7444 tvb, offset, 1, ENC_BIG_ENDIAN);
7446 offset += 1;
7447 /* exchange (shortstr) */
7448 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_exchange,
7449 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7450 offset += 1 + tvb_get_guint8(tvb, offset);
7452 /* routing-key (shortstr) */
7453 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_routing_key,
7454 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7455 offset += 1 + tvb_get_guint8(tvb, offset);
7457 /* message-count (long) */
7458 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_ok_message_count,
7459 tvb, offset, 4, ENC_BIG_ENDIAN);
7460 offset += 4;
7462 return offset;
7465 /* Dissection routine for method Basic.Get-Empty */
7467 static int
7468 dissect_amqp_0_9_method_basic_get_empty(tvbuff_t *tvb,
7469 int offset, proto_tree *args_tree)
7471 /* cluster-id (shortstr) */
7472 proto_tree_add_item(args_tree, hf_amqp_method_basic_get_empty_cluster_id,
7473 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7474 offset += 1 + tvb_get_guint8(tvb, offset);
7476 return offset;
7479 /* Dissection routine for method Basic.Ack */
7481 static int
7482 dissect_amqp_0_9_method_basic_ack(tvbuff_t *tvb,
7483 int offset, proto_tree *args_tree)
7485 /* delivery-tag (longlong) */
7486 proto_tree_add_item(args_tree, hf_amqp_method_basic_ack_delivery_tag,
7487 tvb, offset, 8, ENC_BIG_ENDIAN);
7488 offset += 8;
7490 /* multiple (bit) */
7491 proto_tree_add_item(args_tree, hf_amqp_method_basic_ack_multiple,
7492 tvb, offset, 1, ENC_BIG_ENDIAN);
7494 return offset;
7497 /* Dissection routine for method Basic.Reject */
7499 static int
7500 dissect_amqp_0_9_method_basic_reject(tvbuff_t *tvb,
7501 int offset, proto_tree *args_tree)
7503 /* delivery-tag (longlong) */
7504 proto_tree_add_item(args_tree, hf_amqp_method_basic_reject_delivery_tag,
7505 tvb, offset, 8, ENC_BIG_ENDIAN);
7506 offset += 8;
7508 /* requeue (bit) */
7509 proto_tree_add_item(args_tree, hf_amqp_method_basic_reject_requeue,
7510 tvb, offset, 1, ENC_BIG_ENDIAN);
7512 return offset;
7515 /* Dissection routine for method Basic.Recover */
7517 static int
7518 dissect_amqp_0_9_method_basic_recover(tvbuff_t *tvb,
7519 int offset, proto_tree *args_tree)
7521 /* requeue (bit) */
7522 proto_tree_add_item(args_tree, hf_amqp_method_basic_recover_requeue,
7523 tvb, offset, 1, ENC_BIG_ENDIAN);
7525 return offset;
7528 /* Dissection routine for method File.Qos */
7530 static int
7531 dissect_amqp_0_9_method_file_qos(tvbuff_t *tvb,
7532 int offset, proto_tree *args_tree)
7534 /* prefetch-size (long) */
7535 proto_tree_add_item(args_tree, hf_amqp_method_file_qos_prefetch_size,
7536 tvb, offset, 4, ENC_BIG_ENDIAN);
7537 offset += 4;
7539 /* prefetch-count (short) */
7540 proto_tree_add_item(args_tree, hf_amqp_method_file_qos_prefetch_count,
7541 tvb, offset, 2, ENC_BIG_ENDIAN);
7542 offset += 2;
7544 /* global (bit) */
7545 proto_tree_add_item(args_tree, hf_amqp_method_file_qos_global,
7546 tvb, offset, 1, ENC_BIG_ENDIAN);
7548 return offset;
7551 /* Dissection routine for method File.Qos-Ok */
7553 static int
7554 dissect_amqp_0_9_method_file_qos_ok(tvbuff_t *tvb _U_,
7555 int offset _U_, proto_tree *args_tree _U_)
7557 return offset;
7560 /* Dissection routine for method File.Consume */
7562 static int
7563 dissect_amqp_0_9_method_file_consume(tvbuff_t *tvb, packet_info *pinfo,
7564 int offset, proto_tree *args_tree)
7566 proto_item *ti;
7568 /* ticket (short) */
7569 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_ticket,
7570 tvb, offset, 2, ENC_BIG_ENDIAN);
7571 offset += 2;
7573 /* queue (shortstr) */
7574 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_queue,
7575 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7576 offset += 1 + tvb_get_guint8(tvb, offset);
7578 /* consumer-tag (shortstr) */
7579 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_consumer_tag,
7580 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7581 offset += 1 + tvb_get_guint8(tvb, offset);
7583 /* no-local (bit) */
7584 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_no_local,
7585 tvb, offset, 1, ENC_BIG_ENDIAN);
7587 /* no-ack (bit) */
7588 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_no_ack,
7589 tvb, offset, 1, ENC_BIG_ENDIAN);
7591 /* exclusive (bit) */
7592 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_exclusive,
7593 tvb, offset, 1, ENC_BIG_ENDIAN);
7595 /* nowait (bit) */
7596 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_nowait,
7597 tvb, offset, 1, ENC_BIG_ENDIAN);
7599 offset += 1;
7600 /* filter (table) */
7601 ti = proto_tree_add_item(
7602 args_tree, hf_amqp_method_file_consume_filter,
7603 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
7604 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
7605 offset += 4 + tvb_get_ntohl(tvb, offset);
7607 return offset;
7610 /* Dissection routine for method File.Consume-Ok */
7612 static int
7613 dissect_amqp_0_9_method_file_consume_ok(tvbuff_t *tvb,
7614 int offset, proto_tree *args_tree)
7616 /* consumer-tag (shortstr) */
7617 proto_tree_add_item(args_tree, hf_amqp_method_file_consume_ok_consumer_tag,
7618 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7619 offset += 1 + tvb_get_guint8(tvb, offset);
7621 return offset;
7624 /* Dissection routine for method File.Cancel */
7626 static int
7627 dissect_amqp_0_9_method_file_cancel(tvbuff_t *tvb,
7628 int offset, proto_tree *args_tree)
7630 /* consumer-tag (shortstr) */
7631 proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_consumer_tag,
7632 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7633 offset += 1 + tvb_get_guint8(tvb, offset);
7635 /* nowait (bit) */
7636 proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_nowait,
7637 tvb, offset, 1, ENC_BIG_ENDIAN);
7639 return offset;
7642 /* Dissection routine for method File.Cancel-Ok */
7644 static int
7645 dissect_amqp_0_9_method_file_cancel_ok(tvbuff_t *tvb,
7646 int offset, proto_tree *args_tree)
7648 /* consumer-tag (shortstr) */
7649 proto_tree_add_item(args_tree, hf_amqp_method_file_cancel_ok_consumer_tag,
7650 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7651 offset += 1 + tvb_get_guint8(tvb, offset);
7653 return offset;
7656 /* Dissection routine for method File.Open */
7658 static int
7659 dissect_amqp_0_9_method_file_open(tvbuff_t *tvb,
7660 int offset, proto_tree *args_tree)
7662 /* identifier (shortstr) */
7663 proto_tree_add_item(args_tree, hf_amqp_method_file_open_identifier,
7664 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7665 offset += 1 + tvb_get_guint8(tvb, offset);
7667 /* content-size (longlong) */
7668 proto_tree_add_item(args_tree, hf_amqp_method_file_open_content_size,
7669 tvb, offset, 8, ENC_BIG_ENDIAN);
7670 offset += 8;
7672 return offset;
7675 /* Dissection routine for method File.Open-Ok */
7677 static int
7678 dissect_amqp_0_9_method_file_open_ok(tvbuff_t *tvb,
7679 int offset, proto_tree *args_tree)
7681 /* staged-size (longlong) */
7682 proto_tree_add_item(args_tree, hf_amqp_method_file_open_ok_staged_size,
7683 tvb, offset, 8, ENC_BIG_ENDIAN);
7684 offset += 8;
7686 return offset;
7689 /* Dissection routine for method File.Stage */
7691 static int
7692 dissect_amqp_0_9_method_file_stage(tvbuff_t *tvb _U_,
7693 int offset, proto_tree *args_tree _U_)
7695 return offset;
7698 /* Dissection routine for method File.Publish */
7700 static int
7701 dissect_amqp_0_9_method_file_publish(tvbuff_t *tvb,
7702 int offset, proto_tree *args_tree)
7704 /* ticket (short) */
7705 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_ticket,
7706 tvb, offset, 2, ENC_BIG_ENDIAN);
7707 offset += 2;
7709 /* exchange (shortstr) */
7710 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_exchange,
7711 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7712 offset += 1 + tvb_get_guint8(tvb, offset);
7714 /* routing-key (shortstr) */
7715 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_routing_key,
7716 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7717 offset += 1 + tvb_get_guint8(tvb, offset);
7719 /* mandatory (bit) */
7720 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_mandatory,
7721 tvb, offset, 1, ENC_BIG_ENDIAN);
7723 /* immediate (bit) */
7724 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_immediate,
7725 tvb, offset, 1, ENC_BIG_ENDIAN);
7727 offset += 1;
7728 /* identifier (shortstr) */
7729 proto_tree_add_item(args_tree, hf_amqp_method_file_publish_identifier,
7730 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7731 offset += 1 + tvb_get_guint8(tvb, offset);
7733 return offset;
7736 /* Dissection routine for method File.Return */
7738 static int
7739 dissect_amqp_0_9_method_file_return(tvbuff_t *tvb,
7740 int offset, proto_tree *args_tree)
7742 /* reply-code (short) */
7743 proto_tree_add_item(args_tree, hf_amqp_method_file_return_reply_code,
7744 tvb, offset, 2, ENC_BIG_ENDIAN);
7745 offset += 2;
7747 /* reply-text (shortstr) */
7748 proto_tree_add_item(args_tree, hf_amqp_method_file_return_reply_text,
7749 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7750 offset += 1 + tvb_get_guint8(tvb, offset);
7752 /* exchange (shortstr) */
7753 proto_tree_add_item(args_tree, hf_amqp_method_file_return_exchange,
7754 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7755 offset += 1 + tvb_get_guint8(tvb, offset);
7757 /* routing-key (shortstr) */
7758 proto_tree_add_item(args_tree, hf_amqp_method_file_return_routing_key,
7759 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7760 offset += 1 + tvb_get_guint8(tvb, offset);
7762 return offset;
7765 /* Dissection routine for method File.Deliver */
7767 static int
7768 dissect_amqp_0_9_method_file_deliver(tvbuff_t *tvb,
7769 int offset, proto_tree *args_tree)
7771 /* consumer-tag (shortstr) */
7772 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_consumer_tag,
7773 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7774 offset += 1 + tvb_get_guint8(tvb, offset);
7776 /* delivery-tag (longlong) */
7777 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_delivery_tag,
7778 tvb, offset, 8, ENC_BIG_ENDIAN);
7779 offset += 8;
7781 /* redelivered (bit) */
7782 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_redelivered,
7783 tvb, offset, 1, ENC_BIG_ENDIAN);
7785 offset += 1;
7786 /* exchange (shortstr) */
7787 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_exchange,
7788 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7789 offset += 1 + tvb_get_guint8(tvb, offset);
7791 /* routing-key (shortstr) */
7792 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_routing_key,
7793 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7794 offset += 1 + tvb_get_guint8(tvb, offset);
7796 /* identifier (shortstr) */
7797 proto_tree_add_item(args_tree, hf_amqp_method_file_deliver_identifier,
7798 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7799 offset += 1 + tvb_get_guint8(tvb, offset);
7801 return offset;
7804 /* Dissection routine for method File.Ack */
7806 static int
7807 dissect_amqp_0_9_method_file_ack(tvbuff_t *tvb,
7808 int offset, proto_tree *args_tree)
7810 /* delivery-tag (longlong) */
7811 proto_tree_add_item(args_tree, hf_amqp_method_file_ack_delivery_tag,
7812 tvb, offset, 8, ENC_BIG_ENDIAN);
7813 offset += 8;
7815 /* multiple (bit) */
7816 proto_tree_add_item(args_tree, hf_amqp_method_file_ack_multiple,
7817 tvb, offset, 1, ENC_BIG_ENDIAN);
7819 return offset;
7822 /* Dissection routine for method File.Reject */
7824 static int
7825 dissect_amqp_0_9_method_file_reject(tvbuff_t *tvb,
7826 int offset, proto_tree *args_tree)
7828 /* delivery-tag (longlong) */
7829 proto_tree_add_item(args_tree, hf_amqp_method_file_reject_delivery_tag,
7830 tvb, offset, 8, ENC_BIG_ENDIAN);
7831 offset += 8;
7833 /* requeue (bit) */
7834 proto_tree_add_item(args_tree, hf_amqp_method_file_reject_requeue,
7835 tvb, offset, 1, ENC_BIG_ENDIAN);
7837 return offset;
7840 /* Dissection routine for method Stream.Qos */
7842 static int
7843 dissect_amqp_0_9_method_stream_qos(tvbuff_t *tvb,
7844 int offset, proto_tree *args_tree)
7846 /* prefetch-size (long) */
7847 proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_prefetch_size,
7848 tvb, offset, 4, ENC_BIG_ENDIAN);
7849 offset += 4;
7851 /* prefetch-count (short) */
7852 proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_prefetch_count,
7853 tvb, offset, 2, ENC_BIG_ENDIAN);
7854 offset += 2;
7856 /* consume-rate (long) */
7857 proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_consume_rate,
7858 tvb, offset, 4, ENC_BIG_ENDIAN);
7859 offset += 4;
7861 /* global (bit) */
7862 proto_tree_add_item(args_tree, hf_amqp_method_stream_qos_global,
7863 tvb, offset, 1, ENC_BIG_ENDIAN);
7865 return offset;
7868 /* Dissection routine for method Stream.Qos-Ok */
7870 static int
7871 dissect_amqp_0_9_method_stream_qos_ok(tvbuff_t *tvb _U_,
7872 int offset, proto_tree *args_tree _U_)
7874 return offset;
7877 /* Dissection routine for method Stream.Consume */
7879 static int
7880 dissect_amqp_0_9_method_stream_consume(tvbuff_t *tvb, packet_info *pinfo,
7881 int offset, proto_tree *args_tree)
7883 proto_item *ti;
7885 /* ticket (short) */
7886 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_ticket,
7887 tvb, offset, 2, ENC_BIG_ENDIAN);
7888 offset += 2;
7890 /* queue (shortstr) */
7891 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_queue,
7892 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7893 offset += 1 + tvb_get_guint8(tvb, offset);
7895 /* consumer-tag (shortstr) */
7896 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_consumer_tag,
7897 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7898 offset += 1 + tvb_get_guint8(tvb, offset);
7900 /* no-local (bit) */
7901 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_no_local,
7902 tvb, offset, 1, ENC_BIG_ENDIAN);
7904 /* exclusive (bit) */
7905 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_exclusive,
7906 tvb, offset, 1, ENC_BIG_ENDIAN);
7908 /* nowait (bit) */
7909 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_nowait,
7910 tvb, offset, 1, ENC_BIG_ENDIAN);
7912 offset += 1;
7913 /* filter (table) */
7914 ti = proto_tree_add_item(
7915 args_tree, hf_amqp_method_stream_consume_filter,
7916 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
7917 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
7918 offset += 4 + tvb_get_ntohl(tvb, offset);
7920 return offset;
7923 /* Dissection routine for method Stream.Consume-Ok */
7925 static int
7926 dissect_amqp_0_9_method_stream_consume_ok(tvbuff_t *tvb,
7927 int offset, proto_tree *args_tree)
7929 /* consumer-tag (shortstr) */
7930 proto_tree_add_item(args_tree, hf_amqp_method_stream_consume_ok_consumer_tag,
7931 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7932 offset += 1 + tvb_get_guint8(tvb, offset);
7934 return offset;
7937 /* Dissection routine for method Stream.Cancel */
7939 static int
7940 dissect_amqp_0_9_method_stream_cancel(tvbuff_t *tvb,
7941 int offset, proto_tree *args_tree)
7943 /* consumer-tag (shortstr) */
7944 proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_consumer_tag,
7945 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7946 offset += 1 + tvb_get_guint8(tvb, offset);
7948 /* nowait (bit) */
7949 proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_nowait,
7950 tvb, offset, 1, ENC_BIG_ENDIAN);
7952 return offset;
7955 /* Dissection routine for method Stream.Cancel-Ok */
7957 static int
7958 dissect_amqp_0_9_method_stream_cancel_ok(tvbuff_t *tvb,
7959 int offset, proto_tree *args_tree)
7961 /* consumer-tag (shortstr) */
7962 proto_tree_add_item(args_tree, hf_amqp_method_stream_cancel_ok_consumer_tag,
7963 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7964 offset += 1 + tvb_get_guint8(tvb, offset);
7966 return offset;
7969 /* Dissection routine for method Stream.Publish */
7971 static int
7972 dissect_amqp_0_9_method_stream_publish(tvbuff_t *tvb,
7973 int offset, proto_tree *args_tree)
7975 /* ticket (short) */
7976 proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_ticket,
7977 tvb, offset, 2, ENC_BIG_ENDIAN);
7978 offset += 2;
7980 /* exchange (shortstr) */
7981 proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_exchange,
7982 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7983 offset += 1 + tvb_get_guint8(tvb, offset);
7985 /* routing-key (shortstr) */
7986 proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_routing_key,
7987 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
7988 offset += 1 + tvb_get_guint8(tvb, offset);
7990 /* mandatory (bit) */
7991 proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_mandatory,
7992 tvb, offset, 1, ENC_BIG_ENDIAN);
7994 /* immediate (bit) */
7995 proto_tree_add_item(args_tree, hf_amqp_method_stream_publish_immediate,
7996 tvb, offset, 1, ENC_BIG_ENDIAN);
7998 return offset;
8001 /* Dissection routine for method Stream.Return */
8003 static int
8004 dissect_amqp_0_9_method_stream_return(tvbuff_t *tvb,
8005 int offset, proto_tree *args_tree)
8007 /* reply-code (short) */
8008 proto_tree_add_item(args_tree, hf_amqp_method_stream_return_reply_code,
8009 tvb, offset, 2, ENC_BIG_ENDIAN);
8010 offset += 2;
8012 /* reply-text (shortstr) */
8013 proto_tree_add_item(args_tree, hf_amqp_method_stream_return_reply_text,
8014 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8015 offset += 1 + tvb_get_guint8(tvb, offset);
8017 /* exchange (shortstr) */
8018 proto_tree_add_item(args_tree, hf_amqp_method_stream_return_exchange,
8019 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8020 offset += 1 + tvb_get_guint8(tvb, offset);
8022 /* routing-key (shortstr) */
8023 proto_tree_add_item(args_tree, hf_amqp_method_stream_return_routing_key,
8024 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8025 offset += 1 + tvb_get_guint8(tvb, offset);
8027 return offset;
8030 /* Dissection routine for method Stream.Deliver */
8032 static int
8033 dissect_amqp_0_9_method_stream_deliver(tvbuff_t *tvb,
8034 int offset, proto_tree *args_tree)
8036 /* consumer-tag (shortstr) */
8037 proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_consumer_tag,
8038 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8039 offset += 1 + tvb_get_guint8(tvb, offset);
8041 /* delivery-tag (longlong) */
8042 proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_delivery_tag,
8043 tvb, offset, 8, ENC_BIG_ENDIAN);
8044 offset += 8;
8046 /* exchange (shortstr) */
8047 proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_exchange,
8048 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8049 offset += 1 + tvb_get_guint8(tvb, offset);
8051 /* queue (shortstr) */
8052 proto_tree_add_item(args_tree, hf_amqp_method_stream_deliver_queue,
8053 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8054 offset += 1 + tvb_get_guint8(tvb, offset);
8056 return offset;
8059 /* Dissection routine for method Tx.Select */
8061 static int
8062 dissect_amqp_0_9_method_tx_select(tvbuff_t *tvb _U_,
8063 int offset, proto_tree *args_tree _U_)
8065 return offset;
8068 /* Dissection routine for method Tx.Select-Ok */
8070 static int
8071 dissect_amqp_0_9_method_tx_select_ok(tvbuff_t *tvb _U_,
8072 int offset, proto_tree *args_tree _U_)
8074 return offset;
8077 /* Dissection routine for method Tx.Commit */
8079 static int
8080 dissect_amqp_0_9_method_tx_commit(tvbuff_t *tvb _U_,
8081 int offset, proto_tree *args_tree _U_)
8083 return offset;
8086 /* Dissection routine for method Tx.Commit-Ok */
8088 static int
8089 dissect_amqp_0_9_method_tx_commit_ok(tvbuff_t *tvb _U_,
8090 int offset, proto_tree *args_tree _U_)
8092 return offset;
8095 /* Dissection routine for method Tx.Rollback */
8097 static int
8098 dissect_amqp_0_9_method_tx_rollback(tvbuff_t *tvb _U_,
8099 int offset, proto_tree *args_tree _U_)
8101 return offset;
8104 /* Dissection routine for method Tx.Rollback-Ok */
8106 static int
8107 dissect_amqp_0_9_method_tx_rollback_ok(tvbuff_t *tvb _U_,
8108 int offset, proto_tree *args_tree _U_)
8110 return offset;
8113 /* Dissection routine for method Dtx.Select */
8115 static int
8116 dissect_amqp_0_9_method_dtx_select(tvbuff_t *tvb _U_,
8117 int offset, proto_tree *args_tree _U_)
8119 return offset;
8122 /* Dissection routine for method Dtx.Select-Ok */
8124 static int
8125 dissect_amqp_0_9_method_dtx_select_ok(tvbuff_t *tvb _U_,
8126 int offset, proto_tree *args_tree _U_)
8128 return offset;
8131 /* Dissection routine for method Dtx.Start */
8133 static int
8134 dissect_amqp_0_9_method_dtx_start(tvbuff_t *tvb,
8135 int offset, proto_tree *args_tree)
8137 /* dtx-identifier (shortstr) */
8138 proto_tree_add_item(args_tree, hf_amqp_method_dtx_start_dtx_identifier,
8139 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8140 offset += 1 + tvb_get_guint8(tvb, offset);
8142 return offset;
8145 /* Dissection routine for method Dtx.Start-Ok */
8147 static int
8148 dissect_amqp_0_9_method_dtx_start_ok(tvbuff_t *tvb _U_,
8149 int offset, proto_tree *args_tree _U_)
8151 return offset;
8154 /* Dissection routine for method Tunnel.Request */
8156 static int
8157 dissect_amqp_0_9_method_tunnel_request(tvbuff_t *tvb, packet_info *pinfo,
8158 int offset, proto_tree *args_tree)
8160 proto_item *ti;
8162 /* meta-data (table) */
8163 ti = proto_tree_add_item(
8164 args_tree, hf_amqp_method_tunnel_request_meta_data,
8165 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
8166 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
8167 offset += 4 + tvb_get_ntohl(tvb, offset);
8169 return offset;
8173 /* Dissection routine for content headers of class basic */
8175 static int
8176 dissect_amqp_0_9_content_header_basic(tvbuff_t *tvb, packet_info *pinfo,
8177 int offset, proto_tree *prop_tree)
8179 proto_item *ti;
8180 guint16 prop_flags;
8182 prop_flags = tvb_get_ntohs(tvb, 19);
8184 if (prop_flags & 0x8000) {
8185 /* content-type (shortstr) */
8186 proto_tree_add_item(prop_tree, hf_amqp_header_basic_content_type,
8187 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8188 offset += 1 + tvb_get_guint8(tvb, offset);
8190 prop_flags <<= 1;
8192 if (prop_flags & 0x8000) {
8193 /* content-encoding (shortstr) */
8194 proto_tree_add_item(prop_tree, hf_amqp_header_basic_content_encoding,
8195 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8196 offset += 1 + tvb_get_guint8(tvb, offset);
8198 prop_flags <<= 1;
8200 if (prop_flags & 0x8000) {
8201 /* headers (table) */
8202 ti = proto_tree_add_item(
8203 prop_tree, hf_amqp_header_basic_headers,
8204 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
8205 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
8206 offset += 4 + tvb_get_ntohl(tvb, offset);
8208 prop_flags <<= 1;
8210 if (prop_flags & 0x8000) {
8211 /* delivery-mode (octet) */
8212 proto_tree_add_item(prop_tree, hf_amqp_header_basic_delivery_mode,
8213 tvb, offset, 1, ENC_BIG_ENDIAN);
8214 offset += 1;
8216 prop_flags <<= 1;
8218 if (prop_flags & 0x8000) {
8219 /* priority (octet) */
8220 proto_tree_add_item(prop_tree, hf_amqp_header_basic_priority,
8221 tvb, offset, 1, ENC_BIG_ENDIAN);
8222 offset += 1;
8224 prop_flags <<= 1;
8226 if (prop_flags & 0x8000) {
8227 /* correlation-id (shortstr) */
8228 proto_tree_add_item(prop_tree, hf_amqp_header_basic_correlation_id,
8229 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8230 offset += 1 + tvb_get_guint8(tvb, offset);
8232 prop_flags <<= 1;
8234 if (prop_flags & 0x8000) {
8235 /* reply-to (shortstr) */
8236 proto_tree_add_item(prop_tree, hf_amqp_header_basic_reply_to,
8237 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8238 offset += 1 + tvb_get_guint8(tvb, offset);
8240 prop_flags <<= 1;
8242 if (prop_flags & 0x8000) {
8243 /* expiration (shortstr) */
8244 proto_tree_add_item(prop_tree, hf_amqp_header_basic_expiration,
8245 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8246 offset += 1 + tvb_get_guint8(tvb, offset);
8248 prop_flags <<= 1;
8250 if (prop_flags & 0x8000) {
8251 /* message-id (shortstr) */
8252 proto_tree_add_item(prop_tree, hf_amqp_header_basic_message_id,
8253 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8254 offset += 1 + tvb_get_guint8(tvb, offset);
8256 prop_flags <<= 1;
8258 if (prop_flags & 0x8000) {
8259 /* timestamp (timestamp) */
8260 proto_tree_add_item(prop_tree, hf_amqp_header_basic_timestamp,
8261 tvb, offset, 8, ENC_BIG_ENDIAN);
8262 offset += 8;
8264 prop_flags <<= 1;
8266 if (prop_flags & 0x8000) {
8267 /* type (shortstr) */
8268 proto_tree_add_item(prop_tree, hf_amqp_header_basic_type,
8269 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8270 offset += 1 + tvb_get_guint8(tvb, offset);
8272 prop_flags <<= 1;
8274 if (prop_flags & 0x8000) {
8275 /* user-id (shortstr) */
8276 proto_tree_add_item(prop_tree, hf_amqp_header_basic_user_id,
8277 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8278 offset += 1 + tvb_get_guint8(tvb, offset);
8280 prop_flags <<= 1;
8282 if (prop_flags & 0x8000) {
8283 /* app-id (shortstr) */
8284 proto_tree_add_item(prop_tree, hf_amqp_header_basic_app_id,
8285 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8286 offset += 1 + tvb_get_guint8(tvb, offset);
8288 prop_flags <<= 1;
8290 if (prop_flags & 0x8000) {
8291 /* cluster-id (shortstr) */
8292 proto_tree_add_item(prop_tree, hf_amqp_header_basic_cluster_id,
8293 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8294 offset += 1 + tvb_get_guint8(tvb, offset);
8296 /*prop_flags <<= 1;*/
8298 return offset;
8300 /* Dissection routine for content headers of class file */
8302 static int
8303 dissect_amqp_0_9_content_header_file(tvbuff_t *tvb, packet_info *pinfo,
8304 int offset, proto_tree *prop_tree)
8306 proto_item *ti;
8307 guint16 prop_flags;
8309 prop_flags = tvb_get_ntohs(tvb, 19);
8311 if (prop_flags & 0x8000) {
8312 /* content-type (shortstr) */
8313 proto_tree_add_item(prop_tree, hf_amqp_header_file_content_type,
8314 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8315 offset += 1 + tvb_get_guint8(tvb, offset);
8317 prop_flags <<= 1;
8319 if (prop_flags & 0x8000) {
8320 /* content-encoding (shortstr) */
8321 proto_tree_add_item(prop_tree, hf_amqp_header_file_content_encoding,
8322 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8323 offset += 1 + tvb_get_guint8(tvb, offset);
8325 prop_flags <<= 1;
8327 if (prop_flags & 0x8000) {
8328 /* headers (table) */
8329 ti = proto_tree_add_item(prop_tree, hf_amqp_header_file_headers,
8330 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
8331 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
8332 offset += 4 + tvb_get_ntohl(tvb, offset);
8334 prop_flags <<= 1;
8336 if (prop_flags & 0x8000) {
8337 /* priority (octet) */
8338 proto_tree_add_item(prop_tree, hf_amqp_header_file_priority,
8339 tvb, offset, 1, ENC_BIG_ENDIAN);
8340 offset += 1;
8342 prop_flags <<= 1;
8344 if (prop_flags & 0x8000) {
8345 /* reply-to (shortstr) */
8346 proto_tree_add_item(prop_tree, hf_amqp_header_file_reply_to,
8347 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8348 offset += 1 + tvb_get_guint8(tvb, offset);
8350 prop_flags <<= 1;
8352 if (prop_flags & 0x8000) {
8353 /* message-id (shortstr) */
8354 proto_tree_add_item(prop_tree, hf_amqp_header_file_message_id,
8355 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8356 offset += 1 + tvb_get_guint8(tvb, offset);
8358 prop_flags <<= 1;
8360 if (prop_flags & 0x8000) {
8361 /* filename (shortstr) */
8362 proto_tree_add_item(prop_tree, hf_amqp_header_file_filename,
8363 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8364 offset += 1 + tvb_get_guint8(tvb, offset);
8366 prop_flags <<= 1;
8368 if (prop_flags & 0x8000) {
8369 /* timestamp (timestamp) */
8370 proto_tree_add_item(prop_tree, hf_amqp_header_file_timestamp,
8371 tvb, offset, 8, ENC_BIG_ENDIAN);
8372 offset += 8;
8374 prop_flags <<= 1;
8376 if (prop_flags & 0x8000) {
8377 /* cluster-id (shortstr) */
8378 proto_tree_add_item(prop_tree, hf_amqp_header_file_cluster_id,
8379 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8380 offset += 1 + tvb_get_guint8(tvb, offset);
8382 /*prop_flags <<= 1;*/
8384 return offset;
8386 /* Dissection routine for content headers of class stream */
8388 static int
8389 dissect_amqp_0_9_content_header_stream(tvbuff_t *tvb, packet_info *pinfo,
8390 int offset, proto_tree *prop_tree)
8392 proto_item *ti;
8393 guint16 prop_flags;
8395 prop_flags = tvb_get_ntohs(tvb, 19);
8397 if (prop_flags & 0x8000) {
8398 /* content-type (shortstr) */
8399 proto_tree_add_item(prop_tree, hf_amqp_header_stream_content_type,
8400 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8401 offset += 1 + tvb_get_guint8(tvb, offset);
8403 prop_flags <<= 1;
8405 if (prop_flags & 0x8000) {
8406 /* content-encoding (shortstr) */
8407 proto_tree_add_item(prop_tree, hf_amqp_header_stream_content_encoding,
8408 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8409 offset += 1 + tvb_get_guint8(tvb, offset);
8411 prop_flags <<= 1;
8413 if (prop_flags & 0x8000) {
8414 /* headers (table) */
8415 ti = proto_tree_add_item(prop_tree, hf_amqp_header_stream_headers,
8416 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
8417 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
8418 offset += 4 + tvb_get_ntohl(tvb, offset);
8420 prop_flags <<= 1;
8422 if (prop_flags & 0x8000) {
8423 /* priority (octet) */
8424 proto_tree_add_item(prop_tree, hf_amqp_header_stream_priority,
8425 tvb, offset, 1, ENC_BIG_ENDIAN);
8426 offset += 1;
8428 prop_flags <<= 1;
8430 if (prop_flags & 0x8000) {
8431 /* timestamp (timestamp) */
8432 proto_tree_add_item(prop_tree, hf_amqp_header_stream_timestamp,
8433 tvb, offset, 8, ENC_BIG_ENDIAN);
8434 offset += 8;
8436 /*prop_flags <<= 1;*/
8438 return offset;
8441 /* Dissection routine for content headers of class tunnel */
8443 static int
8444 dissect_amqp_0_9_content_header_tunnel(tvbuff_t *tvb, packet_info *pinfo,
8445 int offset, proto_tree *prop_tree)
8447 proto_item *ti;
8448 guint16 prop_flags;
8450 prop_flags = tvb_get_ntohs(tvb, 19);
8452 if (prop_flags & 0x8000) {
8453 /* headers (table) */
8454 ti = proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_headers,
8455 tvb, offset + 4, tvb_get_ntohl(tvb, offset), ENC_NA);
8456 dissect_amqp_0_9_field_table(tvb, pinfo, offset + 4, tvb_get_ntohl(tvb, offset), ti);
8457 offset += 4 + tvb_get_ntohl(tvb, offset);
8459 prop_flags <<= 1;
8461 if (prop_flags & 0x8000) {
8462 /* proxy-name (shortstr) */
8463 proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_proxy_name,
8464 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8465 offset += 1 + tvb_get_guint8(tvb, offset);
8467 prop_flags <<= 1;
8469 if (prop_flags & 0x8000) {
8470 /* data-name (shortstr) */
8471 proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_data_name,
8472 tvb, offset + 1, tvb_get_guint8(tvb, offset), ENC_ASCII|ENC_NA);
8473 offset += 1 + tvb_get_guint8(tvb, offset);
8475 prop_flags <<= 1;
8477 if (prop_flags & 0x8000) {
8478 /* durable (octet) */
8479 proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_durable,
8480 tvb, offset, 1, ENC_BIG_ENDIAN);
8481 offset += 1;
8483 prop_flags <<= 1;
8485 if (prop_flags & 0x8000) {
8486 /* broadcast (octet) */
8487 proto_tree_add_item(prop_tree, hf_amqp_header_tunnel_broadcast,
8488 tvb, offset, 1, ENC_BIG_ENDIAN);
8489 offset += 1;
8491 /*prop_flags <<= 1;*/
8493 return offset;
8496 /* AMQP 0-10 Type Decoders */
8498 static gboolean
8499 get_amqp_0_10_type_formatter(guint8 code,
8500 const char **name,
8501 type_formatter *formatter,
8502 guint *length_size)
8504 int i;
8505 struct amqp_typeinfo *table;
8507 if (code & 0x80)
8508 table = amqp_0_10_var_types;
8509 else
8510 table = amqp_0_10_fixed_types;
8511 for (i = 0; table[i].typecode != 0xff; ++i) {
8512 if (table[i].typecode == code) {
8513 *name = wmem_strdup(wmem_packet_scope(), table[i].amqp_typename);
8514 *formatter = table[i].formatter;
8515 *length_size = table[i].known_size;
8516 return TRUE;
8519 return FALSE;
8522 static int
8523 format_amqp_0_10_bin(tvbuff_t *tvb,
8524 guint offset, guint bound _U_, guint length,
8525 const char **value)
8527 *value = tvb_bytes_to_str(tvb, offset, length);
8528 return length;
8531 static int
8532 format_amqp_0_10_int(tvbuff_t *tvb,
8533 guint offset, guint bound _U_, guint length,
8534 const char **value)
8536 int val;
8538 if (length == 1)
8539 val = (gint8)tvb_get_guint8(tvb, offset);
8540 else if (length == 2)
8541 val = (gint16)tvb_get_ntohs(tvb, offset);
8542 else if (length == 4)
8543 val = (gint32)tvb_get_ntohl(tvb, offset);
8544 else {
8545 *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid int length %d!", length);
8546 return length;
8548 *value = wmem_strdup_printf(wmem_packet_scope(), "%d", val);
8549 return length;
8552 static int
8553 format_amqp_0_10_uint(tvbuff_t *tvb,
8554 guint offset, guint bound _U_, guint length,
8555 const char **value)
8557 unsigned int val;
8559 if (length == 1)
8560 val = tvb_get_guint8(tvb, offset);
8561 else if (length == 2)
8562 val = tvb_get_ntohs(tvb, offset);
8563 else if (length == 4)
8564 val = tvb_get_ntohl(tvb, offset);
8565 else {
8566 *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid uint length %d!", length);
8567 return length;
8569 *value = wmem_strdup_printf(wmem_packet_scope(), "%u", val);
8570 return length;
8573 static int
8574 format_amqp_0_10_char(tvbuff_t *tvb,
8575 guint offset, guint bound _U_, guint length _U_,
8576 const char **value)
8578 *value = tvb_format_text(tvb, offset, 1);
8579 return 1;
8582 static int
8583 format_amqp_0_10_boolean(tvbuff_t *tvb,
8584 guint offset, guint bound _U_, guint length _U_,
8585 const char **value)
8587 guint8 val;
8589 val = tvb_get_guint8(tvb, offset);
8590 *value = wmem_strdup(wmem_packet_scope(), val ? "true" : "false");
8591 return 1;
8594 static int
8595 format_amqp_0_10_vbin(tvbuff_t *tvb,
8596 guint offset, guint bound, guint length,
8597 const char **value)
8599 guint bin_length;
8601 if (length == 1)
8602 bin_length = tvb_get_guint8(tvb, offset);
8603 else if (length == 2)
8604 bin_length = tvb_get_ntohs(tvb, offset);
8605 else if (length == 4)
8606 bin_length = tvb_get_ntohl(tvb, offset);
8607 else {
8608 *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid vbin length size %d!", length);
8609 return length;
8611 AMQP_INCREMENT(offset, length, bound);
8612 *value = tvb_bytes_to_str(tvb, offset, bin_length);
8613 AMQP_INCREMENT(offset, bin_length, bound);
8614 return (bin_length + length);
8617 static int
8618 format_amqp_0_10_str(tvbuff_t *tvb,
8619 guint offset, guint bound, guint length,
8620 const char **value)
8622 guint string_length;
8624 if (length == 1)
8625 string_length = tvb_get_guint8(tvb, offset);
8626 else if (length == 2)
8627 string_length = tvb_get_ntohs(tvb, offset);
8628 else if (length == 4)
8629 string_length = tvb_get_ntohl(tvb, offset);
8630 else {
8631 *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid string length size %d!", length);
8632 return length;
8634 AMQP_INCREMENT(offset, length, bound);
8635 *value = tvb_get_string(wmem_packet_scope(), tvb, offset, string_length);
8636 AMQP_INCREMENT(offset, string_length, bound);
8637 return (string_length + length);
8640 static void
8641 format_amqp_0_10_sequence_set(tvbuff_t *tvb, guint offset, guint length,
8642 proto_item *item)
8644 guint values;
8646 /* Must be 4-byte values */
8647 if ((length % 4) != 0) {
8648 proto_item_append_text(item, "Invalid sequence set length %u",
8649 length);
8652 values = length / 4;
8653 /* There must be pairs of values */
8654 if ((values % 2) != 0) {
8655 proto_item_append_text(item, "Invalid sequence set value count %u",
8656 values);
8658 proto_item_append_text(item, " [");
8659 while(values > 0) {
8660 proto_item_append_text(item, "(%u, %u)%s",
8661 tvb_get_ntohl(tvb, offset),
8662 tvb_get_ntohl(tvb, offset + 4),
8663 values > 2 ? ", " : "");
8664 offset += 8;
8665 values -= 2;
8667 proto_item_append_text(item, "]");
8670 /* Basic registration functions */
8672 void
8673 proto_register_amqp(void)
8676 * Setup of field format array. A few of the 0-9 fields are reused
8677 * in 0-10, but there are many separate.
8679 static hf_register_info hf[] = {
8680 {&hf_amqp_0_10_format, {
8681 "Format", "amqp.format",
8682 FT_UINT8, BASE_DEC, NULL, 0xc0,
8683 "Framing version", HFILL}},
8684 {&hf_amqp_0_10_position, {
8685 "Position", "amqp.frame-position",
8686 FT_UINT8, BASE_DEC, VALS(amqp_0_10_frame_position), 0x0f,
8687 "Framing position", HFILL}},
8688 {&hf_amqp_0_10_type, {
8689 "Type", "amqp.type",
8690 FT_UINT8, BASE_DEC, VALS(amqp_0_10_frame_types), 0x0,
8691 "Frame type", HFILL}},
8692 {&hf_amqp_0_10_size, {
8693 "Length", "amqp.length",
8694 FT_UINT16, BASE_DEC, NULL, 0x0,
8695 "Length of the frame", HFILL}},
8696 {&hf_amqp_0_10_track, {
8697 "Track", "amqp.track-number",
8698 FT_UINT8, BASE_DEC, VALS(amqp_0_10_frame_tracks), 0x0,
8699 "Track number", HFILL}},
8700 {&hf_amqp_0_10_class, {
8701 "Class", "amqp.class",
8702 FT_UINT8, BASE_DEC, VALS(amqp_0_10_class), 0x0,
8703 "Class ID", HFILL}},
8704 {&hf_amqp_0_10_connection_method, {
8705 "Method", "amqp.connection.method",
8706 FT_UINT8, BASE_DEC, VALS(amqp_0_10_connection_methods), 0x0,
8707 "Connection Class Method", HFILL}},
8708 {&hf_amqp_0_10_session_method, {
8709 "Method", "amqp.session.method",
8710 FT_UINT8, BASE_DEC, VALS(amqp_0_10_session_methods), 0x0,
8711 "Session Class Method", HFILL}},
8712 {&hf_amqp_0_10_execution_method, {
8713 "Method", "amqp.execution.method",
8714 FT_UINT8, BASE_DEC, VALS(amqp_0_10_execution_methods), 0x0,
8715 "Execution Class Method", HFILL}},
8716 {&hf_amqp_0_10_message_method, {
8717 "Method", "amqp.message.method",
8718 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_methods), 0x0,
8719 "Message Class Method", HFILL}},
8720 {&hf_amqp_0_10_tx_method, {
8721 "Method", "amqp.tx.method",
8722 FT_UINT8, BASE_DEC, VALS(amqp_0_10_tx_methods), 0x0,
8723 "Tx Class Method", HFILL}},
8724 {&hf_amqp_0_10_dtx_method, {
8725 "Method", "amqp.dtx.method",
8726 FT_UINT8, BASE_DEC, VALS(amqp_0_10_dtx_methods), 0x0,
8727 "Dtx Class Method", HFILL}},
8728 {&hf_amqp_0_10_exchange_method, {
8729 "Method", "amqp.exchange.method",
8730 FT_UINT8, BASE_DEC, VALS(amqp_0_10_exchange_methods), 0x0,
8731 "Exchange Class Method", HFILL}},
8732 {&hf_amqp_0_10_queue_method, {
8733 "Method", "amqp.queue.method",
8734 FT_UINT8, BASE_DEC, VALS(amqp_0_10_queue_methods), 0x0,
8735 "Queue Class Method", HFILL}},
8736 {&hf_amqp_0_10_file_method, {
8737 "Method", "amqp.file.method",
8738 FT_UINT8, BASE_DEC, VALS(amqp_0_10_file_methods), 0x0,
8739 "File Class Method", HFILL}},
8740 {&hf_amqp_0_10_stream_method, {
8741 "Method", "amqp.stream.method",
8742 FT_UINT8, BASE_DEC, VALS(amqp_0_10_stream_methods), 0x0,
8743 "Stream Class Method", HFILL}},
8744 {&hf_amqp_0_10_message_body, {
8745 "Message body", "amqp.message-body",
8746 FT_NONE, BASE_NONE, NULL, 0x0,
8747 "Message body content", HFILL}},
8748 {&hf_amqp_0_10_dtx_xid, {
8749 "Xid", "amqp.dtx.xid",
8750 FT_NONE, BASE_NONE, NULL, 0x0,
8751 "Dtx transaction id", HFILL}},
8752 {&hf_amqp_0_10_dtx_xid_format, {
8753 "Format", "amqp.dtx.xid.format",
8754 FT_UINT32, BASE_DEC, NULL, 0x0,
8755 "Implementation-specific xid format code", HFILL}},
8756 {&hf_amqp_0_10_dtx_xid_global_id, {
8757 "Global-id", "amqp.dtx.xid.global-id",
8758 FT_BYTES, BASE_NONE, NULL, 0x0,
8759 "Global transaction id", HFILL}},
8760 {&hf_amqp_0_10_dtx_xid_branch_id, {
8761 "Branch-id", "amqp.dtx.xid.branch-id",
8762 FT_BYTES, BASE_NONE, NULL, 0x0,
8763 "Transaction branch qualifier", HFILL}},
8764 {&hf_amqp_0_10_undissected_struct32, {
8765 "(undissected struct)", "amqp.undissected",
8766 FT_NONE, BASE_NONE, NULL, 0x0,
8767 "Message header struct not yet dissected", HFILL}},
8768 {&hf_amqp_0_10_struct_delivery_properties_discard_unroutable, {
8769 "Discard-unroutable", "amqp.message.delivery-properties.discard-unroutable",
8770 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
8771 "Discard message if unroutable", HFILL}},
8772 {&hf_amqp_0_10_struct_delivery_properties_immediate, {
8773 "Immediate", "amqp.message.delivery-properties.immediate",
8774 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
8775 "Consider unroutable if can't be routed immediately", HFILL}},
8776 {&hf_amqp_0_10_struct_delivery_properties_redelivered, {
8777 "Redelivered", "amqp.message.delivery-properties.redelivered",
8778 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
8779 "Message may have been previously delivered", HFILL}},
8780 {&hf_amqp_0_10_struct_delivery_properties_priority, {
8781 "Delivery-priority", "amqp.message.delivery-properties.delivery-priority",
8782 FT_UINT8, BASE_DEC, VALS(amqp_0_10_struct_delivery_properties_priorities), 0x0,
8783 "Message delivery priority", HFILL}},
8784 {&hf_amqp_0_10_struct_delivery_properties_mode, {
8785 "Delivery-mode", "amqp.message.delivery-properties.delivery-mode",
8786 FT_UINT8, BASE_DEC, VALS(amqp_0_10_struct_delivery_properties_modes), 0x0,
8787 "Message delivery persistence mode", HFILL}},
8788 {&hf_amqp_0_10_struct_delivery_properties_ttl, {
8789 "TTL", "amqp.message.delivery-properties.ttl",
8790 FT_UINT64, BASE_DEC, NULL, 0x0,
8791 "Message time-to-live in msec", HFILL}},
8792 {&hf_amqp_0_10_struct_delivery_properties_timestamp, {
8793 "Timestamp", "amqp.message.delivery-properties.timestamp",
8794 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
8795 "Time of arrival at broker", HFILL}},
8796 {&hf_amqp_0_10_struct_delivery_properties_expiration, {
8797 "Expiration", "amqp.message.delivery-properties.expiration",
8798 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
8799 "Expiration time calculated by broker", HFILL}},
8800 {&hf_amqp_0_10_struct_delivery_properties_exchange, {
8801 "Exchange", "amqp.message.delivery-properties.exchange",
8802 FT_STRING, BASE_NONE, NULL, 0x0,
8803 "Originating exchange", HFILL}},
8804 {&hf_amqp_0_10_struct_delivery_properties_routing_key, {
8805 "Routing-key", "amqp.message.delivery-properties.routing-key",
8806 FT_STRING, BASE_NONE, NULL, 0x0,
8807 "Message routing key", HFILL}},
8808 {&hf_amqp_0_10_struct_delivery_properties_resume_ttl, {
8809 "Resume-ttl", "amqp.message.delivery-properties.resume-ttl",
8810 FT_UINT64, BASE_DEC, NULL, 0x0,
8811 "TTL to use when resuming", HFILL}},
8812 {&hf_amqp_0_10_struct_fragment_properties_first, {
8813 "First", "amqp.message.fragment-properties.first",
8814 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
8815 "Fragment contains the start of the message", HFILL}},
8816 {&hf_amqp_0_10_struct_fragment_properties_last, {
8817 "Last", "amqp.message.fragment-properties.last",
8818 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
8819 "Fragment contains the end of the message", HFILL}},
8820 {&hf_amqp_0_10_struct_fragment_properties_size, {
8821 "Fragment-size", "amqp.message.fragment-properties.fragment-size",
8822 FT_UINT64, BASE_DEC, NULL, 0x0,
8823 "Size of the message fragment", HFILL}},
8824 #if 0
8825 {&hf_amqp_0_10_struct_message_properties, {
8826 "message.message-properties", "amqp.message.message-properties",
8827 FT_NONE, BASE_NONE, NULL, 0x0,
8828 "Message properties struct", HFILL}},
8829 #endif
8830 {&hf_amqp_0_10_struct_message_properties_content_len, {
8831 "Content-length", "amqp.message.message-properties.content-length",
8832 FT_UINT64, BASE_DEC, NULL, 0x0,
8833 "Length of associated message", HFILL}},
8834 {&hf_amqp_0_10_struct_message_properties_message_id, {
8835 "Message-id", "amqp.message.message-properties.message-id",
8836 FT_GUID, BASE_NONE, NULL, 0x0,
8837 "Message Id", HFILL}},
8838 {&hf_amqp_0_10_struct_message_properties_correlation, {
8839 "Correlation-id", "amqp.message.message-properties.correlation-id",
8840 FT_BYTES, BASE_NONE, NULL, 0x0,
8841 "Correlation id", HFILL}},
8842 {&hf_amqp_0_10_struct_message_properties_reply_to, {
8843 "Reply-to", "amqp.message.message-properties.reply-to",
8844 FT_NONE, BASE_NONE, NULL, 0x0,
8845 "Address to reply to", HFILL}},
8846 {&hf_amqp_0_10_struct_message_properties_content_type, {
8847 "Content-type", "amqp.message.message-properties.content-type",
8848 FT_STRING, BASE_NONE, NULL, 0x0,
8849 "MIME content type", HFILL}},
8850 {&hf_amqp_0_10_struct_message_properties_content_encoding, {
8851 "Content-encoding", "amqp.message.message-properties.content-encoding",
8852 FT_STRING, BASE_NONE, NULL, 0x0,
8853 "MIME content encoding method", HFILL}},
8854 {&hf_amqp_0_10_struct_message_properties_user_id, {
8855 "User-id", "amqp.message.message-properties.user-id",
8856 FT_BYTES, BASE_NONE, NULL, 0x0,
8857 "Creating user id", HFILL}},
8858 {&hf_amqp_0_10_struct_message_properties_app_id, {
8859 "App-id", "amqp.message.message-properties.app-id",
8860 FT_BYTES, BASE_NONE, NULL, 0x0,
8861 "Creating user id", HFILL}},
8862 {&hf_amqp_0_10_struct_message_properties_application_headers, {
8863 "Application-headers", "amqp.message.message-properties.application-headers",
8864 FT_NONE, BASE_NONE, NULL, 0,
8865 "Application-private headers", HFILL}},
8866 {&hf_amqp_0_10_struct_reply_to_exchange, {
8867 "Exchange", "amqp.message.message-properties.reply-to.exchange",
8868 FT_STRING, BASE_NONE, NULL, 0x0,
8869 "Exchange to reply to", HFILL}},
8870 {&hf_amqp_0_10_struct_reply_to_routing_key, {
8871 "Routing-key", "amqp.message.message-properties.reply-to.routing-key",
8872 FT_STRING, BASE_NONE, NULL, 0x0,
8873 "Routing key to reply with", HFILL}},
8874 {&hf_amqp_0_10_struct_acquired_transfers, {
8875 "Transfers", "amqp.message.acquired.transfers",
8876 FT_NONE, BASE_NONE, NULL, 0x0,
8877 "Command set", HFILL}},
8878 {&hf_amqp_0_10_struct_resume_result_offset, {
8879 "Offset", "amqp.message.resume-result.offset",
8880 FT_UINT64, BASE_DEC, NULL, 0x0,
8881 "Amount of data already transferred", HFILL}},
8882 {&hf_amqp_0_10_struct_exchange_query_result_durable, {
8883 "Durable", "amqp.exchange.exchange-query-result.durable",
8884 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
8885 "Exchange is durable", HFILL}},
8886 {&hf_amqp_0_10_struct_exchange_query_result_not_found, {
8887 "Not-found", "amqp.exchange.exchange-query-result.not-found",
8888 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
8889 "Exchange was not found", HFILL}},
8890 {&hf_amqp_0_10_struct_exchange_bound_result_exchange_not_found, {
8891 "Exchange-not-found", "amqp.exchange.exchange-bound-result.exchange-not-found",
8892 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x01,
8893 "Exchange was not found", HFILL}},
8894 {&hf_amqp_0_10_struct_exchange_bound_result_queue_not_found, {
8895 "Queue-not-found", "amqp.exchange.exchange-bound-result.queue-not-found",
8896 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
8897 "Queue was not found", HFILL}},
8898 {&hf_amqp_0_10_struct_exchange_bound_result_queue_not_matched, {
8899 "Queue-not-matched", "amqp.exchange.exchange-bound-result.queue-not-matched",
8900 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
8901 "No binding from exchange to queue", HFILL}},
8902 {&hf_amqp_0_10_struct_exchange_bound_result_key_not_matched, {
8903 "Key-not-matched", "amqp.exchange.exchange-bound-result.key-not-matched",
8904 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
8905 "No binding from exchange with binding-key", HFILL}},
8906 {&hf_amqp_0_10_struct_exchange_bound_result_args_not_matched, {
8907 "Args-not-matched", "amqp.exchange.exchange-bound-result.args-not-matched",
8908 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
8909 "No binding from exchange with specified arguments", HFILL}},
8910 {&hf_amqp_0_10_struct_queue_query_result_durable, {
8911 "Durable", "amqp.queue.queue-query-result.durable",
8912 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
8913 "Queue is durable", HFILL}},
8914 {&hf_amqp_0_10_struct_queue_query_result_exclusive, {
8915 "Exclusive", "amqp.queue.queue-query-result.exclusive",
8916 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
8917 "Queue created exclusive-use", HFILL}},
8918 {&hf_amqp_0_10_struct_queue_query_result_auto_delete, {
8919 "Auto-delete", "amqp.queue.queue-query-result.auto-delete",
8920 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
8921 "Queue created auto-delete", HFILL}},
8922 {&hf_amqp_0_10_struct_queue_query_result_message_count, {
8923 "Message-count", "amqp.queue.queue-query-result.message-countt",
8924 FT_UINT32, BASE_DEC, NULL, 0x0,
8925 "Number of messages in the queue", HFILL}},
8926 {&hf_amqp_0_10_struct_queue_query_result_subscriber_count, {
8927 "Subscriber-count", "amqp.queue.queue-query-result.subscriber-count",
8928 FT_UINT32, BASE_DEC, NULL, 0x0,
8929 "Number of subscribers for the queue", HFILL}},
8930 {&hf_amqp_0_10_struct_file_properties_content_type, {
8931 "Content-type", "amqp.file.file-properties.content-type",
8932 FT_STRING, BASE_NONE, NULL, 0x0,
8933 "MIME content type", HFILL}},
8934 {&hf_amqp_0_10_struct_file_properties_content_encoding, {
8935 "Content-encoding", "amqp.file.file-properties.content-encoding",
8936 FT_STRING, BASE_NONE, NULL, 0x0,
8937 "MIME content encoding", HFILL}},
8938 {&hf_amqp_0_10_struct_file_properties_headers, {
8939 "Headers", "amqp.file.file-properties.headers",
8940 FT_NONE, BASE_NONE, NULL, 0,
8941 "Message header fields", HFILL}},
8942 {&hf_amqp_0_10_struct_file_properties_priority, {
8943 "Priority", "amqp.file.file-properties.priority",
8944 FT_UINT8, BASE_DEC, NULL, 0,
8945 "Message priority, 0 to 9", HFILL}},
8946 {&hf_amqp_0_10_struct_file_properties_reply_to, {
8947 "Reply-to", "amqp.file.file-properties.reply-to",
8948 FT_STRING, BASE_NONE, NULL, 0x0,
8949 "Destination to reply to", HFILL}},
8950 {&hf_amqp_0_10_struct_file_properties_message_id, {
8951 "Message-id", "amqp.file.file-properties.message-id",
8952 FT_STRING, BASE_NONE, NULL, 0x0,
8953 "Application message identifier", HFILL}},
8954 {&hf_amqp_0_10_struct_file_properties_filename, {
8955 "Filename", "amqp.file.file-properties.filename",
8956 FT_STRING, BASE_NONE, NULL, 0x0,
8957 "Message filename", HFILL}},
8958 {&hf_amqp_0_10_struct_file_properties_timestamp, {
8959 "Timestamp", "amqp.file.file-properties.timestamp",
8960 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
8961 "Message timestamp", HFILL}},
8962 {&hf_amqp_0_10_struct_file_properties_cluster_id, {
8963 "Cluster-id", "amqp.file.file-properties.cluster-id",
8964 FT_STRING, BASE_NONE, NULL, 0x0,
8965 "Intra-cluster routing identifier", HFILL}},
8966 {&hf_amqp_0_10_struct_stream_properties_content_type, {
8967 "Content-type", "amqp.stream.stream-properties.content-type",
8968 FT_STRING, BASE_NONE, NULL, 0x0,
8969 "MIME content type", HFILL}},
8970 {&hf_amqp_0_10_struct_stream_properties_content_encoding, {
8971 "Content-encoding", "amqp.stream.stream-properties.content-encoding",
8972 FT_STRING, BASE_NONE, NULL, 0x0,
8973 "MIME content encoding", HFILL}},
8974 {&hf_amqp_0_10_struct_stream_properties_headers, {
8975 "Headers", "amqp.stream.stream-properties.headers",
8976 FT_NONE, BASE_NONE, NULL, 0,
8977 "Message header fields", HFILL}},
8978 {&hf_amqp_0_10_struct_stream_properties_priority, {
8979 "Priority", "amqp.stream.stream-properties.priority",
8980 FT_UINT8, BASE_DEC, NULL, 0,
8981 "Message priority, 0 to 9", HFILL}},
8982 {&hf_amqp_0_10_struct_stream_properties_timestamp, {
8983 "Timestamp", "amqp.stream.stream-properties.timestamp",
8984 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
8985 "Message timestamp", HFILL}},
8986 {&hf_amqp_0_10_argument_packing_flags, {
8987 "Packing Flags", "amqp.struct.packing",
8988 FT_UINT16, BASE_HEX, NULL, 0xffff,
8989 "Argument Struct Packing Flags", HFILL}},
8990 {&hf_amqp_0_10_session_header_sync, {
8991 "Sync", "amqp.session.header.sync",
8992 FT_BOOLEAN, 8, TFS(&amqp_0_10_session_header_sync), 0x01,
8993 "Sync requested", HFILL}},
8994 {&hf_amqp_0_10_method_session_attach_name, {
8995 "Name", "amqp.session.attach.name",
8996 FT_BYTES, BASE_NONE, NULL, 0x0,
8997 "Session name", HFILL}},
8998 {&hf_amqp_0_10_method_session_attach_force, {
8999 "Force", "amqp.session.attach.force",
9000 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9001 "Session forced", HFILL}},
9002 {&hf_amqp_0_10_method_session_detached_code, {
9003 "Code", "amqp.session.detached.code",
9004 FT_UINT8, BASE_DEC, VALS(amqp_0_10_method_session_detached_codes), 0x0,
9005 "Reason for detach", HFILL}},
9006 {&hf_amqp_0_10_method_session_timeout, {
9007 "Timeout", "amqp.session.timeout",
9008 FT_UINT32, BASE_DEC, NULL, 0x0,
9009 "Session timeout (seconds)", HFILL}},
9010 {&hf_amqp_0_10_method_session_completed_timely, {
9011 "Timely-reply", "amqp.session.completed.timely-reply",
9012 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9013 "Timely reply requested", HFILL}},
9014 {&hf_amqp_0_10_method_session_flush_expected, {
9015 "Expected", "amqp.session.flush.expected",
9016 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
9017 "Request notification of expected commands", HFILL}},
9018 {&hf_amqp_0_10_method_session_flush_confirmed, {
9019 "Confirmed", "amqp.session.flush.confirmed",
9020 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
9021 "Request notification of confirmed commands", HFILL}},
9022 {&hf_amqp_0_10_method_session_flush_completed, {
9023 "Completed", "amqp.session.flush.completed",
9024 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
9025 "Request notification of completed commands", HFILL}},
9026 {&hf_amqp_0_10_method_session_command_point_id, {
9027 "Command-id", "amqp.session.command_point.command_id",
9028 FT_UINT32, BASE_DEC, NULL, 0x0,
9029 "Next command's sequence number", HFILL}},
9030 {&hf_amqp_0_10_method_session_command_point_offset, {
9031 "Command-offset", "amqp.session.command_point.command_offset",
9032 FT_UINT64, BASE_DEC, NULL, 0x0,
9033 "Byte offset within command", HFILL}},
9034 {&hf_amqp_0_10_method_session_commands, {
9035 "Commands", "amqp.session.expected.commands",
9036 FT_NONE, BASE_NONE, NULL, 0x0,
9037 "Command set", HFILL}},
9038 {&hf_amqp_0_10_method_session_fragments, {
9039 "Fragments", "amqp.session.expected.fragments",
9040 FT_NONE, BASE_NONE, NULL, 0x0,
9041 "Command Fragments", HFILL}},
9042 {&hf_amqp_0_10_method_execution_command_id, {
9043 "Command-id", "amqp.execution.command_id",
9044 FT_UINT32, BASE_DEC, NULL, 0x0,
9045 "Command's sequence number", HFILL}},
9046 {&hf_amqp_0_10_method_execution_exception_error, {
9047 "Error-code", "amqp.execution.exception.error-code",
9048 FT_UINT16, BASE_DEC, VALS(amqp_0_10_method_execution_exception_errors), 0x0,
9049 "Exception error code", HFILL}},
9050 {&hf_amqp_0_10_method_execution_field_index, {
9051 "Field-index", "amqp.execution.exception.field-index",
9052 FT_UINT8, BASE_DEC, NULL, 0x0,
9053 "0-based index of exceptional field", HFILL}},
9054 {&hf_amqp_0_10_method_execution_description, {
9055 "Description", "amqp.execution.exception.description",
9056 FT_STRING, BASE_NONE, NULL, 0,
9057 "Description of exception", HFILL}},
9058 {&hf_amqp_0_10_method_execution_error_info, {
9059 "Error-info", "amqp.execution.exception.error-info",
9060 FT_NONE, BASE_NONE, NULL, 0,
9061 "client-properties", HFILL}},
9062 {&hf_amqp_0_10_method_message_transfer_destination, {
9063 "Description", "amqp.message.transfer.destination",
9064 FT_STRING, BASE_NONE, NULL, 0,
9065 "Message destination", HFILL}},
9066 {&hf_amqp_0_10_method_message_transfer_accept_mode, {
9067 "Accept-mode", "amqp.message.transfer.accept-mode",
9068 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_transfer_accept_modes), 0x0,
9069 "Message accept mode", HFILL}},
9070 {&hf_amqp_0_10_method_message_transfer_acquire_mode, {
9071 "Acquire-mode", "amqp.message.transfer.acquire-mode",
9072 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_transfer_acquire_modes), 0x0,
9073 "Message acquire mode", HFILL}},
9074 {&hf_amqp_0_10_method_message_accept_transfers, {
9075 "Commands", "amqp.message.accept.transfers",
9076 FT_NONE, BASE_NONE, NULL, 0x0,
9077 "Previously transferred messages", HFILL}},
9078 {&hf_amqp_0_10_method_message_transfer_reject_code, {
9079 "Reject-code", "amqp.message.reject.reject-code",
9080 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_transfer_reject_codes), 0x0,
9081 "Message reject code", HFILL}},
9082 {&hf_amqp_0_10_method_message_reject_text, {
9083 "Text", "amqp.message.reject.text",
9084 FT_STRING, BASE_NONE, NULL, 0,
9085 "Reject description", HFILL}},
9086 {&hf_amqp_0_10_method_message_release_set_redelivered, {
9087 "Set-redelivered", "amqp.message.release.set-redelivered",
9088 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9089 "Mark redelivered on next transfer from queue", HFILL}},
9090 {&hf_amqp_0_10_method_message_dest, {
9091 "Destination", "amqp.message.destination",
9092 FT_STRING, BASE_NONE, NULL, 0,
9093 "Message destination", HFILL}},
9094 {&hf_amqp_0_10_method_message_resume_id, {
9095 "Resume-Id", "amqp.message.resume.id",
9096 FT_STRING, BASE_NONE, NULL, 0,
9097 "Message id to resume", HFILL}},
9098 {&hf_amqp_0_10_method_message_subscribe_queue, {
9099 "Queue", "amqp.message.subscribe.queue",
9100 FT_STRING, BASE_NONE, NULL, 0,
9101 "Queue to subscribe to", HFILL}},
9102 {&hf_amqp_0_10_method_message_subscribe_exclusive, {
9103 "Exclusive", "amqp.message.subscribe.exclusive",
9104 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
9105 "Request exclusive subscription", HFILL}},
9106 {&hf_amqp_0_10_method_message_subscribe_resume_ttl, {
9107 "Resume-ttl", "amqp.message.subscribe.resume_ttl",
9108 FT_UINT64, BASE_DEC, NULL, 0x0,
9109 "TTL to use when resuming", HFILL}},
9110 {&hf_amqp_0_10_method_message_subscribe_args, {
9111 "Extended arguments", "amqp.message.subscribe.arguments",
9112 FT_NONE, BASE_NONE, NULL, 0x0,
9113 "Implementation-specific arguments", HFILL}},
9114 {&hf_amqp_0_10_method_message_flow_mode, {
9115 "Flow-mode", "amqp.message.flow-mode",
9116 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_flow_modes), 0x0,
9117 "Method for allocating message flow credit", HFILL}},
9118 {&hf_amqp_0_10_method_message_credit_unit, {
9119 "Credit-unit", "amqp.message.flow.credit-unit",
9120 FT_UINT8, BASE_DEC, VALS(amqp_0_10_message_credit_units), 0x0,
9121 "Unit of message flow value", HFILL}},
9122 {&hf_amqp_0_10_method_message_credit_value, {
9123 "Value", "amqp.message.flow.value",
9124 FT_UINT32, BASE_DEC, NULL, 0x0,
9125 "Message flow value", HFILL}},
9126 {&hf_amqp_0_10_method_dtx_start_join, {
9127 "Join", "amqp.dtx.start.join",
9128 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9129 "Join with existing xid", HFILL}},
9130 {&hf_amqp_0_10_method_dtx_start_resume, {
9131 "Resume", "amqp.dtx.start.resume",
9132 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
9133 "Resume suspended transaction", HFILL}},
9134 {&hf_amqp_0_10_method_dtx_end_fail, {
9135 "Fail", "amqp.dtx.end.fail",
9136 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9137 "This portion of work has failed", HFILL}},
9138 {&hf_amqp_0_10_method_dtx_end_suspend, {
9139 "Suspend", "amqp.dtx.end.suspend",
9140 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
9141 "Temporarily suspending transaction", HFILL}},
9142 {&hf_amqp_0_10_method_dtx_commit_one_phase, {
9143 "One-phase", "amqp.dtx.commit.one-phase",
9144 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9145 "Use one-phase optimization", HFILL}},
9146 {&hf_amqp_0_10_method_dtx_set_timeout_timeout, {
9147 "Timeout", "amqp.dtx.set-timeout.timeout",
9148 FT_UINT32, BASE_DEC, NULL, 0x0,
9149 "Transaction timeout value in seconds", HFILL}},
9150 {&hf_amqp_0_10_method_exchange_declare_exchange, {
9151 "Exchange", "amqp.exchange.declare.exchange",
9152 FT_STRING, BASE_NONE, NULL, 0,
9153 "Exchange to declare", HFILL}},
9154 {&hf_amqp_0_10_method_exchange_declare_type, {
9155 "Type", "amqp.exchange.declare.type",
9156 FT_STRING, BASE_NONE, NULL, 0,
9157 "Type of exchange to declare", HFILL}},
9158 {&hf_amqp_0_10_method_exchange_declare_alt_exchange, {
9159 "Alternate-exchange", "amqp.exchange.declare.alternate-exchange",
9160 FT_STRING, BASE_NONE, NULL, 0,
9161 "Alternate exchange for unroutable messages", HFILL}},
9162 {&hf_amqp_0_10_method_exchange_declare_passive, {
9163 "Passive", "amqp.exchange.declare.passive",
9164 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
9165 "Do not create the exchange", HFILL}},
9166 {&hf_amqp_0_10_method_exchange_declare_durable, {
9167 "Durable", "amqp.exchange.declare.durable",
9168 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
9169 "Create a durable exchange", HFILL}},
9170 {&hf_amqp_0_10_method_exchange_declare_auto_delete, {
9171 "Auto-delete", "amqp.exchange.declare.auto-delete",
9172 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
9173 "Delete exchange when last binding removed", HFILL}},
9174 {&hf_amqp_0_10_method_exchange_declare_arguments, {
9175 "Arguments", "amqp.exchange.declare.arguments",
9176 FT_NONE, BASE_NONE, NULL, 0,
9177 "Declaration arguments", HFILL}},
9178 {&hf_amqp_0_10_method_exchange_delete_if_unused, {
9179 "If-unused", "amqp.exchange.delete.if-unused",
9180 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9181 "Delete exchange only if it has no queue bindings", HFILL}},
9182 {&hf_amqp_0_10_method_exchange_bind_queue, {
9183 "Queue", "amqp.exchange.bind.queue",
9184 FT_STRING, BASE_NONE, NULL, 0,
9185 "Queue to bind to", HFILL}},
9186 {&hf_amqp_0_10_method_exchange_binding_key, {
9187 "Binding-key", "amqp.exchange.bind.binding-key",
9188 FT_STRING, BASE_NONE, NULL, 0,
9189 "Binding between exchange and queue", HFILL}},
9190 {&hf_amqp_0_10_method_queue_name, {
9191 "Queue", "amqp.queue.declare.queue",
9192 FT_STRING, BASE_NONE, NULL, 0,
9193 "Queue name", HFILL}},
9194 {&hf_amqp_0_10_method_queue_alt_exchange, {
9195 "Alternate-exchange", "amqp.queue.declare.alternate-exchange",
9196 FT_STRING, BASE_NONE, NULL, 0,
9197 "Alternate Exchange", HFILL}},
9198 {&hf_amqp_0_10_method_queue_declare_passive, {
9199 "Passive", "amqp.queue.declare.passive",
9200 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
9201 "Do not create the queue", HFILL}},
9202 {&hf_amqp_0_10_method_queue_declare_durable, {
9203 "Durable", "amqp.queue.declare.durable",
9204 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
9205 "Create a durable queue", HFILL}},
9206 {&hf_amqp_0_10_method_queue_declare_exclusive, {
9207 "Exclusive", "amqp.queue.declare.exclusive",
9208 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
9209 "Create a queue usable from only one session", HFILL}},
9210 {&hf_amqp_0_10_method_queue_declare_auto_delete, {
9211 "Auto-delete", "amqp.queue.declare.auto-delete",
9212 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
9213 "Delete queue when all uses completed", HFILL}},
9214 {&hf_amqp_0_10_method_queue_declare_arguments, {
9215 "Arguments", "amqp.queue.declare.arguments",
9216 FT_NONE, BASE_NONE, NULL, 0,
9217 "Declaration arguments", HFILL}},
9218 {&hf_amqp_0_10_method_queue_delete_if_unused, {
9219 "If-unused", "amqp.queue.delete.if-unused",
9220 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
9221 "Delete the queue only if there are no consumers", HFILL}},
9222 {&hf_amqp_0_10_method_queue_delete_if_empty, {
9223 "If-empty", "amqp.queue.delete.if-empty",
9224 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9225 "Delete queue only if empty", HFILL}},
9226 {&hf_amqp_0_10_method_file_qos_prefetch_size, {
9227 "Prefetch-size", "amqp.file.qos.prefetch-size",
9228 FT_UINT32, BASE_DEC, NULL, 0x0,
9229 "Pre-fetch window size in octets", HFILL}},
9230 {&hf_amqp_0_10_method_file_qos_prefetch_count, {
9231 "Prefetch-count", "amqp.file.qos.prefetch-count",
9232 FT_UINT16, BASE_DEC, NULL, 0x0,
9233 "Pre-fetch window size in messages", HFILL}},
9234 {&hf_amqp_0_10_method_file_qos_global, {
9235 "Global", "amqp.file.qos.global",
9236 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9237 "Apply QoS to entire connection", HFILL}},
9238 {&hf_amqp_0_10_method_file_consumer_tag, {
9239 "Consumer-tag", "amqp.file.consumer-tag",
9240 FT_STRING, BASE_NONE, NULL, 0,
9241 "Consumer tag", HFILL}},
9242 {&hf_amqp_0_10_method_file_consume_no_local, {
9243 "No-local", "amqp.file.consume.no-local",
9244 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9245 "Don't send messages to connection that publishes them", HFILL}},
9246 {&hf_amqp_0_10_method_file_consume_no_ack, {
9247 "No-ack", "amqp.file.consume.no-ack",
9248 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
9249 "No acknowledgement needed", HFILL}},
9250 {&hf_amqp_0_10_method_file_consume_exclusive, {
9251 "Exclusive", "amqp.file.consume.exclusive",
9252 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
9253 "Request exclusive access", HFILL}},
9254 {&hf_amqp_0_10_method_file_consume_nowait, {
9255 "Nowait", "amqp.file.consume.nowait",
9256 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x20,
9257 "Do not send a reply", HFILL}},
9258 {&hf_amqp_0_10_method_file_consume_arguments, {
9259 "Arguments", "amqp.file.consume.arguments",
9260 FT_NONE, BASE_NONE, NULL, 0,
9261 "Arguments for consuming", HFILL}},
9262 {&hf_amqp_0_10_method_file_identifier, {
9263 "Identifier", "amqp.file.identifier",
9264 FT_STRING, BASE_NONE, NULL, 0,
9265 "Staging identifier", HFILL}},
9266 {&hf_amqp_0_10_method_file_open_content_size, {
9267 "Content-size", "amqp.file.open.content-size",
9268 FT_UINT64, BASE_DEC, NULL, 0x0,
9269 "Message content size in octets", HFILL}},
9270 {&hf_amqp_0_10_method_file_open_ok_staged_size, {
9271 "Staged-size", "amqp.file.open_ok.staged-size",
9272 FT_UINT64, BASE_DEC, NULL, 0x0,
9273 "Amount of previously staged content in octets", HFILL}},
9274 {&hf_amqp_0_10_method_file_publish_exchange, {
9275 "Exchange", "amqp.file.publish.exchange",
9276 FT_STRING, BASE_NONE, NULL, 0,
9277 "Exchange to publish to", HFILL}},
9278 {&hf_amqp_0_10_method_file_publish_routing_key, {
9279 "Routing-key", "amqp.file.publish.routing-key",
9280 FT_STRING, BASE_NONE, NULL, 0,
9281 "Message routing key", HFILL}},
9282 {&hf_amqp_0_10_method_file_publish_mandatory, {
9283 "Mandatory", "amqp.file.publish.mandatory",
9284 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9285 "Mandatory routing", HFILL}},
9286 {&hf_amqp_0_10_method_file_publish_immediate, {
9287 "Immediate", "amqp.file.publish.immediate",
9288 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
9289 "Request immediate delivery", HFILL}},
9290 {&hf_amqp_0_10_method_file_return_reply_code, {
9291 "Reply-code", "amqp.file.return.reply-code",
9292 FT_UINT16, BASE_DEC, VALS(amqp_0_10_file_return_codes), 0x0,
9293 "Reply code", HFILL}},
9294 {&hf_amqp_0_10_method_file_return_reply_text, {
9295 "Reply-text", "amqp.file.return.reply-text",
9296 FT_STRING, BASE_NONE, NULL, 0,
9297 "Localized reply text", HFILL}},
9298 {&hf_amqp_0_10_method_file_return_exchange, {
9299 "Exchange", "amqp.file.return.exchange",
9300 FT_STRING, BASE_NONE, NULL, 0,
9301 "Exchange the original message was published to", HFILL}},
9302 {&hf_amqp_0_10_method_file_return_routing_key, {
9303 "Routing-key", "amqp.file.return.routing-key",
9304 FT_STRING, BASE_NONE, NULL, 0,
9305 "Message routing key", HFILL}},
9306 {&hf_amqp_0_10_method_file_deliver_consumer_tag, {
9307 "Consumer-tag", "amqp.file.deliver.consumer-tag",
9308 FT_STRING, BASE_NONE, NULL, 0,
9309 "Consumer tag", HFILL}},
9310 {&hf_amqp_0_10_method_file_deliver_delivery_tag, {
9311 "Delivery-tag", "amqp.file.deliver.delivery-tag",
9312 FT_UINT64, BASE_HEX, NULL, 0,
9313 "Server-assigned, session-specific delivery tag", HFILL}},
9314 {&hf_amqp_0_10_method_file_deliver_redelivered, {
9315 "Redelivered", "amqp.file.deliver.redelivered",
9316 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
9317 "Possible duplicate delivery", HFILL}},
9318 {&hf_amqp_0_10_method_file_deliver_exchange, {
9319 "Exchange", "amqp.file.deliver.exchange",
9320 FT_STRING, BASE_NONE, NULL, 0,
9321 "Exchange the original message was published to", HFILL}},
9322 {&hf_amqp_0_10_method_file_deliver_routing_key, {
9323 "Routing-key", "amqp.file.deliver.routing-key",
9324 FT_STRING, BASE_NONE, NULL, 0,
9325 "Message routing key", HFILL}},
9326 {&hf_amqp_0_10_method_file_ack_delivery_tag, {
9327 "Delivery-tag", "amqp.file.ack.delivery-tag",
9328 FT_UINT64, BASE_HEX, NULL, 0,
9329 "Identifier of message being acknowledged", HFILL}},
9330 {&hf_amqp_0_10_method_file_ack_multiple, {
9331 "Multiple", "amqp.file.ack.multiple",
9332 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
9333 "Acknowledge multiple messages", HFILL}},
9334 {&hf_amqp_0_10_method_file_reject_delivery_tag, {
9335 "Delivery-tag", "amqp.file.reject.delivery-tag",
9336 FT_UINT64, BASE_HEX, NULL, 0,
9337 "Identifier of message to be rejected", HFILL}},
9338 {&hf_amqp_0_10_method_file_reject_requeue, {
9339 "Requeue", "amqp.file.reject.multiple",
9340 FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
9341 "Requeue the message", HFILL}},
9342 {&hf_amqp_0_10_method_stream_qos_prefetch_size, {
9343 "Prefetch-size", "amqp.stream.qos.prefetch-size",
9344 FT_UINT32, BASE_DEC, NULL, 0x0,
9345 "Pre-fetch window size in octets", HFILL}},
9346 {&hf_amqp_0_10_method_stream_qos_prefetch_count, {
9347 "Prefetch-count", "amqp.stream.qos.prefetch-count",
9348 FT_UINT16, BASE_DEC, NULL, 0x0,
9349 "Pre-fetch window size in messages", HFILL}},
9350 #if 0
9351 {&hf_amqp_0_10_method_stream_qos_consume_rate, {
9352 "Prefetch-size", "amqp.stream.qos.consume_rate",
9353 FT_UINT32, BASE_DEC, NULL, 0x0,
9354 "Desired transfer rate in octets/second", HFILL}},
9355 #endif
9356 {&hf_amqp_0_10_method_stream_qos_global, {
9357 "Global", "amqp.stream.qos.global",
9358 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
9359 "Apply QoS to entire connection", HFILL}},
9360 {&hf_amqp_0_10_method_stream_consumer_tag, {
9361 "Consumer-tag", "amqp.stream.consumer-tag",
9362 FT_STRING, BASE_NONE, NULL, 0,
9363 "Consumer tag", HFILL}},
9364 {&hf_amqp_0_10_method_stream_consume_no_local, {
9365 "No-local", "amqp.stream.consume.no-local",
9366 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9367 "Don't send messages to connection that publishes them", HFILL}},
9368 {&hf_amqp_0_10_method_stream_consume_exclusive, {
9369 "Exclusive", "amqp.stream.consume.exclusive",
9370 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
9371 "Request exclusive access", HFILL}},
9372 {&hf_amqp_0_10_method_stream_consume_nowait, {
9373 "Nowait", "amqp.stream.consume.nowait",
9374 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
9375 "Do not send a reply", HFILL}},
9376 {&hf_amqp_0_10_method_stream_consume_arguments, {
9377 "Arguments", "amqp.stream.consume.arguments",
9378 FT_NONE, BASE_NONE, NULL, 0,
9379 "Arguments for consuming", HFILL}},
9380 {&hf_amqp_0_10_method_stream_publish_exchange, {
9381 "Exchange", "amqp.stream.publish.exchange",
9382 FT_STRING, BASE_NONE, NULL, 0,
9383 "Exchange to publish to", HFILL}},
9384 {&hf_amqp_0_10_method_stream_publish_routing_key, {
9385 "Routing-key", "amqp.stream.publish.routing-key",
9386 FT_STRING, BASE_NONE, NULL, 0,
9387 "Message routing key", HFILL}},
9388 {&hf_amqp_0_10_method_stream_publish_mandatory, {
9389 "Mandatory", "amqp.stream.publish.mandatory",
9390 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
9391 "Mandatory routing", HFILL}},
9392 {&hf_amqp_0_10_method_stream_publish_immediate, {
9393 "Immediate", "amqp.stream.publish.immediate",
9394 FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
9395 "Request immediate delivery", HFILL}},
9396 {&hf_amqp_0_10_method_stream_return_reply_code, {
9397 "Reply-code", "amqp.stream.return.reply-code",
9398 FT_UINT16, BASE_DEC, VALS(amqp_0_10_stream_return_codes), 0x0,
9399 "Reply code", HFILL}},
9400 {&hf_amqp_0_10_method_stream_return_reply_text, {
9401 "Reply-text", "amqp.stream.return.reply-text",
9402 FT_STRING, BASE_NONE, NULL, 0,
9403 "Localized reply text", HFILL}},
9404 {&hf_amqp_0_10_method_stream_return_exchange, {
9405 "Exchange", "amqp.stream.return.exchange",
9406 FT_STRING, BASE_NONE, NULL, 0,
9407 "Exchange the original message was published to", HFILL}},
9408 {&hf_amqp_0_10_method_stream_return_routing_key, {
9409 "Routing-key", "amqp.stream.return.routing-key",
9410 FT_STRING, BASE_NONE, NULL, 0,
9411 "Message routing key", HFILL}},
9412 {&hf_amqp_0_10_method_stream_deliver_consumer_tag, {
9413 "Consumer-tag", "amqp.stream.deliver.consumer-tag",
9414 FT_STRING, BASE_NONE, NULL, 0,
9415 "Consumer tag", HFILL}},
9416 {&hf_amqp_0_10_method_stream_deliver_delivery_tag, {
9417 "Delivery-tag", "amqp.stream.deliver.delivery-tag",
9418 FT_UINT64, BASE_HEX, NULL, 0,
9419 "Server-assigned, session-specific delivery tag", HFILL}},
9420 {&hf_amqp_0_10_method_stream_deliver_exchange, {
9421 "Exchange", "amqp.stream.deliver.exchange",
9422 FT_STRING, BASE_NONE, NULL, 0,
9423 "Exchange the original message was published to", HFILL}},
9424 {&hf_amqp_0_10_method_stream_deliver_queue, {
9425 "Queue", "amqp.stream.deliver.queue",
9426 FT_STRING, BASE_NONE, NULL, 0,
9427 "Name of the queue the message came from", HFILL}},
9428 {&hf_amqp_channel, {
9429 "Channel", "amqp.channel",
9430 FT_UINT16, BASE_DEC, NULL, 0x0,
9431 "Channel ID", HFILL}},
9432 {&hf_amqp_0_9_type, {
9433 "Type", "amqp.type",
9434 FT_UINT8, BASE_DEC, VALS(amqp_0_9_frame_types), 0x0,
9435 "Frame type", HFILL}},
9436 {&hf_amqp_0_9_length, {
9437 "Length", "amqp.length",
9438 FT_UINT32, BASE_DEC, NULL, 0x0,
9439 "Length of the frame", HFILL}},
9440 {&hf_amqp_0_9_method_class_id, {
9441 "Class", "amqp.method.class",
9442 FT_UINT16, BASE_DEC, VALS(amqp_0_9_method_classes), 0x0,
9443 "Class ID", HFILL}},
9444 {&hf_amqp_method_connection_method_id, {
9445 "Method", "amqp.method.method",
9446 FT_UINT16, BASE_DEC, VALS(amqp_method_connection_methods), 0x0,
9447 "Method ID", HFILL}},
9448 {&hf_amqp_method_channel_method_id, {
9449 "Method", "amqp.method.method",
9450 FT_UINT16, BASE_DEC, VALS(amqp_method_channel_methods), 0x0,
9451 "Method ID", HFILL}},
9452 {&hf_amqp_method_access_method_id, {
9453 "Method", "amqp.method.method",
9454 FT_UINT16, BASE_DEC, VALS(amqp_method_access_methods), 0x0,
9455 "Method ID", HFILL}},
9456 {&hf_amqp_method_exchange_method_id, {
9457 "Method", "amqp.method.method",
9458 FT_UINT16, BASE_DEC, VALS(amqp_method_exchange_methods), 0x0,
9459 "Method ID", HFILL}},
9460 {&hf_amqp_method_queue_method_id, {
9461 "Method", "amqp.method.method",
9462 FT_UINT16, BASE_DEC, VALS(amqp_method_queue_methods), 0x0,
9463 "Method ID", HFILL}},
9464 {&hf_amqp_method_basic_method_id, {
9465 "Method", "amqp.method.method",
9466 FT_UINT16, BASE_DEC, VALS(amqp_method_basic_methods), 0x0,
9467 "Method ID", HFILL}},
9468 {&hf_amqp_method_file_method_id, {
9469 "Method", "amqp.method.method",
9470 FT_UINT16, BASE_DEC, VALS(amqp_method_file_methods), 0x0,
9471 "Method ID", HFILL}},
9472 {&hf_amqp_method_stream_method_id, {
9473 "Method", "amqp.method.method",
9474 FT_UINT16, BASE_DEC, VALS(amqp_method_stream_methods), 0x0,
9475 "Method ID", HFILL}},
9476 {&hf_amqp_method_tx_method_id, {
9477 "Method", "amqp.method.method",
9478 FT_UINT16, BASE_DEC, VALS(amqp_method_tx_methods), 0x0,
9479 "Method ID", HFILL}},
9480 {&hf_amqp_method_dtx_method_id, {
9481 "Method", "amqp.method.method",
9482 FT_UINT16, BASE_DEC, VALS(amqp_method_dtx_methods), 0x0,
9483 "Method ID", HFILL}},
9484 {&hf_amqp_method_tunnel_method_id, {
9485 "Method", "amqp.method.method",
9486 FT_UINT16, BASE_DEC, VALS(amqp_method_tunnel_methods), 0x0,
9487 "Method ID", HFILL}},
9488 {&hf_amqp_method_arguments, {
9489 "Arguments", "amqp.method.arguments",
9490 FT_NONE, BASE_NONE, NULL, 0x0,
9491 "Method arguments", HFILL}},
9492 {&hf_amqp_method_connection_start_version_major, {
9493 "Version-Major", "amqp.method.arguments.version_major",
9494 FT_UINT8, BASE_DEC, NULL, 0,
9495 NULL, HFILL}},
9496 {&hf_amqp_method_connection_start_version_minor, {
9497 "Version-Minor", "amqp.method.arguments.version_minor",
9498 FT_UINT8, BASE_DEC, NULL, 0,
9499 NULL, HFILL}},
9500 {&hf_amqp_method_connection_start_server_properties, {
9501 "Server-Properties", "amqp.method.arguments.server_properties",
9502 FT_NONE, BASE_NONE, NULL, 0,
9503 NULL, HFILL}},
9504 {&hf_amqp_0_9_method_connection_start_mechanisms, {
9505 "Mechanisms", "amqp.method.arguments.mechanisms",
9506 FT_BYTES, BASE_NONE, NULL, 0,
9507 NULL, HFILL}},
9508 {&hf_amqp_0_10_method_connection_start_mechanisms, {
9509 "Mechanisms", "amqp.method.arguments.mechanisms",
9510 FT_NONE, BASE_NONE, NULL, 0,
9511 "Supported security mechanisms", HFILL}},
9512 {&hf_amqp_0_9_method_connection_start_locales, {
9513 "Locales", "amqp.method.arguments.locales",
9514 FT_BYTES, BASE_NONE, NULL, 0,
9515 NULL, HFILL}},
9516 {&hf_amqp_0_10_method_connection_start_locales, {
9517 "Locales", "amqp.method.arguments.locales",
9518 FT_NONE, BASE_NONE, NULL, 0,
9519 "Supported message locales", HFILL}},
9520 {&hf_amqp_method_connection_start_ok_client_properties, {
9521 "Client-Properties", "amqp.method.arguments.client_properties",
9522 FT_NONE, BASE_NONE, NULL, 0,
9523 NULL, HFILL}},
9524 {&hf_amqp_method_connection_start_ok_mechanism, {
9525 "Mechanism", "amqp.method.arguments.mechanism",
9526 FT_STRING, BASE_NONE, NULL, 0,
9527 NULL, HFILL}},
9528 {&hf_amqp_method_connection_start_ok_response, {
9529 "Response", "amqp.method.arguments.response",
9530 FT_BYTES, BASE_NONE, NULL, 0,
9531 NULL, HFILL}},
9532 {&hf_amqp_method_connection_start_ok_locale, {
9533 "Locale", "amqp.method.arguments.locale",
9534 FT_STRING, BASE_NONE, NULL, 0,
9535 NULL, HFILL}},
9536 {&hf_amqp_method_connection_secure_challenge, {
9537 "Challenge", "amqp.method.arguments.challenge",
9538 FT_BYTES, BASE_NONE, NULL, 0,
9539 NULL, HFILL}},
9540 {&hf_amqp_method_connection_secure_ok_response, {
9541 "Response", "amqp.method.arguments.response",
9542 FT_BYTES, BASE_NONE, NULL, 0,
9543 NULL, HFILL}},
9544 {&hf_amqp_method_connection_tune_channel_max, {
9545 "Channel-Max", "amqp.method.arguments.channel_max",
9546 FT_UINT16, BASE_DEC, NULL, 0,
9547 NULL, HFILL}},
9548 {&hf_amqp_0_9_method_connection_tune_frame_max, {
9549 "Frame-Max", "amqp.method.arguments.frame_max",
9550 FT_UINT32, BASE_DEC, NULL, 0,
9551 NULL, HFILL}},
9552 {&hf_amqp_0_10_method_connection_tune_frame_max, {
9553 "Frame-Max", "amqp.method.arguments.frame_max",
9554 FT_UINT16, BASE_DEC, NULL, 0,
9555 "Server-proposed maximum frame size", HFILL}},
9556 {&hf_amqp_0_9_method_connection_tune_heartbeat, {
9557 "Heartbeat", "amqp.method.arguments.heartbeat",
9558 FT_UINT16, BASE_DEC, NULL, 0,
9559 NULL, HFILL}},
9560 {&hf_amqp_0_10_method_connection_tune_heartbeat_min, {
9561 "Heartbeat-Min", "amqp.method.arguments.heartbeat_min",
9562 FT_UINT16, BASE_DEC, NULL, 0,
9563 "Minimum heartbeat delay (seconds)", HFILL}},
9564 {&hf_amqp_0_10_method_connection_tune_heartbeat_max, {
9565 "Heartbeat-Max", "amqp.method.arguments.heartbeat_max",
9566 FT_UINT16, BASE_DEC, NULL, 0,
9567 "Maximum heartbeat delay (seconds)", HFILL}},
9568 {&hf_amqp_method_connection_tune_ok_channel_max, {
9569 "Channel-Max", "amqp.method.arguments.channel_max",
9570 FT_UINT16, BASE_DEC, NULL, 0,
9571 NULL, HFILL}},
9572 {&hf_amqp_0_9_method_connection_tune_ok_frame_max, {
9573 "Frame-Max", "amqp.method.arguments.frame_max",
9574 FT_UINT32, BASE_DEC, NULL, 0,
9575 NULL, HFILL}},
9576 {&hf_amqp_0_10_method_connection_tune_ok_frame_max, {
9577 "Frame-Max", "amqp.method.arguments.frame_max",
9578 FT_UINT16, BASE_DEC, NULL, 0,
9579 "Negotiated maximum frame size", HFILL}},
9580 {&hf_amqp_method_connection_tune_ok_heartbeat, {
9581 "Heartbeat", "amqp.method.arguments.heartbeat",
9582 FT_UINT16, BASE_DEC, NULL, 0,
9583 NULL, HFILL}},
9584 {&hf_amqp_method_connection_open_virtual_host, {
9585 "Virtual-Host", "amqp.method.arguments.virtual_host",
9586 FT_STRING, BASE_NONE, NULL, 0,
9587 NULL, HFILL}},
9588 {&hf_amqp_0_9_method_connection_open_capabilities, {
9589 "Capabilities", "amqp.method.arguments.capabilities",
9590 FT_STRING, BASE_NONE, NULL, 0,
9591 NULL, HFILL}},
9592 {&hf_amqp_0_10_method_connection_open_capabilities, {
9593 "Capabilities", "amqp.method.arguments.capabilities",
9594 FT_NONE, BASE_NONE, NULL, 0,
9595 "Required capabilities", HFILL}},
9596 {&hf_amqp_0_9_method_connection_open_insist, {
9597 "Insist", "amqp.method.arguments.insist",
9598 FT_BOOLEAN, 8, NULL, 0x01,
9599 NULL, HFILL}},
9600 {&hf_amqp_0_10_method_connection_open_insist, {
9601 "Insist", "amqp.method.arguments.insist",
9602 FT_BOOLEAN, 8, NULL, 0x04,
9603 "Client insists on this server", HFILL}},
9604 {&hf_amqp_0_9_method_connection_open_ok_known_hosts, {
9605 "Known-Hosts", "amqp.method.arguments.known_hosts",
9606 FT_STRING, BASE_NONE, NULL, 0,
9607 NULL, HFILL}},
9608 {&hf_amqp_0_10_method_connection_open_ok_known_hosts, {
9609 "Known-Hosts", "amqp.method.arguments.known_hosts",
9610 FT_NONE, BASE_NONE, NULL, 0,
9611 "Equivalent or alternate hosts for reconnection", HFILL}},
9612 {&hf_amqp_method_connection_redirect_host, {
9613 "Host", "amqp.method.arguments.host",
9614 FT_STRING, BASE_NONE, NULL, 0,
9615 NULL, HFILL}},
9616 {&hf_amqp_0_9_method_connection_redirect_known_hosts, {
9617 "Known-Hosts", "amqp.method.arguments.known_hosts",
9618 FT_STRING, BASE_NONE, NULL, 0,
9619 NULL, HFILL}},
9620 {&hf_amqp_0_10_method_connection_redirect_known_hosts, {
9621 "Known-Hosts", "amqp.method.arguments.known_hosts",
9622 FT_NONE, BASE_NONE, NULL, 0,
9623 "Equivalent or alternate hosts to redirect to", HFILL}},
9624 {&hf_amqp_0_9_method_connection_close_reply_code, {
9625 "Reply-Code", "amqp.method.arguments.reply_code",
9626 FT_UINT16, BASE_DEC, NULL, 0,
9627 NULL, HFILL}},
9628 {&hf_amqp_0_10_method_connection_close_reply_code, {
9629 "Reply-Code", "amqp.method.arguments.reply_code",
9630 FT_UINT16, BASE_DEC,
9631 VALS(amqp_0_10_method_connection_close_reply_codes), 0,
9632 "Close reason", HFILL}},
9633 {&hf_amqp_method_connection_close_reply_text, {
9634 "Reply-Text", "amqp.method.arguments.reply_text",
9635 FT_STRING, BASE_NONE, NULL, 0,
9636 NULL, HFILL}},
9637 {&hf_amqp_method_connection_close_class_id, {
9638 "Class-Id", "amqp.method.arguments.class_id",
9639 FT_UINT16, BASE_DEC, NULL, 0,
9640 NULL, HFILL}},
9641 {&hf_amqp_method_connection_close_method_id, {
9642 "Method-Id", "amqp.method.arguments.method_id",
9643 FT_UINT16, BASE_DEC, NULL, 0,
9644 NULL, HFILL}},
9645 {&hf_amqp_method_channel_open_out_of_band, {
9646 "Out-Of-Band", "amqp.method.arguments.out_of_band",
9647 FT_STRING, BASE_NONE, NULL, 0,
9648 NULL, HFILL}},
9649 {&hf_amqp_method_channel_open_ok_channel_id, {
9650 "Channel-Id", "amqp.method.arguments.channel_id",
9651 FT_BYTES, BASE_NONE, NULL, 0,
9652 NULL, HFILL}},
9653 {&hf_amqp_method_channel_flow_active, {
9654 "Active", "amqp.method.arguments.active",
9655 FT_BOOLEAN, 8, NULL, 0x01,
9656 NULL, HFILL}},
9657 {&hf_amqp_method_channel_flow_ok_active, {
9658 "Active", "amqp.method.arguments.active",
9659 FT_BOOLEAN, 8, NULL, 0x01,
9660 NULL, HFILL}},
9661 {&hf_amqp_method_channel_close_reply_code, {
9662 "Reply-Code", "amqp.method.arguments.reply_code",
9663 FT_UINT16, BASE_DEC, NULL, 0,
9664 NULL, HFILL}},
9665 {&hf_amqp_method_channel_close_reply_text, {
9666 "Reply-Text", "amqp.method.arguments.reply_text",
9667 FT_STRING, BASE_NONE, NULL, 0,
9668 NULL, HFILL}},
9669 {&hf_amqp_method_channel_close_class_id, {
9670 "Class-Id", "amqp.method.arguments.class_id",
9671 FT_UINT16, BASE_DEC, NULL, 0,
9672 NULL, HFILL}},
9673 {&hf_amqp_method_channel_close_method_id, {
9674 "Method-Id", "amqp.method.arguments.method_id",
9675 FT_UINT16, BASE_DEC, NULL, 0,
9676 NULL, HFILL}},
9677 {&hf_amqp_method_channel_resume_channel_id, {
9678 "Channel-Id", "amqp.method.arguments.channel_id",
9679 FT_BYTES, BASE_NONE, NULL, 0,
9680 NULL, HFILL}},
9681 {&hf_amqp_method_access_request_realm, {
9682 "Realm", "amqp.method.arguments.realm",
9683 FT_STRING, BASE_NONE, NULL, 0,
9684 NULL, HFILL}},
9685 {&hf_amqp_method_access_request_exclusive, {
9686 "Exclusive", "amqp.method.arguments.exclusive",
9687 FT_BOOLEAN, 8, NULL, 0x01,
9688 NULL, HFILL}},
9689 {&hf_amqp_method_access_request_passive, {
9690 "Passive", "amqp.method.arguments.passive",
9691 FT_BOOLEAN, 8, NULL, 0x02,
9692 NULL, HFILL}},
9693 {&hf_amqp_method_access_request_active, {
9694 "Active", "amqp.method.arguments.active",
9695 FT_BOOLEAN, 8, NULL, 0x04,
9696 NULL, HFILL}},
9697 {&hf_amqp_method_access_request_write, {
9698 "Write", "amqp.method.arguments.write",
9699 FT_BOOLEAN, 8, NULL, 0x08,
9700 NULL, HFILL}},
9701 {&hf_amqp_method_access_request_read, {
9702 "Read", "amqp.method.arguments.read",
9703 FT_BOOLEAN, 8, NULL, 0x10,
9704 NULL, HFILL}},
9705 {&hf_amqp_method_access_request_ok_ticket, {
9706 "Ticket", "amqp.method.arguments.ticket",
9707 FT_UINT16, BASE_DEC, NULL, 0,
9708 NULL, HFILL}},
9709 {&hf_amqp_method_exchange_declare_ticket, {
9710 "Ticket", "amqp.method.arguments.ticket",
9711 FT_UINT16, BASE_DEC, NULL, 0,
9712 NULL, HFILL}},
9713 {&hf_amqp_method_exchange_declare_exchange, {
9714 "Exchange", "amqp.method.arguments.exchange",
9715 FT_STRING, BASE_NONE, NULL, 0,
9716 NULL, HFILL}},
9717 {&hf_amqp_method_exchange_declare_type, {
9718 "Type", "amqp.method.arguments.type",
9719 FT_STRING, BASE_NONE, NULL, 0,
9720 NULL, HFILL}},
9721 {&hf_amqp_method_exchange_declare_passive, {
9722 "Passive", "amqp.method.arguments.passive",
9723 FT_BOOLEAN, 8, NULL, 0x01,
9724 NULL, HFILL}},
9725 {&hf_amqp_method_exchange_declare_durable, {
9726 "Durable", "amqp.method.arguments.durable",
9727 FT_BOOLEAN, 8, NULL, 0x02,
9728 NULL, HFILL}},
9729 {&hf_amqp_method_exchange_declare_auto_delete, {
9730 "Auto-Delete", "amqp.method.arguments.auto_delete",
9731 FT_BOOLEAN, 8, NULL, 0x04,
9732 NULL, HFILL}},
9733 {&hf_amqp_method_exchange_declare_internal, {
9734 "Internal", "amqp.method.arguments.internal",
9735 FT_BOOLEAN, 8, NULL, 0x08,
9736 NULL, HFILL}},
9737 {&hf_amqp_method_exchange_declare_nowait, {
9738 "Nowait", "amqp.method.arguments.nowait",
9739 FT_BOOLEAN, 8, NULL, 0x10,
9740 NULL, HFILL}},
9741 {&hf_amqp_method_exchange_declare_arguments, {
9742 "Arguments", "amqp.method.arguments.arguments",
9743 FT_NONE, BASE_NONE, NULL, 0,
9744 NULL, HFILL}},
9745 {&hf_amqp_method_exchange_bind_destination, {
9746 "Destination", "amqp.method.arguments.destination",
9747 FT_STRING, BASE_NONE, NULL, 0,
9748 NULL, HFILL}},
9749 {&hf_amqp_method_exchange_bind_source, {
9750 "Destination", "amqp.method.arguments.source",
9751 FT_STRING, BASE_NONE, NULL, 0,
9752 NULL, HFILL}},
9753 {&hf_amqp_method_exchange_bind_routing_key, {
9754 "Routing-Key", "amqp.method.arguments.routing_key",
9755 FT_STRING, BASE_NONE, NULL, 0,
9756 NULL, HFILL}},
9757 {&hf_amqp_method_exchange_bind_nowait, {
9758 "Nowait", "amqp.method.arguments.nowait",
9759 FT_BOOLEAN, 8, NULL, 0x01,
9760 NULL, HFILL}},
9761 {&hf_amqp_method_exchange_bind_arguments, {
9762 "Arguments", "amqp.method.arguments.arguments",
9763 FT_NONE, BASE_NONE, NULL, 0,
9764 NULL, HFILL}},
9765 {&hf_amqp_method_exchange_delete_ticket, {
9766 "Ticket", "amqp.method.arguments.ticket",
9767 FT_UINT16, BASE_DEC, NULL, 0,
9768 NULL, HFILL}},
9769 {&hf_amqp_method_exchange_delete_exchange, {
9770 "Exchange", "amqp.method.arguments.exchange",
9771 FT_STRING, BASE_NONE, NULL, 0,
9772 NULL, HFILL}},
9773 {&hf_amqp_method_exchange_delete_if_unused, {
9774 "If-Unused", "amqp.method.arguments.if_unused",
9775 FT_BOOLEAN, 8, NULL, 0x01,
9776 NULL, HFILL}},
9777 {&hf_amqp_method_exchange_delete_nowait, {
9778 "Nowait", "amqp.method.arguments.nowait",
9779 FT_BOOLEAN, 8, NULL, 0x02,
9780 NULL, HFILL}},
9781 {&hf_amqp_method_queue_declare_ticket, {
9782 "Ticket", "amqp.method.arguments.ticket",
9783 FT_UINT16, BASE_DEC, NULL, 0,
9784 NULL, HFILL}},
9785 {&hf_amqp_method_queue_declare_queue, {
9786 "Queue", "amqp.method.arguments.queue",
9787 FT_STRING, BASE_NONE, NULL, 0,
9788 NULL, HFILL}},
9789 {&hf_amqp_method_queue_declare_passive, {
9790 "Passive", "amqp.method.arguments.passive",
9791 FT_BOOLEAN, 8, NULL, 0x01,
9792 NULL, HFILL}},
9793 {&hf_amqp_method_queue_declare_durable, {
9794 "Durable", "amqp.method.arguments.durable",
9795 FT_BOOLEAN, 8, NULL, 0x02,
9796 NULL, HFILL}},
9797 {&hf_amqp_method_queue_declare_exclusive, {
9798 "Exclusive", "amqp.method.arguments.exclusive",
9799 FT_BOOLEAN, 8, NULL, 0x04,
9800 NULL, HFILL}},
9801 {&hf_amqp_method_queue_declare_auto_delete, {
9802 "Auto-Delete", "amqp.method.arguments.auto_delete",
9803 FT_BOOLEAN, 8, NULL, 0x08,
9804 NULL, HFILL}},
9805 {&hf_amqp_method_queue_declare_nowait, {
9806 "Nowait", "amqp.method.arguments.nowait",
9807 FT_BOOLEAN, 8, NULL, 0x10,
9808 NULL, HFILL}},
9809 {&hf_amqp_method_queue_declare_arguments, {
9810 "Arguments", "amqp.method.arguments.arguments",
9811 FT_NONE, BASE_NONE, NULL, 0,
9812 NULL, HFILL}},
9813 {&hf_amqp_method_queue_declare_ok_queue, {
9814 "Queue", "amqp.method.arguments.queue",
9815 FT_STRING, BASE_NONE, NULL, 0,
9816 NULL, HFILL}},
9817 {&hf_amqp_method_queue_declare_ok_message_count, {
9818 "Message-Count", "amqp.method.arguments.message_count",
9819 FT_UINT32, BASE_DEC, NULL, 0,
9820 NULL, HFILL}},
9821 {&hf_amqp_method_queue_declare_ok_consumer_count, {
9822 "Consumer-Count", "amqp.method.arguments.consumer_count",
9823 FT_UINT32, BASE_DEC, NULL, 0,
9824 NULL, HFILL}},
9825 {&hf_amqp_method_queue_bind_ticket, {
9826 "Ticket", "amqp.method.arguments.ticket",
9827 FT_UINT16, BASE_DEC, NULL, 0,
9828 NULL, HFILL}},
9829 {&hf_amqp_method_queue_bind_queue, {
9830 "Queue", "amqp.method.arguments.queue",
9831 FT_STRING, BASE_NONE, NULL, 0,
9832 NULL, HFILL}},
9833 {&hf_amqp_method_queue_bind_exchange, {
9834 "Exchange", "amqp.method.arguments.exchange",
9835 FT_STRING, BASE_NONE, NULL, 0,
9836 NULL, HFILL}},
9837 {&hf_amqp_method_queue_bind_routing_key, {
9838 "Routing-Key", "amqp.method.arguments.routing_key",
9839 FT_STRING, BASE_NONE, NULL, 0,
9840 NULL, HFILL}},
9841 {&hf_amqp_method_queue_bind_nowait, {
9842 "Nowait", "amqp.method.arguments.nowait",
9843 FT_BOOLEAN, 8, NULL, 0x01,
9844 NULL, HFILL}},
9845 {&hf_amqp_method_queue_bind_arguments, {
9846 "Arguments", "amqp.method.arguments.arguments",
9847 FT_NONE, BASE_NONE, NULL, 0,
9848 NULL, HFILL}},
9849 {&hf_amqp_method_queue_unbind_ticket, {
9850 "Ticket", "amqp.method.arguments.ticket",
9851 FT_UINT16, BASE_DEC, NULL, 0,
9852 NULL, HFILL}},
9853 {&hf_amqp_method_queue_unbind_queue, {
9854 "Queue", "amqp.method.arguments.queue",
9855 FT_STRING, BASE_NONE, NULL, 0,
9856 NULL, HFILL}},
9857 {&hf_amqp_method_queue_unbind_exchange, {
9858 "Exchange", "amqp.method.arguments.exchange",
9859 FT_STRING, BASE_NONE, NULL, 0,
9860 NULL, HFILL}},
9861 {&hf_amqp_method_queue_unbind_routing_key, {
9862 "Routing-Key", "amqp.method.arguments.routing_key",
9863 FT_STRING, BASE_NONE, NULL, 0,
9864 NULL, HFILL}},
9865 {&hf_amqp_method_queue_unbind_arguments, {
9866 "Arguments", "amqp.method.arguments.arguments",
9867 FT_NONE, BASE_NONE, NULL, 0,
9868 NULL, HFILL}},
9869 {&hf_amqp_method_queue_purge_ticket, {
9870 "Ticket", "amqp.method.arguments.ticket",
9871 FT_UINT16, BASE_DEC, NULL, 0,
9872 NULL, HFILL}},
9873 {&hf_amqp_method_queue_purge_queue, {
9874 "Queue", "amqp.method.arguments.queue",
9875 FT_STRING, BASE_NONE, NULL, 0,
9876 NULL, HFILL}},
9877 {&hf_amqp_method_queue_purge_nowait, {
9878 "Nowait", "amqp.method.arguments.nowait",
9879 FT_BOOLEAN, 8, NULL, 0x01,
9880 NULL, HFILL}},
9881 {&hf_amqp_method_queue_purge_ok_message_count, {
9882 "Message-Count", "amqp.method.arguments.message_count",
9883 FT_UINT32, BASE_DEC, NULL, 0,
9884 NULL, HFILL}},
9885 {&hf_amqp_method_queue_delete_ticket, {
9886 "Ticket", "amqp.method.arguments.ticket",
9887 FT_UINT16, BASE_DEC, NULL, 0,
9888 NULL, HFILL}},
9889 {&hf_amqp_method_queue_delete_queue, {
9890 "Queue", "amqp.method.arguments.queue",
9891 FT_STRING, BASE_NONE, NULL, 0,
9892 NULL, HFILL}},
9893 {&hf_amqp_method_queue_delete_if_unused, {
9894 "If-Unused", "amqp.method.arguments.if_unused",
9895 FT_BOOLEAN, 8, NULL, 0x01,
9896 NULL, HFILL}},
9897 {&hf_amqp_method_queue_delete_if_empty, {
9898 "If-Empty", "amqp.method.arguments.if_empty",
9899 FT_BOOLEAN, 8, NULL, 0x02,
9900 NULL, HFILL}},
9901 {&hf_amqp_method_queue_delete_nowait, {
9902 "Nowait", "amqp.method.arguments.nowait",
9903 FT_BOOLEAN, 8, NULL, 0x04,
9904 NULL, HFILL}},
9905 {&hf_amqp_method_queue_delete_ok_message_count, {
9906 "Message-Count", "amqp.method.arguments.message_count",
9907 FT_UINT32, BASE_DEC, NULL, 0,
9908 NULL, HFILL}},
9909 {&hf_amqp_method_basic_qos_prefetch_size, {
9910 "Prefetch-Size", "amqp.method.arguments.prefetch_size",
9911 FT_UINT32, BASE_DEC, NULL, 0,
9912 NULL, HFILL}},
9913 {&hf_amqp_method_basic_qos_prefetch_count, {
9914 "Prefetch-Count", "amqp.method.arguments.prefetch_count",
9915 FT_UINT16, BASE_DEC, NULL, 0,
9916 NULL, HFILL}},
9917 {&hf_amqp_method_basic_qos_global, {
9918 "Global", "amqp.method.arguments.global",
9919 FT_BOOLEAN, 8, NULL, 0x01,
9920 NULL, HFILL}},
9921 {&hf_amqp_method_basic_consume_ticket, {
9922 "Ticket", "amqp.method.arguments.ticket",
9923 FT_UINT16, BASE_DEC, NULL, 0,
9924 NULL, HFILL}},
9925 {&hf_amqp_method_basic_consume_queue, {
9926 "Queue", "amqp.method.arguments.queue",
9927 FT_STRING, BASE_NONE, NULL, 0,
9928 NULL, HFILL}},
9929 {&hf_amqp_method_basic_consume_consumer_tag, {
9930 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
9931 FT_STRING, BASE_NONE, NULL, 0,
9932 NULL, HFILL}},
9933 {&hf_amqp_method_basic_consume_no_local, {
9934 "No-Local", "amqp.method.arguments.no_local",
9935 FT_BOOLEAN, 8, NULL, 0x01,
9936 NULL, HFILL}},
9937 {&hf_amqp_method_basic_consume_no_ack, {
9938 "No-Ack", "amqp.method.arguments.no_ack",
9939 FT_BOOLEAN, 8, NULL, 0x02,
9940 NULL, HFILL}},
9941 {&hf_amqp_method_basic_consume_exclusive, {
9942 "Exclusive", "amqp.method.arguments.exclusive",
9943 FT_BOOLEAN, 8, NULL, 0x04,
9944 NULL, HFILL}},
9945 {&hf_amqp_method_basic_consume_nowait, {
9946 "Nowait", "amqp.method.arguments.nowait",
9947 FT_BOOLEAN, 8, NULL, 0x08,
9948 NULL, HFILL}},
9949 {&hf_amqp_method_basic_consume_filter, {
9950 "Filter", "amqp.method.arguments.filter",
9951 FT_NONE, BASE_NONE, NULL, 0,
9952 NULL, HFILL}},
9953 {&hf_amqp_method_basic_consume_ok_consumer_tag, {
9954 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
9955 FT_STRING, BASE_NONE, NULL, 0,
9956 NULL, HFILL}},
9957 {&hf_amqp_method_basic_cancel_consumer_tag, {
9958 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
9959 FT_STRING, BASE_NONE, NULL, 0,
9960 NULL, HFILL}},
9961 {&hf_amqp_method_basic_cancel_nowait, {
9962 "Nowait", "amqp.method.arguments.nowait",
9963 FT_BOOLEAN, 8, NULL, 0x01,
9964 NULL, HFILL}},
9965 {&hf_amqp_method_basic_cancel_ok_consumer_tag, {
9966 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
9967 FT_STRING, BASE_NONE, NULL, 0,
9968 NULL, HFILL}},
9969 {&hf_amqp_method_basic_publish_ticket, {
9970 "Ticket", "amqp.method.arguments.ticket",
9971 FT_UINT16, BASE_DEC, NULL, 0,
9972 NULL, HFILL}},
9973 {&hf_amqp_method_basic_publish_exchange, {
9974 "Exchange", "amqp.method.arguments.exchange",
9975 FT_STRING, BASE_NONE, NULL, 0,
9976 NULL, HFILL}},
9977 {&hf_amqp_method_basic_publish_routing_key, {
9978 "Routing-Key", "amqp.method.arguments.routing_key",
9979 FT_STRING, BASE_NONE, NULL, 0,
9980 NULL, HFILL}},
9981 {&hf_amqp_method_basic_publish_mandatory, {
9982 "Mandatory", "amqp.method.arguments.mandatory",
9983 FT_BOOLEAN, 8, NULL, 0x01,
9984 NULL, HFILL}},
9985 {&hf_amqp_method_basic_publish_immediate, {
9986 "Immediate", "amqp.method.arguments.immediate",
9987 FT_BOOLEAN, 8, NULL, 0x02,
9988 NULL, HFILL}},
9989 {&hf_amqp_method_basic_return_reply_code, {
9990 "Reply-Code", "amqp.method.arguments.reply_code",
9991 FT_UINT16, BASE_DEC, NULL, 0,
9992 NULL, HFILL}},
9993 {&hf_amqp_method_basic_return_reply_text, {
9994 "Reply-Text", "amqp.method.arguments.reply_text",
9995 FT_STRING, BASE_NONE, NULL, 0,
9996 NULL, HFILL}},
9997 {&hf_amqp_method_basic_return_exchange, {
9998 "Exchange", "amqp.method.arguments.exchange",
9999 FT_STRING, BASE_NONE, NULL, 0,
10000 NULL, HFILL}},
10001 {&hf_amqp_method_basic_return_routing_key, {
10002 "Routing-Key", "amqp.method.arguments.routing_key",
10003 FT_STRING, BASE_NONE, NULL, 0,
10004 NULL, HFILL}},
10005 {&hf_amqp_method_basic_deliver_consumer_tag, {
10006 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10007 FT_STRING, BASE_NONE, NULL, 0,
10008 NULL, HFILL}},
10009 {&hf_amqp_method_basic_deliver_delivery_tag, {
10010 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10011 FT_UINT64, BASE_DEC, NULL, 0,
10012 NULL, HFILL}},
10013 {&hf_amqp_method_basic_deliver_redelivered, {
10014 "Redelivered", "amqp.method.arguments.redelivered",
10015 FT_BOOLEAN, 8, NULL, 0x01,
10016 NULL, HFILL}},
10017 {&hf_amqp_method_basic_deliver_exchange, {
10018 "Exchange", "amqp.method.arguments.exchange",
10019 FT_STRING, BASE_NONE, NULL, 0,
10020 NULL, HFILL}},
10021 {&hf_amqp_method_basic_deliver_routing_key, {
10022 "Routing-Key", "amqp.method.arguments.routing_key",
10023 FT_STRING, BASE_NONE, NULL, 0,
10024 NULL, HFILL}},
10025 {&hf_amqp_method_basic_get_ticket, {
10026 "Ticket", "amqp.method.arguments.ticket",
10027 FT_UINT16, BASE_DEC, NULL, 0,
10028 NULL, HFILL}},
10029 {&hf_amqp_method_basic_get_queue, {
10030 "Queue", "amqp.method.arguments.queue",
10031 FT_STRING, BASE_NONE, NULL, 0,
10032 NULL, HFILL}},
10033 {&hf_amqp_method_basic_get_no_ack, {
10034 "No-Ack", "amqp.method.arguments.no_ack",
10035 FT_BOOLEAN, 8, NULL, 0x01,
10036 NULL, HFILL}},
10037 {&hf_amqp_method_basic_get_ok_delivery_tag, {
10038 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10039 FT_UINT64, BASE_DEC, NULL, 0,
10040 NULL, HFILL}},
10041 {&hf_amqp_method_basic_get_ok_redelivered, {
10042 "Redelivered", "amqp.method.arguments.redelivered",
10043 FT_BOOLEAN, 8, NULL, 0x01,
10044 NULL, HFILL}},
10045 {&hf_amqp_method_basic_get_ok_exchange, {
10046 "Exchange", "amqp.method.arguments.exchange",
10047 FT_STRING, BASE_NONE, NULL, 0,
10048 NULL, HFILL}},
10049 {&hf_amqp_method_basic_get_ok_routing_key, {
10050 "Routing-Key", "amqp.method.arguments.routing_key",
10051 FT_STRING, BASE_NONE, NULL, 0,
10052 NULL, HFILL}},
10053 {&hf_amqp_method_basic_get_ok_message_count, {
10054 "Message-Count", "amqp.method.arguments.message_count",
10055 FT_UINT32, BASE_DEC, NULL, 0,
10056 NULL, HFILL}},
10057 {&hf_amqp_method_basic_get_empty_cluster_id, {
10058 "Cluster-Id", "amqp.method.arguments.cluster_id",
10059 FT_STRING, BASE_NONE, NULL, 0,
10060 NULL, HFILL}},
10061 {&hf_amqp_method_basic_ack_delivery_tag, {
10062 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10063 FT_UINT64, BASE_DEC, NULL, 0,
10064 NULL, HFILL}},
10065 {&hf_amqp_method_basic_ack_multiple, {
10066 "Multiple", "amqp.method.arguments.multiple",
10067 FT_BOOLEAN, 8, NULL, 0x01,
10068 NULL, HFILL}},
10069 {&hf_amqp_method_basic_reject_delivery_tag, {
10070 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10071 FT_UINT64, BASE_DEC, NULL, 0,
10072 NULL, HFILL}},
10073 {&hf_amqp_method_basic_reject_requeue, {
10074 "Requeue", "amqp.method.arguments.requeue",
10075 FT_BOOLEAN, 8, NULL, 0x01,
10076 NULL, HFILL}},
10077 {&hf_amqp_method_basic_recover_requeue, {
10078 "Requeue", "amqp.method.arguments.requeue",
10079 FT_BOOLEAN, 8, NULL, 0x01,
10080 NULL, HFILL}},
10081 {&hf_amqp_method_file_qos_prefetch_size, {
10082 "Prefetch-Size", "amqp.method.arguments.prefetch_size",
10083 FT_UINT32, BASE_DEC, NULL, 0,
10084 NULL, HFILL}},
10085 {&hf_amqp_method_file_qos_prefetch_count, {
10086 "Prefetch-Count", "amqp.method.arguments.prefetch_count",
10087 FT_UINT16, BASE_DEC, NULL, 0,
10088 NULL, HFILL}},
10089 {&hf_amqp_method_file_qos_global, {
10090 "Global", "amqp.method.arguments.global",
10091 FT_BOOLEAN, 8, NULL, 0x01,
10092 NULL, HFILL}},
10093 {&hf_amqp_method_file_consume_ticket, {
10094 "Ticket", "amqp.method.arguments.ticket",
10095 FT_UINT16, BASE_DEC, NULL, 0,
10096 NULL, HFILL}},
10097 {&hf_amqp_method_file_consume_queue, {
10098 "Queue", "amqp.method.arguments.queue",
10099 FT_STRING, BASE_NONE, NULL, 0,
10100 NULL, HFILL}},
10101 {&hf_amqp_method_file_consume_consumer_tag, {
10102 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10103 FT_STRING, BASE_NONE, NULL, 0,
10104 NULL, HFILL}},
10105 {&hf_amqp_method_file_consume_no_local, {
10106 "No-Local", "amqp.method.arguments.no_local",
10107 FT_BOOLEAN, 8, NULL, 0x01,
10108 NULL, HFILL}},
10109 {&hf_amqp_method_file_consume_no_ack, {
10110 "No-Ack", "amqp.method.arguments.no_ack",
10111 FT_BOOLEAN, 8, NULL, 0x02,
10112 NULL, HFILL}},
10113 {&hf_amqp_method_file_consume_exclusive, {
10114 "Exclusive", "amqp.method.arguments.exclusive",
10115 FT_BOOLEAN, 8, NULL, 0x04,
10116 NULL, HFILL}},
10117 {&hf_amqp_method_file_consume_nowait, {
10118 "Nowait", "amqp.method.arguments.nowait",
10119 FT_BOOLEAN, 8, NULL, 0x08,
10120 NULL, HFILL}},
10121 {&hf_amqp_method_file_consume_filter, {
10122 "Filter", "amqp.method.arguments.filter",
10123 FT_NONE, BASE_NONE, NULL, 0,
10124 NULL, HFILL}},
10125 {&hf_amqp_method_file_consume_ok_consumer_tag, {
10126 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10127 FT_STRING, BASE_NONE, NULL, 0,
10128 NULL, HFILL}},
10129 {&hf_amqp_method_file_cancel_consumer_tag, {
10130 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10131 FT_STRING, BASE_NONE, NULL, 0,
10132 NULL, HFILL}},
10133 {&hf_amqp_method_file_cancel_nowait, {
10134 "Nowait", "amqp.method.arguments.nowait",
10135 FT_BOOLEAN, 8, NULL, 0x01,
10136 NULL, HFILL}},
10137 {&hf_amqp_method_file_cancel_ok_consumer_tag, {
10138 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10139 FT_STRING, BASE_NONE, NULL, 0,
10140 NULL, HFILL}},
10141 {&hf_amqp_method_file_open_identifier, {
10142 "Identifier", "amqp.method.arguments.identifier",
10143 FT_STRING, BASE_NONE, NULL, 0,
10144 NULL, HFILL}},
10145 {&hf_amqp_method_file_open_content_size, {
10146 "Content-Size", "amqp.method.arguments.content_size",
10147 FT_UINT64, BASE_DEC, NULL, 0,
10148 NULL, HFILL}},
10149 {&hf_amqp_method_file_open_ok_staged_size, {
10150 "Staged-Size", "amqp.method.arguments.staged_size",
10151 FT_UINT64, BASE_DEC, NULL, 0,
10152 NULL, HFILL}},
10153 {&hf_amqp_method_file_publish_ticket, {
10154 "Ticket", "amqp.method.arguments.ticket",
10155 FT_UINT16, BASE_DEC, NULL, 0,
10156 NULL, HFILL}},
10157 {&hf_amqp_method_file_publish_exchange, {
10158 "Exchange", "amqp.method.arguments.exchange",
10159 FT_STRING, BASE_NONE, NULL, 0,
10160 NULL, HFILL}},
10161 {&hf_amqp_method_file_publish_routing_key, {
10162 "Routing-Key", "amqp.method.arguments.routing_key",
10163 FT_STRING, BASE_NONE, NULL, 0,
10164 NULL, HFILL}},
10165 {&hf_amqp_method_file_publish_mandatory, {
10166 "Mandatory", "amqp.method.arguments.mandatory",
10167 FT_BOOLEAN, 8, NULL, 0x01,
10168 NULL, HFILL}},
10169 {&hf_amqp_method_file_publish_immediate, {
10170 "Immediate", "amqp.method.arguments.immediate",
10171 FT_BOOLEAN, 8, NULL, 0x02,
10172 NULL, HFILL}},
10173 {&hf_amqp_method_file_publish_identifier, {
10174 "Identifier", "amqp.method.arguments.identifier",
10175 FT_STRING, BASE_NONE, NULL, 0,
10176 NULL, HFILL}},
10177 {&hf_amqp_method_file_return_reply_code, {
10178 "Reply-Code", "amqp.method.arguments.reply_code",
10179 FT_UINT16, BASE_DEC, NULL, 0,
10180 NULL, HFILL}},
10181 {&hf_amqp_method_file_return_reply_text, {
10182 "Reply-Text", "amqp.method.arguments.reply_text",
10183 FT_STRING, BASE_NONE, NULL, 0,
10184 NULL, HFILL}},
10185 {&hf_amqp_method_file_return_exchange, {
10186 "Exchange", "amqp.method.arguments.exchange",
10187 FT_STRING, BASE_NONE, NULL, 0,
10188 NULL, HFILL}},
10189 {&hf_amqp_method_file_return_routing_key, {
10190 "Routing-Key", "amqp.method.arguments.routing_key",
10191 FT_STRING, BASE_NONE, NULL, 0,
10192 NULL, HFILL}},
10193 {&hf_amqp_method_file_deliver_consumer_tag, {
10194 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10195 FT_STRING, BASE_NONE, NULL, 0,
10196 NULL, HFILL}},
10197 {&hf_amqp_method_file_deliver_delivery_tag, {
10198 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10199 FT_UINT64, BASE_DEC, NULL, 0,
10200 NULL, HFILL}},
10201 {&hf_amqp_method_file_deliver_redelivered, {
10202 "Redelivered", "amqp.method.arguments.redelivered",
10203 FT_BOOLEAN, 8, NULL, 0x01,
10204 NULL, HFILL}},
10205 {&hf_amqp_method_file_deliver_exchange, {
10206 "Exchange", "amqp.method.arguments.exchange",
10207 FT_STRING, BASE_NONE, NULL, 0,
10208 NULL, HFILL}},
10209 {&hf_amqp_method_file_deliver_routing_key, {
10210 "Routing-Key", "amqp.method.arguments.routing_key",
10211 FT_STRING, BASE_NONE, NULL, 0,
10212 NULL, HFILL}},
10213 {&hf_amqp_method_file_deliver_identifier, {
10214 "Identifier", "amqp.method.arguments.identifier",
10215 FT_STRING, BASE_NONE, NULL, 0,
10216 NULL, HFILL}},
10217 {&hf_amqp_method_file_ack_delivery_tag, {
10218 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10219 FT_UINT64, BASE_DEC, NULL, 0,
10220 NULL, HFILL}},
10221 {&hf_amqp_method_file_ack_multiple, {
10222 "Multiple", "amqp.method.arguments.multiple",
10223 FT_BOOLEAN, 8, NULL, 0x01,
10224 NULL, HFILL}},
10225 {&hf_amqp_method_file_reject_delivery_tag, {
10226 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10227 FT_UINT64, BASE_DEC, NULL, 0,
10228 NULL, HFILL}},
10229 {&hf_amqp_method_file_reject_requeue, {
10230 "Requeue", "amqp.method.arguments.requeue",
10231 FT_BOOLEAN, 8, NULL, 0x01,
10232 NULL, HFILL}},
10233 {&hf_amqp_method_stream_qos_prefetch_size, {
10234 "Prefetch-Size", "amqp.method.arguments.prefetch_size",
10235 FT_UINT32, BASE_DEC, NULL, 0,
10236 NULL, HFILL}},
10237 {&hf_amqp_method_stream_qos_prefetch_count, {
10238 "Prefetch-Count", "amqp.method.arguments.prefetch_count",
10239 FT_UINT16, BASE_DEC, NULL, 0,
10240 NULL, HFILL}},
10241 {&hf_amqp_method_stream_qos_consume_rate, {
10242 "Consume-Rate", "amqp.method.arguments.consume_rate",
10243 FT_UINT32, BASE_DEC, NULL, 0,
10244 NULL, HFILL}},
10245 {&hf_amqp_method_stream_qos_global, {
10246 "Global", "amqp.method.arguments.global",
10247 FT_BOOLEAN, 8, NULL, 0x01,
10248 NULL, HFILL}},
10249 {&hf_amqp_method_stream_consume_ticket, {
10250 "Ticket", "amqp.method.arguments.ticket",
10251 FT_UINT16, BASE_DEC, NULL, 0,
10252 NULL, HFILL}},
10253 {&hf_amqp_method_stream_consume_queue, {
10254 "Queue", "amqp.method.arguments.queue",
10255 FT_STRING, BASE_NONE, NULL, 0,
10256 NULL, HFILL}},
10257 {&hf_amqp_method_stream_consume_consumer_tag, {
10258 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10259 FT_STRING, BASE_NONE, NULL, 0,
10260 NULL, HFILL}},
10261 {&hf_amqp_method_stream_consume_no_local, {
10262 "No-Local", "amqp.method.arguments.no_local",
10263 FT_BOOLEAN, 8, NULL, 0x01,
10264 NULL, HFILL}},
10265 {&hf_amqp_method_stream_consume_exclusive, {
10266 "Exclusive", "amqp.method.arguments.exclusive",
10267 FT_BOOLEAN, 8, NULL, 0x02,
10268 NULL, HFILL}},
10269 {&hf_amqp_method_stream_consume_nowait, {
10270 "Nowait", "amqp.method.arguments.nowait",
10271 FT_BOOLEAN, 8, NULL, 0x04,
10272 NULL, HFILL}},
10273 {&hf_amqp_method_stream_consume_filter, {
10274 "Filter", "amqp.method.arguments.filter",
10275 FT_NONE, BASE_NONE, NULL, 0,
10276 NULL, HFILL}},
10277 {&hf_amqp_method_stream_consume_ok_consumer_tag, {
10278 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10279 FT_STRING, BASE_NONE, NULL, 0,
10280 NULL, HFILL}},
10281 {&hf_amqp_method_stream_cancel_consumer_tag, {
10282 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10283 FT_STRING, BASE_NONE, NULL, 0,
10284 NULL, HFILL}},
10285 {&hf_amqp_method_stream_cancel_nowait, {
10286 "Nowait", "amqp.method.arguments.nowait",
10287 FT_BOOLEAN, 8, NULL, 0x01,
10288 NULL, HFILL}},
10289 {&hf_amqp_method_stream_cancel_ok_consumer_tag, {
10290 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10291 FT_STRING, BASE_NONE, NULL, 0,
10292 NULL, HFILL}},
10293 {&hf_amqp_method_stream_publish_ticket, {
10294 "Ticket", "amqp.method.arguments.ticket",
10295 FT_UINT16, BASE_DEC, NULL, 0,
10296 NULL, HFILL}},
10297 {&hf_amqp_method_stream_publish_exchange, {
10298 "Exchange", "amqp.method.arguments.exchange",
10299 FT_STRING, BASE_NONE, NULL, 0,
10300 NULL, HFILL}},
10301 {&hf_amqp_method_stream_publish_routing_key, {
10302 "Routing-Key", "amqp.method.arguments.routing_key",
10303 FT_STRING, BASE_NONE, NULL, 0,
10304 NULL, HFILL}},
10305 {&hf_amqp_method_stream_publish_mandatory, {
10306 "Mandatory", "amqp.method.arguments.mandatory",
10307 FT_BOOLEAN, 8, NULL, 0x01,
10308 NULL, HFILL}},
10309 {&hf_amqp_method_stream_publish_immediate, {
10310 "Immediate", "amqp.method.arguments.immediate",
10311 FT_BOOLEAN, 8, NULL, 0x02,
10312 NULL, HFILL}},
10313 {&hf_amqp_method_stream_return_reply_code, {
10314 "Reply-Code", "amqp.method.arguments.reply_code",
10315 FT_UINT16, BASE_DEC, NULL, 0,
10316 NULL, HFILL}},
10317 {&hf_amqp_method_stream_return_reply_text, {
10318 "Reply-Text", "amqp.method.arguments.reply_text",
10319 FT_STRING, BASE_NONE, NULL, 0,
10320 NULL, HFILL}},
10321 {&hf_amqp_method_stream_return_exchange, {
10322 "Exchange", "amqp.method.arguments.exchange",
10323 FT_STRING, BASE_NONE, NULL, 0,
10324 NULL, HFILL}},
10325 {&hf_amqp_method_stream_return_routing_key, {
10326 "Routing-Key", "amqp.method.arguments.routing_key",
10327 FT_STRING, BASE_NONE, NULL, 0,
10328 NULL, HFILL}},
10329 {&hf_amqp_method_stream_deliver_consumer_tag, {
10330 "Consumer-Tag", "amqp.method.arguments.consumer_tag",
10331 FT_STRING, BASE_NONE, NULL, 0,
10332 NULL, HFILL}},
10333 {&hf_amqp_method_stream_deliver_delivery_tag, {
10334 "Delivery-Tag", "amqp.method.arguments.delivery_tag",
10335 FT_UINT64, BASE_DEC, NULL, 0,
10336 NULL, HFILL}},
10337 {&hf_amqp_method_stream_deliver_exchange, {
10338 "Exchange", "amqp.method.arguments.exchange",
10339 FT_STRING, BASE_NONE, NULL, 0,
10340 NULL, HFILL}},
10341 {&hf_amqp_method_stream_deliver_queue, {
10342 "Queue", "amqp.method.arguments.queue",
10343 FT_STRING, BASE_NONE, NULL, 0,
10344 NULL, HFILL}},
10345 {&hf_amqp_method_dtx_start_dtx_identifier, {
10346 "Dtx-Identifier", "amqp.method.arguments.dtx_identifier",
10347 FT_STRING, BASE_NONE, NULL, 0,
10348 NULL, HFILL}},
10349 {&hf_amqp_method_tunnel_request_meta_data, {
10350 "Meta-Data", "amqp.method.arguments.meta_data",
10351 FT_NONE, BASE_NONE, NULL, 0,
10352 NULL, HFILL}},
10353 {&hf_amqp_field, {
10354 "AMQP", "amqp.field",
10355 FT_NONE, BASE_NONE, NULL, 0,
10356 NULL, HFILL}},
10357 {&hf_amqp_header_class_id, {
10358 "Class ID", "amqp.header.class",
10359 FT_UINT16, BASE_DEC, VALS(amqp_0_9_method_classes), 0,
10360 NULL, HFILL}},
10361 {&hf_amqp_header_weight, {
10362 "Weight", "amqp.header.weight",
10363 FT_UINT16, BASE_DEC, NULL, 0,
10364 NULL, HFILL}},
10365 {&hf_amqp_header_body_size, {
10366 "Body size", "amqp.header.body-size",
10367 FT_UINT64, BASE_DEC, NULL, 0,
10368 NULL, HFILL}},
10369 {&hf_amqp_header_property_flags, {
10370 "Property flags", "amqp.header.property-flags",
10371 FT_UINT16, BASE_HEX, NULL, 0,
10372 NULL, HFILL}},
10373 {&hf_amqp_header_properties, {
10374 "Properties", "amqp.header.properties",
10375 FT_NONE, BASE_NONE, NULL, 0x0,
10376 "Message properties", HFILL}},
10377 {&hf_amqp_header_basic_content_type, {
10378 "Content-Type", "amqp.method.properties.content_type",
10379 FT_STRING, BASE_NONE, NULL, 0,
10380 NULL, HFILL}},
10381 {&hf_amqp_header_basic_content_encoding, {
10382 "Content-Encoding", "amqp.method.properties.content_encoding",
10383 FT_STRING, BASE_NONE, NULL, 0,
10384 NULL, HFILL}},
10385 {&hf_amqp_header_basic_headers, {
10386 "Headers", "amqp.method.properties.headers",
10387 FT_NONE, BASE_NONE, NULL, 0,
10388 NULL, HFILL}},
10389 {&hf_amqp_header_basic_delivery_mode, {
10390 "Delivery-Mode", "amqp.method.properties.delivery_mode",
10391 FT_UINT8, BASE_DEC, NULL, 0,
10392 NULL, HFILL}},
10393 {&hf_amqp_header_basic_priority, {
10394 "Priority", "amqp.method.properties.priority",
10395 FT_UINT8, BASE_DEC, NULL, 0,
10396 NULL, HFILL}},
10397 {&hf_amqp_header_basic_correlation_id, {
10398 "Correlation-Id", "amqp.method.properties.correlation_id",
10399 FT_STRING, BASE_NONE, NULL, 0,
10400 NULL, HFILL}},
10401 {&hf_amqp_header_basic_reply_to, {
10402 "Reply-To", "amqp.method.properties.reply_to",
10403 FT_STRING, BASE_NONE, NULL, 0,
10404 NULL, HFILL}},
10405 {&hf_amqp_header_basic_expiration, {
10406 "Expiration", "amqp.method.properties.expiration",
10407 FT_STRING, BASE_NONE, NULL, 0,
10408 NULL, HFILL}},
10409 {&hf_amqp_header_basic_message_id, {
10410 "Message-Id", "amqp.method.properties.message_id",
10411 FT_STRING, BASE_NONE, NULL, 0,
10412 NULL, HFILL}},
10413 {&hf_amqp_header_basic_timestamp, {
10414 "Timestamp", "amqp.method.properties.timestamp",
10415 FT_UINT64, BASE_DEC, NULL, 0,
10416 NULL, HFILL}},
10417 {&hf_amqp_header_basic_type, {
10418 "Type", "amqp.method.properties.type",
10419 FT_STRING, BASE_NONE, NULL, 0,
10420 NULL, HFILL}},
10421 {&hf_amqp_header_basic_user_id, {
10422 "User-Id", "amqp.method.properties.user_id",
10423 FT_STRING, BASE_NONE, NULL, 0,
10424 NULL, HFILL}},
10425 {&hf_amqp_header_basic_app_id, {
10426 "App-Id", "amqp.method.properties.app_id",
10427 FT_STRING, BASE_NONE, NULL, 0,
10428 NULL, HFILL}},
10429 {&hf_amqp_header_basic_cluster_id, {
10430 "Cluster-Id", "amqp.method.properties.cluster_id",
10431 FT_STRING, BASE_NONE, NULL, 0,
10432 NULL, HFILL}},
10433 {&hf_amqp_header_file_content_type, {
10434 "Content-Type", "amqp.method.properties.content_type",
10435 FT_STRING, BASE_NONE, NULL, 0,
10436 NULL, HFILL}},
10437 {&hf_amqp_header_file_content_encoding, {
10438 "Content-Encoding", "amqp.method.properties.content_encoding",
10439 FT_STRING, BASE_NONE, NULL, 0,
10440 NULL, HFILL}},
10441 {&hf_amqp_header_file_headers, {
10442 "Headers", "amqp.method.properties.headers",
10443 FT_NONE, BASE_NONE, NULL, 0,
10444 NULL, HFILL}},
10445 {&hf_amqp_header_file_priority, {
10446 "Priority", "amqp.method.properties.priority",
10447 FT_UINT8, BASE_DEC, NULL, 0,
10448 NULL, HFILL}},
10449 {&hf_amqp_header_file_reply_to, {
10450 "Reply-To", "amqp.method.properties.reply_to",
10451 FT_STRING, BASE_NONE, NULL, 0,
10452 NULL, HFILL}},
10453 {&hf_amqp_header_file_message_id, {
10454 "Message-Id", "amqp.method.properties.message_id",
10455 FT_STRING, BASE_NONE, NULL, 0,
10456 NULL, HFILL}},
10457 {&hf_amqp_header_file_filename, {
10458 "Filename", "amqp.method.properties.filename",
10459 FT_STRING, BASE_NONE, NULL, 0,
10460 NULL, HFILL}},
10461 {&hf_amqp_header_file_timestamp, {
10462 "Timestamp", "amqp.method.properties.timestamp",
10463 FT_UINT64, BASE_DEC, NULL, 0,
10464 NULL, HFILL}},
10465 {&hf_amqp_header_file_cluster_id, {
10466 "Cluster-Id", "amqp.method.properties.cluster_id",
10467 FT_STRING, BASE_NONE, NULL, 0,
10468 NULL, HFILL}},
10469 {&hf_amqp_header_stream_content_type, {
10470 "Content-Type", "amqp.method.properties.content_type",
10471 FT_STRING, BASE_NONE, NULL, 0,
10472 NULL, HFILL}},
10473 {&hf_amqp_header_stream_content_encoding, {
10474 "Content-Encoding", "amqp.method.properties.content_encoding",
10475 FT_STRING, BASE_NONE, NULL, 0,
10476 NULL, HFILL}},
10477 {&hf_amqp_header_stream_headers, {
10478 "Headers", "amqp.method.properties.headers",
10479 FT_NONE, BASE_NONE, NULL, 0,
10480 NULL, HFILL}},
10481 {&hf_amqp_header_stream_priority, {
10482 "Priority", "amqp.method.properties.priority",
10483 FT_UINT8, BASE_DEC, NULL, 0,
10484 NULL, HFILL}},
10485 {&hf_amqp_header_stream_timestamp, {
10486 "Timestamp", "amqp.method.properties.timestamp",
10487 FT_UINT64, BASE_DEC, NULL, 0,
10488 NULL, HFILL}},
10489 {&hf_amqp_header_tunnel_headers, {
10490 "Headers", "amqp.method.properties.headers",
10491 FT_NONE, BASE_NONE, NULL, 0,
10492 NULL, HFILL}},
10493 {&hf_amqp_header_tunnel_proxy_name, {
10494 "Proxy-Name", "amqp.method.properties.proxy_name",
10495 FT_STRING, BASE_NONE, NULL, 0,
10496 NULL, HFILL}},
10497 {&hf_amqp_header_tunnel_data_name, {
10498 "Data-Name", "amqp.method.properties.data_name",
10499 FT_STRING, BASE_NONE, NULL, 0,
10500 NULL, HFILL}},
10501 {&hf_amqp_header_tunnel_durable, {
10502 "Durable", "amqp.method.properties.durable",
10503 FT_UINT8, BASE_DEC, NULL, 0,
10504 NULL, HFILL}},
10505 {&hf_amqp_header_tunnel_broadcast, {
10506 "Broadcast", "amqp.method.properties.broadcast",
10507 FT_UINT8, BASE_DEC, NULL, 0,
10508 NULL, HFILL}},
10509 {&hf_amqp_payload, {
10510 "Payload", "amqp.payload",
10511 FT_BYTES, BASE_NONE, NULL, 0,
10512 "Message payload", HFILL}},
10513 {&hf_amqp_init_protocol, {
10514 "Protocol", "amqp.init.protocol",
10515 FT_STRING, BASE_NONE, NULL, 0,
10516 "Protocol name", HFILL}},
10517 {&hf_amqp_init_id_major, {
10518 "Protocol ID Major", "amqp.init.id_major",
10519 FT_UINT8, BASE_DEC, NULL, 0,
10520 NULL, HFILL}},
10521 {&hf_amqp_init_id_minor, {
10522 "Protocol ID Minor", "amqp.init.id_minor",
10523 FT_UINT8, BASE_DEC, NULL, 0,
10524 NULL, HFILL}},
10525 {&hf_amqp_init_version_major, {
10526 "Version Major", "amqp.init.version_major",
10527 FT_UINT8, BASE_DEC, NULL, 0,
10528 "Protocol version major", HFILL}},
10529 {&hf_amqp_init_version_minor, {
10530 "Version Minor", "amqp.init.version_minor",
10531 FT_UINT8, BASE_DEC, NULL, 0,
10532 "Protocol version minor", HFILL}}
10535 /* Setup of protocol subtree array */
10537 static gint *ett [] = {
10538 &ett_amqp,
10539 &ett_header,
10540 &ett_args,
10541 &ett_props,
10542 &ett_field_table,
10543 &ett_amqp_init,
10544 &ett_amqp_0_10_map,
10545 &ett_amqp_0_10_array
10548 static ei_register_info ei[] = {
10549 { &ei_amqp_bad_flag_value, { "amqp.bad_flag_value", PI_PROTOCOL, PI_WARN, "Bad flag value", EXPFILL }},
10550 { &ei_amqp_bad_length, { "amqp.bad_length", PI_MALFORMED, PI_ERROR, "Bad frame length", EXPFILL }},
10551 { &ei_amqp_field_short, { "amqp.field_short", PI_PROTOCOL, PI_ERROR, "Field is cut off by the end of the field table", EXPFILL }},
10552 { &ei_amqp_invalid_class_code, { "amqp.unknown.class_code", PI_PROTOCOL, PI_WARN, "Invalid class code", EXPFILL }},
10553 { &ei_amqp_unknown_command_class, { "amqp.unknown.command_class", PI_PROTOCOL, PI_ERROR, "Unknown command/control class", EXPFILL }},
10554 { &ei_amqp_unknown_frame_type, { "amqp.unknown.frame_type", PI_PROTOCOL, PI_ERROR, "Unknown frame type", EXPFILL }},
10555 { &ei_amqp_unknown_connection_method, { "amqp.unknown.method.connection", PI_PROTOCOL, PI_ERROR, "Unknown connection method", EXPFILL }},
10556 { &ei_amqp_unknown_channel_method, { "amqp.unknown.method.channel", PI_PROTOCOL, PI_ERROR, "Unknown channel method", EXPFILL }},
10557 { &ei_amqp_unknown_access_method, { "amqp.unknown.method.access", PI_PROTOCOL, PI_ERROR, "Unknown access method", EXPFILL }},
10558 { &ei_amqp_unknown_exchange_method, { "amqp.unknown.method.exchange", PI_PROTOCOL, PI_ERROR, "Unknown exchange method", EXPFILL }},
10559 { &ei_amqp_unknown_queue_method, { "amqp.unknown.method.queue", PI_PROTOCOL, PI_ERROR, "Unknown queue method", EXPFILL }},
10560 { &ei_amqp_unknown_basic_method, { "amqp.unknown.method.basic", PI_PROTOCOL, PI_ERROR, "Unknown basic method", EXPFILL }},
10561 { &ei_amqp_unknown_file_method, { "amqp.unknown.method.file", PI_PROTOCOL, PI_ERROR, "Unknown file method", EXPFILL }},
10562 { &ei_amqp_unknown_stream_method, { "amqp.unknown.method.stream", PI_PROTOCOL, PI_ERROR, "Unknown stream method", EXPFILL }},
10563 { &ei_amqp_unknown_tx_method, { "amqp.unknown.method.tx", PI_PROTOCOL, PI_ERROR, "Unknown tx method", EXPFILL }},
10564 { &ei_amqp_unknown_dtx_method, { "amqp.unknown.method.dtx", PI_PROTOCOL, PI_ERROR, "Unknown dtx method", EXPFILL }},
10565 { &ei_amqp_unknown_tunnel_method, { "amqp.unknown.method.tunnel", PI_PROTOCOL, PI_ERROR, "Unknown tunnel method", EXPFILL }},
10566 { &ei_amqp_unknown_method_class, { "amqp.unknown.method.class", PI_PROTOCOL, PI_ERROR, "Unknown method class", EXPFILL }},
10567 { &ei_amqp_unknown_header_class, { "amqp.unknown.header_class", PI_PROTOCOL, PI_ERROR, "Unknown header class", EXPFILL }},
10570 expert_module_t* expert_amqp;
10572 proto_amqp = proto_register_protocol(
10573 "Advanced Message Queueing Protocol", "AMQP", "amqp");
10574 proto_register_field_array(proto_amqp, hf, array_length(hf));
10575 proto_register_subtree_array(ett, array_length(ett));
10576 expert_amqp = expert_register_protocol(proto_amqp);
10577 expert_register_field_array(expert_amqp, ei, array_length(ei));
10580 void
10581 proto_reg_handoff_amqp(void)
10583 dissector_add_uint("tcp.port", amqp_port,
10584 create_dissector_handle(dissect_amqp, proto_amqp));