Wireshark-dev: [Wireshark-dev] AMQP dissector - the code to review
From: Martin Sustrik <sustrik@xxxxxxxxxx>
Date: Thu, 22 Mar 2007 11:37:24 +0100
Ronnie,

Here's the code and a sample capture. Is there anyting else I should do? What's the process for getting things into the codebase?

Thanks.
Martin

ronnie sahlberg wrote:
For inclusion into mainline wireshark,
please send the patch to the list for revies (unless it is very large
in case a url is better)

also please provide a few example captures that we can use to test the
dissector with.

/*--------------------------------------------------------------------
   AMQP Wireshark dissector plug-in

   Author: Martin Sustrik <martin@xxxxxxxxxx>

   Copyright (c) 1996-2007 iMatix Corporation

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or (at
   your option) any later version.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.
----------------------------------------------------------------------*/

#ifdef HAVE_CONFIG_H
#    include "config.h"
#endif

#include <gmodule.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/emem.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/prefs.h>

/*  Generic data  */

static int amqp_port = 5672;
static dissector_handle_t amqp_handle;

/*  Generic defines  */

#define AMQP_FRAME_TYPE_METHOD                 1
#define AMQP_FRAME_TYPE_CONTENT_HEADER         2
#define AMQP_FRAME_TYPE_CONTENT_BODY           3
#define AMQP_FRAME_TYPE_OOB_METHOD             4
#define AMQP_FRAME_TYPE_OOB_CONTENT_HEADER     5
#define AMQP_FRAME_TYPE_OOB_CONTENT_BODY       6
#define AMQP_FRAME_TYPE_TRACE                  7
#define AMQP_FRAME_TYPE_HEARTBEAT              8

/*  Registration functions for the dissctor  */

void proto_register_amqp ();
void proto_reg_handoff_amqp ();

/*  Private functions  */

static void dissect_amqp (tvbuff_t *tvb, packet_info *pinfo,
    proto_tree *tree);
static guint get_amqp_message_len (packet_info *pinfo, tvbuff_t *tvb,
    int offset);
static void dissect_amqp_message (tvbuff_t *tvb, packet_info *pinfo,
    proto_tree *tree);
static void dissect_amqp_field_table (tvbuff_t *tvb, size_t offset,
    size_t length, proto_item *item);

/*  Various handles  */

static int proto_amqp = -1;

static int hf_amqp_info = -1;
static int hf_amqp_type = -1;
static int hf_amqp_channel = -1;
static int hf_amqp_length = -1;
static int hf_amqp_method_class_id = -1;
static int hf_amqp_method_connection_method_id = -1;
static int hf_amqp_method_channel_method_id = -1;
static int hf_amqp_method_access_method_id = -1;
static int hf_amqp_method_exchange_method_id = -1;
static int hf_amqp_method_queue_method_id = -1;
static int hf_amqp_method_basic_method_id = -1;
static int hf_amqp_method_file_method_id = -1;
static int hf_amqp_method_stream_method_id = -1;
static int hf_amqp_method_tx_method_id = -1;
static int hf_amqp_method_dtx_method_id = -1;
static int hf_amqp_method_tunnel_method_id = -1;
static int hf_amqp_method_test_method_id = -1;
static int hf_amqp_method_arguments = -1;
static int hf_amqp_method_connection_start_version_major = -1;
static int hf_amqp_method_connection_start_version_minor = -1;
static int hf_amqp_method_connection_start_server_properties = -1;
static int hf_amqp_method_connection_start_mechanisms = -1;
static int hf_amqp_method_connection_start_locales = -1;
static int hf_amqp_method_connection_start_ok_client_properties = -1;
static int hf_amqp_method_connection_start_ok_mechanism = -1;
static int hf_amqp_method_connection_start_ok_response = -1;
static int hf_amqp_method_connection_start_ok_locale = -1;
static int hf_amqp_method_connection_secure_challenge = -1;
static int hf_amqp_method_connection_secure_ok_response = -1;
static int hf_amqp_method_connection_tune_channel_max = -1;
static int hf_amqp_method_connection_tune_frame_max = -1;
static int hf_amqp_method_connection_tune_heartbeat = -1;
static int hf_amqp_method_connection_tune_ok_channel_max = -1;
static int hf_amqp_method_connection_tune_ok_frame_max = -1;
static int hf_amqp_method_connection_tune_ok_heartbeat = -1;
static int hf_amqp_method_connection_open_virtual_host = -1;
static int hf_amqp_method_connection_open_capabilities = -1;
static int hf_amqp_method_connection_open_insist = -1;
static int hf_amqp_method_connection_open_ok_known_hosts = -1;
static int hf_amqp_method_connection_redirect_host = -1;
static int hf_amqp_method_connection_redirect_known_hosts = -1;
static int hf_amqp_method_connection_close_reply_code = -1;
static int hf_amqp_method_connection_close_reply_text = -1;
static int hf_amqp_method_connection_close_class_id = -1;
static int hf_amqp_method_connection_close_method_id = -1;
static int hf_amqp_method_channel_open_out_of_band = -1;
static int hf_amqp_method_channel_flow_active = -1;
static int hf_amqp_method_channel_flow_ok_active = -1;
static int hf_amqp_method_channel_alert_reply_code = -1;
static int hf_amqp_method_channel_alert_reply_text = -1;
static int hf_amqp_method_channel_alert_details = -1;
static int hf_amqp_method_channel_close_reply_code = -1;
static int hf_amqp_method_channel_close_reply_text = -1;
static int hf_amqp_method_channel_close_class_id = -1;
static int hf_amqp_method_channel_close_method_id = -1;
static int hf_amqp_method_access_request_realm = -1;
static int hf_amqp_method_access_request_exclusive = -1;
static int hf_amqp_method_access_request_passive = -1;
static int hf_amqp_method_access_request_active = -1;
static int hf_amqp_method_access_request_write = -1;
static int hf_amqp_method_access_request_read = -1;
static int hf_amqp_method_access_request_ok_ticket = -1;
static int hf_amqp_method_exchange_declare_ticket = -1;
static int hf_amqp_method_exchange_declare_exchange = -1;
static int hf_amqp_method_exchange_declare_type = -1;
static int hf_amqp_method_exchange_declare_passive = -1;
static int hf_amqp_method_exchange_declare_durable = -1;
static int hf_amqp_method_exchange_declare_auto_delete = -1;
static int hf_amqp_method_exchange_declare_internal = -1;
static int hf_amqp_method_exchange_declare_nowait = -1;
static int hf_amqp_method_exchange_declare_arguments = -1;
static int hf_amqp_method_exchange_delete_ticket = -1;
static int hf_amqp_method_exchange_delete_exchange = -1;
static int hf_amqp_method_exchange_delete_if_unused = -1;
static int hf_amqp_method_exchange_delete_nowait = -1;
static int hf_amqp_method_queue_declare_ticket = -1;
static int hf_amqp_method_queue_declare_queue = -1;
static int hf_amqp_method_queue_declare_passive = -1;
static int hf_amqp_method_queue_declare_durable = -1;
static int hf_amqp_method_queue_declare_exclusive = -1;
static int hf_amqp_method_queue_declare_auto_delete = -1;
static int hf_amqp_method_queue_declare_nowait = -1;
static int hf_amqp_method_queue_declare_arguments = -1;
static int hf_amqp_method_queue_declare_ok_queue = -1;
static int hf_amqp_method_queue_declare_ok_message_count = -1;
static int hf_amqp_method_queue_declare_ok_consumer_count = -1;
static int hf_amqp_method_queue_bind_ticket = -1;
static int hf_amqp_method_queue_bind_queue = -1;
static int hf_amqp_method_queue_bind_exchange = -1;
static int hf_amqp_method_queue_bind_routing_key = -1;
static int hf_amqp_method_queue_bind_nowait = -1;
static int hf_amqp_method_queue_bind_arguments = -1;
static int hf_amqp_method_queue_purge_ticket = -1;
static int hf_amqp_method_queue_purge_queue = -1;
static int hf_amqp_method_queue_purge_nowait = -1;
static int hf_amqp_method_queue_purge_ok_message_count = -1;
static int hf_amqp_method_queue_delete_ticket = -1;
static int hf_amqp_method_queue_delete_queue = -1;
static int hf_amqp_method_queue_delete_if_unused = -1;
static int hf_amqp_method_queue_delete_if_empty = -1;
static int hf_amqp_method_queue_delete_nowait = -1;
static int hf_amqp_method_queue_delete_ok_message_count = -1;
static int hf_amqp_method_basic_qos_prefetch_size = -1;
static int hf_amqp_method_basic_qos_prefetch_count = -1;
static int hf_amqp_method_basic_qos_global = -1;
static int hf_amqp_method_basic_consume_ticket = -1;
static int hf_amqp_method_basic_consume_queue = -1;
static int hf_amqp_method_basic_consume_consumer_tag = -1;
static int hf_amqp_method_basic_consume_no_local = -1;
static int hf_amqp_method_basic_consume_no_ack = -1;
static int hf_amqp_method_basic_consume_exclusive = -1;
static int hf_amqp_method_basic_consume_nowait = -1;
static int hf_amqp_method_basic_consume_ok_consumer_tag = -1;
static int hf_amqp_method_basic_cancel_consumer_tag = -1;
static int hf_amqp_method_basic_cancel_nowait = -1;
static int hf_amqp_method_basic_cancel_ok_consumer_tag = -1;
static int hf_amqp_method_basic_publish_ticket = -1;
static int hf_amqp_method_basic_publish_exchange = -1;
static int hf_amqp_method_basic_publish_routing_key = -1;
static int hf_amqp_method_basic_publish_mandatory = -1;
static int hf_amqp_method_basic_publish_immediate = -1;
static int hf_amqp_method_basic_return_reply_code = -1;
static int hf_amqp_method_basic_return_reply_text = -1;
static int hf_amqp_method_basic_return_exchange = -1;
static int hf_amqp_method_basic_return_routing_key = -1;
static int hf_amqp_method_basic_deliver_consumer_tag = -1;
static int hf_amqp_method_basic_deliver_delivery_tag = -1;
static int hf_amqp_method_basic_deliver_redelivered = -1;
static int hf_amqp_method_basic_deliver_exchange = -1;
static int hf_amqp_method_basic_deliver_routing_key = -1;
static int hf_amqp_method_basic_get_ticket = -1;
static int hf_amqp_method_basic_get_queue = -1;
static int hf_amqp_method_basic_get_no_ack = -1;
static int hf_amqp_method_basic_get_ok_delivery_tag = -1;
static int hf_amqp_method_basic_get_ok_redelivered = -1;
static int hf_amqp_method_basic_get_ok_exchange = -1;
static int hf_amqp_method_basic_get_ok_routing_key = -1;
static int hf_amqp_method_basic_get_ok_message_count = -1;
static int hf_amqp_method_basic_get_empty_cluster_id = -1;
static int hf_amqp_method_basic_ack_delivery_tag = -1;
static int hf_amqp_method_basic_ack_multiple = -1;
static int hf_amqp_method_basic_reject_delivery_tag = -1;
static int hf_amqp_method_basic_reject_requeue = -1;
static int hf_amqp_method_basic_recover_requeue = -1;
static int hf_amqp_method_file_qos_prefetch_size = -1;
static int hf_amqp_method_file_qos_prefetch_count = -1;
static int hf_amqp_method_file_qos_global = -1;
static int hf_amqp_method_file_consume_ticket = -1;
static int hf_amqp_method_file_consume_queue = -1;
static int hf_amqp_method_file_consume_consumer_tag = -1;
static int hf_amqp_method_file_consume_no_local = -1;
static int hf_amqp_method_file_consume_no_ack = -1;
static int hf_amqp_method_file_consume_exclusive = -1;
static int hf_amqp_method_file_consume_nowait = -1;
static int hf_amqp_method_file_consume_ok_consumer_tag = -1;
static int hf_amqp_method_file_cancel_consumer_tag = -1;
static int hf_amqp_method_file_cancel_nowait = -1;
static int hf_amqp_method_file_cancel_ok_consumer_tag = -1;
static int hf_amqp_method_file_open_identifier = -1;
static int hf_amqp_method_file_open_content_size = -1;
static int hf_amqp_method_file_open_ok_staged_size = -1;
static int hf_amqp_method_file_publish_ticket = -1;
static int hf_amqp_method_file_publish_exchange = -1;
static int hf_amqp_method_file_publish_routing_key = -1;
static int hf_amqp_method_file_publish_mandatory = -1;
static int hf_amqp_method_file_publish_immediate = -1;
static int hf_amqp_method_file_publish_identifier = -1;
static int hf_amqp_method_file_return_reply_code = -1;
static int hf_amqp_method_file_return_reply_text = -1;
static int hf_amqp_method_file_return_exchange = -1;
static int hf_amqp_method_file_return_routing_key = -1;
static int hf_amqp_method_file_deliver_consumer_tag = -1;
static int hf_amqp_method_file_deliver_delivery_tag = -1;
static int hf_amqp_method_file_deliver_redelivered = -1;
static int hf_amqp_method_file_deliver_exchange = -1;
static int hf_amqp_method_file_deliver_routing_key = -1;
static int hf_amqp_method_file_deliver_identifier = -1;
static int hf_amqp_method_file_ack_delivery_tag = -1;
static int hf_amqp_method_file_ack_multiple = -1;
static int hf_amqp_method_file_reject_delivery_tag = -1;
static int hf_amqp_method_file_reject_requeue = -1;
static int hf_amqp_method_stream_qos_prefetch_size = -1;
static int hf_amqp_method_stream_qos_prefetch_count = -1;
static int hf_amqp_method_stream_qos_consume_rate = -1;
static int hf_amqp_method_stream_qos_global = -1;
static int hf_amqp_method_stream_consume_ticket = -1;
static int hf_amqp_method_stream_consume_queue = -1;
static int hf_amqp_method_stream_consume_consumer_tag = -1;
static int hf_amqp_method_stream_consume_no_local = -1;
static int hf_amqp_method_stream_consume_exclusive = -1;
static int hf_amqp_method_stream_consume_nowait = -1;
static int hf_amqp_method_stream_consume_ok_consumer_tag = -1;
static int hf_amqp_method_stream_cancel_consumer_tag = -1;
static int hf_amqp_method_stream_cancel_nowait = -1;
static int hf_amqp_method_stream_cancel_ok_consumer_tag = -1;
static int hf_amqp_method_stream_publish_ticket = -1;
static int hf_amqp_method_stream_publish_exchange = -1;
static int hf_amqp_method_stream_publish_routing_key = -1;
static int hf_amqp_method_stream_publish_mandatory = -1;
static int hf_amqp_method_stream_publish_immediate = -1;
static int hf_amqp_method_stream_return_reply_code = -1;
static int hf_amqp_method_stream_return_reply_text = -1;
static int hf_amqp_method_stream_return_exchange = -1;
static int hf_amqp_method_stream_return_routing_key = -1;
static int hf_amqp_method_stream_deliver_consumer_tag = -1;
static int hf_amqp_method_stream_deliver_delivery_tag = -1;
static int hf_amqp_method_stream_deliver_exchange = -1;
static int hf_amqp_method_stream_deliver_queue = -1;
static int hf_amqp_method_dtx_start_dtx_identifier = -1;
static int hf_amqp_method_tunnel_request_meta_data = -1;
static int hf_amqp_method_test_integer_integer_1 = -1;
static int hf_amqp_method_test_integer_integer_2 = -1;
static int hf_amqp_method_test_integer_integer_3 = -1;
static int hf_amqp_method_test_integer_integer_4 = -1;
static int hf_amqp_method_test_integer_operation = -1;
static int hf_amqp_method_test_integer_ok_result = -1;
static int hf_amqp_method_test_string_string_1 = -1;
static int hf_amqp_method_test_string_string_2 = -1;
static int hf_amqp_method_test_string_operation = -1;
static int hf_amqp_method_test_string_ok_result = -1;
static int hf_amqp_method_test_table_table = -1;
static int hf_amqp_method_test_table_integer_op = -1;
static int hf_amqp_method_test_table_string_op = -1;
static int hf_amqp_method_test_table_ok_integer_result = -1;
static int hf_amqp_method_test_table_ok_string_result = -1;
static int hf_amqp_method_test_content_ok_content_checksum = -1;
static int hf_amqp_field = -1;
static int hf_amqp_header_class_id = -1;
static int hf_amqp_header_weight = -1;
static int hf_amqp_header_body_size = -1;
static int hf_amqp_header_property_flags = -1;
static int hf_amqp_header_properties = -1;
static int hf_amqp_header_basic_content_type = -1;
static int hf_amqp_header_basic_content_encoding = -1;
static int hf_amqp_header_basic_headers = -1;
static int hf_amqp_header_basic_delivery_mode = -1;
static int hf_amqp_header_basic_priority = -1;
static int hf_amqp_header_basic_correlation_id = -1;
static int hf_amqp_header_basic_reply_to = -1;
static int hf_amqp_header_basic_expiration = -1;
static int hf_amqp_header_basic_message_id = -1;
static int hf_amqp_header_basic_timestamp = -1;
static int hf_amqp_header_basic_type = -1;
static int hf_amqp_header_basic_user_id = -1;
static int hf_amqp_header_basic_app_id = -1;
static int hf_amqp_header_basic_cluster_id = -1;
static int hf_amqp_header_file_content_type = -1;
static int hf_amqp_header_file_content_encoding = -1;
static int hf_amqp_header_file_headers = -1;
static int hf_amqp_header_file_priority = -1;
static int hf_amqp_header_file_reply_to = -1;
static int hf_amqp_header_file_message_id = -1;
static int hf_amqp_header_file_filename = -1;
static int hf_amqp_header_file_timestamp = -1;
static int hf_amqp_header_file_cluster_id = -1;
static int hf_amqp_header_stream_content_type = -1;
static int hf_amqp_header_stream_content_encoding = -1;
static int hf_amqp_header_stream_headers = -1;
static int hf_amqp_header_stream_priority = -1;
static int hf_amqp_header_stream_timestamp = -1;
static int hf_amqp_header_tunnel_headers = -1;
static int hf_amqp_header_tunnel_proxy_name = -1;
static int hf_amqp_header_tunnel_data_name = -1;
static int hf_amqp_header_tunnel_durable = -1;
static int hf_amqp_header_tunnel_broadcast = -1;
static int hf_amqp_payload = -1;

/*  Setup of protocol subtree array  */

static gint ett_amqp = -1;
static gint ett_args = -1;
static gint ett_props = -1;
static gint ett_field_table = -1;

static gint *ett [] = {
     &ett_amqp,
     &ett_args,
     &ett_props,
     &ett_field_table
};

/*  Various enumerations  */

static const value_string amqp_frame_types [] = {
    {AMQP_FRAME_TYPE_METHOD,             "Method"},
    {AMQP_FRAME_TYPE_CONTENT_HEADER,     "Content header"},
    {AMQP_FRAME_TYPE_CONTENT_BODY,       "Content body"},
    {AMQP_FRAME_TYPE_OOB_METHOD,         "OOB Method"},
    {AMQP_FRAME_TYPE_OOB_CONTENT_HEADER, "OOB Content header"},
    {AMQP_FRAME_TYPE_OOB_CONTENT_BODY,   "OOB Content body"},
    {AMQP_FRAME_TYPE_TRACE ,             "Trace"},
    {AMQP_FRAME_TYPE_HEARTBEAT,          "Heartbeat"},
    {0, NULL}
};

static const value_string amqp_method_classes [] = {
    {10, "Connection"},
    {20, "Channel"},
    {30, "Access"},
    {40, "Exchange"},
    {50, "Queue"},
    {60, "Basic"},
    {70, "File"},
    {80, "Stream"},
    {90, "Tx"},
    {100, "Dtx"},
    {110, "Tunnel"},
    {120, "Test"},
    {0, NULL}
};

static const value_string amqp_method_connection_methods [] = {
    {10, "Start"},
    {11, "Start-Ok"},
    {20, "Secure"},
    {21, "Secure-Ok"},
    {30, "Tune"},
    {31, "Tune-Ok"},
    {40, "Open"},
    {41, "Open-Ok"},
    {50, "Redirect"},
    {60, "Close"},
    {61, "Close-Ok"},
    {0, NULL}
};
static const value_string amqp_method_channel_methods [] = {
    {10, "Open"},
    {11, "Open-Ok"},
    {20, "Flow"},
    {21, "Flow-Ok"},
    {30, "Alert"},
    {40, "Close"},
    {41, "Close-Ok"},
    {0, NULL}
};
static const value_string amqp_method_access_methods [] = {
    {10, "Request"},
    {11, "Request-Ok"},
    {0, NULL}
};
static const value_string amqp_method_exchange_methods [] = {
    {10, "Declare"},
    {11, "Declare-Ok"},
    {20, "Delete"},
    {21, "Delete-Ok"},
    {0, NULL}
};
static const value_string amqp_method_queue_methods [] = {
    {10, "Declare"},
    {11, "Declare-Ok"},
    {20, "Bind"},
    {21, "Bind-Ok"},
    {30, "Purge"},
    {31, "Purge-Ok"},
    {40, "Delete"},
    {41, "Delete-Ok"},
    {0, NULL}
};
static const value_string amqp_method_basic_methods [] = {
    {10, "Qos"},
    {11, "Qos-Ok"},
    {20, "Consume"},
    {21, "Consume-Ok"},
    {30, "Cancel"},
    {31, "Cancel-Ok"},
    {40, "Publish"},
    {50, "Return"},
    {60, "Deliver"},
    {70, "Get"},
    {71, "Get-Ok"},
    {72, "Get-Empty"},
    {80, "Ack"},
    {90, "Reject"},
    {100, "Recover"},
    {0, NULL}
};
static const value_string amqp_method_file_methods [] = {
    {10, "Qos"},
    {11, "Qos-Ok"},
    {20, "Consume"},
    {21, "Consume-Ok"},
    {30, "Cancel"},
    {31, "Cancel-Ok"},
    {40, "Open"},
    {41, "Open-Ok"},
    {50, "Stage"},
    {60, "Publish"},
    {70, "Return"},
    {80, "Deliver"},
    {90, "Ack"},
    {100, "Reject"},
    {0, NULL}
};
static const value_string amqp_method_stream_methods [] = {
    {10, "Qos"},
    {11, "Qos-Ok"},
    {20, "Consume"},
    {21, "Consume-Ok"},
    {30, "Cancel"},
    {31, "Cancel-Ok"},
    {40, "Publish"},
    {50, "Return"},
    {60, "Deliver"},
    {0, NULL}
};
static const value_string amqp_method_tx_methods [] = {
    {10, "Select"},
    {11, "Select-Ok"},
    {20, "Commit"},
    {21, "Commit-Ok"},
    {30, "Rollback"},
    {31, "Rollback-Ok"},
    {0, NULL}
};
static const value_string amqp_method_dtx_methods [] = {
    {10, "Select"},
    {11, "Select-Ok"},
    {20, "Start"},
    {21, "Start-Ok"},
    {0, NULL}
};
static const value_string amqp_method_tunnel_methods [] = {
    {10, "Request"},
    {0, NULL}
};
static const value_string amqp_method_test_methods [] = {
    {10, "Integer"},
    {11, "Integer-Ok"},
    {20, "String"},
    {21, "String-Ok"},
    {30, "Table"},
    {31, "Table-Ok"},
    {40, "Content"},
    {41, "Content-Ok"},
    {0, NULL}
};

/*  Formatting info for different elements of AMQP protocol  */

static hf_register_info hf[] = {
    {&hf_amqp_info, {
        "Info", "",
        FT_NONE, BASE_NONE, NULL, 0x0,
        "Dissector info", HFILL}},
    {&hf_amqp_type, {
        "Type", "amqp.type",
        FT_UINT8, BASE_DEC, VALS (amqp_frame_types), 0x0,
        "Frame type", HFILL}},
    {&hf_amqp_channel,{
        "Channel", "amqp.channel",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        "Channel ID", HFILL}},
    {&hf_amqp_length, {
        "Length", "amqp.length",
        FT_UINT32, BASE_DEC, NULL, 0x0,
        "Length of the frame", HFILL}},
    {&hf_amqp_method_class_id, {
        "Class", "amqp.method.class",
        FT_UINT16, BASE_DEC, VALS (amqp_method_classes), 0x0,
        "Class ID", HFILL}},
    {&hf_amqp_method_connection_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_connection_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_channel_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_channel_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_access_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_access_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_exchange_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_exchange_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_queue_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_queue_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_basic_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_basic_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_file_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_file_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_stream_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_stream_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_tx_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_tx_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_dtx_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_dtx_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_tunnel_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_tunnel_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_test_method_id, {
        "Method", "amqp.method.method",
        FT_UINT16, BASE_DEC, VALS (amqp_method_test_methods), 0x0,
        "Method ID", HFILL}},
    {&hf_amqp_method_arguments, {
        "Arguments", "",
        FT_NONE, 0, NULL, 0x0,
        "Method arguments", HFILL}},
    {&hf_amqp_method_connection_start_version_major, {
        "Version Major", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "version major", HFILL}},
    {&hf_amqp_method_connection_start_version_minor, {
        "Version Minor", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "version minor", HFILL}},
    {&hf_amqp_method_connection_start_server_properties, {
        "Server Properties", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "server properties", HFILL}},
    {&hf_amqp_method_connection_start_mechanisms, {
        "Mechanisms", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "mechanisms", HFILL}},
    {&hf_amqp_method_connection_start_locales, {
        "Locales", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "locales", HFILL}},
    {&hf_amqp_method_connection_start_ok_client_properties, {
        "Client Properties", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "client properties", HFILL}},
    {&hf_amqp_method_connection_start_ok_mechanism, {
        "Mechanism", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "mechanism", HFILL}},
    {&hf_amqp_method_connection_start_ok_response, {
        "Response", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "response", HFILL}},
    {&hf_amqp_method_connection_start_ok_locale, {
        "Locale", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "locale", HFILL}},
    {&hf_amqp_method_connection_secure_challenge, {
        "Challenge", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "challenge", HFILL}},
    {&hf_amqp_method_connection_secure_ok_response, {
        "Response", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "response", HFILL}},
    {&hf_amqp_method_connection_tune_channel_max, {
        "Channel Max", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "channel max", HFILL}},
    {&hf_amqp_method_connection_tune_frame_max, {
        "Frame Max", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "frame max", HFILL}},
    {&hf_amqp_method_connection_tune_heartbeat, {
        "Heartbeat", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "heartbeat", HFILL}},
    {&hf_amqp_method_connection_tune_ok_channel_max, {
        "Channel Max", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "channel max", HFILL}},
    {&hf_amqp_method_connection_tune_ok_frame_max, {
        "Frame Max", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "frame max", HFILL}},
    {&hf_amqp_method_connection_tune_ok_heartbeat, {
        "Heartbeat", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "heartbeat", HFILL}},
    {&hf_amqp_method_connection_open_virtual_host, {
        "Virtual Host", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "virtual host", HFILL}},
    {&hf_amqp_method_connection_open_capabilities, {
        "Capabilities", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "capabilities", HFILL}},
    {&hf_amqp_method_connection_open_insist, {
        "Insist", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "insist", HFILL}},
    {&hf_amqp_method_connection_open_ok_known_hosts, {
        "Known Hosts", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "known hosts", HFILL}},
    {&hf_amqp_method_connection_redirect_host, {
        "Host", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "host", HFILL}},
    {&hf_amqp_method_connection_redirect_known_hosts, {
        "Known Hosts", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "known hosts", HFILL}},
    {&hf_amqp_method_connection_close_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_connection_close_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_connection_close_class_id, {
        "Class Id", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "class id", HFILL}},
    {&hf_amqp_method_connection_close_method_id, {
        "Method Id", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "method id", HFILL}},
    {&hf_amqp_method_channel_open_out_of_band, {
        "Out Of Band", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "out of band", HFILL}},
    {&hf_amqp_method_channel_flow_active, {
        "Active", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "active", HFILL}},
    {&hf_amqp_method_channel_flow_ok_active, {
        "Active", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "active", HFILL}},
    {&hf_amqp_method_channel_alert_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_channel_alert_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_channel_alert_details, {
        "Details", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "details", HFILL}},
    {&hf_amqp_method_channel_close_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_channel_close_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_channel_close_class_id, {
        "Class Id", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "class id", HFILL}},
    {&hf_amqp_method_channel_close_method_id, {
        "Method Id", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "method id", HFILL}},
    {&hf_amqp_method_access_request_realm, {
        "Realm", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "realm", HFILL}},
    {&hf_amqp_method_access_request_exclusive, {
        "Exclusive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "exclusive", HFILL}},
    {&hf_amqp_method_access_request_passive, {
        "Passive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "passive", HFILL}},
    {&hf_amqp_method_access_request_active, {
        "Active", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "active", HFILL}},
    {&hf_amqp_method_access_request_write, {
        "Write", "",
        FT_BOOLEAN, BASE_NONE, NULL, 8,
        "write", HFILL}},
    {&hf_amqp_method_access_request_read, {
        "Read", "",
        FT_BOOLEAN, BASE_NONE, NULL, 16,
        "read", HFILL}},
    {&hf_amqp_method_access_request_ok_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_exchange_declare_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_exchange_declare_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_exchange_declare_type, {
        "Type", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "type", HFILL}},
    {&hf_amqp_method_exchange_declare_passive, {
        "Passive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "passive", HFILL}},
    {&hf_amqp_method_exchange_declare_durable, {
        "Durable", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "durable", HFILL}},
    {&hf_amqp_method_exchange_declare_auto_delete, {
        "Auto Delete", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "auto delete", HFILL}},
    {&hf_amqp_method_exchange_declare_internal, {
        "Internal", "",
        FT_BOOLEAN, BASE_NONE, NULL, 8,
        "internal", HFILL}},
    {&hf_amqp_method_exchange_declare_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 16,
        "nowait", HFILL}},
    {&hf_amqp_method_exchange_declare_arguments, {
        "Arguments", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "arguments", HFILL}},
    {&hf_amqp_method_exchange_delete_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_exchange_delete_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_exchange_delete_if_unused, {
        "If Unused", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "if unused", HFILL}},
    {&hf_amqp_method_exchange_delete_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "nowait", HFILL}},
    {&hf_amqp_method_queue_declare_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_queue_declare_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_queue_declare_passive, {
        "Passive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "passive", HFILL}},
    {&hf_amqp_method_queue_declare_durable, {
        "Durable", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "durable", HFILL}},
    {&hf_amqp_method_queue_declare_exclusive, {
        "Exclusive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "exclusive", HFILL}},
    {&hf_amqp_method_queue_declare_auto_delete, {
        "Auto Delete", "",
        FT_BOOLEAN, BASE_NONE, NULL, 8,
        "auto delete", HFILL}},
    {&hf_amqp_method_queue_declare_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 16,
        "nowait", HFILL}},
    {&hf_amqp_method_queue_declare_arguments, {
        "Arguments", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "arguments", HFILL}},
    {&hf_amqp_method_queue_declare_ok_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_queue_declare_ok_message_count, {
        "Message Count", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "message count", HFILL}},
    {&hf_amqp_method_queue_declare_ok_consumer_count, {
        "Consumer Count", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "consumer count", HFILL}},
    {&hf_amqp_method_queue_bind_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_queue_bind_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_queue_bind_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_queue_bind_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_queue_bind_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "nowait", HFILL}},
    {&hf_amqp_method_queue_bind_arguments, {
        "Arguments", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "arguments", HFILL}},
    {&hf_amqp_method_queue_purge_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_queue_purge_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_queue_purge_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "nowait", HFILL}},
    {&hf_amqp_method_queue_purge_ok_message_count, {
        "Message Count", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "message count", HFILL}},
    {&hf_amqp_method_queue_delete_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_queue_delete_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_queue_delete_if_unused, {
        "If Unused", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "if unused", HFILL}},
    {&hf_amqp_method_queue_delete_if_empty, {
        "If Empty", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "if empty", HFILL}},
    {&hf_amqp_method_queue_delete_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "nowait", HFILL}},
    {&hf_amqp_method_queue_delete_ok_message_count, {
        "Message Count", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "message count", HFILL}},
    {&hf_amqp_method_basic_qos_prefetch_size, {
        "Prefetch Size", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "prefetch size", HFILL}},
    {&hf_amqp_method_basic_qos_prefetch_count, {
        "Prefetch Count", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "prefetch count", HFILL}},
    {&hf_amqp_method_basic_qos_global, {
        "Global", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "global", HFILL}},
    {&hf_amqp_method_basic_consume_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_basic_consume_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_basic_consume_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_basic_consume_no_local, {
        "No Local", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "no local", HFILL}},
    {&hf_amqp_method_basic_consume_no_ack, {
        "No Ack", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "no ack", HFILL}},
    {&hf_amqp_method_basic_consume_exclusive, {
        "Exclusive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "exclusive", HFILL}},
    {&hf_amqp_method_basic_consume_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 8,
        "nowait", HFILL}},
    {&hf_amqp_method_basic_consume_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_basic_cancel_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_basic_cancel_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "nowait", HFILL}},
    {&hf_amqp_method_basic_cancel_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_basic_publish_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_basic_publish_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_basic_publish_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_basic_publish_mandatory, {
        "Mandatory", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "mandatory", HFILL}},
    {&hf_amqp_method_basic_publish_immediate, {
        "Immediate", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "immediate", HFILL}},
    {&hf_amqp_method_basic_return_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_basic_return_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_basic_return_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_basic_return_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_basic_deliver_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_basic_deliver_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_basic_deliver_redelivered, {
        "Redelivered", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "redelivered", HFILL}},
    {&hf_amqp_method_basic_deliver_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_basic_deliver_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_basic_get_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_basic_get_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_basic_get_no_ack, {
        "No Ack", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "no ack", HFILL}},
    {&hf_amqp_method_basic_get_ok_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_basic_get_ok_redelivered, {
        "Redelivered", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "redelivered", HFILL}},
    {&hf_amqp_method_basic_get_ok_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_basic_get_ok_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_basic_get_ok_message_count, {
        "Message Count", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "message count", HFILL}},
    {&hf_amqp_method_basic_get_empty_cluster_id, {
        "Cluster Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "cluster id", HFILL}},
    {&hf_amqp_method_basic_ack_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_basic_ack_multiple, {
        "Multiple", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "multiple", HFILL}},
    {&hf_amqp_method_basic_reject_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_basic_reject_requeue, {
        "Requeue", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "requeue", HFILL}},
    {&hf_amqp_method_basic_recover_requeue, {
        "Requeue", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "requeue", HFILL}},
    {&hf_amqp_method_file_qos_prefetch_size, {
        "Prefetch Size", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "prefetch size", HFILL}},
    {&hf_amqp_method_file_qos_prefetch_count, {
        "Prefetch Count", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "prefetch count", HFILL}},
    {&hf_amqp_method_file_qos_global, {
        "Global", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "global", HFILL}},
    {&hf_amqp_method_file_consume_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_file_consume_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_file_consume_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_file_consume_no_local, {
        "No Local", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "no local", HFILL}},
    {&hf_amqp_method_file_consume_no_ack, {
        "No Ack", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "no ack", HFILL}},
    {&hf_amqp_method_file_consume_exclusive, {
        "Exclusive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "exclusive", HFILL}},
    {&hf_amqp_method_file_consume_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 8,
        "nowait", HFILL}},
    {&hf_amqp_method_file_consume_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_file_cancel_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_file_cancel_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "nowait", HFILL}},
    {&hf_amqp_method_file_cancel_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_file_open_identifier, {
        "Identifier", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "identifier", HFILL}},
    {&hf_amqp_method_file_open_content_size, {
        "Content Size", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "content size", HFILL}},
    {&hf_amqp_method_file_open_ok_staged_size, {
        "Staged Size", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "staged size", HFILL}},
    {&hf_amqp_method_file_publish_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_file_publish_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_file_publish_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_file_publish_mandatory, {
        "Mandatory", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "mandatory", HFILL}},
    {&hf_amqp_method_file_publish_immediate, {
        "Immediate", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "immediate", HFILL}},
    {&hf_amqp_method_file_publish_identifier, {
        "Identifier", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "identifier", HFILL}},
    {&hf_amqp_method_file_return_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_file_return_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_file_return_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_file_return_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_file_deliver_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_file_deliver_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_file_deliver_redelivered, {
        "Redelivered", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "redelivered", HFILL}},
    {&hf_amqp_method_file_deliver_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_file_deliver_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_file_deliver_identifier, {
        "Identifier", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "identifier", HFILL}},
    {&hf_amqp_method_file_ack_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_file_ack_multiple, {
        "Multiple", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "multiple", HFILL}},
    {&hf_amqp_method_file_reject_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_file_reject_requeue, {
        "Requeue", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "requeue", HFILL}},
    {&hf_amqp_method_stream_qos_prefetch_size, {
        "Prefetch Size", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "prefetch size", HFILL}},
    {&hf_amqp_method_stream_qos_prefetch_count, {
        "Prefetch Count", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "prefetch count", HFILL}},
    {&hf_amqp_method_stream_qos_consume_rate, {
        "Consume Rate", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "consume rate", HFILL}},
    {&hf_amqp_method_stream_qos_global, {
        "Global", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "global", HFILL}},
    {&hf_amqp_method_stream_consume_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_stream_consume_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_stream_consume_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_stream_consume_no_local, {
        "No Local", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "no local", HFILL}},
    {&hf_amqp_method_stream_consume_exclusive, {
        "Exclusive", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "exclusive", HFILL}},
    {&hf_amqp_method_stream_consume_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 4,
        "nowait", HFILL}},
    {&hf_amqp_method_stream_consume_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_stream_cancel_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_stream_cancel_nowait, {
        "Nowait", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "nowait", HFILL}},
    {&hf_amqp_method_stream_cancel_ok_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_stream_publish_ticket, {
        "Ticket", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "ticket", HFILL}},
    {&hf_amqp_method_stream_publish_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_stream_publish_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_stream_publish_mandatory, {
        "Mandatory", "",
        FT_BOOLEAN, BASE_NONE, NULL, 1,
        "mandatory", HFILL}},
    {&hf_amqp_method_stream_publish_immediate, {
        "Immediate", "",
        FT_BOOLEAN, BASE_NONE, NULL, 2,
        "immediate", HFILL}},
    {&hf_amqp_method_stream_return_reply_code, {
        "Reply Code", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "reply code", HFILL}},
    {&hf_amqp_method_stream_return_reply_text, {
        "Reply Text", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply text", HFILL}},
    {&hf_amqp_method_stream_return_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_stream_return_routing_key, {
        "Routing Key", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "routing key", HFILL}},
    {&hf_amqp_method_stream_deliver_consumer_tag, {
        "Consumer Tag", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "consumer tag", HFILL}},
    {&hf_amqp_method_stream_deliver_delivery_tag, {
        "Delivery Tag", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "delivery tag", HFILL}},
    {&hf_amqp_method_stream_deliver_exchange, {
        "Exchange", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "exchange", HFILL}},
    {&hf_amqp_method_stream_deliver_queue, {
        "Queue", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "queue", HFILL}},
    {&hf_amqp_method_dtx_start_dtx_identifier, {
        "Dtx Identifier", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "dtx identifier", HFILL}},
    {&hf_amqp_method_tunnel_request_meta_data, {
        "Meta Data", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "meta data", HFILL}},
    {&hf_amqp_method_test_integer_integer_1, {
        "Integer 1", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "integer 1", HFILL}},
    {&hf_amqp_method_test_integer_integer_2, {
        "Integer 2", "",
         FT_UINT16, BASE_DEC, NULL, 0,
        "integer 2", HFILL}},
    {&hf_amqp_method_test_integer_integer_3, {
        "Integer 3", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "integer 3", HFILL}},
    {&hf_amqp_method_test_integer_integer_4, {
        "Integer 4", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "integer 4", HFILL}},
    {&hf_amqp_method_test_integer_operation, {
        "Operation", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "operation", HFILL}},
    {&hf_amqp_method_test_integer_ok_result, {
        "Result", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "result", HFILL}},
    {&hf_amqp_method_test_string_string_1, {
        "String 1", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "string 1", HFILL}},
    {&hf_amqp_method_test_string_string_2, {
        "String 2", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "string 2", HFILL}},
    {&hf_amqp_method_test_string_operation, {
        "Operation", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "operation", HFILL}},
    {&hf_amqp_method_test_string_ok_result, {
        "Result", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "result", HFILL}},
    {&hf_amqp_method_test_table_table, {
        "Table", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "table", HFILL}},
    {&hf_amqp_method_test_table_integer_op, {
        "Integer Op", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "integer op", HFILL}},
    {&hf_amqp_method_test_table_string_op, {
        "String Op", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "string op", HFILL}},
    {&hf_amqp_method_test_table_ok_integer_result, {
        "Integer Result", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "integer result", HFILL}},
    {&hf_amqp_method_test_table_ok_string_result, {
        "String Result", "",
        FT_BYTES, BASE_NONE, NULL, 0,
        "string result", HFILL}},
    {&hf_amqp_method_test_content_ok_content_checksum, {
        "Content Checksum", "",
        FT_UINT32, BASE_DEC, NULL, 0,
        "content checksum", HFILL}},
    {&hf_amqp_field, {
        "", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "", HFILL}},
    {&hf_amqp_header_class_id, {
        "Class ID", "amqp.header.class",
        FT_UINT16, BASE_DEC, VALS (amqp_method_classes), 0,
        "Class ID", HFILL}},
    {&hf_amqp_header_weight, {
        "Weight", "amqp.header.weight",
        FT_UINT16, BASE_DEC, NULL, 0,
        "Weight", HFILL}},
    {&hf_amqp_header_body_size, {
        "Body size", "amqp.header.body-size",
        FT_UINT64, BASE_DEC, NULL, 0,
        "Body size", HFILL}},
    {&hf_amqp_header_property_flags, {
        "Property flags", "amqp.header.property-flags",
        FT_UINT16, BASE_HEX, NULL, 0,
        "Property flags", HFILL}},
    {&hf_amqp_header_properties, {
        "Properties", "",
        FT_NONE, 0, NULL, 0x0,
        "Message properties", HFILL}},
    {&hf_amqp_header_basic_content_type, {
        "Content Type", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content type", HFILL}},
    {&hf_amqp_header_basic_content_encoding, {
        "Content Encoding", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content encoding", HFILL}},
    {&hf_amqp_header_basic_headers, {
        "Headers", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "headers", HFILL}},
    {&hf_amqp_header_basic_delivery_mode, {
        "Delivery Mode", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "delivery mode", HFILL}},
    {&hf_amqp_header_basic_priority, {
        "Priority", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "priority", HFILL}},
    {&hf_amqp_header_basic_correlation_id, {
        "Correlation Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "correlation id", HFILL}},
    {&hf_amqp_header_basic_reply_to, {
        "Reply To", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply to", HFILL}},
    {&hf_amqp_header_basic_expiration, {
        "Expiration", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "expiration", HFILL}},
    {&hf_amqp_header_basic_message_id, {
        "Message Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "message id", HFILL}},
    {&hf_amqp_header_basic_timestamp, {
        "Timestamp", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "timestamp", HFILL}},
    {&hf_amqp_header_basic_type, {
        "Type", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "type", HFILL}},
    {&hf_amqp_header_basic_user_id, {
        "User Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "user id", HFILL}},
    {&hf_amqp_header_basic_app_id, {
        "App Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "app id", HFILL}},
    {&hf_amqp_header_basic_cluster_id, {
        "Cluster Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "cluster id", HFILL}},
    {&hf_amqp_header_file_content_type, {
        "Content Type", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content type", HFILL}},
    {&hf_amqp_header_file_content_encoding, {
        "Content Encoding", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content encoding", HFILL}},
    {&hf_amqp_header_file_headers, {
        "Headers", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "headers", HFILL}},
    {&hf_amqp_header_file_priority, {
        "Priority", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "priority", HFILL}},
    {&hf_amqp_header_file_reply_to, {
        "Reply To", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "reply to", HFILL}},
    {&hf_amqp_header_file_message_id, {
        "Message Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "message id", HFILL}},
    {&hf_amqp_header_file_filename, {
        "Filename", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "filename", HFILL}},
    {&hf_amqp_header_file_timestamp, {
        "Timestamp", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "timestamp", HFILL}},
    {&hf_amqp_header_file_cluster_id, {
        "Cluster Id", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "cluster id", HFILL}},
    {&hf_amqp_header_stream_content_type, {
        "Content Type", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content type", HFILL}},
    {&hf_amqp_header_stream_content_encoding, {
        "Content Encoding", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "content encoding", HFILL}},
    {&hf_amqp_header_stream_headers, {
        "Headers", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "headers", HFILL}},
    {&hf_amqp_header_stream_priority, {
        "Priority", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "priority", HFILL}},
    {&hf_amqp_header_stream_timestamp, {
        "Timestamp", "",
        FT_UINT64, BASE_DEC, NULL, 0,
        "timestamp", HFILL}},
    {&hf_amqp_header_tunnel_headers, {
        "Headers", "",
        FT_NONE, BASE_NONE, NULL, 0,
        "headers", HFILL}},
    {&hf_amqp_header_tunnel_proxy_name, {
        "Proxy Name", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "proxy name", HFILL}},
    {&hf_amqp_header_tunnel_data_name, {
        "Data Name", "",
        FT_STRING, BASE_NONE, NULL, 0,
        "data name", HFILL}},
    {&hf_amqp_header_tunnel_durable, {
        "Durable", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "durable", HFILL}},
    {&hf_amqp_header_tunnel_broadcast, {
        "Broadcast", "",
        FT_UINT8, BASE_DEC, NULL, 0,
        "broadcast", HFILL}},
    {&hf_amqp_payload, {
        "Payload", "amqp.payload",
        FT_BYTES, BASE_NONE, NULL, 0,
        "Message payload", HFILL}},
};

/*  Basic registration functions  */

void proto_register_amqp (void)
{
    module_t *amqp_module;
    if (proto_amqp == -1) {
        proto_amqp = proto_register_protocol (
            "Advanced Message Queueing Protocol", "AMQP", "amqp");
	proto_register_field_array (proto_amqp, hf, array_length(hf));
	proto_register_subtree_array (ett, array_length(ett));
    }
    amqp_module = prefs_register_protocol (proto_amqp, proto_reg_handoff_amqp);
}

void proto_reg_handoff_amqp (void)
{
    static int initialised = FALSE;
    if (!initialised) {
        amqp_handle = create_dissector_handle (dissect_amqp, proto_amqp);
        dissector_add ("tcp.port", amqp_port, amqp_handle);
    }
}

/*  Main dissection routine  */

static void dissect_amqp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
    tcp_dissect_pdus (tvb, pinfo, tree, TRUE, 7,
                     get_amqp_message_len, dissect_amqp_message);
}

static guint get_amqp_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
{
    return (guint) tvb_get_ntohl (tvb, offset + 3) + 8;
}

/*  Dissection routine for AMQP frames  */

static void dissect_amqp_message (tvbuff_t *tvb, packet_info *pinfo,
    proto_tree *tree)
{
    proto_item 
        *ti,
        *amqp_tree,
        *args_tree,
        *prop_tree;
    size_t
        argptr;
    guint16
        prop_flags;

    if (check_col (pinfo->cinfo, COL_PROTOCOL))
        col_set_str (pinfo->cinfo, COL_PROTOCOL, "AMQP");
    if (check_col (pinfo->cinfo, COL_INFO)) {
        col_clear (pinfo->cinfo, COL_INFO);
    }

    if (tree) {
        
        ti = proto_tree_add_item (tree, proto_amqp, tvb, 0, -1, FALSE);
        amqp_tree = proto_item_add_subtree (ti, ett_amqp);
	proto_tree_add_item (amqp_tree, hf_amqp_type, tvb, 0, 1, FALSE);
	proto_tree_add_item (amqp_tree, hf_amqp_channel, tvb, 1, 2, FALSE);
	proto_tree_add_item (amqp_tree, hf_amqp_length, tvb, 3, 4, FALSE);
        switch (tvb_get_guint8(tvb, 0)) {
        case AMQP_FRAME_TYPE_METHOD:
            proto_tree_add_item (amqp_tree, hf_amqp_method_class_id,
                tvb, 7, 2, FALSE);
            switch (tvb_get_ntohs (tvb, 7)) {
            case 10:
                proto_tree_add_item (amqp_tree, hf_amqp_method_connection_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  version major (octet)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_version_major,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  version minor (octet)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_version_minor,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  server properties (table)  */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_connection_start_server_properties,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  mechanisms (longstr)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_mechanisms,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  locales (longstr)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_locales,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 11:
                    argptr = 11;
                    /*  client properties (table)  */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_connection_start_ok_client_properties,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  mechanism (shortstr)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_ok_mechanism,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  response (longstr)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_ok_response,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  locale (shortstr)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_start_ok_locale,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 20:
                    argptr = 11;
                    /*  challenge (longstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_secure_challenge,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 21:
                    argptr = 11;
                    /*  response (longstr)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_secure_ok_response,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 30:
                    argptr = 11;
                    /*  channel max (short)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_channel_max,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  frame max (long)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_frame_max,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  heartbeat (short)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_heartbeat,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    break;
                case 31:
                    argptr = 11;
                    /*  channel max (short)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_ok_channel_max,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  frame max (long)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_ok_frame_max,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  heartbeat (short)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_tune_ok_heartbeat,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    break;
                case 40:
                    argptr = 11;
                    /*  virtual host (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_open_virtual_host,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  capabilities (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_open_capabilities,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  insist (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_open_insist,
                        tvb, argptr, 1, FALSE);
                    break;
                case 41:
                    argptr = 11;
                    /*  known hosts (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_open_ok_known_hosts,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 50:
                    argptr = 11;
                    /*  host (shortstr)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_redirect_host,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  known hosts (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_redirect_known_hosts,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 60:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_close_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_close_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  class id (short)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_close_class_id,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  method id (short)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_connection_close_method_id,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    break;
                case 61:
                    argptr = 11;
                    break;
                }
                break;
            case 20:
                proto_tree_add_item (amqp_tree, hf_amqp_method_channel_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  out of band (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_open_out_of_band,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  active (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_flow_active,
                        tvb, argptr, 1, FALSE);
                    break;
                case 21:
                    argptr = 11;
                    /*  active (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_flow_ok_active,
                        tvb, argptr, 1, FALSE);
                    break;
                case 30:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_alert_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_alert_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  details (table)          */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_channel_alert_details,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 40:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_close_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_close_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  class id (short)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_close_class_id,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  method id (short)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_channel_close_method_id,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    break;
                case 41:
                    argptr = 11;
                    break;
                }
                break;
            case 30:
                proto_tree_add_item (amqp_tree, hf_amqp_method_access_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  realm (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_realm,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  exclusive (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_exclusive,
                        tvb, argptr, 1, FALSE);
                    /*  passive (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_passive,
                        tvb, argptr, 1, FALSE);
                    /*  active (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_active,
                        tvb, argptr, 1, FALSE);
                    /*  write (bit)              */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_write,
                        tvb, argptr, 1, FALSE);
                    /*  read (bit)               */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_read,
                        tvb, argptr, 1, FALSE);
                    break;
                case 11:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_access_request_ok_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    break;
                }
                break;
            case 40:
                proto_tree_add_item (amqp_tree, hf_amqp_method_exchange_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  type (shortstr)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_type,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  passive (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_passive,
                        tvb, argptr, 1, FALSE);
                    /*  durable (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_durable,
                        tvb, argptr, 1, FALSE);
                    /*  auto delete (bit)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_auto_delete,
                        tvb, argptr, 1, FALSE);
                    /*  internal (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_internal,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_declare_nowait,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  arguments (table)        */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_exchange_declare_arguments,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_delete_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_delete_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  if unused (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_delete_if_unused,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_exchange_delete_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 21:
                    argptr = 11;
                    break;
                }
                break;
            case 50:
                proto_tree_add_item (amqp_tree, hf_amqp_method_queue_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  passive (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_passive,
                        tvb, argptr, 1, FALSE);
                    /*  durable (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_durable,
                        tvb, argptr, 1, FALSE);
                    /*  exclusive (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_exclusive,
                        tvb, argptr, 1, FALSE);
                    /*  auto delete (bit)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_auto_delete,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_nowait,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  arguments (table)        */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_queue_declare_arguments,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 11:
                    argptr = 11;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_ok_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  message count (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_ok_message_count,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  consumer count (long)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_declare_ok_consumer_count,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    break;
                case 20:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_bind_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_bind_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_bind_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_bind_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_bind_nowait,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  arguments (table)        */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_queue_bind_arguments,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 21:
                    argptr = 11;
                    break;
                case 30:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_purge_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_purge_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_purge_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 31:
                    argptr = 11;
                    /*  message count (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_purge_ok_message_count,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    break;
                case 40:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  if unused (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_if_unused,
                        tvb, argptr, 1, FALSE);
                    /*  if empty (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_if_empty,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 41:
                    argptr = 11;
                    /*  message count (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_queue_delete_ok_message_count,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    break;
                }
                break;
            case 60:
                proto_tree_add_item (amqp_tree, hf_amqp_method_basic_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  prefetch size (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_qos_prefetch_size,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  prefetch count (short)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_qos_prefetch_count,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  global (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_qos_global,
                        tvb, argptr, 1, FALSE);
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  no local (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_no_local,
                        tvb, argptr, 1, FALSE);
                    /*  no ack (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_no_ack,
                        tvb, argptr, 1, FALSE);
                    /*  exclusive (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_exclusive,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 21:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_consume_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 30:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_cancel_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_cancel_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 31:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_cancel_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 40:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_publish_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_publish_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_publish_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  mandatory (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_publish_mandatory,
                        tvb, argptr, 1, FALSE);
                    /*  immediate (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_publish_immediate,
                        tvb, argptr, 1, FALSE);
                    break;
                case 50:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_return_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_return_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_return_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_return_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 60:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_deliver_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_deliver_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  redelivered (bit)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_deliver_redelivered,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_deliver_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_deliver_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 70:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  no ack (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_no_ack,
                        tvb, argptr, 1, FALSE);
                    break;
                case 71:
                    argptr = 11;
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ok_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  redelivered (bit)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ok_redelivered,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ok_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ok_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  message count (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_ok_message_count,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    break;
                case 72:
                    argptr = 11;
                    /*  cluster id (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_get_empty_cluster_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 80:
                    argptr = 11;
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_ack_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  multiple (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_ack_multiple,
                        tvb, argptr, 1, FALSE);
                    break;
                case 90:
                    argptr = 11;
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_reject_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  requeue (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_reject_requeue,
                        tvb, argptr, 1, FALSE);
                    break;
                case 100:
                    argptr = 11;
                    /*  requeue (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_basic_recover_requeue,
                        tvb, argptr, 1, FALSE);
                    break;
                }
                break;
            case 70:
                proto_tree_add_item (amqp_tree, hf_amqp_method_file_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  prefetch size (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_qos_prefetch_size,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  prefetch count (short)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_qos_prefetch_count,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  global (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_qos_global,
                        tvb, argptr, 1, FALSE);
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  no local (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_no_local,
                        tvb, argptr, 1, FALSE);
                    /*  no ack (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_no_ack,
                        tvb, argptr, 1, FALSE);
                    /*  exclusive (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_exclusive,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 21:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_consume_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 30:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_cancel_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_cancel_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 31:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_cancel_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 40:
                    argptr = 11;
                    /*  identifier (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_open_identifier,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  content size (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_open_content_size,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    break;
                case 41:
                    argptr = 11;
                    /*  staged size (longlong)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_open_ok_staged_size,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    break;
                case 50:
                    argptr = 11;
                    break;
                case 60:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  mandatory (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_mandatory,
                        tvb, argptr, 1, FALSE);
                    /*  immediate (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_immediate,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  identifier (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_publish_identifier,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 70:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_return_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_return_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_return_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_return_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 80:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  redelivered (bit)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_redelivered,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  identifier (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_deliver_identifier,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 90:
                    argptr = 11;
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_ack_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  multiple (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_ack_multiple,
                        tvb, argptr, 1, FALSE);
                    break;
                case 100:
                    argptr = 11;
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_reject_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  requeue (bit)            */
                    proto_tree_add_item (args_tree, hf_amqp_method_file_reject_requeue,
                        tvb, argptr, 1, FALSE);
                    break;
                }
                break;
            case 80:
                proto_tree_add_item (amqp_tree, hf_amqp_method_stream_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  prefetch size (long)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_qos_prefetch_size,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  prefetch count (short)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_qos_prefetch_count,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  consume rate (long)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_qos_consume_rate,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  global (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_qos_global,
                        tvb, argptr, 1, FALSE);
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  no local (bit)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_no_local,
                        tvb, argptr, 1, FALSE);
                    /*  exclusive (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_exclusive,
                        tvb, argptr, 1, FALSE);
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 21:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_consume_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 30:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_cancel_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  nowait (bit)             */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_cancel_nowait,
                        tvb, argptr, 1, FALSE);
                    break;
                case 31:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_cancel_ok_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 40:
                    argptr = 11;
                    /*  ticket (short)           */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_publish_ticket,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_publish_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_publish_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  mandatory (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_publish_mandatory,
                        tvb, argptr, 1, FALSE);
                    /*  immediate (bit)          */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_publish_immediate,
                        tvb, argptr, 1, FALSE);
                    break;
                case 50:
                    argptr = 11;
                    /*  reply code (short)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_return_reply_code,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  reply text (shortstr)    */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_return_reply_text,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_return_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  routing key (shortstr)   */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_return_routing_key,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 60:
                    argptr = 11;
                    /*  consumer tag (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_deliver_consumer_tag,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  delivery tag (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_deliver_delivery_tag,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  exchange (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_deliver_exchange,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  queue (shortstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_stream_deliver_queue,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                }
                break;
            case 90:
                proto_tree_add_item (amqp_tree, hf_amqp_method_tx_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    break;
                case 21:
                    argptr = 11;
                    break;
                case 30:
                    argptr = 11;
                    break;
                case 31:
                    argptr = 11;
                    break;
                }
                break;
            case 100:
                proto_tree_add_item (amqp_tree, hf_amqp_method_dtx_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    break;
                case 11:
                    argptr = 11;
                    break;
                case 20:
                    argptr = 11;
                    /*  dtx identifier (shortstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_dtx_start_dtx_identifier,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    break;
                case 21:
                    argptr = 11;
                    break;
                }
                break;
            case 110:
                proto_tree_add_item (amqp_tree, hf_amqp_method_tunnel_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  meta data (table)        */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_tunnel_request_meta_data,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                }
                break;
            case 120:
                proto_tree_add_item (amqp_tree, hf_amqp_method_test_method_id,
                    tvb, 9, 2, FALSE);              
                ti = proto_tree_add_item (amqp_tree, hf_amqp_method_arguments,
                    tvb, 11, -1, FALSE);
                args_tree = proto_item_add_subtree (ti, ett_args);
                switch (tvb_get_ntohs (tvb, 9)) {
                case 10:
                    argptr = 11;
                    /*  integer 1 (octet)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_integer_1,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  integer 2 (short)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_integer_2,
                        tvb, argptr, 2, FALSE);
                    argptr += 2;
                    /*  integer 3 (long)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_integer_3,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    /*  integer 4 (longlong)     */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_integer_4,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  operation (octet)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_operation,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    break;
                case 11:
                    argptr = 11;
                    /*  result (longlong)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_integer_ok_result,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    break;
                case 20:
                    argptr = 11;
                    /*  string 1 (shortstr)      */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_string_string_1,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                    /*  string 2 (longstr)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_string_string_2,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  operation (octet)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_string_operation,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    break;
                case 21:
                    argptr = 11;
                    /*  result (longstr)         */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_string_ok_result,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 30:
                    argptr = 11;
                    /*  table (table)            */
                    ti = proto_tree_add_item (
                        args_tree, hf_amqp_method_test_table_table,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    /*  integer op (octet)       */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_table_integer_op,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    /*  string op (octet)        */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_table_string_op,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                    break;
                case 31:
                    argptr = 11;
                    /*  integer result (longlong)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_table_ok_integer_result,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                    /*  string result (longstr)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_table_ok_string_result,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                    break;
                case 40:
                    argptr = 11;
                    break;
                case 41:
                    argptr = 11;
                    /*  content checksum (long)  */
                    proto_tree_add_item (args_tree, hf_amqp_method_test_content_ok_content_checksum,
                        tvb, argptr, 4, FALSE);
                    argptr += 4;
                    break;
                }
                break;
            }
            break;
        case AMQP_FRAME_TYPE_CONTENT_HEADER:
            proto_tree_add_item (amqp_tree, hf_amqp_header_class_id,
                tvb, 7, 2, FALSE);
            proto_tree_add_item (amqp_tree, hf_amqp_header_weight,
                tvb, 9, 2, FALSE);
            proto_tree_add_item (amqp_tree, hf_amqp_header_body_size,
                tvb, 11, 8, FALSE);
            proto_tree_add_item (amqp_tree, hf_amqp_header_property_flags,
                tvb, 19, 2, FALSE);
            ti = proto_tree_add_item (amqp_tree, hf_amqp_header_properties,
                tvb, 21, -1, FALSE);
            prop_tree = proto_item_add_subtree (ti, ett_props);
            argptr = 21;
            prop_flags = tvb_get_ntohs (tvb, 19);
            switch (tvb_get_ntohs (tvb, 7)) {
            case 10:
                break;
            case 20:
                break;
            case 30:
                break;
            case 40:
                break;
            case 50:
                break;
            case 60:
                if (prop_flags & 0x8000) {
                    /*  content type (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_content_type,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  content encoding (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_content_encoding,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  headers (table)          */
                    ti = proto_tree_add_item (
                        prop_tree, hf_amqp_header_basic_headers,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  delivery mode (octet)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_delivery_mode,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  priority (octet)         */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_priority,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  correlation id (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_correlation_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  reply to (shortstr)      */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_reply_to,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  expiration (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_expiration,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  message id (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_message_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  timestamp (timestamp)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_timestamp,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  type (shortstr)          */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_type,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  user id (shortstr)       */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_user_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  app id (shortstr)        */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_app_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  cluster id (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_basic_cluster_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                break;
            case 70:
                if (prop_flags & 0x8000) {
                    /*  content type (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_content_type,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  content encoding (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_content_encoding,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  headers (table)          */
                    ti = proto_tree_add_item (
                        prop_tree, hf_amqp_header_file_headers,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  priority (octet)         */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_priority,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  reply to (shortstr)      */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_reply_to,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  message id (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_message_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  filename (shortstr)      */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_filename,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  timestamp (timestamp)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_timestamp,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  cluster id (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_file_cluster_id,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                break;
            case 80:
                if (prop_flags & 0x8000) {
                    /*  content type (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_stream_content_type,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  content encoding (shortstr)  */
                    proto_tree_add_item (prop_tree, hf_amqp_header_stream_content_encoding,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  headers (table)          */
                    ti = proto_tree_add_item (
                        prop_tree, hf_amqp_header_stream_headers,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  priority (octet)         */
                    proto_tree_add_item (prop_tree, hf_amqp_header_stream_priority,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  timestamp (timestamp)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_stream_timestamp,
                        tvb, argptr, 8, FALSE);
                    argptr += 8;
                }
                prop_flags <<= 1;
                break;
            case 90:
                break;
            case 100:
                break;
            case 110:
                if (prop_flags & 0x8000) {
                    /*  headers (table)          */
                    ti = proto_tree_add_item (
                        prop_tree, hf_amqp_header_tunnel_headers,
                        tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), FALSE);
                    dissect_amqp_field_table (tvb, argptr + 4, tvb_get_ntohl (tvb, argptr), ti);
                    argptr += (4 + tvb_get_ntohl (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  proxy name (shortstr)    */
                    proto_tree_add_item (prop_tree, hf_amqp_header_tunnel_proxy_name,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  data name (shortstr)     */
                    proto_tree_add_item (prop_tree, hf_amqp_header_tunnel_data_name,
                        tvb, argptr + 1, tvb_get_guint8 (tvb, argptr), FALSE);
                    argptr += (1 + tvb_get_guint8 (tvb, argptr));
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  durable (octet)          */
                    proto_tree_add_item (prop_tree, hf_amqp_header_tunnel_durable,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                if (prop_flags & 0x8000) {
                    /*  broadcast (octet)        */
                    proto_tree_add_item (prop_tree, hf_amqp_header_tunnel_broadcast,
                        tvb, argptr, 1, FALSE);
                    argptr += 1;
                }
                prop_flags <<= 1;
                break;
            case 120:
                break;
            }
            break;
        case AMQP_FRAME_TYPE_CONTENT_BODY:
            proto_tree_add_item (amqp_tree, hf_amqp_payload,
                tvb, 7, -1, FALSE);
            break;
        }
    }
}

/*  Dissection routine for AMQP field tables  */

static void dissect_amqp_field_table (tvbuff_t *tvb, size_t offset,
    size_t length, proto_item *item)
{
    proto_item
        *field_table_tree;
    char
        buff [256];
    size_t
        namelen,
        vallen;
    guint8
        type;
    const char
        *name,
        *typename,
        *value;
    size_t
        field_start;

    field_table_tree = proto_item_add_subtree (item, ett_amqp);

    while (length > 0) {
        field_start = offset;
        namelen = tvb_get_guint8 (tvb, offset);
        offset += 1;
        length -= 1;
        name = (char*) tvb_get_ephemeral_string (tvb, offset, namelen);
        offset += namelen;
        length -= namelen;
        type = tvb_get_guint8 (tvb, offset);
        offset += 1;
        length -= 1;
        switch (type) {
        case 'S':
            typename = "string";
            vallen = tvb_get_ntohl (tvb, offset);
            offset += 4;
            length -= 4;
            value = (char*) tvb_get_ephemeral_string (tvb, offset, vallen);
            offset += vallen;
            length -= vallen;
            break;
        case 'I':
            typename = "integer";
            sprintf (buff, "%ld", (long) tvb_get_ntohl (tvb, offset));
            value = buff;
            offset += 4;
            length -= 4;  
            break;
        case 'D':
            typename = "decimal";
            value = "...";
            offset += 5;
            length -= 5; 
            break;
        case 'T':
            typename =  "timestamp";
            value = "...";
            offset += 8;
            length -= 8; 
            break;
        case 'F':
            /*  TODO: make it recursive here  */
            typename =  "field table";
            vallen = tvb_get_ntohl (tvb, offset);
            offset += 4;
            length -= 4;
            value = "...";
            offset += vallen;
            length -= vallen;
            break;
        case 'V':
            typename = "void";
            value = "";
        default:
            typename = "invalid";
            value = "";
            break;
        }

        proto_tree_add_none_format(field_table_tree, hf_amqp_field, tvb,
            field_start, offset - field_start, "%s (%s): %s", name, typename,
            value);
    }
}

Attachment: amqp
Description: Binary data