Function amqp_decode_method

Synopsis

#include <librabbitmq/amqp_framing.h>

int amqp_decode_method(amqp_method_number_t methodNumber, amqp_pool_t *pool, amqp_bytes_t encoded, void **decoded)

Description

Decodes a method from AMQP wireformat

Parameters:

[ in ] methodNumber - the method number for the decoded parameter

[ in ] pool - the memory pool to allocate the decoded method from

[ in ] encoded - the encoded byte string buffer

[ out ] decoded - pointer to the decoded method struct

Return
0 on success, an error code otherwise

Source

Lines 283-1404 in librabbitmq/amqp_framing.c. Line 134 in librabbitmq/amqp_framing.h.

int amqp_decode_method(amqp_method_number_t methodNumber, amqp_pool_t *pool,
                       amqp_bytes_t encoded, void **decoded) {
  size_t offset = 0;
  uint8_t bit_buffer;

  switch (methodNumber) {
    case AMQP_CONNECTION_START_METHOD: {
      amqp_connection_start_t *m = (amqp_connection_start_t *)amqp_pool_alloc(
          pool, sizeof(amqp_connection_start_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &m->version_major))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &m->version_minor))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        int res =
            amqp_decode_table(encoded, pool, &(m->server_properties), &offset);
        if (res < 0) return res;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->mechanisms, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->locales, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_START_OK_METHOD: {
      amqp_connection_start_ok_t *m =
          (amqp_connection_start_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_start_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        int res =
            amqp_decode_table(encoded, pool, &(m->client_properties), &offset);
        if (res < 0) return res;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->mechanism, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->response, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->locale, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_SECURE_METHOD: {
      amqp_connection_secure_t *m = (amqp_connection_secure_t *)amqp_pool_alloc(
          pool, sizeof(amqp_connection_secure_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->challenge, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_SECURE_OK_METHOD: {
      amqp_connection_secure_ok_t *m =
          (amqp_connection_secure_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_secure_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->response, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_TUNE_METHOD: {
      amqp_connection_tune_t *m = (amqp_connection_tune_t *)amqp_pool_alloc(
          pool, sizeof(amqp_connection_tune_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->channel_max))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_32(encoded, &offset, &m->frame_max))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_16(encoded, &offset, &m->heartbeat))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_TUNE_OK_METHOD: {
      amqp_connection_tune_ok_t *m =
          (amqp_connection_tune_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_tune_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->channel_max))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_32(encoded, &offset, &m->frame_max))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_16(encoded, &offset, &m->heartbeat))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_OPEN_METHOD: {
      amqp_connection_open_t *m = (amqp_connection_open_t *)amqp_pool_alloc(
          pool, sizeof(amqp_connection_open_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->virtual_host, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->capabilities, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->insist = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_OPEN_OK_METHOD: {
      amqp_connection_open_ok_t *m =
          (amqp_connection_open_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_open_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->known_hosts, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_CLOSE_METHOD: {
      amqp_connection_close_t *m = (amqp_connection_close_t *)amqp_pool_alloc(
          pool, sizeof(amqp_connection_close_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->reply_code))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_16(encoded, &offset, &m->class_id))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_16(encoded, &offset, &m->method_id))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_CLOSE_OK_METHOD: {
      amqp_connection_close_ok_t *m =
          (amqp_connection_close_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_close_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_BLOCKED_METHOD: {
      amqp_connection_blocked_t *m =
          (amqp_connection_blocked_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_blocked_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->reason, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONNECTION_UNBLOCKED_METHOD: {
      amqp_connection_unblocked_t *m =
          (amqp_connection_unblocked_t *)amqp_pool_alloc(
              pool, sizeof(amqp_connection_unblocked_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_OPEN_METHOD: {
      amqp_channel_open_t *m = (amqp_channel_open_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_open_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->out_of_band, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_OPEN_OK_METHOD: {
      amqp_channel_open_ok_t *m = (amqp_channel_open_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_open_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint32_t len;
        if (!amqp_decode_32(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->channel_id, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_FLOW_METHOD: {
      amqp_channel_flow_t *m = (amqp_channel_flow_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_flow_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->active = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_FLOW_OK_METHOD: {
      amqp_channel_flow_ok_t *m = (amqp_channel_flow_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_flow_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->active = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_CLOSE_METHOD: {
      amqp_channel_close_t *m = (amqp_channel_close_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_close_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->reply_code))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_16(encoded, &offset, &m->class_id))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_16(encoded, &offset, &m->method_id))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_CHANNEL_CLOSE_OK_METHOD: {
      amqp_channel_close_ok_t *m = (amqp_channel_close_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_channel_close_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_ACCESS_REQUEST_METHOD: {
      amqp_access_request_t *m = (amqp_access_request_t *)amqp_pool_alloc(
          pool, sizeof(amqp_access_request_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->realm, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->exclusive = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->passive = (bit_buffer & (1 << 1)) ? 1 : 0;
      m->active = (bit_buffer & (1 << 2)) ? 1 : 0;
      m->write = (bit_buffer & (1 << 3)) ? 1 : 0;
      m->read = (bit_buffer & (1 << 4)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_ACCESS_REQUEST_OK_METHOD: {
      amqp_access_request_ok_t *m = (amqp_access_request_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_access_request_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_DECLARE_METHOD: {
      amqp_exchange_declare_t *m = (amqp_exchange_declare_t *)amqp_pool_alloc(
          pool, sizeof(amqp_exchange_declare_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->type, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->passive = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->durable = (bit_buffer & (1 << 1)) ? 1 : 0;
      m->auto_delete = (bit_buffer & (1 << 2)) ? 1 : 0;
      m->internal = (bit_buffer & (1 << 3)) ? 1 : 0;
      m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_DECLARE_OK_METHOD: {
      amqp_exchange_declare_ok_t *m =
          (amqp_exchange_declare_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_exchange_declare_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_DELETE_METHOD: {
      amqp_exchange_delete_t *m = (amqp_exchange_delete_t *)amqp_pool_alloc(
          pool, sizeof(amqp_exchange_delete_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->if_unused = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->nowait = (bit_buffer & (1 << 1)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_DELETE_OK_METHOD: {
      amqp_exchange_delete_ok_t *m =
          (amqp_exchange_delete_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_exchange_delete_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_BIND_METHOD: {
      amqp_exchange_bind_t *m = (amqp_exchange_bind_t *)amqp_pool_alloc(
          pool, sizeof(amqp_exchange_bind_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->destination, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->source, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_BIND_OK_METHOD: {
      amqp_exchange_bind_ok_t *m = (amqp_exchange_bind_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_exchange_bind_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_UNBIND_METHOD: {
      amqp_exchange_unbind_t *m = (amqp_exchange_unbind_t *)amqp_pool_alloc(
          pool, sizeof(amqp_exchange_unbind_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->destination, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->source, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_EXCHANGE_UNBIND_OK_METHOD: {
      amqp_exchange_unbind_ok_t *m =
          (amqp_exchange_unbind_ok_t *)amqp_pool_alloc(
              pool, sizeof(amqp_exchange_unbind_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_DECLARE_METHOD: {
      amqp_queue_declare_t *m = (amqp_queue_declare_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_declare_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->passive = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->durable = (bit_buffer & (1 << 1)) ? 1 : 0;
      m->exclusive = (bit_buffer & (1 << 2)) ? 1 : 0;
      m->auto_delete = (bit_buffer & (1 << 3)) ? 1 : 0;
      m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_DECLARE_OK_METHOD: {
      amqp_queue_declare_ok_t *m = (amqp_queue_declare_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_declare_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_32(encoded, &offset, &m->message_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_32(encoded, &offset, &m->consumer_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_BIND_METHOD: {
      amqp_queue_bind_t *m =
          (amqp_queue_bind_t *)amqp_pool_alloc(pool, sizeof(amqp_queue_bind_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_BIND_OK_METHOD: {
      amqp_queue_bind_ok_t *m = (amqp_queue_bind_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_bind_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_PURGE_METHOD: {
      amqp_queue_purge_t *m = (amqp_queue_purge_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_purge_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_PURGE_OK_METHOD: {
      amqp_queue_purge_ok_t *m = (amqp_queue_purge_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_purge_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_32(encoded, &offset, &m->message_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_DELETE_METHOD: {
      amqp_queue_delete_t *m = (amqp_queue_delete_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_delete_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->if_unused = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->if_empty = (bit_buffer & (1 << 1)) ? 1 : 0;
      m->nowait = (bit_buffer & (1 << 2)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_DELETE_OK_METHOD: {
      amqp_queue_delete_ok_t *m = (amqp_queue_delete_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_delete_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_32(encoded, &offset, &m->message_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_UNBIND_METHOD: {
      amqp_queue_unbind_t *m = (amqp_queue_unbind_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_unbind_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_QUEUE_UNBIND_OK_METHOD: {
      amqp_queue_unbind_ok_t *m = (amqp_queue_unbind_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_queue_unbind_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_QOS_METHOD: {
      amqp_basic_qos_t *m =
          (amqp_basic_qos_t *)amqp_pool_alloc(pool, sizeof(amqp_basic_qos_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_32(encoded, &offset, &m->prefetch_size))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_16(encoded, &offset, &m->prefetch_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->global = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_QOS_OK_METHOD: {
      amqp_basic_qos_ok_t *m = (amqp_basic_qos_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_qos_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_CONSUME_METHOD: {
      amqp_basic_consume_t *m = (amqp_basic_consume_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_consume_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->no_local = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->no_ack = (bit_buffer & (1 << 1)) ? 1 : 0;
      m->exclusive = (bit_buffer & (1 << 2)) ? 1 : 0;
      m->nowait = (bit_buffer & (1 << 3)) ? 1 : 0;
      {
        int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
        if (res < 0) return res;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_CONSUME_OK_METHOD: {
      amqp_basic_consume_ok_t *m = (amqp_basic_consume_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_consume_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_CANCEL_METHOD: {
      amqp_basic_cancel_t *m = (amqp_basic_cancel_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_cancel_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_CANCEL_OK_METHOD: {
      amqp_basic_cancel_ok_t *m = (amqp_basic_cancel_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_cancel_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_PUBLISH_METHOD: {
      amqp_basic_publish_t *m = (amqp_basic_publish_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_publish_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->mandatory = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->immediate = (bit_buffer & (1 << 1)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_RETURN_METHOD: {
      amqp_basic_return_t *m = (amqp_basic_return_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_return_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->reply_code))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_DELIVER_METHOD: {
      amqp_basic_deliver_t *m = (amqp_basic_deliver_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_deliver_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_64(encoded, &offset, &m->delivery_tag))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->redelivered = (bit_buffer & (1 << 0)) ? 1 : 0;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_GET_METHOD: {
      amqp_basic_get_t *m =
          (amqp_basic_get_t *)amqp_pool_alloc(pool, sizeof(amqp_basic_get_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_16(encoded, &offset, &m->ticket))
        return AMQP_STATUS_BAD_AMQP_DATA;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->queue, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->no_ack = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_GET_OK_METHOD: {
      amqp_basic_get_ok_t *m = (amqp_basic_get_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_get_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_64(encoded, &offset, &m->delivery_tag))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->redelivered = (bit_buffer & (1 << 0)) ? 1 : 0;
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      if (!amqp_decode_32(encoded, &offset, &m->message_count))
        return AMQP_STATUS_BAD_AMQP_DATA;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_GET_EMPTY_METHOD: {
      amqp_basic_get_empty_t *m = (amqp_basic_get_empty_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_get_empty_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      {
        uint8_t len;
        if (!amqp_decode_8(encoded, &offset, &len) ||
            !amqp_decode_bytes(encoded, &offset, &m->cluster_id, len))
          return AMQP_STATUS_BAD_AMQP_DATA;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_ACK_METHOD: {
      amqp_basic_ack_t *m =
          (amqp_basic_ack_t *)amqp_pool_alloc(pool, sizeof(amqp_basic_ack_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_64(encoded, &offset, &m->delivery_tag))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->multiple = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_REJECT_METHOD: {
      amqp_basic_reject_t *m = (amqp_basic_reject_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_reject_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_64(encoded, &offset, &m->delivery_tag))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_RECOVER_ASYNC_METHOD: {
      amqp_basic_recover_async_t *m =
          (amqp_basic_recover_async_t *)amqp_pool_alloc(
              pool, sizeof(amqp_basic_recover_async_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_RECOVER_METHOD: {
      amqp_basic_recover_t *m = (amqp_basic_recover_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_recover_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_RECOVER_OK_METHOD: {
      amqp_basic_recover_ok_t *m = (amqp_basic_recover_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_basic_recover_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_BASIC_NACK_METHOD: {
      amqp_basic_nack_t *m =
          (amqp_basic_nack_t *)amqp_pool_alloc(pool, sizeof(amqp_basic_nack_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_64(encoded, &offset, &m->delivery_tag))
        return AMQP_STATUS_BAD_AMQP_DATA;
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->multiple = (bit_buffer & (1 << 0)) ? 1 : 0;
      m->requeue = (bit_buffer & (1 << 1)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_TX_SELECT_METHOD: {
      amqp_tx_select_t *m =
          (amqp_tx_select_t *)amqp_pool_alloc(pool, sizeof(amqp_tx_select_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_TX_SELECT_OK_METHOD: {
      amqp_tx_select_ok_t *m = (amqp_tx_select_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_tx_select_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_TX_COMMIT_METHOD: {
      amqp_tx_commit_t *m =
          (amqp_tx_commit_t *)amqp_pool_alloc(pool, sizeof(amqp_tx_commit_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_TX_COMMIT_OK_METHOD: {
      amqp_tx_commit_ok_t *m = (amqp_tx_commit_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_tx_commit_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_TX_ROLLBACK_METHOD: {
      amqp_tx_rollback_t *m = (amqp_tx_rollback_t *)amqp_pool_alloc(
          pool, sizeof(amqp_tx_rollback_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_TX_ROLLBACK_OK_METHOD: {
      amqp_tx_rollback_ok_t *m = (amqp_tx_rollback_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_tx_rollback_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    case AMQP_CONFIRM_SELECT_METHOD: {
      amqp_confirm_select_t *m = (amqp_confirm_select_t *)amqp_pool_alloc(
          pool, sizeof(amqp_confirm_select_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      if (!amqp_decode_8(encoded, &offset, &bit_buffer))
        return AMQP_STATUS_BAD_AMQP_DATA;
      m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
      *decoded = m;
      return 0;
    }
    case AMQP_CONFIRM_SELECT_OK_METHOD: {
      amqp_confirm_select_ok_t *m = (amqp_confirm_select_ok_t *)amqp_pool_alloc(
          pool, sizeof(amqp_confirm_select_ok_t));
      if (m == NULL) {
        return AMQP_STATUS_NO_MEMORY;
      }
      *decoded = m;
      return 0;
    }
    default:
      return AMQP_STATUS_UNKNOWN_METHOD;
  }
}





Add Discussion as Guest

Log in to DocsForge