--/////////////////////////////////////////////////////////////////////////////
-- Copyright (c) 2000-2021 Ericsson Telecom AB
-- All rights reserved. This program and the accompanying materials
-- are made available under the terms of the Eclipse Public License v2.0
-- which accompanies this distribution, and is available at
-- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
--
-- Contributors:
--   Balasko, Jeno
--   Kulcsar, Endre
--   Szabados, Kristof
--
--/////////////////////////////////////////////////////////////////////////////
Test4  --X.683 - parameters

DEFINITIONS

AUTOMATIC TAGS

::=

BEGIN
--***************************************************************************************************
--PARAMETRIZED TYPES (SEQUENCE, SET, CHOICE, SEQUENCE OF, SET OF, INTEGER, BIT STRING, OCTET STRING)
--***************************************************************************************************

--SEQUENCE
MyParametrizedSequenceType{Field1Type,Field2Type}
::= SEQUENCE
	{field1 Field1Type,
	 field2  Field2Type}

myParametrizedSequenceValue1  MyParametrizedSequenceType{INTEGER, BIT STRING}
::=   {
       field1 5,
       field2 '00110011'B
      }

myParametrizedSequenceValue2  MyParametrizedSequenceType{INTEGER(0..3), BIT STRING (SIZE(1..5))}
::=   {
       field1 1,
       field2 '001'B
      }

-- parametrized type in a parametrized type

myParametrizedSequenceValue3  MyParametrizedSequenceType
{ MyParametrizedSetType{INTEGER, BIT STRING}, MyParametrizedChoiceType{INTEGER, BIT STRING}}
::=
{

field1 {
       field2 '00110011'B,
       field1 5
       },

field2
      field1 : 5

}

MyParametrizedSequenceTypeAlias ::= MyParametrizedSequenceType{INTEGER, BIT STRING}

myParametrizedSequenceValue4 MyParametrizedSequenceTypeAlias ::=
{
       field1 5,
       field2 '00110011'B
      }

--SET

MyParametrizedSetType{Field1Type,Field2Type}
::= SET
	{field1 Field1Type,
	 field2  Field2Type}

myParametrizedSetValue1  MyParametrizedSetType{INTEGER, BIT STRING}
::=   {

       field2 '00110011'B,
       field1 5
      }

myParametrizedSetValue2  MyParametrizedSetType{INTEGER(0..3), BIT STRING(SIZE(1..5))}
::=   {
       field2 '10'B,
       field1 3
      }

MyParametrizedSetTypeAlias ::= MyParametrizedSetType{INTEGER, BIT STRING}

myParametrizedSetValue4 MyParametrizedSetTypeAlias ::=
    {
     field2 '00110011'B,
     field1 5
    }

--CHOICE

MyParametrizedChoiceType{Field1Type,Field2Type}
::= CHOICE
	{field1 Field1Type,
	 field2  Field2Type}

myParametrizedChoiceValue1  MyParametrizedChoiceType{INTEGER, BIT STRING}
::=
      field1 : 5

MyParametrizedChoiceTypeAlias ::= MyParametrizedChoiceType{INTEGER, BIT STRING}

myParametrizedChoiceValue4 MyParametrizedChoiceTypeAlias ::=

      field2 : '001100'B

--SEQUENCE OF

MyParametrizedSequenceOfType{Field1Type}
::= SEQUENCE OF Field1Type

myParametrizedSequenceOfValue1  MyParametrizedSequenceOfType{BIT STRING}
::=   { '00'B, '11'B, '01'B    }

MyParametrizedSequenceOfTypeAlias ::= MyParametrizedSequenceOfType{BIT STRING}

myParametrizedSequenceOfValue4 MyParametrizedSequenceOfTypeAlias ::=
{  '11'B , '01'B    }

--SET OF

MyParametrizedSetOfType{Field1Type}
::= SET OF Field1Type

myParametrizedSetOfValue1  MyParametrizedSetOfType{INTEGER}
::=   { 3,6,777 }

MyParametrizedSetOfTypeAlias ::= MyParametrizedSetOfType{INTEGER}

myParametrizedSetOfValue4 MyParametrizedSetOfTypeAlias ::=
{ 3,6,777,5,3   }

-- INTEGER

     --Matyastol
MyParametrizedIntegerType1 {MyInt:par-int} ::= INTEGER {namednum(par-int), namednum2(ketto)}
ketto INTEGER ::= 2
MyInt ::= INTEGER {harom(3)}

myParametrizedIntegrValue1 MyParametrizedIntegerType1{ 4 } ::= 6

myParametrizedIntegrValue2 MyParametrizedIntegerType1{ 4 } ::= 4

myParametrizedIntegrValue3 MyParametrizedIntegerType1{ 4 } ::= namednum

MyParametrizedIntegerType2 {MyInt2:par-int2} ::= INTEGER (par-int2.. 10)

myParametrizedIntegerValue4 MyParametrizedIntegerType2 {5} ::= 5

-- BIT STRING

MyParametrizedBitstringType1 {MyInt:par-int} ::= BIT STRING {namedbit(par-int), namedbit2 (3)}

myParametrizedBitstringValue1 MyParametrizedBitstringType1{2} ::= '0000'B

myParametrizedBitstringValue2 MyParametrizedBitstringType1{2} ::= {namedbit}

myParametrizedBitstringValue3 MyParametrizedBitstringType1{2} ::= {namedbit2}

MyParametrizedBitstringType2  {MyInt2:par-int2} ::= BIT STRING (SIZE (par-int2.. 10))

myParametrizedBitstringValue4 MyParametrizedBitstringType2{3} ::= '00000'B

-- OCTET STRING
MyParametrizedOctetstringType1  {MyInt:par-int} ::= OCTET STRING (SIZE (par-int.. 10))

myParametrizedOctetstringValue1 MyParametrizedOctetstringType1{3} ::= 'FF00AA'H

-- ENUMERATED
MyParametrizedEnumeratedType1  {MyInt:par-int} ::= ENUMERATED {a(par-int) ,b, ..., c}

myParametrizedEnumeratedValue1 MyParametrizedEnumeratedType1{0} ::= a

--***************************************************************************************************
--PARAMETRIZED VALUES ********************************************************
--***************************************************************************************************

myIntegerValue1 { INTEGER : par-int} INTEGER ::= par-int

myIntegerValue2 INTEGER ::= myIntegerValue1 {3}

myBitstringValue1 { BIT STRING : par-bitstring} BIT STRING ::= par-bitstring

myBitstringValue2 BIT STRING ::= myBitstringValue1{'0011'B}

myOctetstringValue1 {OCTET STRING : par-octetstring} OCTET STRING::= par-octetstring

myOctetstringValue2 OCTET STRING ::= myOctetstringValue1{'FFFF'H}

myEnumeratedValue1 {ENUMERATED{a,b,c} : par-enum} ENUMERATED{a,b,c} ::= par-enum

--myEnumeratedValue2 ENUMERATED{a,b,c} ::= myEnumeratedValue1{a}

myBooleanValue1 {BOOLEAN : par-boolean} BOOLEAN ::= par-boolean

myBooleanValue2 BOOLEAN ::= myBooleanValue1{TRUE}

myNullValue1 {NULL : par-null} NULL ::= par-null

myNullValue2 NULL ::= myNullValue1{NULL}

myRealValue1 {REAL : par-real} REAL ::= par-real

myRealValue2 REAL ::= 5.3    --myRealValue1{{mantissa 314159,base 10, exponent -10}}

mySequenceValue1 { INTEGER : par-int} SequenceAliasType ::= {field1 par-int}

mySequenceValue2   SequenceAliasType  ::= mySequenceValue1 {44}

SequenceAliasType ::= SEQUENCE {field1 INTEGER}

mySetValue1 { INTEGER : par-int} SetAliastype
::= {field1 par-int}

mySetValue2 SetAliastype ::= mySetValue1 {33}

SetAliastype ::= SET { field1 INTEGER }

myChoiceValue1 { INTEGER : par-int} ChoiceAliasType ::= field1 : par-int

myChoiceValue2 ChoiceAliasType ::= myChoiceValue1 {22}

ChoiceAliasType ::=  CHOICE {field1 INTEGER, field2 BOOLEAN}

mySequenceOfValue1 { INTEGER : par-int1, INTEGER : par-int2} SequenceOfAliasType ::=
{
par-int1,
par-int2,
4
}

mySequenceOfValue2 SequenceOfAliasType ::= mySequenceOfValue1{2,3}

SequenceOfAliasType ::= SEQUENCE OF INTEGER

mySetOfValue1 { BIT STRING : par-bitstring} SetOfAliasType ::= {par-bitstring, par-bitstring, '000111'B}

mySetOfValue2 SetOfAliasType ::= mySetOfValue1 {'000'B}

SetOfAliasType ::= SET OF BIT STRING

myIA5StringValue1 {IA5String : par-string} IA5String ::=  par-string

myIA5StringValue2 IA5String ::= myIA5StringValue1 {"hihi"}

--***************************************************************************************************
-- PARAMETRIZED VALUE SETS    TO BE ADDED
--***************************************************************************************************

--***************************************************************************************************
-- PARAMETRIZED OBJECT CLASS ************************************************************************
--***************************************************************************************************
MY-PARAMETRIZED-OBJECT-CLASS1
{PAR-ASN1-Type1,
 INTEGER : par-Value1,
 INTEGER : par-Value3,
 INTEGER : par-Value4,
 INTEGER : par-Value5,
 INTEGER : par-Value6
 }
::= CLASS
{
&TypeField OPTIONAL,
&fixedTypeValueField                 PAR-ASN1-Type1   UNIQUE OPTIONAL,
&additionalFieldforValueField1       INTEGER DEFAULT par-Value1,
&additionalFieldforValueField3       BIT STRING { first(par-Value3), second (1), last-in-first-octet(7) },
&additionalFieldforValueField4       ASN1-Type5,
&additionalFieldforValueField5       INTEGER (par-Value5..par-Value6)
}

MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE ::= MY-PARAMETRIZED-OBJECT-CLASS1
{
INTEGER,
111,
0,
2,
10,
18
}

myObject-1 MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE
::=
{
&TypeField                        ASN1-Type3,
&fixedTypeValueField              999,
&additionalFieldforValueField1     110,
&additionalFieldforValueField3   '00001111'B,
&additionalFieldforValueField4    a,
&additionalFieldforValueField5    11
}

--***************************************************************************************************
-- PARAMETRIZED OBJECT  *****************************************************************************
--***************************************************************************************************

myParametrizedObject-1

{PAR-ASN1-Type3, -- BIT STRING
INTEGER : par-int,
INTEGER : par-int2,
BIT STRING : par-bitstring,
ASN1-Type5 : par-enum,
INTEGER : par-int3
 }
MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE
::=
{
&TypeField                       PAR-ASN1-Type3,   -- BIT STRING
&fixedTypeValueField             par-int,
&additionalFieldforValueField1   par-int2,
&additionalFieldforValueField3   par-bitstring,
&additionalFieldforValueField4   par-enum,
&additionalFieldforValueField5   par-int3
}

myObject-2  MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE
::=
myParametrizedObject-1
{
  ASN1-Type3,
  66,
  88,
 '001100'B,
  a,
  6
}

-- ***************************************************************

ASN1-Type1 ::= INTEGER

ASN1-Type2 ::= BOOLEAN

ASN1-Type3 ::= BIT STRING

ASN1-Type4 ::= OCTET STRING

ASN1-Type5  ::= ENUMERATED {a(3) ,b, ..., c}

--***************************************************************************************************
-- PARAMETRIZED OBJECT SET **************************************************************************
--***************************************************************************************************

MY-PARAMETRIZED-OBJECT-SET1 {MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE : par-myObject-1,
MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE : par-myObject-2} MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE ::=
{
par-myObject-1|
par-myObject-2|
MY-OBJECT-SET2,
...
}

MY-OBJECT-SET2 MY-PARAMETRIZED-OBJECT-CLASS1-INSTANCE ::= {MY-PARAMETRIZED-OBJECT-SET1{myObject-1, myObject-2}}

-- RANAP specification ***************************************************************
-- using only (simpilfied) Reset and ResetResource elementary procedures CLASS1

RANAP-ELEMENTARY-PROCEDURES RANAP-ELEMENTARY-PROCEDURE ::= {
	RANAP-ELEMENTARY-PROCEDURES-CLASS-1
/*	 |
	RANAP-ELEMENTARY-PROCEDURES-CLASS-2	|
	RANAP-ELEMENTARY-PROCEDURES-CLASS-3	,
	...
*/

}

RANAP-ELEMENTARY-PROCEDURES-CLASS-1 RANAP-ELEMENTARY-PROCEDURE ::= {
/*
	iu-Release			|
	relocationPreparation		|
	relocationResourceAllocation	|
	relocationCancel		|
	sRNS-ContextTransfer		|
	securityModeControl		|
	dataVolumeReport		|
*/

	reset		|
	resetResource				,
	...
}

RANAP-ELEMENTARY-PROCEDURE ::= CLASS {
	&InitiatingMessage				,
	&SuccessfulOutcome				OPTIONAL,
	&UnsuccessfulOutcome				OPTIONAL,
	&Outcome					OPTIONAL,
	&procedureCode			ProcedureCode 	UNIQUE,
	&criticality			Criticality 	DEFAULT ignore
}
WITH SYNTAX {
	INITIATING MESSAGE		&InitiatingMessage
	[SUCCESSFUL OUTCOME		&SuccessfulOutcome]
	[UNSUCCESSFUL OUTCOME		&UnsuccessfulOutcome]
	[OUTCOME			&Outcome]
	PROCEDURE CODE				&procedureCode
	[CRITICALITY			&criticality]
}

RANAP-PDU ::= CHOICE {
	initiatingMessage	InitiatingMessage,
	successfulOutcome	SuccessfulOutcome,
	unsuccessfulOutcome	UnsuccessfulOutcome,
	outcome			Outcome,
	...
}

InitiatingMessage ::= SEQUENCE {
	procedureCode	RANAP-ELEMENTARY-PROCEDURE.&procedureCode	({RANAP-ELEMENTARY-PROCEDURES}),
	criticality	RANAP-ELEMENTARY-PROCEDURE.&criticality		({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
	value		RANAP-ELEMENTARY-PROCEDURE.&InitiatingMessage	({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}

SuccessfulOutcome ::= SEQUENCE {
	procedureCode	RANAP-ELEMENTARY-PROCEDURE.&procedureCode	({RANAP-ELEMENTARY-PROCEDURES}),
	criticality	RANAP-ELEMENTARY-PROCEDURE.&criticality		({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
	value		RANAP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome	({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}

UnsuccessfulOutcome ::= SEQUENCE {
	procedureCode	RANAP-ELEMENTARY-PROCEDURE.&procedureCode	({RANAP-ELEMENTARY-PROCEDURES}),
	criticality	RANAP-ELEMENTARY-PROCEDURE.&criticality		({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
	value		RANAP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome	({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}

Outcome ::= SEQUENCE {
	procedureCode	RANAP-ELEMENTARY-PROCEDURE.&procedureCode	({RANAP-ELEMENTARY-PROCEDURES}),
	criticality	RANAP-ELEMENTARY-PROCEDURE.&criticality		({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
	value		RANAP-ELEMENTARY-PROCEDURE.&Outcome		({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}

reset RANAP-ELEMENTARY-PROCEDURE ::= {
	INITIATING MESSAGE	Reset
	SUCCESSFUL OUTCOME	ResetAcknowledge
	PROCEDURE CODE		id-Reset
	CRITICALITY		reject
}

resetResource RANAP-ELEMENTARY-PROCEDURE ::= {
	INITIATING MESSAGE      ResetResource
	SUCCESSFUL OUTCOME      ResetResourceAcknowledge
	PROCEDURE CODE          id-ResetResource
	CRITICALITY             reject
}

Reset ::= SEQUENCE {
	protocolIEs		OCTET STRING,	     --simplified with dummy fields
	protocolExtensions	OCTET STRING,         --simplified with dummy fields
	...
}

ResetAcknowledge ::= SEQUENCE {
        protocolIEs		OCTET STRING,	        --simplified with dummy fields
	protocolExtensions	OCTET STRING,		--simplified with dummy fields
	...
}

ResetResource ::= SEQUENCE {
	protocolIEs               OCTET STRING,  --simplified with dummy fields
	protocolExtensions	  OCTET STRING,	 --simplified with dummy fields
	...
}
ResetResourceAcknowledge ::= SEQUENCE {
	protocolIEs			OCTET STRING,   --simplified with dummy fields
	protocolExtensions		OCTET STRING, 	--simplified with dummy fields
	...
}

id-Reset ProcedureCode ::= 0

id-ResetResource ProcedureCode ::= 1

ProcedureCode		::= INTEGER (0..255)

Criticality		::= ENUMERATED { reject, ignore, notify, unspecified }

END
