diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-01-21 12:21:29 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-01-21 12:21:29 +0000 |
commit | 37b1c97c13aa05c6eb44687d95409709a46b0070 (patch) | |
tree | 1f46c927d6bdbdb46be081dd4936a0c8f6bac074 | |
parent | 00bf1ba8d3eec4fc5ee3c2c47921d9e821447213 (diff) |
From Martin Lutz:
Updated the GOOSE dissector ASN.1 file to be able to display data for UTC timestamps.
svn path=/trunk/; revision=40628
-rw-r--r-- | asn1/goose/goose.asn | 38 | ||||
-rw-r--r-- | epan/dissectors/packet-goose.c | 41 |
2 files changed, 64 insertions, 15 deletions
diff --git a/asn1/goose/goose.asn b/asn1/goose/goose.asn index 5247ac98a6..3caf0c2813 100644 --- a/asn1/goose/goose.asn +++ b/asn1/goose/goose.asn @@ -116,21 +116,29 @@ UtcTime ::= OCTET STRING -- format and size defined in 8.1.3.6. TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) FloatingPoint ::= OCTET STRING -Data ::= CHOICE { + +Data ::= CHOICE + { -- context tag 0 is reserved for AccessResult - array [1] IMPLICIT SEQUENCE OF Data, - structure [2] IMPLICIT SEQUENCE OF Data, - boolean [3] IMPLICIT BOOLEAN, - bit-string [4] IMPLICIT BIT STRING, - integer [5] IMPLICIT INTEGER, - unsigned [6] IMPLICIT INTEGER, - floating-point [7] IMPLICIT FloatingPoint, - real [8] IMPLICIT REAL, - octet-string [9] IMPLICIT OCTET STRING, - visible-string [10] IMPLICIT VisibleString, - binary-time [12] IMPLICIT TimeOfDay, - bcd [13] IMPLICIT INTEGER, - booleanArray [14] IMPLICIT BIT STRING -} + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating-point [7] IMPLICIT FloatingPoint, + real [8] IMPLICIT REAL, + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING, + objId [15] IMPLICIT OBJECT IDENTIFIER, + ..., + mMSString [16] IMPLICIT MMSString, + utc-time [17] IMPLICIT UtcTime -- added by IEC61850 8.1 G3 + } + +MMSString ::= UTF8String END diff --git a/epan/dissectors/packet-goose.c b/epan/dissectors/packet-goose.c index 4fd51b25f0..12afd42c91 100644 --- a/epan/dissectors/packet-goose.c +++ b/epan/dissectors/packet-goose.c @@ -115,6 +115,9 @@ static int hf_goose_visible_string = -1; /* VisibleString */ static int hf_goose_binary_time = -1; /* TimeOfDay */ static int hf_goose_bcd = -1; /* INTEGER */ static int hf_goose_booleanArray = -1; /* BIT_STRING */ +static int hf_goose_objId = -1; /* OBJECT_IDENTIFIER */ +static int hf_goose_mMSString = -1; /* MMSString */ +static int hf_goose_utc_time = -1; /* UtcTime */ /*--- End of included file: packet-goose-hf.c ---*/ #line 52 "../../asn1/goose/packet-goose-template.c" @@ -594,6 +597,26 @@ dissect_goose_TimeOfDay(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset } + +static int +dissect_goose_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); + + return offset; +} + + + +static int +dissect_goose_MMSString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String, + actx, tree, tvb, offset, hf_index, + NULL); + + return offset; +} + + static const value_string goose_Data_vals[] = { { 1, "array" }, { 2, "structure" }, @@ -608,6 +631,9 @@ static const value_string goose_Data_vals[] = { { 12, "binary-time" }, { 13, "bcd" }, { 14, "booleanArray" }, + { 15, "objId" }, + { 16, "mMSString" }, + { 17, "utc-time" }, { 0, NULL } }; @@ -625,6 +651,9 @@ static const ber_choice_t Data_choice[] = { { 12, &hf_goose_binary_time , BER_CLASS_CON, 12, BER_FLAGS_IMPLTAG, dissect_goose_TimeOfDay }, { 13, &hf_goose_bcd , BER_CLASS_CON, 13, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER }, { 14, &hf_goose_booleanArray , BER_CLASS_CON, 14, BER_FLAGS_IMPLTAG, dissect_goose_BIT_STRING }, + { 15, &hf_goose_objId , BER_CLASS_CON, 15, BER_FLAGS_IMPLTAG, dissect_goose_OBJECT_IDENTIFIER }, + { 16, &hf_goose_mMSString , BER_CLASS_CON, 16, BER_FLAGS_IMPLTAG, dissect_goose_MMSString }, + { 17, &hf_goose_utc_time , BER_CLASS_CON, 17, BER_FLAGS_IMPLTAG, dissect_goose_UtcTime }, { 0, NULL, 0, 0, 0, NULL } }; @@ -987,6 +1016,18 @@ void proto_register_goose(void) { { "booleanArray", "goose.booleanArray", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING", HFILL }}, + { &hf_goose_objId, + { "objId", "goose.objId", + FT_OID, BASE_NONE, NULL, 0, + "OBJECT_IDENTIFIER", HFILL }}, + { &hf_goose_mMSString, + { "mMSString", "goose.mMSString", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL }}, + { &hf_goose_utc_time, + { "utc-time", "goose.utc_time", + FT_STRING, BASE_NONE, NULL, 0, + "UtcTime", HFILL }}, /*--- End of included file: packet-goose-hfarr.c ---*/ #line 133 "../../asn1/goose/packet-goose-template.c" |