[erlang-questions] testing ASN.1 compiled module returns error

Martin Dimitrov mrtndimitrov@REDACTED
Fri Nov 18 16:02:05 CET 2011


Hello,

I have an ASN.1 definition file (given bellow). It compiles all right
but when I test the ExtensionContainer type, it crashes with the following:

** exception error: no case clause matching
                    {error,
                        {asn1_error,nyi,
                            {'ObjectClassFieldType',
                                {'Externaltypereference',54,
                                   
'MAP-ExtensionDataTypes','MAP-EXTENSION'},
                                [],
                                {extensionId,[]},
                                {fixedtypevaluefield,extensionId,
                                    {type,[],'OBJECT
IDENTIFIER',[],[],no}}}}}
     in function  asn1ct:test/2
     in call from asn1ct:test_each/2

I traced the error to asn1ct_value:get_type_prim(D,Erule) where the
D#type.def equals to:

 {'ObjectClassFieldType',
     {'Externaltypereference',54,'MAP-ExtensionDataTypes',
         'MAP-EXTENSION'},
     [],
     {extensionId,[]},
     {fixedtypevaluefield,extensionId,
         {type,[],'OBJECT IDENTIFIER',[],[],no}}}

The case clause in the function doesn't have such a match. That is why
XX ->
        exit({asn1_error,nyi,XX})
is executed.

Can anyone bring some light to this problem? Isn't
'ObjectClassFieldType' supported by the current implementation of ASN.1
in Erlang?

Thanks a lot.

Martin


-- $Id: MAP-ExtensionDataTypes.asn 24270 2008-02-05 06:10:34Z etxrab $
-- MAP-ExtensionDataTypes.asn
--
-- Taken from 3GPP TS 29.002 V8.4.0 (2007-12)
--
http://www.3gpp.org/ftp/Specs/archive/29_series/29.002/29002-840.zip/29002-840.doc
--
-- 17.7.11 Extension data types
--

MAP-ExtensionDataTypes {
   itu-t identified-organization (4) etsi (0) mobileDomain (0)
   gsm-Network (1) modules (3) map-ExtensionDataTypes (21) version11 (11)}

DEFINITIONS

IMPLICIT TAGS

::=

BEGIN

EXPORTS

    PrivateExtension,
    ExtensionContainer,
    SLR-ArgExtensionContainer;


-- IOC for private MAP extensions


MAP-EXTENSION  ::= CLASS {
    &ExtensionType                OPTIONAL,
    &extensionId     OBJECT IDENTIFIER }
    -- The length of the Object Identifier shall not exceed 16 octets
and the
    -- number of components of the Object Identifier shall not exceed 16

-- data types

ExtensionContainer ::= SEQUENCE {
    privateExtensionList    [0]PrivateExtensionList    OPTIONAL,
    pcs-Extensions    [1]PCS-Extensions    OPTIONAL,
    ...}

SLR-ArgExtensionContainer ::= SEQUENCE {
    privateExtensionList    [0]PrivateExtensionList    OPTIONAL,
    slr-Arg-PCS-Extensions    [1]SLR-Arg-PCS-Extensions    OPTIONAL,
    ...}

PrivateExtensionList ::= SEQUENCE SIZE (1..maxNumOfPrivateExtensions) OF
                PrivateExtension

PrivateExtension ::= SEQUENCE {
    extId        MAP-EXTENSION.&extensionId
                ({ExtensionSet}),
    extType        MAP-EXTENSION.&ExtensionType
                ({ExtensionSet}{@extId})    OPTIONAL}

maxNumOfPrivateExtensions  INTEGER ::= 10

ExtensionSet        MAP-EXTENSION ::=
        {...
         -- ExtensionSet is the set of all defined private extensions
    }
    -- Unsupported private extensions shall be discarded if received.

PCS-Extensions ::= SEQUENCE {
    ...}

SLR-Arg-PCS-Extensions ::= SEQUENCE {
    ...,
    na-ESRK-Request    [0]    NULL        OPTIONAL }

END




More information about the erlang-questions mailing list