diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /epan/dissectors/asn1/goose/goose.cnf | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/asn1/goose/goose.cnf')
-rw-r--r-- | epan/dissectors/asn1/goose/goose.cnf | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/goose/goose.cnf b/epan/dissectors/asn1/goose/goose.cnf new file mode 100644 index 00000000..b0c84ffe --- /dev/null +++ b/epan/dissectors/asn1/goose/goose.cnf @@ -0,0 +1,96 @@ +# goose.cnf +# goose conformation file + +#.MODULE_IMPORT + +#.EXPORTS + +#.PDU + +#.NO_EMIT ONLY_VALS +GOOSEpdu + +#.FN_BODY IECGoosePdu/simulation VAL_PTR = &value + bool value; + guint32 len = tvb_reported_length_remaining(tvb, offset); + int origin_offset = offset; +%(DEFAULT_BODY)s + if((actx->private_data) && (actx->created_item)){ + goose_chk_data_t *data_chk = (goose_chk_data_t *)actx->private_data; + proto_tree *expert_inf_tree = NULL; + /* S bit set and Simulation attribute clear: reject as invalid GOOSE */ + if((data_chk->s_bit == TRUE) && (value == FALSE)){ + /* It really looks better showed as a new subtree */ + expert_inf_tree = proto_item_add_subtree(actx->created_item, ett_expert_inf_sim); + proto_tree_add_expert(expert_inf_tree, actx->pinfo, &ei_goose_invalid_sim, tvb, origin_offset, len); + } + } +#.END + +#.FN_BODY UtcTime + + guint32 len; + guint32 seconds; + guint32 fraction; + guint32 nanoseconds; + nstime_t ts; + gchar * ptime; + + len = tvb_reported_length_remaining(tvb, offset); + + if(len != 8) + { + proto_tree_add_expert(tree, actx->pinfo, &ei_goose_mal_utctime, tvb, offset, len); + if(hf_index >= 0) + { + proto_tree_add_string(tree, hf_index, tvb, offset, len, "????"); + } + return offset; + } + + seconds = tvb_get_ntohl(tvb, offset); + fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */ + nanoseconds = (guint32)( ((guint64)fraction * G_GUINT64_CONSTANT(1000000000)) / G_GUINT64_CONSTANT(0x100000000) ) ; + + ts.secs = seconds; + ts.nsecs = nanoseconds; + + ptime = abs_time_to_str(actx->pinfo->pool, &ts, ABSOLUTE_TIME_UTC, TRUE); + + if(hf_index >= 0) + { + proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime); + } + +#.END + +#.FN_BODY FloatingPoint + + 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); + } + +#.END + +#.TYPE_ATTR +UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE + + +#.FIELD_RENAME +GetReferenceRequestPdu/offset getReferenceRequest_offset +GSEMngtResponses/getGsReference gseMngtResponses_GetGSReference +GSEMngtResponses/getGoReference gseMngtResponses_GetGOReference +GSEMngtResponses/getGSSEDataOffset gseMngtResponses_GetGSSEDataOffset +GSEMngtResponses/getGOOSEElementNumber gseMngtResponses_GetGOOSEElementNumber + +#.FIELD_ATTR +IECGoosePdu/stNum TYPE = FT_UINT32 DISPLAY = BASE_DEC +IECGoosePdu/sqNum TYPE = FT_UINT32 DISPLAY = BASE_DEC +GetReferenceRequestPdu/offset ABBREV=getReferenceRequest.offset +IECGoosePdu/simulation BLURB = "BOOLEAN" +#.END |