dexter has uploaded this change for review.

View Change

es9p_Types_JSON: split headers into separate module

The headers used in the JSON binding of ES9+ are also used in ES2+, ES11 and ES12.
Let's split the headers into a separate module, so that we can re-use them in
other definitions too.

Change-Id: I0242c877805003fa67445800960f75ce27752383
Related: SYS#7339
---
M eim/gen_links.sh
M library/euicc/es9p_Types_JSON.ttcn
A library/euicc/esx_header_Types_JSON.ttcn
3 files changed, 63 insertions(+), 25 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/39654/1
diff --git a/eim/gen_links.sh b/eim/gen_links.sh
index 1996da9..9fa3ac2 100755
--- a/eim/gen_links.sh
+++ b/eim/gen_links.sh
@@ -36,7 +36,7 @@
FILES+="PKIX1Implicit88_Types.ttcn RSPDefinitions_Templates.ttcn RSPDefinitions_Types.ttcn "
FILES+="SGP32Definitions_Templates.ttcn SGP32Definitions_Types.ttcn "
FILES+="PKIX1Explicit88_EncDec.cc PKIX1Implicit88_EncDec.cc RSPDefinitions_EncDec.cc SGP32Definitions_EncDec.cc "
-FILES+="es9p_Types_JSON.ttcn"
+FILES+="es9p_Types_JSON.ttcn esx_header_Types_JSON.ttcn"
gen_links $DIR $FILES

DIR=../library
diff --git a/library/euicc/es9p_Types_JSON.ttcn b/library/euicc/es9p_Types_JSON.ttcn
index 5a8587b..79d5381 100644
--- a/library/euicc/es9p_Types_JSON.ttcn
+++ b/library/euicc/es9p_Types_JSON.ttcn
@@ -10,6 +10,8 @@

module es9p_Types_JSON {

+import from esx_header_Types_JSON all;
+
import from RSPDefinitions all;
import from RSPDefinitions_Types all;
import from RSPDefinitions_Templates all;
@@ -22,30 +24,15 @@
import from PKIX1Implicit88_Templates all;
import from PKIX1Implicit88_Types all;

-
-/* GSMA SGP.22, section 6.5.1.3 */
-type record JSON_ES9p_RequestHeader {
- charstring functionRequesterIdentifier,
- charstring functionCallIdentifier
-};
-
-/* GSMA SGP.22, section 6.5.1.4 */
-type record JSON_ES9p_FunctionExecutionStatus {
- charstring status
-};
-type record JSON_ES9p_ResponseHeader {
- JSON_ES9p_FunctionExecutionStatus functionExecutionStatus
-};
-
/* GSMA SGP.22, section 6.5.2.6 */
type record JSON_ES9p_InitiateAuthenticationRequest {
- JSON_ES9p_RequestHeader header,
+ JSON_ESx_RequestHeader header,
charstring euiccChallenge,
charstring euiccInfo1,
charstring smdpAddress
};
type record JSON_ES9p_InitiateAuthenticationResponse {
- JSON_ES9p_ResponseHeader header,
+ JSON_ESx_ResponseHeader header,
charstring transactionId,
charstring serverSigned1,
charstring serverSignature1,
@@ -55,24 +42,24 @@

/* GSMA SGP.22, section 6.5.2.7 */
type record JSON_ES9p_GetBoundProfilePackageRequest {
- JSON_ES9p_RequestHeader header,
+ JSON_ESx_RequestHeader header,
charstring transactionId,
charstring prepareDownloadResponse
};
type record JSON_ES9p_GetBoundProfilePackageResponse {
- JSON_ES9p_ResponseHeader header,
+ JSON_ESx_ResponseHeader header,
charstring transactionId,
charstring boundProfilePackage
};

/* GSMA SGP.22, section 6.5.2.8 */
type record JSON_ES9p_AuthenticateClientRequest {
- JSON_ES9p_RequestHeader header,
+ JSON_ESx_RequestHeader header,
charstring transactionId,
charstring authenticateServerResponse
};
type record JSON_ES9p_AuthenticateClientResponseEs9 {
- JSON_ES9p_ResponseHeader header,
+ JSON_ESx_ResponseHeader header,
charstring transactionId,
charstring profileMetadata,
charstring smdpSigned2,
@@ -82,20 +69,20 @@

/* GSMA SGP.22, section 6.5.2.9 */
type record JSON_ES9p_HandleNotification {
- JSON_ES9p_RequestHeader header,
+ JSON_ESx_RequestHeader header,
charstring pendingNotification
};

/* GSMA SGP.22, section 6.5.2.10 */
type record JSON_ES9p_CancelSessionRequestEs9 {
- JSON_ES9p_RequestHeader header,
+ JSON_ESx_RequestHeader header,
charstring transactionId,
charstring cancelSessionResponse
};

/* An empty response that is used when the response only consists of a JSON header */
type record JSON_ES9p_EmptyResponse {
- JSON_ES9p_ResponseHeader header
+ JSON_ESx_ResponseHeader header
};


diff --git a/library/euicc/esx_header_Types_JSON.ttcn b/library/euicc/esx_header_Types_JSON.ttcn
new file mode 100644
index 0000000..4a4f4ca
--- /dev/null
+++ b/library/euicc/esx_header_Types_JSON.ttcn
@@ -0,0 +1,51 @@
+/* JSON message definitions for ES2+
+ *
+ * Author: Philipp Maier <pmaier@sysmocom.de> / sysmocom - s.f.m.c. GmbH
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+module esx_header_Types_JSON {
+
+/* GSMA SGP.22, section 6.5.1.3 */
+type record JSON_ESx_RequestHeader {
+ charstring functionRequesterIdentifier,
+ charstring functionCallIdentifier
+};
+
+/* GSMA SGP.22, section 6.5.1.4 */
+type record JSON_ESx_FunctionExecutionStatus {
+ charstring status
+};
+type record JSON_ESx_ResponseHeader {
+ JSON_ESx_FunctionExecutionStatus functionExecutionStatus
+};
+
+template (value) JSON_ESx_ResponseHeader
+ts_responseHeader := {
+ functionExecutionStatus := {
+ status := "Executed-Success"
+ }
+}
+template (present) JSON_ESx_ResponseHeader
+tr_responseHeader := {
+ functionExecutionStatus := {
+ status := ?
+ }
+}
+
+template (value) JSON_ESx_RequestHeader
+ts_requestHeader := {
+ functionRequesterIdentifier := "TTCN3",
+ functionCallIdentifier := "testsuite"
+}
+template (present) JSON_ESx_RequestHeader
+tr_requestHeader := {
+ functionRequesterIdentifier := ?,
+ functionCallIdentifier := ?
+}
+
+}
\ No newline at end of file

To view, visit change 39654. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0242c877805003fa67445800960f75ce27752383
Gerrit-Change-Number: 39654
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>