From a1c55f2356c90dbd60861e33270f875b24734346 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Tue, 1 Nov 2022 14:02:43 +0000 Subject: [PATCH] GOOSE: add back goose.floating_point filter Let's add it as a hidden filter for IEEE 754 single precision floating point Closes #18491 --- epan/dissectors/asn1/goose/goose.cnf | 5 ++--- epan/dissectors/packet-goose.c | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/epan/dissectors/asn1/goose/goose.cnf b/epan/dissectors/asn1/goose/goose.cnf index d70db3fb48..26289e1250 100644 --- a/epan/dissectors/asn1/goose/goose.cnf +++ b/epan/dissectors/asn1/goose/goose.cnf @@ -68,12 +68,11 @@ GOOSEpdu int len = tvb_reported_length_remaining(tvb, offset); + %(DEFAULT_BODY)s if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){ /* IEEE 754 single precision floating point */ + proto_item_set_hidden(actx->created_item); proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN); - offset = len; - }else{ - %(DEFAULT_BODY)s } #.END diff --git a/epan/dissectors/packet-goose.c b/epan/dissectors/packet-goose.c index 3989d4251b..ec72d1a0cb 100644 --- a/epan/dissectors/packet-goose.c +++ b/epan/dissectors/packet-goose.c @@ -626,14 +626,13 @@ dissect_goose_FloatingPoint(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of int len = tvb_reported_length_remaining(tvb, offset); - if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){ - /* IEEE 754 single precision floating point */ - proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN); - offset = len; - }else{ - offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); + if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){ + /* IEEE 754 single precision floating point */ + proto_item_set_hidden(actx->created_item); + proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN); }