dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43821?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: es*_Types_JSON: use ts_responseHeader instead of manual assignments ......................................................................
es*_Types_JSON: use ts_responseHeader instead of manual assignments
The template ts_responseHeader already provides a response header ("Executed-Success") ready to use. Let's use this template instead of assigning the header members indidvidually each time.
Related: SYS#8203 Change-Id: Ifcc3ed49053bd737c96cb34ab142b5522d86821c --- M library/euicc/es9p_Types_JSON.ttcn M library/euicc/esipa_Types_JSON.ttcn 2 files changed, 15 insertions(+), 15 deletions(-)
Approvals: jolly: Looks good to me, approved Jenkins Builder: Verified
diff --git a/library/euicc/es9p_Types_JSON.ttcn b/library/euicc/es9p_Types_JSON.ttcn index f7e6587..1a146eb 100644 --- a/library/euicc/es9p_Types_JSON.ttcn +++ b/library/euicc/es9p_Types_JSON.ttcn @@ -269,7 +269,7 @@ var JSON_ES9p_RemoteProfileProvisioningResponse json_pdu;
if (ispresent(asn1_pdu_dec.initiateAuthenticationResponse)) { - json_pdu.initiateAuthenticationResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.initiateAuthenticationResponse.header := valueof(ts_responseHeader); json_pdu.initiateAuthenticationResponse.transactionId := oct2str(asn1_pdu_dec.initiateAuthenticationResponse.initiateAuthenticationOk.transactionId); json_pdu.initiateAuthenticationResponse.serverSigned1 := @@ -283,14 +283,14 @@ encode_base64(enc_Certificate(asn1_pdu_dec.initiateAuthenticationResponse.initiateAuthenticationOk.serverCertificate)); json_pdu_enc := oct2char(enc_JSON_ES9p_RemoteProfileProvisioningResponse(json_pdu)); } else if (ispresent(asn1_pdu_dec.getBoundProfilePackageResponse)) { - json_pdu.getBoundProfilePackageResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getBoundProfilePackageResponse.header := valueof(ts_responseHeader); json_pdu.getBoundProfilePackageResponse.transactionId := oct2str(asn1_pdu_dec.getBoundProfilePackageResponse.getBoundProfilePackageOk.transactionId); json_pdu.getBoundProfilePackageResponse.boundProfilePackage := encode_base64(enc_BoundProfilePackage(asn1_pdu_dec.getBoundProfilePackageResponse.getBoundProfilePackageOk.boundProfilePackage)); json_pdu_enc := oct2char(enc_JSON_ES9p_RemoteProfileProvisioningResponse(json_pdu)); } else if (ispresent(asn1_pdu_dec.authenticateClientResponseEs9)) { - json_pdu.authenticateClientResponseEs9.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.authenticateClientResponseEs9.header := valueof(ts_responseHeader); json_pdu.authenticateClientResponseEs9.transactionId := oct2str(asn1_pdu_dec.authenticateClientResponseEs9.authenticateClientOk.transactionId); json_pdu.authenticateClientResponseEs9.profileMetadata := @@ -304,12 +304,12 @@ json_pdu_enc := oct2char(enc_JSON_ES9p_RemoteProfileProvisioningResponse(json_pdu)); } else if (ispresent(asn1_pdu_dec.cancelSessionResponseEs9)) { /* This message has no JSON body, see also GSMA SGP.22, section 6.5.2.10 */ - json_pdu.emptyResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.emptyResponse.header := valueof(ts_responseHeader); json_pdu_enc := oct2char(enc_JSON_ES9p_RemoteProfileProvisioningResponse(json_pdu)); } else if (ispresent(asn1_pdu_dec.authenticateClientResponseEs11)) { setverdict(fail, "encoder path not implemented for JSON ES9+ message AuthenticateClientResponseEs11"); } else { - json_pdu.emptyResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.emptyResponse.header := valueof(ts_responseHeader); json_pdu_enc := oct2char(enc_JSON_ES9p_RemoteProfileProvisioningResponse(json_pdu)); } } with { extension "prototype(fast)" } diff --git a/library/euicc/esipa_Types_JSON.ttcn b/library/euicc/esipa_Types_JSON.ttcn index 18f28ce..6d027b5 100644 --- a/library/euicc/esipa_Types_JSON.ttcn +++ b/library/euicc/esipa_Types_JSON.ttcn @@ -471,7 +471,7 @@ var JSON_ESipa_EsipaMessageFromEimToIpa json_pdu;
if (ispresent(asn1_pdu_dec.initiateAuthenticationResponseEsipa)) { - json_pdu.initiateAuthenticationResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.initiateAuthenticationResponse.header := valueof(ts_responseHeader); if (ispresent(asn1_pdu_dec.initiateAuthenticationResponseEsipa.initiateAuthenticationOkEsipa.transactionId)) { json_pdu.initiateAuthenticationResponse.transactionId := oct2str(asn1_pdu_dec.initiateAuthenticationResponseEsipa.initiateAuthenticationOkEsipa.transactionId); @@ -494,7 +494,7 @@ } json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else if (ispresent(asn1_pdu_dec.authenticateClientResponseEsipa)) { - json_pdu.authenticateClientResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.authenticateClientResponse.header := valueof(ts_responseHeader); if (ispresent(asn1_pdu_dec.authenticateClientResponseEsipa.authenticateClientOkDPEsipa.transactionId)) { json_pdu.authenticateClientResponse.transactionId := oct2str(asn1_pdu_dec.authenticateClientResponseEsipa.authenticateClientOkDPEsipa.transactionId); @@ -515,7 +515,7 @@ } json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else if (ispresent(asn1_pdu_dec.getBoundProfilePackageResponseEsipa)) { - json_pdu.getBoundProfilePackageResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getBoundProfilePackageResponse.header := valueof(ts_responseHeader); if (ispresent(asn1_pdu_dec.getBoundProfilePackageResponseEsipa.getBoundProfilePackageOkEsipa.transactionId)) { json_pdu.getBoundProfilePackageResponse.transactionId := oct2str(asn1_pdu_dec.getBoundProfilePackageResponseEsipa.getBoundProfilePackageOkEsipa.transactionId); @@ -525,25 +525,25 @@ json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else if (ispresent(asn1_pdu_dec.getEimPackageResponse)) { if (ispresent(asn1_pdu_dec.getEimPackageResponse.euiccPackageRequest)) { - json_pdu.getEimPackageResponse.getEimPackageResponse_euiccPkgReq.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getEimPackageResponse.getEimPackageResponse_euiccPkgReq.header := valueof(ts_responseHeader); json_pdu.getEimPackageResponse.getEimPackageResponse_euiccPkgReq.euiccPackageRequest := encode_base64(enc_EuiccPackageRequest(asn1_pdu_dec.getEimPackageResponse.euiccPackageRequest)); } else if (ispresent(asn1_pdu_dec.getEimPackageResponse.ipaEuiccDataRequest)) { - json_pdu.getEimPackageResponse.getEimPackageResponse_euiccDataReq.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getEimPackageResponse.getEimPackageResponse_euiccDataReq.header := valueof(ts_responseHeader); json_pdu.getEimPackageResponse.getEimPackageResponse_euiccDataReq.ipaEuiccDataRequest := encode_base64(enc_IpaEuiccDataRequest(asn1_pdu_dec.getEimPackageResponse.ipaEuiccDataRequest)); } else if (ispresent(asn1_pdu_dec.getEimPackageResponse.profileDownloadTriggerRequest)) { - json_pdu.getEimPackageResponse.getEimPackageResponse_dnlTrigReq.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getEimPackageResponse.getEimPackageResponse_dnlTrigReq.header := valueof(ts_responseHeader); json_pdu.getEimPackageResponse.getEimPackageResponse_dnlTrigReq.profileDownloadTriggerRequest := encode_base64(enc_ProfileDownloadTriggerRequest(asn1_pdu_dec.getEimPackageResponse.profileDownloadTriggerRequest)); } else if (ispresent(asn1_pdu_dec.getEimPackageResponse.eimPackageError)) { - json_pdu.getEimPackageResponse.getEimPackageResponse_eimPkgErr.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.getEimPackageResponse.getEimPackageResponse_eimPkgErr.header := valueof(ts_responseHeader); json_pdu.getEimPackageResponse.getEimPackageResponse_eimPkgErr.eimPackageError := asn1_pdu_dec.getEimPackageResponse.eimPackageError; } json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else if (ispresent(asn1_pdu_dec.provideEimPackageResultResponse)) { - json_pdu.provideEimPackageResultResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.provideEimPackageResultResponse.header := valueof(ts_responseHeader); if (ispresent(asn1_pdu_dec.provideEimPackageResultResponse.eimAcknowledgements)) { json_pdu.provideEimPackageResultResponse.eimAcknowledgements := encode_base64(enc_EimAcknowledgements(asn1_pdu_dec.provideEimPackageResultResponse.eimAcknowledgements)); @@ -551,10 +551,10 @@ json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else if (ispresent(asn1_pdu_dec.cancelSessionResponseEsipa)) { /* This message has no JSON body, see also GSMA SGP.32, section 6.4.1.8 */ - json_pdu.emptyResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.emptyResponse.header := valueof(ts_responseHeader); json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } else { - json_pdu.emptyResponse.header.functionExecutionStatus.status := "Executed-Success"; + json_pdu.emptyResponse.header := valueof(ts_responseHeader); json_pdu_enc := oct2char(enc_JSON_ESipa_EsipaMessageFromEimToIpa(json_pdu)); } } with { extension "prototype(fast)" }