AMQP 1.0: Don't treat decimal[32|64|128] as packet errors

Packets with a decimal datatype should be correctly dissected.
Yet, we still cannot display the decimal floating-point numbers as
there is no support in printf and glib.

Change-Id: I48a6dafd1e12ab55f660fad37a759dd16a9cf4b1
Reviewed-on: https://code.wireshark.org/review/8902
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Petr Gotthard 2015-06-12 15:41:04 -07:00 committed by Pascal Quantin
parent de3997e4d0
commit 70fa77f1a3
1 changed files with 19 additions and 1 deletions

View File

@ -1082,6 +1082,11 @@ format_amqp_1_0_double(tvbuff_t *tvb,
guint offset, guint bound _U_, guint length _U_,
const char **value);
static int
format_amqp_1_0_decimal(tvbuff_t *tvb _U_,
guint offset _U_, guint bound _U_, guint length,
const char **value);
static int
format_amqp_1_0_char(tvbuff_t *tvb,
guint offset, guint bound _U_, guint length _U_,
@ -2784,6 +2789,9 @@ static struct amqp_typeinfo amqp_1_0_fixed_types[] = {
{ 0x55, "smalllong", format_amqp_1_0_int, 1 },
{ 0x72, "float", format_amqp_1_0_float, 4 },
{ 0x82, "double", format_amqp_1_0_double, 8 },
{ 0x74, "decimal32", format_amqp_1_0_decimal, 4 },
{ 0x84, "decimal64", format_amqp_1_0_decimal, 8 },
{ 0x94, "decimal128", format_amqp_1_0_decimal, 16 },
{ 0x73, "char", format_amqp_1_0_char, 4 },
{ 0x83, "timestamp", format_amqp_1_0_timestamp, 8 },
{ 0x98, "uuid", format_amqp_1_0_uuid, 16 },
@ -10943,7 +10951,17 @@ format_amqp_1_0_double(tvbuff_t *tvb,
return 8;
}
/* TODO: add AMQP 1.0 decimal[32|64|128] primitive types */
static int
format_amqp_1_0_decimal(tvbuff_t *tvb _U_,
guint offset _U_, guint bound _U_, guint length,
const char **value)
{
/* TODO: this requires the _Decimal32 datatype from ISO/IEC TR 24732
* and corresponding support in printf and glib
*/
*value = wmem_strdup_printf(wmem_packet_scope(), "(not supported)");
return length;
}
static int
format_amqp_1_0_char(tvbuff_t *tvb,