Initial commit

Signed-off-by: Gabor Szalai <gabor.szalai@ericsson.com>
diff --git a/5G_system_TS29518_Namf_CNL113890.tpd b/5G_system_TS29518_Namf_CNL113890.tpd
new file mode 100644
index 0000000..f7797a9
--- /dev/null
+++ b/5G_system_TS29518_Namf_CNL113890.tpd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TITAN_Project_File_Information version="1.0">
+  <ProjectName>5G_system_TS29518_Namf_CNL113890</ProjectName>
+  <ReferencedProjects>
+    <ReferencedProject name="5G_system_TS29502_Nsmf_CNL113882" projectLocationURI="../5G_system_TS29502_Nsmf_CNL113882/5G_system_TS29502_Nsmf_CNL113882.tpd"/>
+    <ReferencedProject name="5G_system_TS29531_Nnssf_CNL113901" projectLocationURI="../5G_system_TS29531_Nnssf_CNL113901/5G_system_TS29531_Nnssf_CNL113901.tpd"/>
+    <ReferencedProject name="5G_system_TS29571_CommonData_CNL113880" projectLocationURI="../5G_system_TS29571_CommonData_CNL113880/5G_system_TS29571_CommonData_CNL113880.tpd"/>
+    <ReferencedProject name="5G_system_TS29572_Nlmf_CNL113892" projectLocationURI="../5G_system_TS29572_Nlmf_CNL113892/5G_system_TS29572_Nlmf_CNL113892.tpd"/>
+  </ReferencedProjects>
+  <Folders>
+    <FolderResource projectRelativePath="src" relativeURI="src"/>
+  </Folders>
+  <Files>
+    <FileResource projectRelativePath="src/TS29518_Namf_Communication.ttcn" relativeURI="src/TS29518_Namf_Communication.ttcn"/>
+    <FileResource projectRelativePath="src/TS29518_Namf_EventExposure.ttcn" relativeURI="src/TS29518_Namf_EventExposure.ttcn"/>
+    <FileResource projectRelativePath="src/TS29518_Namf_Location.ttcn" relativeURI="src/TS29518_Namf_Location.ttcn"/>
+    <FileResource projectRelativePath="src/TS29518_Namf_MT.ttcn" relativeURI="src/TS29518_Namf_MT.ttcn"/>
+  </Files>
+  <ActiveConfiguration>Default</ActiveConfiguration>
+  <Configurations>
+    <Configuration name="Default">
+      <ProjectProperties>
+        <MakefileSettings>
+          <GNUMake>true</GNUMake>
+          <incrementalDependencyRefresh>true</incrementalDependencyRefresh>
+          <targetExecutable>bin/5G_system_TS29518_Namf_CNL113890</targetExecutable>
+        </MakefileSettings>
+        <LocalBuildSettings>
+          <workingDirectory>bin</workingDirectory>
+        </LocalBuildSettings>
+      </ProjectProperties>
+    </Configuration>
+  </Configurations>
+</TITAN_Project_File_Information>
\ No newline at end of file
diff --git a/doc/5G_system_TS29518_Namf_Description.adoc b/doc/5G_system_TS29518_Namf_Description.adoc
new file mode 100644
index 0000000..14ac7a7
--- /dev/null
+++ b/doc/5G_system_TS29518_Namf_Description.adoc
@@ -0,0 +1,144 @@
+= 5G system TS29518 Namf Protocol Modules for TTCN-3 Toolset with TITAN, Description
+:author: Gábor Szalai
+:toc: left
+
+== About This Document
+
+This is the description for the 5G system TS29518 Namf protocol module. The 5G system TS29518 Namf protocol modules are developed for the TTCN-3 Toolset with Titan. 
+
+== Functionality
+
+The 5G system TS29518 Namf protocol module implements the object structures of the 3GPP TS 29518 v15.1.0<<_5, [5]>> in a formalized way, using the standard specification language TTCN-3. This allows defining of test data (templates) in the TTCN-3 language and correctly encoding/decoding messages when executing test suites using the Titan TTCN-3 test environment.
+The 5G system TS29518 Namf protocol module uses Titan’s JSON encoding <<_3, [3]>> and hence is usable with the Titan test toolset only.
+
+=== System Requirements
+Protocol modules are a set of TTCN-3 source code files that can be used as part of TTCN-3 test suites only. Hence, protocol modules alone do not put specific requirements on the system used. However, in order to compile and execute a TTCN-3 test suite using the set of protocol modules the following system requirements must be satisfied:
+
+* Titan TTCN-3 Test Executor version CRL 113 200/6 R5A (6.5.pl0) or higher installed. For Installation Guide see <<_2, [2]>>. Please note: This version of the test port is not compatible with Titan releases earlier than CRL 113 200/6 R5A.
+
+===	Installation
+The set of protocol modules can be used in developing TTCN-3 test suites using any text editor. Since the 5G system TS29518 Namf protocol is used as a part of a TTCN-3 test suite, this requires TTCN-3 Test Executor be installed before the module can be compiled and executed together with other parts of the test suite. For more details on the installation of TTCN-3 Test Executor see the relevant section of <<_2, [2]>>.
+
+== Interface description
+
+=== Encoding/decoding and other related functions
+This product also contains encoding/decoding functions, which assure correct encoding of messages when sent from Titan and correct decoding of messages when received by Titan. 
+
+==== Implemented encoding and decoding functions
+
+[source]
+----
+Name	Type of formal parameters	Type of return value
+f_enc_UeContextCreateData(in UeContextCreateData pdu) return octetstring 
+f_dec_UeContextCreateData(in octetstring stream, out UeContextCreateData pdu) return integer 
+f_enc_UeContextCreatedData(in UeContextCreatedData pdu) return octetstring 
+f_dec_UeContextCreatedData(in octetstring stream, out UeContextCreatedData pdu) return integer 
+f_enc_UeContextCreateError(in UeContextCreateError pdu) return octetstring 
+f_dec_UeContextCreateError(in octetstring stream, out UeContextCreateError pdu) return integer 
+f_enc_UEContextRelease(in UEContextRelease pdu) return octetstring 
+f_dec_UEContextRelease(in octetstring stream, out UEContextRelease pdu) return integer 
+f_enc_AssignEbiData(in AssignEbiData pdu) return octetstring 
+f_dec_AssignEbiData(in octetstring stream, out AssignEbiData pdu) return integer 
+f_enc_AssignedEbiData(in AssignedEbiData pdu) return octetstring 
+f_dec_AssignedEbiData(in octetstring stream, out AssignedEbiData pdu) return integer 
+f_enc_AssignEbiError(in AssignEbiError pdu) return octetstring 
+f_dec_AssignEbiError(in octetstring stream, out AssignEbiError pdu) return integer 
+f_enc_UeContextTransferReqData(in UeContextTransferReqData pdu) return octetstring 
+f_dec_UeContextTransferReqData(in octetstring stream, out UeContextTransferReqData pdu) return integer 
+f_enc_UeContextTransferRspData(in UeContextTransferRspData pdu) return octetstring 
+f_dec_UeContextTransferRspData(in octetstring stream, out UeContextTransferRspData pdu) return integer 
+f_enc_UeRegStatusUpdateReqData(in UeRegStatusUpdateReqData pdu) return octetstring 
+f_dec_UeRegStatusUpdateReqData(in octetstring stream, out UeRegStatusUpdateReqData pdu) return integer 
+f_enc_UeRegStatusUpdateRspData(in UeRegStatusUpdateRspData pdu) return octetstring 
+f_dec_UeRegStatusUpdateRspData(in octetstring stream, out UeRegStatusUpdateRspData pdu) return integer 
+f_enc_N1N2MessageTransferReqData(in N1N2MessageTransferReqData pdu) return octetstring 
+f_dec_N1N2MessageTransferReqData(in octetstring stream, out N1N2MessageTransferReqData pdu) return integer 
+f_enc_N1N2MessageTransferRspData(in N1N2MessageTransferRspData pdu) return octetstring 
+f_dec_N1N2MessageTransferRspData(in octetstring stream, out N1N2MessageTransferRspData pdu) return integer 
+f_enc_N1N2MessageTransferError(in N1N2MessageTransferError pdu) return octetstring 
+f_dec_N1N2MessageTransferError(in octetstring stream, out N1N2MessageTransferError pdu) return integer 
+f_enc_N1N2MsgTxfrFailureNotification(in N1N2MsgTxfrFailureNotification pdu) return octetstring 
+f_dec_N1N2MsgTxfrFailureNotification(in octetstring stream, out N1N2MsgTxfrFailureNotification pdu) return integer 
+f_enc_UeN1N2InfoSubscriptionCreateData(in UeN1N2InfoSubscriptionCreateData pdu) return octetstring 
+f_dec_UeN1N2InfoSubscriptionCreateData(in octetstring stream, out UeN1N2InfoSubscriptionCreateData pdu) return integer 
+f_enc_UeN1N2InfoSubscriptionCreatedData(in UeN1N2InfoSubscriptionCreatedData pdu) return octetstring 
+f_dec_UeN1N2InfoSubscriptionCreatedData(in octetstring stream, out UeN1N2InfoSubscriptionCreatedData pdu) return integer 
+f_enc_N2InformationTransferReqData(in N2InformationTransferReqData pdu) return octetstring 
+f_dec_N2InformationTransferReqData(in octetstring stream, out N2InformationTransferReqData pdu) return integer 
+f_enc_N2InformationTransferRspData(in N2InformationTransferRspData pdu) return octetstring 
+f_dec_N2InformationTransferRspData(in octetstring stream, out N2InformationTransferRspData pdu) return integer 
+f_enc_N2InformationTransferError(in N2InformationTransferError pdu) return octetstring 
+f_dec_N2InformationTransferError(in octetstring stream, out N2InformationTransferError pdu) return integer 
+f_enc_NonUeN2InfoSubscriptionCreateData(in NonUeN2InfoSubscriptionCreateData pdu) return octetstring 
+f_dec_NonUeN2InfoSubscriptionCreateData(in octetstring stream, out NonUeN2InfoSubscriptionCreateData pdu) return integer 
+f_enc_NonUeN2InfoSubscriptionCreatedData(in NonUeN2InfoSubscriptionCreatedData pdu) return octetstring 
+f_dec_NonUeN2InfoSubscriptionCreatedData(in octetstring stream, out NonUeN2InfoSubscriptionCreatedData pdu) return integer 
+f_enc_N2InformationNotification(in N2InformationNotification pdu) return octetstring 
+f_dec_N2InformationNotification(in octetstring stream, out N2InformationNotification pdu) return integer 
+f_enc_SubscriptionData(in SubscriptionData pdu) return octetstring 
+f_dec_SubscriptionData(in octetstring stream, out SubscriptionData pdu) return integer 
+f_enc_AmfStatusChangeNotification(in AmfStatusChangeNotification pdu) return octetstring 
+f_dec_AmfStatusChangeNotification(in octetstring stream, out AmfStatusChangeNotification pdu) return integer 
+f_enc_AmfCreateEventSubscription(in AmfCreateEventSubscription pdu) return octetstring 
+f_dec_AmfCreateEventSubscription(in octetstring stream, out AmfCreateEventSubscription pdu) return integer 
+f_enc_AmfCreatedEventSubscription(in AmfCreatedEventSubscription pdu) return octetstring 
+f_dec_AmfCreatedEventSubscription(in octetstring stream, out AmfCreatedEventSubscription pdu) return integer 
+f_enc_AmfEventNotification(in AmfEventNotification pdu) return octetstring 
+f_dec_AmfEventNotification(in octetstring stream, out AmfEventNotification pdu) return integer 
+f_enc_AmfUpdateEventSubscriptionItem(in AmfUpdateEventSubscriptionItem pdu) return octetstring 
+f_dec_AmfUpdateEventSubscriptionItem(in octetstring stream, out AmfUpdateEventSubscriptionItem pdu) return integer 
+f_enc_AmfUpdatedEventSubscription(in AmfUpdatedEventSubscription pdu) return octetstring 
+f_dec_AmfUpdatedEventSubscription(in octetstring stream, out AmfUpdatedEventSubscription pdu) return integer 
+f_enc_RequestPosInfo(in RequestPosInfo pdu) return octetstring 
+f_dec_RequestPosInfo(in octetstring stream, out RequestPosInfo pdu) return integer 
+f_enc_ProvidePosInfo(in ProvidePosInfo pdu) return octetstring 
+f_dec_ProvidePosInfo(in octetstring stream, out ProvidePosInfo pdu) return integer 
+f_enc_NotifiedPosInfo(in NotifiedPosInfo pdu) return octetstring 
+f_dec_NotifiedPosInfo(in octetstring stream, out NotifiedPosInfo pdu) return integer 
+f_enc_RequestLocInfo(in RequestLocInfo pdu) return octetstring 
+f_dec_RequestLocInfo(in octetstring stream, out RequestLocInfo pdu) return integer 
+f_enc_ProvideLocInfo(in ProvideLocInfo pdu) return octetstring 
+f_dec_ProvideLocInfo(in octetstring stream, out ProvideLocInfo pdu) return integer 
+f_enc_UeContextInfo(in UeContextInfo pdu) return octetstring 
+f_dec_UeContextInfo(in octetstring stream, out UeContextInfo pdu) return integer 
+f_enc_EnableUeReachabilityReqData(in EnableUeReachabilityReqData pdu) return octetstring 
+f_dec_EnableUeReachabilityReqData(in octetstring stream, out EnableUeReachabilityReqData pdu) return integer 
+f_enc_EnableUeReachabilityRspData(in EnableUeReachabilityRspData pdu) return octetstring 
+f_dec_EnableUeReachabilityRspData(in octetstring stream, out EnableUeReachabilityRspData pdu) return integer 
+----
+
+== Usage
+
+The protocol module provides abstract data types for JSON objects used by the services defined in the standard <<_5, [5]>>. The protocol module provides encoder and decoder functions for the JSON objects. The decoder function validates the received JSON object based on the JSON schema as well. Only the validated JSON value is decoded.
+
+== Terminology	
+
+=== Abbreviations
+
+JSON:: JavaScript Object Notation
+
+PDU:: Protocol Data Unit
+
+TTCN-3:: Testing and Test Control Notation version 3
+
+== References
+
+[[_1]]
+[1]	ETSI ES 201 873-1 v4.4.1 (2012-04) +
+The Testing and Test Control Notation version 3. Part 1: Core Language
+
+[[_2]]
+[2]	1/ 198 17-CRL 113 200/6 Uen +
+Installation Guide for the TITAN TTCN-3 Test Executor
+
+[[_3]]
+[3]	2/198 17-CRL 113 200/6 Uen +
+Programmer's Technical Reference for Titan TTCN-3 Test Executor
+
+[[_4]]
+[4]	https://www.json.org
+
+[[_5]]
+[5] 3GPP TS 29518 v15.1.0+
+5G System; Access and Mobility Management Services; Stage 3
+
diff --git a/doc/change.log b/doc/change.log
new file mode 100644
index 0000000..1220b3b
--- /dev/null
+++ b/doc/change.log
@@ -0,0 +1,9 @@
+= 5G system TS29518 Namf Protocol Modules for TTCN-3 Toolset with TITAN, Change log

+:author: Gábor Szalai

+:toc: left

+

+== Changes

+

+=== R1A

+

+Initial revision
\ No newline at end of file
diff --git a/src/TS29518_Namf_Communication.ttcn b/src/TS29518_Namf_Communication.ttcn
new file mode 100644
index 0000000..b60d1de
--- /dev/null
+++ b/src/TS29518_Namf_Communication.ttcn
@@ -0,0 +1,721 @@
+/******************************************************************************
+* Copyright (c) 2000-2019  Ericsson 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:
+*   Gabor Szalai - initial implementation and initial documentation
+******************************************************************************/
+//
+//  File:               TS29518_Namf_Communication.ttcn
+//  Description:	      Type definitions for 3GPP TS29518
+/////////////////////////////////////////////// 
+module TS29518_Namf_Communication {
+
+  import from TS29571_CommonData all
+  import from TS29502_Nsmf_PDUSession all
+  import from TS29572_Nlmf_Location all
+  import from TS29531_Nnssf_NSSelection all
+  import from TS29518_Namf_EventExposure all
+
+external function f_enc_UeContextCreateData(in UeContextCreateData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeContextCreateData(in octetstring stream, out UeContextCreateData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeContextCreatedData(in UeContextCreatedData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeContextCreatedData(in octetstring stream, out UeContextCreatedData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeContextCreateError(in UeContextCreateError pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeContextCreateError(in octetstring stream, out UeContextCreateError pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UEContextRelease(in UEContextRelease pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UEContextRelease(in octetstring stream, out UEContextRelease pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_AssignEbiData(in AssignEbiData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_AssignEbiData(in octetstring stream, out AssignEbiData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_AssignedEbiData(in AssignedEbiData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_AssignedEbiData(in octetstring stream, out AssignedEbiData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_AssignEbiError(in AssignEbiError pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_AssignEbiError(in octetstring stream, out AssignEbiError pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeContextTransferReqData(in UeContextTransferReqData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeContextTransferReqData(in octetstring stream, out UeContextTransferReqData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeContextTransferRspData(in UeContextTransferRspData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeContextTransferRspData(in octetstring stream, out UeContextTransferRspData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeRegStatusUpdateReqData(in UeRegStatusUpdateReqData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeRegStatusUpdateReqData(in octetstring stream, out UeRegStatusUpdateReqData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeRegStatusUpdateRspData(in UeRegStatusUpdateRspData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeRegStatusUpdateRspData(in octetstring stream, out UeRegStatusUpdateRspData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N1N2MessageTransferReqData(in N1N2MessageTransferReqData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N1N2MessageTransferReqData(in octetstring stream, out N1N2MessageTransferReqData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N1N2MessageTransferRspData(in N1N2MessageTransferRspData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N1N2MessageTransferRspData(in octetstring stream, out N1N2MessageTransferRspData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N1N2MessageTransferError(in N1N2MessageTransferError pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N1N2MessageTransferError(in octetstring stream, out N1N2MessageTransferError pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N1N2MsgTxfrFailureNotification(in N1N2MsgTxfrFailureNotification pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N1N2MsgTxfrFailureNotification(in octetstring stream, out N1N2MsgTxfrFailureNotification pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeN1N2InfoSubscriptionCreateData(in UeN1N2InfoSubscriptionCreateData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeN1N2InfoSubscriptionCreateData(in octetstring stream, out UeN1N2InfoSubscriptionCreateData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_UeN1N2InfoSubscriptionCreatedData(in UeN1N2InfoSubscriptionCreatedData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_UeN1N2InfoSubscriptionCreatedData(in octetstring stream, out UeN1N2InfoSubscriptionCreatedData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N2InformationTransferReqData(in N2InformationTransferReqData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N2InformationTransferReqData(in octetstring stream, out N2InformationTransferReqData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N2InformationTransferRspData(in N2InformationTransferRspData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N2InformationTransferRspData(in octetstring stream, out N2InformationTransferRspData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N2InformationTransferError(in N2InformationTransferError pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N2InformationTransferError(in octetstring stream, out N2InformationTransferError pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_NonUeN2InfoSubscriptionCreateData(in NonUeN2InfoSubscriptionCreateData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_NonUeN2InfoSubscriptionCreateData(in octetstring stream, out NonUeN2InfoSubscriptionCreateData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_NonUeN2InfoSubscriptionCreatedData(in NonUeN2InfoSubscriptionCreatedData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_NonUeN2InfoSubscriptionCreatedData(in octetstring stream, out NonUeN2InfoSubscriptionCreatedData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_N2InformationNotification(in N2InformationNotification pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_N2InformationNotification(in octetstring stream, out N2InformationNotification pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_SubscriptionData(in SubscriptionData pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_SubscriptionData(in octetstring stream, out SubscriptionData pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+external function f_enc_AmfStatusChangeNotification(in AmfStatusChangeNotification pdu) return octetstring 
+with { extension "prototype(convert) encode(JSON)" }
+
+external function f_dec_AmfStatusChangeNotification(in octetstring stream, out AmfStatusChangeNotification pdu) return integer 
+with { extension "prototype(backtrack) decode(JSON)" }
+
+
+  type set SubscriptionData {
+    TS29571_CommonData.Uri    amfStatusUri,
+    set of       TS29571_CommonData.Guami    guamiList optional
+  }
+
+  type set AmfStatusChangeNotification {
+    set of       AmfStatusInfo    amfStatusInfoList optional
+  }
+
+  type set AmfStatusInfo {
+    set of       TS29571_CommonData.Guami    guamiList optional,
+    StatusChange    statusChange,
+    TS29571_CommonData.AmfName    targetAmfRemoval optional,
+    TS29571_CommonData.AmfName    targetAmfFailure optional
+  }
+
+  type set AssignEbiData {
+    TS29571_CommonData.PduSessionId    pduSessionId,
+    set of       TS29571_CommonData.Arp    arpList optional,
+    set of       EpsBearerId    releasedEbiList optional
+  }
+
+  type set AssignedEbiData {
+    TS29571_CommonData.PduSessionId    pduSessionId,
+    set of       TS29502_Nsmf_PDUSession.EbiArpMapping    assignedEbiList optional,
+    set of       TS29571_CommonData.Arp    failedArpList optional,
+    set of       EpsBearerId    releasedEbiList optional
+  }
+
+  type set AssignEbiFailed {
+    TS29571_CommonData.PduSessionId    pduSessionId,
+    set of       TS29571_CommonData.Arp    failedArpList optional
+  }
+
+  type set UEContextRelease {
+    TS29571_CommonData.Supi    supi optional,
+    boolean unauthenticatedSupi optional,
+    TS29571_CommonData.NgApCause    ngapCause
+  }
+
+  type set N2InformationTransferReqData {
+    set of       TS29571_CommonData.Tai    taiList optional,
+    RatSelector    ratSelector optional,
+    set of       TS29571_CommonData.Ecgi    ecgiList optional,
+    set of       TS29571_CommonData.Ncgi    ncgiList optional,
+    set of       TS29571_CommonData.GlobalRanNodeId    globalRanNodeList optional,
+    N2InfoContainer    n2Information,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set NonUeN2InfoSubscriptionCreateData {
+    set of       TS29571_CommonData.GlobalRanNodeId    globalRanNodeList optional,
+    set of       TS29571_CommonData.AccessType    anTypeList optional,
+    N2InformationClass    n2InformationClass,
+    TS29571_CommonData.Uri    n2NotifyCallbackUri,
+    TS29571_CommonData.NfInstanceId    nfId optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set NonUeN2InfoSubscriptionCreatedData {
+    charstring n2NotifySubscriptionId,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeN1N2InfoSubscriptionCreateData {
+    N2InformationClass    n2InformationClass optional,
+    TS29571_CommonData.Uri    n2NotifyCallbackUri optional,
+    N1MessageClass    n1MessageClass optional,
+    TS29571_CommonData.Uri    n1NotifyCallbackUri optional,
+    TS29571_CommonData.NfInstanceId    nfId optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeN1N2InfoSubscriptionCreatedData {
+    charstring n1n2NotifySubscriptionId,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set N2InformationNotification {
+    charstring n2NotifySubscriptionId,
+    N2InfoContainer    n2InfoContainer,
+    set of       TS29571_CommonData.PduSessionId    toReleaseSessionList optional,
+    TS29572_Nlmf_Location.CorrelationID    lcsCorrelationId optional
+  }
+
+  type set N2InfoContainer {
+    N2InformationClass    n2InformationClass,
+    N2SmInformation    smInfo optional,
+    NrppaInformation    nrppaInfo optional,
+    PwsInformation    pwsInfo optional,
+    AreaOfValidity    areaOfValidity optional
+  }
+
+  type set N1MessageNotification {
+    charstring n1NotifySubscriptionId optional,
+    N1MessageContainer    n1MessageContainer,
+    TS29572_Nlmf_Location.CorrelationID    lcsCorrelationId optional,
+    RegistrationContextContainer    registrationCtxtContainer optional
+  }
+
+  type set N1MessageContainer {
+    N1MessageClass    n1MessageClass,
+    RefToBinaryData    n1MessageContent,
+    TS29571_CommonData.NfInstanceId    nfId optional
+  }
+
+  type set N1N2MessageTransferReqData {
+    N1MessageContainer    n1MessageContainer optional,
+    N2InfoContainer    n2InfoContainer optional,
+    boolean skipInd optional,
+    boolean lastMsgIndication optional,
+    charstring sessionId optional,
+    Ppi    ppi optional,
+    TS29571_CommonData.Arp    arp optional,
+    TS29571_CommonData.FiveQi    fiveqi optional,
+    TS29571_CommonData.Uri    n1n2FailureTxfNotifURI optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  } with {
+    variant (fiveqi) "name as '5qi'"
+  }
+
+  type set N1N2MessageTransferRspData {
+    N1N2MessageTransferCause    cause,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set RegistrationContextContainer {
+    UeContext    ueContext,
+    TS29571_CommonData.TimeZone    localTimeZone optional,
+    TS29571_CommonData.AccessType    anType,
+    integer anN2ApId,
+    TS29571_CommonData.NgRanIdentifier    ranNodeId,
+    TS29571_CommonData.Ipv4Addr    anN2IPv4Addr optional,
+    TS29571_CommonData.Ipv6Addr    anN2IPv6Addr optional,
+    TS29531_Nnssf_NSSelection.AllowedNssai    allowedNssai optional,
+    set of       TS29531_Nnssf_NSSelection.ConfiguredSnssai    configuredNssai optional,
+    set of       TS29571_CommonData.Snssai    rejectedNssaiInPlmn optional,
+    set of       TS29571_CommonData.Snssai    rejectedNssaiInTa optional
+  }
+
+  type set AreaOfValidity {
+    set of       TS29571_CommonData.Tai    taiList optional
+  }
+
+  type set RefToBinaryData {
+    charstring contentId
+  }
+
+  type set UeContextTransferReqData {
+    TransferReason    reason,
+    N1MessageContainer    regRequest optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeContextTransferRspData {
+    UeContext    ueContext,
+    TS29571_CommonData.Uri    regCompleteNotifyUri,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeContext {
+    TS29571_CommonData.Supi    supi optional,
+    boolean supiUnauthInd optional,
+    set of       TS29571_CommonData.Gpsi    gpsiList optional,
+    TS29571_CommonData.Pei    pei optional,
+    set of       TS29571_CommonData.GroupId    groupList optional,
+    DrxParameter    drxParameter optional,
+    TS29571_CommonData.RfspIndex    subRfsp optional,
+    TS29571_CommonData.RfspIndex    usedRfsp optional,
+    TS29571_CommonData.Ambr    subUeAmbr optional,
+    SmsSupport    smsSupport,
+    TS29571_CommonData.NfInstanceId    smsfId optional,
+    SeafData    seafData optional,
+    FivegmmCapability    fivegmmCapability optional,
+    TS29571_CommonData.NfInstanceId    pcfId optional,
+    TS29571_CommonData.Uri    pcfAmPolicyUri optional,
+    set of       AMPolicyReqTrigger    amPolicyReqTriggerList optional,
+    TS29571_CommonData.NfInstanceId    hpcfId optional,
+    set of       TS29571_CommonData.RatType    restrictedRatList optional,
+    set of       TS29571_CommonData.Area    forbiddenAreaList optional,
+    TS29571_CommonData.ServiceAreaRestriction    serviceAreaRestriction optional,
+    set of       TS29571_CommonData.CoreNetworkType    restrictedCoreNwTypeList optional,
+    set of       TS29518_Namf_EventExposure.AmfEventSubscription    eventSubscriptionList optional,
+    set of       MmContext    mmContextList optional,
+    set of       PduSessionContext    sessionContextList optional,
+    TS29571_CommonData.TraceData    traceData optional
+  } with {
+    variant (fivegmmCapability) "name as '5gmmCapability'"
+  }
+
+
+  type set N2SmInformation {
+    TS29571_CommonData.PduSessionId    pduSessionId,
+    N2InfoContent    n2InfoContent optional,
+    N1MessageContainer    nasPdu optional,
+    TS29571_CommonData.Snssai    sNssai optional,
+    boolean subjectToHo optional
+  }
+
+  type set N2InfoContent {
+    TS29571_CommonData.Uinteger    ngapMessageType optional,
+    NgapIeType    ngapIeType,
+    RefToBinaryData    ngapData
+  }
+
+  type set NrppaInformation {
+    TS29571_CommonData.NfInstanceId    nfId optional,
+    N2InfoContent    nrppaPdu
+  }
+
+  type set PwsInformation {
+    TS29571_CommonData.Uint16    messageIdentifier,
+    TS29571_CommonData.Uint16    serialNumber,
+    N2InfoContent    pwsContainer,
+    boolean sendN2Container optional,
+    OmcIdentifier    omcId optional
+  }
+
+  type set N1N2MsgTxfrFailureNotification {
+    N1N2MessageTransferCause    cause,
+    TS29571_CommonData.Uri    n1n2MsgDataUri
+  }
+
+  type set N1N2MessageTransferError {
+    TS29571_CommonData.ProblemDetails    error_,
+    N1N2MsgTxfrErrDetail    errInfo optional
+  } with {
+    variant (error_) "name as 'error'"
+  }
+
+  type set N1N2MsgTxfrErrDetail {
+    TS29571_CommonData.Uinteger    retryAfter optional,
+    TS29571_CommonData.Arp    highestPrioArp optional
+  }
+
+  type set N2InformationTransferRspData {
+    N2InformationTransferResult    result,
+    PWSResponseData    pwsRspData optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set MmContext {
+    TS29571_CommonData.AccessType    accessType,
+    NasSecurityMode    nasSecurityMode optional,
+    NasCount    nasDownlinkCount optional,
+    NasCount    nasUplinkCount optional,
+    UeSecurityCapability    ueSecurityCapability optional,
+    S1UeNetworkCapability    s1UeNetworkCapability optional,
+    set of       TS29571_CommonData.Snssai    allowedNssaiList optional,
+    set of       NssaiMapping    nssaiMappingList optional,
+    set of       TS29531_Nnssf_NSSelection.NsiId    nsInstanceList optional,
+    ExpectedUeBehavior    expectedUEbehavior optional
+  }
+
+  type set SeafData {
+    NgKsi    ngKsi,
+    KeyAmf    keyAmf,
+    charstring nh, // (pattern "^[A-Fa-f0-9]+$") optional,
+    TS29571_CommonData.Uinteger    ncc optional,
+    boolean keyAmfChangeInd optional
+  }
+
+  type set NasSecurityMode {
+    IntegrityAlgorithm    integrityAlgorithm,
+    CipheringAlgorithm    cipheringAlgorithm
+  }
+
+  type set PduSessionContext {
+    TS29571_CommonData.PduSessionId    pduSessionId,
+    TS29571_CommonData.Uri    smContextRef,
+    TS29571_CommonData.Snssai    sNssai,
+    TS29571_CommonData.Dnn    dnn,
+    TS29571_CommonData.AccessType    accessType,
+    set of       TS29502_Nsmf_PDUSession.EbiArpMapping    allocatedEbiList,
+    TS29571_CommonData.NfInstanceId    hsmfId optional,
+    TS29571_CommonData.NfInstanceId    vsmfId optional,
+    TS29531_Nnssf_NSSelection.NsiId    nsInstance optional
+  }
+
+  type set NssaiMapping {
+    TS29571_CommonData.Snssai    mappedSnssai,
+    TS29571_CommonData.Snssai    hSnssai
+  }
+
+  type set UeRegStatusUpdateReqData {
+    UeContextTransferStatus    transferStatus,
+    set of       TS29571_CommonData.PduSessionId    toReleaseSessionList optional
+  }
+
+  type set UeRegStatusUpdateRspData {
+    boolean regStatusTransferComplete
+  }
+
+  type set AssignEbiError {
+    TS29571_CommonData.ProblemDetails    error_,
+    AssignEbiFailed    failureDetails
+  } with {
+    variant (error_) "name as 'error'"
+  }
+
+
+  type set UeContextCreateData {
+    UeContext    ueContext,
+    NgRanTargetId    targetId,
+    N2InfoContent    sourceToTargetData,
+    set of       N2SmInformation    pduSessionList optional,
+    TS29571_CommonData.Uri    n2NotifyUri optional,
+    TS29571_CommonData.NgApCause    ngapCause optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeContextCreatedData {
+    UeContext    ueContext,
+    N2InfoContent    targetToSourceData,
+    set of       N2SmInformation    pduSessionList optional,
+    TS29571_CommonData.NgApCause    ngapCause optional,
+    set of       TS29571_CommonData.PduSessionId    failedSessionList optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeContextCreateError {
+    TS29571_CommonData.ProblemDetails    error_,
+    TS29571_CommonData.NgApCause    ngapCause optional
+  } with {
+    variant (error_) "name as 'error'"
+  }
+
+
+  type set NgRanTargetId {
+    TS29571_CommonData.NgRanIdentifier    ranNodeId,
+    TS29571_CommonData.Tai    tai
+  }
+
+  type set PWSResponseData {
+    TS29571_CommonData.Uinteger    ngapMessageType,
+    TS29571_CommonData.Uint16    serialNumber,
+    integer messageIdentifier,
+    set of       TS29571_CommonData.Tai    unknownTaiList optional
+  }
+
+  type set PWSErrorData {
+    integer namfCause
+  }
+
+  type set N2InformationTransferError {
+    TS29571_CommonData.ProblemDetails    error_,
+    PWSErrorData    pwdErrorInfo optional
+  } with {
+    variant (error_) "name as 'error'"
+  }
+
+
+  type set NgKsi {
+    ScType    tsc,
+    TS29571_CommonData.Uinteger    ksi
+  }
+
+  type set KeyAmf {
+    KeyAmfType    keyType,
+    charstring keyVal
+  }
+
+  type set ExpectedUeBehavior {
+    set of       TS29571_CommonData.UserLocation    expMoveTrajectory,
+    TS29571_CommonData.DateTime    validityTime
+  }
+
+  type TS29571_CommonData.Uinteger    EpsBearerId
+
+  type TS29571_CommonData.Uinteger    Ppi
+
+  type TS29571_CommonData.Uinteger    NasCount
+
+  type TS29571_CommonData.Bytes    FivegmmCapability
+
+  type TS29571_CommonData.Bytes    UeSecurityCapability
+
+  type TS29571_CommonData.Bytes    S1UeNetworkCapability
+
+  type TS29571_CommonData.Bytes    DrxParameter
+
+  type charstring OmcIdentifier
+
+  type enumerated StatusChange_enum { AMF_UNAVAILABLE, AMF_AVAILABLE}
+
+  type union StatusChange {
+    StatusChange_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated N2InformationClass_enum { SM, NRPPa, PWS, PWS_BCAL, PWS_RF}
+  with {
+    variant "text 'PWS_BCAL' as 'PWS-BCAL'"
+    variant "text 'PWS_RF' as 'PWS-RF'"
+  
+  }
+
+  type union N2InformationClass {
+    N2InformationClass_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated N1MessageClass_enum { FIVEGMM, SM, LPP, SMS, UPDP}
+  with {variant "text 'FIVEGMM' as '5GMM'"}
+
+  type union N1MessageClass {
+    N1MessageClass_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated N1N2MessageTransferCause_enum { ATTEMPTING_TO_REACH_UE, N1_N2_TRANSFER_INITIATED, WAITING_FOR_ASYNCHRONOUS_TRANSFER, UE_NOT_RESPONDING, N1_MSG_NOT_TRANSFERRED}
+
+  type union N1N2MessageTransferCause {
+    N1N2MessageTransferCause_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated UeContextTransferStatus_enum { TRANSFERRED, NOT_TRANSFERRED}
+
+  type union UeContextTransferStatus {
+    UeContextTransferStatus_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated N2InformationTransferResult_enum { N2_INFO_TRANSFER_INITIATED}
+
+  type union N2InformationTransferResult {
+    N2InformationTransferResult_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated CipheringAlgorithm_enum { NEA0, NEA1, NEA2, NEA3}
+
+  type union CipheringAlgorithm {
+    CipheringAlgorithm_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated IntegrityAlgorithm_enum { NIA0, NIA1, NIA2, NIA3}
+
+  type union IntegrityAlgorithm {
+    IntegrityAlgorithm_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated SmsSupport_enum { THREEGPP, NON_3GPP, BOTH, NONE}
+  with {variant "text 'THREEGPP' as '3GPP'"}
+
+  type union SmsSupport {
+    SmsSupport_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated ScType_enum { NATIVE, MAPPED}
+
+  type union ScType {
+    ScType_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated KeyAmfType_enum { KAMF, KPRIMEAMF}
+
+  type union KeyAmfType {
+    KeyAmfType_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated TransferReason_enum { INIT_REG, MOBI_REG, MOBI_REG_UE_VALIDATED}
+
+  type union TransferReason {
+    TransferReason_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated AMPolicyReqTrigger_enum { LOCATION_CHANGE, PRA_CHANGE, SARI_CHANGE, RFSP_INDEX_CHANGE}
+
+  type union AMPolicyReqTrigger {
+    AMPolicyReqTrigger_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated RatSelector_enum { E_UTRA, NR}
+  with {variant "text 'E_UTRA' as 'E-UTRA'"}
+
+  type union RatSelector {
+    RatSelector_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated NgapIeType_enum { PDU_RES_SETUP_REQ, PDU_RES_REL_CMD, PDU_RES_MOD_REQ, PDU_RES_MOD_CFM, PATH_SWITCH_REQ_ACK, PATH_SWITCH_REQ_FAIL, HANDOVER_CMD, HANDOVER_PREP_FAIL, SRC_TO_TAR_CONTAINER, TAR_TO_SRC_CONTAINER, NRPPA_PDU}
+
+  type union NgapIeType {
+    NgapIeType_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+
+
+
+
+} with {
+  encode "JSON"
+}
diff --git a/src/TS29518_Namf_EventExposure.ttcn b/src/TS29518_Namf_EventExposure.ttcn
new file mode 100644
index 0000000..894cd9b
--- /dev/null
+++ b/src/TS29518_Namf_EventExposure.ttcn
@@ -0,0 +1,257 @@
+/******************************************************************************
+* Copyright (c) 2000-2019  Ericsson 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:
+*   Gabor Szalai - initial implementation and initial documentation
+******************************************************************************/
+//
+//  File:               TS29518_Namf_EventExposure.ttcn
+//  Description:	      Type definitions for 3GPP TS29518
+//  Prodnr:             CNL 113 890
+/////////////////////////////////////////////// 
+module TS29518_Namf_EventExposure {
+
+  import from TS29571_CommonData all
+
+  external function f_enc_AmfCreateEventSubscription(in AmfCreateEventSubscription pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_AmfCreateEventSubscription(in octetstring stream, out AmfCreateEventSubscription pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_AmfCreatedEventSubscription(in AmfCreatedEventSubscription pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_AmfCreatedEventSubscription(in octetstring stream, out AmfCreatedEventSubscription pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_AmfEventNotification(in AmfEventNotification pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_AmfEventNotification(in octetstring stream, out AmfEventNotification pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_AmfUpdateEventSubscriptionItem(in AmfUpdateEventSubscriptionItem pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_AmfUpdateEventSubscriptionItem(in octetstring stream, out AmfUpdateEventSubscriptionItem pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_AmfUpdatedEventSubscription(in AmfUpdatedEventSubscription pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_AmfUpdatedEventSubscription(in octetstring stream, out AmfUpdatedEventSubscription pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+
+  type set AmfEventSubscription {
+    set of       AmfEvent    eventList optional,
+    TS29571_CommonData.Uri    eventNotifyUri,
+    charstring notifyCorrelationId,
+    TS29571_CommonData.NfInstanceId    nfId,
+    TS29571_CommonData.Uri    subsChangeNotifyUri optional,
+    charstring subsChangeNotifyCorrelationId optional,
+    TS29571_CommonData.Supi    supi optional,
+    TS29571_CommonData.GroupId    groupId optional,
+    TS29571_CommonData.Gpsi    gpsi optional,
+    TS29571_CommonData.Pei    pei optional,
+    boolean anyUE optional,
+    AmfEventMode    options optional
+  }
+
+  type set AmfEvent {
+    AmfEventType    type_,
+    boolean immediateFlag optional,
+    set of       AmfEventArea    areaList optional,
+    set of       LocationFilter    locationFilterList optional,
+    set of       SubscribedDataFilter    subscribedDataFilterList optional
+  } with {
+    variant (type_) "name as 'type'"
+  }
+
+  type set AmfEventNotification {
+    charstring subscriptionId,
+    charstring notifyCorrelationId,
+    set of       AmfEventReport    reportList optional
+  }
+
+  type set AmfEventReport {
+    AmfEventType    type_,
+    AmfEventState    state,
+    TS29571_CommonData.DateTime    timeStamp,
+    boolean anyUe optional,
+    TS29571_CommonData.Supi    supi optional,
+    set of       AmfEventArea    areaList optional,
+    TS29571_CommonData.Gpsi    gpsi optional,
+    TS29571_CommonData.Pei    pei optional,
+    TS29571_CommonData.UserLocation    location optional,
+    TS29571_CommonData.TimeZone    timezone optional,
+    set of       TS29571_CommonData.AccessType    accessTypeList optional,
+    set of       RmInfo    rmInfoList optional,
+    set of       CmInfo    cmInfoList optional,
+    UeReachability    reachability optional,
+    SubscribedData    subscribedData optional,
+    CommunicationFailure    commFailure optional,
+    integer numberOfUes optional
+  } with {
+    variant (type_) "name as 'type'"
+  }
+
+
+  type set AmfEventMode {
+    AmfEventTrigger    trigger_,
+    integer maxReports optional,
+    TS29571_CommonData.DateTime    expiry optional
+  } with {
+    variant (trigger_) "name as 'trigger'"
+  }
+
+  type set AmfEventState {
+    boolean active,
+    integer remainReports optional,
+    TS29571_CommonData.DurationSec    remainDuration optional
+  }
+
+  type set RmInfo {
+    RmState    rmState,
+    TS29571_CommonData.AccessType    accessType
+  }
+
+  type set CmInfo {
+    CmState    cmState,
+    TS29571_CommonData.AccessType    accessType
+  }
+
+  type set SubscribedData {
+    Sari    sari optional,
+    RfspIndex    rfspIndex optional
+  }
+
+  type set CommunicationFailure {
+    charstring nasReleaseCode optional,
+    TS29571_CommonData.NgApCause    ranReleaseCode optional
+  }
+
+  type set AmfCreateEventSubscription {
+    AmfEventSubscription    subscription,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set AmfCreatedEventSubscription {
+    AmfEventSubscription    subscription,
+    set of       AmfEventReport    reportList optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set AmfUpdateEventSubscriptionItem_item {
+      enumerated { add, remove, replace_} op,
+      charstring path, // (pattern "\/events\/[0-]$|\/events\/[1-9][0-9]*$"),
+      AmfEvent    value_ optional
+  } with {
+    variant (op) "text 'replace_' as 'replace'"
+    variant (value_) "name as 'value'"
+  }
+  
+  type set of AmfUpdateEventSubscriptionItem_item AmfUpdateEventSubscriptionItem
+
+  type set AmfUpdatedEventSubscription {
+    AmfEventSubscription    subscription
+  }
+
+  type set AmfEventArea {
+    TS29571_CommonData.PresenceInfo    presenceInfo optional,
+    LadnInfo    ladnInfo optional
+  }
+
+  type set LadnInfo {
+    charstring ladn,
+    TS29571_CommonData.PresenceState    presence optional
+  }
+
+  type charstring FivegGuti
+
+  type TS29571_CommonData.Bytes    Sari
+
+  type integer RfspIndex
+
+  type enumerated AmfEventType_enum { LOCATION_REPORT, PRESENCE_IN_AOI_REPORT, TIMEZONE_REPORT, ACCESS_TYPE_REPORT, REGISTRATION_STATE_REPORT, CONNECTIVITY_STATE_REPORT, REACHABILITY_REPORT, SUBSCRIBED_DATA_REPORT, COMMIUNICATION_FAILURE_REPORT, UES_IN_AREA_REPORT}
+
+  type union AmfEventType {
+    AmfEventType_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated AmfEventTrigger_enum { ONE_TIME, CONTINUOUS}
+
+  type union AmfEventTrigger {
+    AmfEventTrigger_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated LocationFilter_enum { TAI, CELL_ID, N3IWF, UE_IP, UDP_PORT}
+
+  type union LocationFilter {
+    LocationFilter_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated SubscribedDataFilter_enum { SARI, RFSP_INDEX}
+
+  type union SubscribedDataFilter {
+    SubscribedDataFilter_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated UeReachability_enum { UNREACHABLE, REACHABLE, REGULATORY_ONLY}
+
+  type union UeReachability {
+    UeReachability_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated RmState_enum { REGISTERED, DEREGISTERED}
+
+  type union RmState {
+    RmState_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated CmState_enum { IDLE, CONNECTED}
+
+  type union CmState {
+    CmState_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+
+
+
+
+} with {
+  encode "JSON"
+}
diff --git a/src/TS29518_Namf_Location.ttcn b/src/TS29518_Namf_Location.ttcn
new file mode 100644
index 0000000..f3eff95
--- /dev/null
+++ b/src/TS29518_Namf_Location.ttcn
@@ -0,0 +1,142 @@
+/******************************************************************************
+* Copyright (c) 2000-2019  Ericsson 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:
+*   Gabor Szalai - initial implementation and initial documentation
+******************************************************************************/
+//
+//  File:               TS29518_Namf_Location.ttcn
+//  Description:	      Type definitions for 3GPP TS29518
+/////////////////////////////////////////////// 
+module TS29518_Namf_Location {
+
+  import from TS29572_Nlmf_Location all
+  import from TS29571_CommonData all
+
+  external function f_enc_RequestPosInfo(in RequestPosInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_RequestPosInfo(in octetstring stream, out RequestPosInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_ProvidePosInfo(in ProvidePosInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_ProvidePosInfo(in octetstring stream, out ProvidePosInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_NotifiedPosInfo(in NotifiedPosInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_NotifiedPosInfo(in octetstring stream, out NotifiedPosInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_RequestLocInfo(in RequestLocInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_RequestLocInfo(in octetstring stream, out RequestLocInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_ProvideLocInfo(in ProvideLocInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_ProvideLocInfo(in octetstring stream, out ProvideLocInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+
+  type set RequestPosInfo {
+    TS29572_Nlmf_Location.ExternalClientType    lcsClientType,
+    LocationType    lcsLocation,
+    TS29571_CommonData.Supi    supi optional,
+    TS29571_CommonData.Gpsi    gpsi optional,
+    TS29572_Nlmf_Location.LcsPriority    priority optional,
+    TS29572_Nlmf_Location.LocationQoS    lcsQoS optional,
+    TS29572_Nlmf_Location.VelocityRequested    velocityRequested optional,
+    TS29572_Nlmf_Location.SupportedGADShapes    lcsSupportedGADShapes optional,
+    TS29571_CommonData.Uri    locationNotificationUri optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set ProvidePosInfo {
+    TS29572_Nlmf_Location.GeographicArea    locationEstimate optional,
+    TS29572_Nlmf_Location.AccuracyFulfilmentIndicator    accuracyFulfilmentIndicator optional,
+    TS29572_Nlmf_Location.AgeOfLocationEstimate    ageOfLocationEstimate optional,
+    TS29572_Nlmf_Location.VelocityEstimate    velocityEstimate optional,
+    set of       TS29572_Nlmf_Location.PositioningMethodAndUsage    positioningDataList optional,
+    set of       TS29572_Nlmf_Location.GnssPositioningMethodAndUsage    gnssPositioningDataList optional,
+    TS29571_CommonData.Ecgi    ecgi optional,
+    TS29571_CommonData.Ncgi    ncgi optional,
+    TS29571_CommonData.NfInstanceId    targetServingNode optional,
+    TS29572_Nlmf_Location.CivicAddress    civicAddress optional,
+    BarometricPressure    barometricPressure optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set NotifiedPosInfo {
+    LocationEvent    locationEvent,
+    TS29571_CommonData.Supi    supi optional,
+    TS29571_CommonData.Gpsi    gpsi optional,
+    TS29571_CommonData.Pei    pei optional,
+    TS29572_Nlmf_Location.GeographicArea    locationEstimate optional,
+    TS29572_Nlmf_Location.AgeOfLocationEstimate    ageOfLocationEstimate optional,
+    TS29572_Nlmf_Location.VelocityEstimate    velocityEstimate optional,
+    set of       TS29572_Nlmf_Location.PositioningMethodAndUsage    positioningDataList optional,
+    set of       TS29572_Nlmf_Location.GnssPositioningMethodAndUsage    gnssPositioningDataList optional,
+    TS29571_CommonData.Ecgi    ecgi optional,
+    TS29571_CommonData.Ncgi    ncgi optional,
+    TS29571_CommonData.NfInstanceId    servingNode optional,
+    TS29572_Nlmf_Location.CivicAddress    civicAddress optional,
+    BarometricPressure    barometricPressure optional
+  }
+
+  type set RequestLocInfo {
+    boolean req5gsLoc optional,
+    boolean reqCurrentLoc optional,
+    boolean reqRatType optional,
+    boolean reqTimeZone optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set ProvideLocInfo {
+    boolean currentLoc optional,
+    TS29571_CommonData.UserLocation    location optional,
+    TS29572_Nlmf_Location.GeographicArea    geoInfo optional,
+    TS29572_Nlmf_Location.AgeOfLocationEstimate    locatoinAge optional,
+    TS29571_CommonData.RatType    ratType optional,
+    TS29571_CommonData.TimeZone    timezone optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type integer BarometricPressure
+
+  type enumerated LocationType_enum { CURRENT_LOCATION, CURRENT_OR_LAST_KNOWN_LOCATION, INITIAL_LOCATION}
+
+  type union LocationType {
+    LocationType_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+  type enumerated LocationEvent_enum { EMERGENCY_CALL_ORIGINATION, EMERGENCY_CALL_RELEASE, EMERGENCY_CALL_HANDOVER}
+
+  type union LocationEvent {
+    LocationEvent_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+
+
+
+
+} with {
+  encode "JSON"
+}
diff --git a/src/TS29518_Namf_MT.ttcn b/src/TS29518_Namf_MT.ttcn
new file mode 100644
index 0000000..4fa1632
--- /dev/null
+++ b/src/TS29518_Namf_MT.ttcn
@@ -0,0 +1,72 @@
+/******************************************************************************
+* Copyright (c) 2000-2019  Ericsson 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:
+*   Gabor Szalai - initial implementation and initial documentation
+******************************************************************************/
+//
+//  File:               TS29518_Namf_MT.ttcn
+//  Description:	      Type definitions for 3GPP TS29518
+/////////////////////////////////////////////// 
+module TS29518_Namf_MT {
+
+  import from TS29518_Namf_EventExposure all
+  import from TS29571_CommonData all
+
+  external function f_enc_UeContextInfo(in UeContextInfo pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_UeContextInfo(in octetstring stream, out UeContextInfo pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_EnableUeReachabilityReqData(in EnableUeReachabilityReqData pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_EnableUeReachabilityReqData(in octetstring stream, out EnableUeReachabilityReqData pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+  external function f_enc_EnableUeReachabilityRspData(in EnableUeReachabilityRspData pdu) return octetstring 
+  with { extension "prototype(convert) encode(JSON)" }
+
+  external function f_dec_EnableUeReachabilityRspData(in octetstring stream, out EnableUeReachabilityRspData pdu) return integer 
+  with { extension "prototype(backtrack) decode(JSON)" }
+
+
+  type set EnableUeReachabilityReqData {
+    TS29518_Namf_EventExposure.UeReachability    reachability,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set EnableUeReachabilityRspData {
+    TS29518_Namf_EventExposure.UeReachability    reachability,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type set UeContextInfo {
+    boolean supportVoPS optional,
+    TS29571_CommonData.DateTime    lastActTime optional,
+    TS29571_CommonData.RatType    ratType optional,
+    TS29571_CommonData.SupportedFeatures    supportedFeatures optional
+  }
+
+  type enumerated UeContextInfoClass_enum { TADS}
+
+  type union UeContextInfoClass {
+    UeContextInfoClass_enum  enum_val,
+    charstring           other_val
+  } with {
+    variant "JSON: as value"
+  }
+
+
+
+
+
+
+} with {
+  encode "JSON"
+}