From f9eefafe1ad2a4d2a743c1cf7bc52df1a37d6c97 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 21 Jul 2021 08:37:43 +0200 Subject: [PATCH 1/6] Replace references to G5 by RadioNetwork --- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 2 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 2 +- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 2 +- ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn | 2 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- .../LibItsIpv6OverGeoNetworking_TestSystem.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index 39a3ca05..0579ce43 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -41,7 +41,7 @@ module LibItsBtp_TestSystem { group nt1Ports { /** - * @desc NT1 BTP Port (BTP/GeoNet/G5) + * @desc NT1 BTP Port (BTP/GeoNet/RadioNetwork) */ type port BtpPort message { in BtpInd; diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index fd3727e8..ce00ed93 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -59,7 +59,7 @@ module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Test group fa1Ports { /** - * @desc FA1 CAM Port (CAM/BTP/GeoNet/G5) + * @desc FA1 CAM Port (CAM/BTP/GeoNet/RadioNetwork) */ type port CamPort message { in CamInd; diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 8a7cc869..31a08f30 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -58,7 +58,7 @@ module LibItsDenm_TestSystem { group fa1Ports { /** - * @desc FA1 DENM Port (DENM/BTP/GeoNet/G5) + * @desc FA1 DENM Port (DENM/BTP/GeoNet/RadioNetwork) */ type port DenmPort message { in DenmInd; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 4b46b328..7c5c958a 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -60,7 +60,7 @@ module LibItsGeoNetworking_TestSystem { group nt2Ports { /** - * @desc NT2 GeoNetworking Port (GeoNetworking/G5) + * @desc NT2 GeoNetworking Port (GeoNetworking/RadioNetwork) */ type port GeoNetworkingPort message { in GeoNetworkingInd; diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 1808ecf9..acf35389 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -58,7 +58,7 @@ module LibItsIvim_TestSystem { group fa1Ports { /** - * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) + * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/RadioNetwork) */ type port IvimPort message { in IvimInd; diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn index 88b6998b..3348b56b 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn @@ -41,7 +41,7 @@ module LibItsIpv6OverGeoNetworking_TestSystem { group nt2Ports { /** - * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/G5) + * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/RadioNetwork) */ type port IPv6OverGeoNetworkingPort message { in IPv6OverGeoNetworkingInd; diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index f73c90b9..b5b7ca3b 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,4 +1,4 @@ -f_verify_rca_certificate/** +/** * @author ETSI / STF544 * @version $Url$ * $Id$ -- GitLab From 4edb6ec912770497eb6fc19cb6ea066914b443cf Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 22 Jul 2021 14:35:58 +0200 Subject: [PATCH 2/6] Add HTTP header extensions via Pixits --- ttcn/Http/LibItsHttp_Functions.ttcn | 4 ++++ ttcn/Http/LibItsHttp_Pixits.ttcn | 9 +++++++++ ttcn/Http/module.mk | 1 + 3 files changed, 14 insertions(+) create mode 100644 ttcn/Http/LibItsHttp_Pixits.ttcn diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index a2a70803..c1abcf32 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -8,6 +8,7 @@ module LibItsHttp_Functions { // LibHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Pics all; + import from LibItsHttp_Pixits all; import from LibItsHttp_TestSystem all; group http_preambles { @@ -71,6 +72,9 @@ module LibItsHttp_Functions { v_i := v_i + 1; } //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; + if (lengthof(PX_ADDITIONAL_HTTP_HEADERS_KEYS) != 0) { + f_set_headers_list(PX_ADDITIONAL_HTTP_HEADERS_KEYS, PX_ADDITIONAL_HTTP_HEADERS_VALUES, p_headers); + } } // End of function f_init_default_headers_list function f_set_headers_list( diff --git a/ttcn/Http/LibItsHttp_Pixits.ttcn b/ttcn/Http/LibItsHttp_Pixits.ttcn new file mode 100644 index 00000000..037caf7e --- /dev/null +++ b/ttcn/Http/LibItsHttp_Pixits.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_Pixits { + + import from LibItsHttp_TypesAndValues all; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_KEYS := { }; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_VALUES := { }; + +} // End of module LibItsHttp_Pixits diff --git a/ttcn/Http/module.mk b/ttcn/Http/module.mk index 9ac4f5b9..0a2300e5 100644 --- a/ttcn/Http/module.mk +++ b/ttcn/Http/module.mk @@ -8,6 +8,7 @@ sources := LibItsHttp_BinaryMessageBodyTypes.ttcn \ LibItsHttp_JsonTemplates.ttcn \ LibItsHttp_MessageBodyTypes.ttcn \ LibItsHttp_Pics.ttcn \ + LibItsHttp_Pixits.ttcn \ LibItsHttp_Templates.ttcn \ LibItsHttp_TestSystem.ttcn \ LibItsHttp_TypesAndValues.ttcn \ -- GitLab From c17c78b974373442b1e1f5ebe17779d1440b8155 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 13 Aug 2021 10:45:51 +0200 Subject: [PATCH 3/6] Finalyze implementation of new TPs from ETSI TS 103 525-2 V1.2.4 (2021-10) --- ttcn/Pki/LibItsPki_Functions.ttcn | 92 ++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index b5b7ca3b..f96dadbd 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3481,7 +3481,9 @@ module LibItsPki_Functions { in boolean p_check_no_signature := false, in boolean p_check_region_restriction := false, in boolean p_check_signature_content := false, - in boolean p_check_app_permissions := false + in boolean p_check_app_permissions := false, + in boolean p_check_app_ssps := false, + in boolean p_check_app_validity_period := false ) return boolean { var CertificateType v_type_ := explicit; var template Signature v_signature_ := ?; @@ -3682,10 +3684,98 @@ module LibItsPki_Functions { } } // End of 'for'statement } + + if (p_check_app_ssps == true) { + var integer v_idx, v_jdx; + var Certificate v_authorized_certificate; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + for (v_idx := 0; v_idx < lengthof(p_certificate.toBeSigned.appPermissions); v_idx := v_idx + 1) { + log("f_verify_rca_certificate: Processing ", p_certificate.toBeSigned.appPermissions[v_idx]); + if (match(p_certificate.toBeSigned.appPermissions[v_idx], mw_appPermissions(-, ?)) == false) { + log("f_verify_rca_certificate: appPermissions mismatch"); + return false; + } + // Check that 'ssp' is in the certIssuePermissions component in the issuing certificate + for (v_jdx := 0; v_jdx < lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit); v_jdx := v_jdx + 1) { + log("f_verify_rca_certificate: compare psid ", v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid, " - ", p_certificate.toBeSigned.appPermissions[v_idx].psid); + if (v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid == p_certificate.toBeSigned.appPermissions[v_idx].psid) { + break; + } + } // End of 'for'statement + if (v_jdx == lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit)) { + log("f_verify_rca_certificate: Psid is not in the list of the issuing certificate"); + return false; + } else { + var BitmapSsp v_ssp_ca := substr(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].sspRange.bitmapSspRange.sspValue, 1, -1 + lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].sspRange.bitmapSspRange.sspValue)); + log("f_verify_rca_certificate: v_ssp_ca= ", v_ssp_ca, " - ssp= ", p_certificate.toBeSigned.appPermissions[v_idx].ssp.bitmapSsp); + if (v_ssp_ca != p_certificate.toBeSigned.appPermissions[v_idx].ssp.bitmapSsp) { + log("f_verify_rca_certificate: SSPs mismatch: CA"); + return false; + } + } + } // End of 'for'statement + } + + if (p_check_app_validity_period == true) { + var integer v_idx, v_jdx; + var Certificate v_authorized_certificate; + var UInt32 v_duration, v_duration_ca; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + // Check start date (indicating X_START_VALIDITY ( X_START_VALIDITY >= X_START_VALIDITY_CA )) + if (p_certificate.toBeSigned.validityPeriod.start_ < v_authorized_certificate.toBeSigned.validityPeriod.start_) { + log("f_verify_rca_certificate: validityPeriod.start_ mismatch"); + return false; + } + // Check duration (value <= X_START_VALIDITY_CA + X_DURATION_CA - X_START_VALIDITY) + v_duration := duration_to_uint32(p_certificate.toBeSigned.validityPeriod.duration); + v_duration_ca := duration_to_uint32(v_authorized_certificate.toBeSigned.validityPeriod.duration); + if (v_duration > (v_authorized_certificate.toBeSigned.validityPeriod.start_ + v_duration_ca - p_certificate.toBeSigned.validityPeriod.start_)) { + log("f_verify_rca_certificate: validityPeriod.duration mismatch"); + return false; + } + } return true; } + function duration_to_uint32( + in Duration p_duration + ) return UInt32 { + if (ischosen(p_duration.microseconds)) { + return p_duration.microseconds * 1000000; + } + else if (ischosen(p_duration.milliseconds)) { + return p_duration.milliseconds * 1000; + } + else if (ischosen(p_duration.seconds)) { + return p_duration.seconds; + } + else if (ischosen(p_duration.minutes)) { + return p_duration.minutes * 60; + } + else if (ischosen(p_duration.hours)) { + return p_duration.hours * 3600; + } + else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours * 60 * 3600; + } + else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours * 60 * 3600; + } + // No choice! + return p_duration.years * 31536000; // One calendar common year has 365 days + } + } // End of group rca group tlm { -- GitLab From 093a675dd4e727992c9bb71e13d182bdc78414db Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 10:25:26 +0200 Subject: [PATCH 4/6] Merging TTF002 in TTF011 - Phase1: AtsCAM, AtsDENM, AtsGeoNetworking, AtsSecurity, AtsPki --- asn1/CAM/CAM_PDU_Descriptions.asn | 132 - asn1/CAM/module.mk | 2 - asn1/DENM/DENM_PDU_Descriptions.asn | 108 - asn1/DENM/module.mk | 2 - asn1/DSRCData/DSRCData.asn | 267 - asn1/DSRCData/DSRCtransferData.asn | 7 - asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn | 157 - asn1/EVCSN/EVCSN_PDU_Descriptions.asn | 102 - .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 22 - .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 21 - .../RTCMEM_PDU_Descriptions.asn | 22 - .../SPATEM_PDU_Descriptions.asn | 37 - .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 21 - .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 22 - .../AVIAEINumberingAndDataStructures.asn | 29 - asn1/IS/ISO_TS_14823/GDD.asn | 140 - asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 627 -- asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn | 27 - asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn | 44 - asn1/IS/ISO_TS_19091/AddGrpC.asn | 209 - asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn | 33 - asn1/IS/ISO_TS_19091/DSRC.asn | 1317 ----- .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 461 -- asn1/IS/ISO_TS_19091/REGION.asn | 130 - asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 211 - asn1/IS/ISO_TS_19091/original/DSRC.asn | 1257 ---- asn1/IS/ISO_TS_19091/original/REGION.asn | 115 - asn1/IS/ISO_TS_19321/IVI.asn | 630 -- ...trationIdentificationVehicleDataModule.asn | 85 - asn1/IS/module.mk | 19 - asn1/ITS-Container/ITS_Container.asn | 508 -- asn1/ITS-Container/module.mk | 1 - .../ProtocolManagementInformation.asn | 181 - asn1/Security/1609Dot2/IEEE1609dot2.asn | 310 - .../1609Dot2/IEEE1609dot2BaseTypes.asn | 334 -- asn1/Security/EtsiTs103097Module.asn | 103 - .../TS102921/EtsiTs102941BaseTypes.asn | 77 - .../TS102921/EtsiTs102941MessagesCa.asn | 87 - ...siTs102941MessagesItss-OptionalPrivacy.asn | 75 - .../TS102921/EtsiTs102941MessagesItss.asn | 82 - .../TS102921/EtsiTs102941TrustLists.asn | 142 - .../EtsiTs102941TypesAuthorization.asn | 91 - ...siTs102941TypesAuthorizationValidation.asn | 67 - .../EtsiTs102941TypesCaManagement.asn | 31 - .../TS102921/EtsiTs102941TypesEnrolment.asn | 67 - asn1/Security/module.mk | 12 - .../TransportAddressMib.asn | 12 - asn1/cdd | 1 - ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 30 - ttcn/BTP/LibItsBtp_Functions.ttcn | 237 - ttcn/BTP/LibItsBtp_Pixits.ttcn | 49 - ttcn/BTP/LibItsBtp_Templates.ttcn | 204 - ttcn/BTP/LibItsBtp_TestSystem.ttcn | 117 - ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 178 - ttcn/BTP/module.mk | 6 - ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 40 - ttcn/CAM/LibItsCam_Functions.ttcn | 614 -- ttcn/CAM/LibItsCam_Pics.ttcn | 130 - ttcn/CAM/LibItsCam_Pixits.ttcn | 21 - ttcn/CAM/LibItsCam_Templates.ttcn | 879 --- ttcn/CAM/LibItsCam_TestSystem.ttcn | 162 - ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 184 - ttcn/CAM/module.mk | 8 - ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 49 - ttcn/DENM/LibItsDenm_Functions.ttcn | 669 --- ttcn/DENM/LibItsDenm_Pics.ttcn | 72 - ttcn/DENM/LibItsDenm_Pixits.ttcn | 21 - ttcn/DENM/LibItsDenm_Templates.ttcn | 824 --- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 168 - ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 207 - ttcn/DENM/module.mk | 7 - ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 47 - .../LibItsGeoNetworking_Functions.ttcn | 2836 --------- .../LibItsGeoNetworking_Pics.ttcn | 389 -- .../LibItsGeoNetworking_Pixits.ttcn | 207 - .../LibItsGeoNetworking_Templates.ttcn | 2320 -------- .../LibItsGeoNetworking_TestSystem.ttcn | 180 - .../LibItsGeoNetworking_TypesAndValues.ttcn | 1182 ---- ttcn/GeoNetworking/module.mk | 8 - .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 +- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 4 +- ttcn/Http/LibItsHttp_Functions.ttcn | 4 + ttcn/Http/LibItsHttp_Pixits.ttcn | 9 + ttcn/Http/module.mk | 1 + .../IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn | 56 - ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn | 50 - ttcn/IVIM/LibItsIvim_Functions.ttcn | 473 -- ttcn/IVIM/LibItsIvim_Pics.ttcn | 118 - ttcn/IVIM/LibItsIvim_Pixits.ttcn | 95 - ttcn/IVIM/LibItsIvim_Templates.ttcn | 1056 ---- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 166 - ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 203 - ttcn/IVIM/module.mk | 8 - ...6OverGeoNetworking_EncdecDeclarations.ttcn | 11 - ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 761 --- .../LibItsIpv6OverGeoNetworking_Pics.ttcn | 34 - .../LibItsIpv6OverGeoNetworking_Pixits.ttcn | 66 - ...LibItsIpv6OverGeoNetworking_Templates.ttcn | 292 - ...ibItsIpv6OverGeoNetworking_TestSystem.ttcn | 105 - ...sIpv6OverGeoNetworking_TypesAndValues.ttcn | 315 - ttcn/Ipv6OverGeoNetworking/module.mk | 8 - .../LibItsMapemSpatem_EncdecDeclarations.ttcn | 19 - .../LibItsMapemSpatem_Functions.ttcn | 461 -- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 139 - .../MapemSpatem/LibItsMapemSpatem_Pixits.ttcn | 56 - .../LibItsMapemSpatem_Templates.ttcn | 950 --- .../LibItsMapemSpatem_TestSystem.ttcn | 178 - .../LibItsMapemSpatem_TypesAndValues.ttcn | 121 - ttcn/MapemSpatem/module.mk | 7 - ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 138 - ttcn/Pki/LibItsPki_Functions.ttcn | 5106 ----------------- ttcn/Pki/LibItsPki_Pics.ttcn | 259 - ttcn/Pki/LibItsPki_Pixits.ttcn | 79 - ttcn/Pki/LibItsPki_Templates.ttcn | 671 --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 124 - ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 153 - ttcn/Pki/module.mk | 7 - .../LibItsRtcmem_EncdecDeclarations.ttcn | 43 - ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 394 -- ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn | 30 - ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn | 3 - ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 277 - ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 127 - ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 99 - ttcn/Rtcmem/module.mk | 8 - .../LibItsSecurity_EncdecDeclarations.ttcn | 58 - ttcn/Security/LibItsSecurity_Functions.ttcn | 3557 ------------ ttcn/Security/LibItsSecurity_Pics.ttcn | 97 - ttcn/Security/LibItsSecurity_Pixits.ttcn | 65 - ttcn/Security/LibItsSecurity_Templates.ttcn | 2101 ------- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 50 - .../LibItsSecurity_TypesAndValues.ttcn | 314 - ttcn/Security/module.mk | 8 - .../LibItsSremSsem_EncdecDeclarations.ttcn | 59 - ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 518 -- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 97 - ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 64 - ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 738 --- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 162 - .../LibItsSremSsem_TypesAndValues.ttcn | 126 - ttcn/SremSsem/module.mk | 7 - 141 files changed, 18 insertions(+), 41773 deletions(-) delete mode 100644 asn1/CAM/CAM_PDU_Descriptions.asn delete mode 100644 asn1/CAM/module.mk delete mode 100644 asn1/DENM/DENM_PDU_Descriptions.asn delete mode 100644 asn1/DENM/module.mk delete mode 100644 asn1/DSRCData/DSRCData.asn delete mode 100644 asn1/DSRCData/DSRCtransferData.asn delete mode 100644 asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn delete mode 100644 asn1/EVCSN/EVCSN_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn delete mode 100644 asn1/IS/ISO_TS_14823/GDD.asn delete mode 100644 asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn delete mode 100644 asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn delete mode 100644 asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn delete mode 100644 asn1/IS/ISO_TS_19091/AddGrpC.asn delete mode 100644 asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn delete mode 100644 asn1/IS/ISO_TS_19091/DSRC.asn delete mode 100644 asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn delete mode 100644 asn1/IS/ISO_TS_19091/REGION.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/AddGrpC.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/DSRC.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/REGION.asn delete mode 100644 asn1/IS/ISO_TS_19321/IVI.asn delete mode 100644 asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn delete mode 100644 asn1/IS/module.mk delete mode 100644 asn1/ITS-Container/ITS_Container.asn delete mode 100644 asn1/ITS-Container/module.mk delete mode 100644 asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn delete mode 100644 asn1/Security/1609Dot2/IEEE1609dot2.asn delete mode 100644 asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn delete mode 100644 asn1/Security/EtsiTs103097Module.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941BaseTypes.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesCa.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TrustLists.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn delete mode 100644 asn1/Security/module.mk delete mode 100644 asn1/TransportAddressMib/TransportAddressMib.asn delete mode 160000 asn1/cdd delete mode 100644 ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Functions.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Pixits.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Templates.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_TestSystem.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_TypesAndValues.ttcn delete mode 100644 ttcn/BTP/module.mk delete mode 100644 ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Functions.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Pics.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Pixits.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Templates.ttcn delete mode 100644 ttcn/CAM/LibItsCam_TestSystem.ttcn delete mode 100644 ttcn/CAM/LibItsCam_TypesAndValues.ttcn delete mode 100644 ttcn/CAM/module.mk delete mode 100644 ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Functions.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Pics.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Pixits.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Templates.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_TestSystem.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_TypesAndValues.ttcn delete mode 100644 ttcn/DENM/module.mk delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn delete mode 100644 ttcn/GeoNetworking/module.mk create mode 100644 ttcn/Http/LibItsHttp_Pixits.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Functions.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Pics.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Pixits.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Templates.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_TestSystem.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn delete mode 100644 ttcn/IVIM/module.mk delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/module.mk delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn delete mode 100644 ttcn/MapemSpatem/module.mk delete mode 100644 ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Functions.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Pics.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Pixits.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Templates.ttcn delete mode 100644 ttcn/Pki/LibItsPki_TestSystem.ttcn delete mode 100644 ttcn/Pki/LibItsPki_TypesAndValues.ttcn delete mode 100644 ttcn/Pki/module.mk delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn delete mode 100644 ttcn/Rtcmem/module.mk delete mode 100644 ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Functions.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Pics.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Pixits.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Templates.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_TestSystem.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_TypesAndValues.ttcn delete mode 100644 ttcn/Security/module.mk delete mode 100644 ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Functions.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Pics.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Templates.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn delete mode 100644 ttcn/SremSsem/module.mk diff --git a/asn1/CAM/CAM_PDU_Descriptions.asn b/asn1/CAM/CAM_PDU_Descriptions.asn deleted file mode 100644 index a13a9fac..00000000 --- a/asn1/CAM/CAM_PDU_Descriptions.asn +++ /dev/null @@ -1,132 +0,0 @@ -CAM-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - --- The root data frame for cooperative awareness messages - -CAM ::= SEQUENCE { - header ItsPduHeader, - cam CoopAwareness -} - -CoopAwareness ::= SEQUENCE { - generationDeltaTime GenerationDeltaTime, - camParameters CamParameters -} - -CamParameters ::= SEQUENCE { - basicContainer BasicContainer, - highFrequencyContainer HighFrequencyContainer, - lowFrequencyContainer LowFrequencyContainer OPTIONAL, - specialVehicleContainer SpecialVehicleContainer OPTIONAL, - ... -} - -HighFrequencyContainer ::= CHOICE { - basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, - rsuContainerHighFrequency RSUContainerHighFrequency, - ... -} - - LowFrequencyContainer ::= CHOICE { - basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, - ... -} - -SpecialVehicleContainer ::= CHOICE { - publicTransportContainer PublicTransportContainer, - specialTransportContainer SpecialTransportContainer, - dangerousGoodsContainer DangerousGoodsContainer, - roadWorksContainerBasic RoadWorksContainerBasic, - rescueContainer RescueContainer, - emergencyContainer EmergencyContainer, - safetyCarContainer SafetyCarContainer, - ... -} - -BasicContainer ::= SEQUENCE { - stationType StationType, - referencePosition ReferencePosition, - ... -} - -BasicVehicleContainerHighFrequency ::= SEQUENCE { - heading Heading, - speed Speed, - driveDirection DriveDirection, - vehicleLength VehicleLength, - vehicleWidth VehicleWidth, - longitudinalAcceleration LongitudinalAcceleration, - curvature Curvature, - curvatureCalculationMode CurvatureCalculationMode, - yawRate YawRate, - accelerationControl AccelerationControl OPTIONAL, - lanePosition LanePosition OPTIONAL, - steeringWheelAngle SteeringWheelAngle OPTIONAL, - lateralAcceleration LateralAcceleration OPTIONAL, - verticalAcceleration VerticalAcceleration OPTIONAL, - performanceClass PerformanceClass OPTIONAL, - cenDsrcTollingZone CenDsrcTollingZone OPTIONAL -} - -BasicVehicleContainerLowFrequency ::= SEQUENCE { - vehicleRole VehicleRole, - exteriorLights ExteriorLights, - pathHistory PathHistory -} - -PublicTransportContainer ::= SEQUENCE { - embarkationStatus EmbarkationStatus, - ptActivation PtActivation OPTIONAL -} - -SpecialTransportContainer ::= SEQUENCE { - specialTransportType SpecialTransportType, - lightBarSirenInUse LightBarSirenInUse -} - - DangerousGoodsContainer ::= SEQUENCE { - dangerousGoodsBasic DangerousGoodsBasic - } - - RoadWorksContainerBasic ::= SEQUENCE { - roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, - lightBarSirenInUse LightBarSirenInUse, - closedLanes ClosedLanes OPTIONAL - } - -RescueContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse -} - -EmergencyContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - emergencyPriority EmergencyPriority OPTIONAL -} - -SafetyCarContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - trafficRule TrafficRule OPTIONAL, - speedLimit SpeedLimit OPTIONAL -} - -RSUContainerHighFrequency ::= SEQUENCE { - protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, - ... -} - -GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) - -END \ No newline at end of file diff --git a/asn1/CAM/module.mk b/asn1/CAM/module.mk deleted file mode 100644 index bc9e3447..00000000 --- a/asn1/CAM/module.mk +++ /dev/null @@ -1,2 +0,0 @@ -sources := CAM_PDU_Descriptions.asn - diff --git a/asn1/DENM/DENM_PDU_Descriptions.asn b/asn1/DENM/DENM_PDU_Descriptions.asn deleted file mode 100644 index fa4ea6d7..00000000 --- a/asn1/DENM/DENM_PDU_Descriptions.asn +++ /dev/null @@ -1,108 +0,0 @@ -DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - -DENM ::= SEQUENCE { - header ItsPduHeader, - denm DecentralizedEnvironmentalNotificationMessage -} - -DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { - management ManagementContainer, - situation SituationContainer OPTIONAL, - location LocationContainer OPTIONAL, - alacarte AlacarteContainer OPTIONAL -} - -ManagementContainer ::= SEQUENCE { - actionID ActionID, - detectionTime TimestampIts, - referenceTime TimestampIts, - termination Termination OPTIONAL, - eventPosition ReferencePosition, - relevanceDistance RelevanceDistance OPTIONAL, - relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, - validityDuration ValidityDuration DEFAULT defaultValidity, - transmissionInterval TransmissionInterval OPTIONAL, - stationType StationType, - ... -} - -SituationContainer ::= SEQUENCE { - informationQuality InformationQuality, - eventType CauseCode, - linkedCause CauseCode OPTIONAL, - eventHistory EventHistory OPTIONAL, - ... -} - -LocationContainer ::= SEQUENCE { - eventSpeed Speed OPTIONAL, - eventPositionHeading Heading OPTIONAL, - traces Traces, - roadType RoadType OPTIONAL, - ... -} - -ImpactReductionContainer ::= SEQUENCE { - heightLonCarrLeft HeightLonCarr, - heightLonCarrRight HeightLonCarr, - posLonCarrLeft PosLonCarr, - posLonCarrRight PosLonCarr, - positionOfPillars PositionOfPillars, - posCentMass PosCentMass, - wheelBaseVehicle WheelBaseVehicle, - turningRadius TurningRadius, - posFrontAx PosFrontAx, - positionOfOccupants PositionOfOccupants, - vehicleMass VehicleMass, - requestResponseIndication RequestResponseIndication -} - -RoadWorksContainerExtended ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse OPTIONAL, - closedLanes ClosedLanes OPTIONAL, - restriction RestrictedTypes OPTIONAL, - speedLimit SpeedLimit OPTIONAL, - incidentIndication CauseCode OPTIONAL, - recommendedPath ItineraryPath OPTIONAL, - startingPointSpeedLimit DeltaReferencePosition OPTIONAL, - trafficFlowRule TrafficRule OPTIONAL, - referenceDenms ReferenceDenms OPTIONAL - } - -StationaryVehicleContainer ::= SEQUENCE { - stationarySince StationarySince OPTIONAL, - stationaryCause CauseCode OPTIONAL, - carryingDangerousGoods DangerousGoodsExtended OPTIONAL, - numberOfOccupants NumberOfOccupants OPTIONAL, - vehicleIdentification VehicleIdentification OPTIONAL, - energyStorageType EnergyStorageType OPTIONAL -} - -AlacarteContainer ::= SEQUENCE { - lanePosition LanePosition OPTIONAL, - impactReduction ImpactReductionContainer OPTIONAL, - externalTemperature Temperature OPTIONAL, - roadWorks RoadWorksContainerExtended OPTIONAL, - positioningSolution PositioningSolutionType OPTIONAL, - stationaryVehicle StationaryVehicleContainer OPTIONAL, - ... -} - -defaultValidity INTEGER ::= 600 - -Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} - -ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID - -END \ No newline at end of file diff --git a/asn1/DENM/module.mk b/asn1/DENM/module.mk deleted file mode 100644 index 16c39c94..00000000 --- a/asn1/DENM/module.mk +++ /dev/null @@ -1,2 +0,0 @@ -sources := DENM_PDU_Descriptions.asn - diff --git a/asn1/DSRCData/DSRCData.asn b/asn1/DSRCData/DSRCData.asn deleted file mode 100644 index 1af274d7..00000000 --- a/asn1/DSRCData/DSRCData.asn +++ /dev/null @@ -1,267 +0,0 @@ -DSRCData {iso(1) standard(0) dsrc(15628) dsrcData(0) version (1)} -DEFINITIONS AUTOMATIC TAGS::= BEGIN --- IMPORTS --- New type definitions shall be imported from other ASN.1 modules as follows: --- Type1, Type2 FROM ModuleA; --- were: --- - Type1 and Type2 shall be replaced with the names of the types to be imported. --- - ModuleA shall be replaced the name of the exporting ASN.1 module --- EXPORTS everything; -Action-Request::=SEQUENCE{ - mode BOOLEAN, - eid Dsrc-EID, - actionType ActionType, - accessCredentials OCTET STRING (SIZE (0..127,...)) OPTIONAL, - actionParameter Container OPTIONAL, - iid Dsrc-EID OPTIONAL - } - -Action-Response::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - eid Dsrc-EID, - iid Dsrc-EID OPTIONAL, - responseParameter Container OPTIONAL, - ret ReturnStatus OPTIONAL - } - -ActionType::=INTEGER(0..127,...) --- (0..118) Reserved for ISO/CEN use. --- Below ActionTypes defined in ISO FDIS 14906 --- 0 : getStamped --- 1 : setStamped --- 2 : getSecure --- 3 : setSecure --- 4 : getInstance --- 5 : setInstance --- 6 : getNonce --- 7 : setNonce --- 8 : transferChannel --- 9 : copy --- 10 : setMMI --- 11 : substract --- 12 : add --- 13 : debit --- 14 : credit --- 15 : echo --- (119-127) Reserved for private use - -ApplicationContextMark::=Container -- OCTET STRING (SIZE(0..127,...)) --- Illustration of an ApplicationContextMark example --- can be found in ISO 14906, referred to as an EFC-ContextMark - -ApplicationList::=SEQUENCE (SIZE (0..127,...)) OF SEQUENCE { - aid DSRCApplicationEntityID, - eid Dsrc-EID OPTIONAL, - parameter ApplicationContextMark OPTIONAL - } - -AttributeIdList::=SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) - -AttributeList::=SEQUENCE (SIZE(0..127,...)) OF Attributes - -Attributes::=SEQUENCE{ - attributeId INTEGER (0..127,...), - attributeValue Container - } - -BeaconID::=SEQUENCE{ - manufacturerid INTEGER(0..65535), - individualid INTEGER(0..134217727) - } -- for registration of manufacturerid see www.nen.nl/cen278 - -BroadcastPool::=SEQUENCE{ - directoryvalue Directory, - content SEQUENCE (SIZE(0..127,...)) OF File - } - -BST::=SEQUENCE{ - rsu BeaconID, - time Time, - profile Profile, - mandApplications ApplicationList, - nonmandApplications ApplicationList OPTIONAL, - profileList SEQUENCE (SIZE(0..127,...)) OF Profile - } - -Container::=CHOICE{ - integer [0] INTEGER, - bitstring [1] BIT STRING, - octetstring [2] OCTET STRING (SIZE (0..127, ...)), - universalString [3] UniversalString, - beaconId [4] BeaconID, - t-apdu [5] T-APDUs, - dsrcApplicationEntityId[6] DSRCApplicationEntityID, - dsrc-Ase-Id [7] Dsrc-EID, - attrIdList [8] AttributeIdList, - attrList [9] AttributeList, - broadcastPool [10] BroadcastPool, - directory [11] Directory, - file [12] File, - fileType [13] FileType, - record [14] Record, - time [15] Time, - vector [16] SEQUENCE (SIZE(0..255)) OF INTEGER(0..127,...), --- tags [17..69] are defined in ISO 14906 for CEN DSRC application use --- tags [70..86] are reserved for ISO/CEN DSRC application use --- tags [87..127] are reserved for private use and intended for the --- addressing of the corresponding private attribute identifiers. - ... -- extension marker --- New attributes shall be inserted as: --- componentName1 [i] ModuleA.Type1 --- were --- - componentName1 is a name unique within the Container definition --- - "i" is the registered tag chosen from the ranges as specified above. --- - Type1 is the name of an imported type and --- - ModuleA is the name of the module the type Type1 is imported from. --- The prefix “ModuleA.” is only required in case of a name conflict, --- if the name “Type1” is not also defined in the DSRCData module and not --- imported from another module the prefix “ModuleA” should be ommitted. - } - -Directory::=SEQUENCE (SIZE(0..127,...)) OF FileName - -Dsrc-EID::=INTEGER(0..127, ...) - -DSRCApplicationEntityID::=INTEGER{ - system (0), - electronic-fee-collection (1), - freight-fleet-management (2), - public-transport (3), - traffic-traveller-information (4), - traffic-control (5), - parking-management (6), - geographic-road-database (7), - medium-range-preinformation (8), - man-machine-interface (9), - intersystem-interface (10), - automatic-vehicle-identification (11), - emergency-warning (12), - private (13), - multi-purpose-payment (14), - dsrc-resource-manager (15), - after-theft-systems (16), - cruise-assist-highway-system (17), - multi-purpose-information-system (18), - multi-mobile-information-system (19) - -- (20..28) are reserved for ISO/CEN-dsrc-applications - -- (29..30) are reserved for private use - -- 31 is reserved for ISO/CEN-dsrc-applications - }(0..31,...) --- For the latest standard use of application definition, --- refer to Clause 9 --- As an example, the application "electronic-fee-collection (1)" --- is standardised by ISO 14906 - -Event-Report-Request::=SEQUENCE{ - mode BOOLEAN, - eid Dsrc-EID, - eventType EventType, - accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, - eventParameter Container OPTIONAL, - iid Dsrc-EID OPTIONAL - } - -Event-Report-Response::=SEQUENCE{ - fill BIT STRING (SIZE(2)), - eid Dsrc-EID, - iid Dsrc-EID OPTIONAL, - ret ReturnStatus OPTIONAL - } - -EventType::=INTEGER{ - release (0) - -- (1..118) are reserved for ISO/CEN use - -- (119..127) are reserved for private use - }(0..127,...) - -File::=SEQUENCE (SIZE(0..127,...)) OF Record - -FileName::=SEQUENCE{ - aseID Dsrc-EID, - fileID INTEGER(0..127,...) - } - -FileType::=NULL --- Not defined. This might be defined in future version. - -Get-Request::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - eid Dsrc-EID, - accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, - iid Dsrc-EID OPTIONAL, - attrIdList AttributeIdList OPTIONAL - } - -Get-Response::=SEQUENCE{ -fill BIT STRING (SIZE(1)), -eid Dsrc-EID, -iid Dsrc-EID OPTIONAL, -attributelist AttributeList OPTIONAL, -ret ReturnStatus OPTIONAL -} -Initialisation-Request::=BST -Initialisation-Response::=VST -NamedFile::=SEQUENCE{ -name FileName, -file File -} --- NamedFile will be used in T-Kernel with GetBroadcastData-Request, --- that might be specified in T-APDU in future version. -ObeConfiguration::=SEQUENCE{ -equipmentClass INTEGER(0..32767), -manufacturerID INTEGER(0..65535), -obeStatus INTEGER(0..65535) OPTIONAL -} -Profile::=INTEGER (0..127,...) --- (0..118) are reserved for ISO/CEN use, --- (119..127) are reserved for private use -Record::=CHOICE{ simple VisibleString, -... -} -ReturnStatus::=INTEGER{ -noError (0), -accessDenied (1), -argumentError (2), -complexityLimitation (3), -processingFailure (4), -processing (5), -chainingError (6) --- (7..99) are reserved for future ISO/CEN use, --- (100..127) are reserved for private use -}(0..127,...) -Set-Request::=SEQUENCE{ -fill BIT STRING (SIZE(1)), -mode BOOLEAN, -eid Dsrc-EID, -accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, -attrList AttributeList, -iid Dsrc-EID OPTIONAL -} -Set-Response::=SEQUENCE{ -fill BIT STRING (SIZE(2)), -eid Dsrc-EID, -iid Dsrc-EID OPTIONAL, -ret ReturnStatus OPTIONAL -} -Time::=INTEGER(0..4294967295) --- The number of seconds passed since --- 1st January 1970, 00:00 (UTC) -T-APDUs::=CHOICE{ -action-request [0] Action-Request, -action-response [1] Action-Response, -event-report-request [2] Event-Report-Request, -event-report-response [3] Event-Report-Response, -set-request [4] Set-Request, -set-response [5] Set-Response, -get-request [6] Get-Request, -get-response [7] Get-Response, -initialisation-request [8] Initialisation-Request, -initialisation-response [9] Initialisation-Response -} -VST::=SEQUENCE{ -fill BIT STRING (SIZE(4)), -profile Profile, -applications ApplicationList, -obeConfiguration ObeConfiguration -} -END diff --git a/asn1/DSRCData/DSRCtransferData.asn b/asn1/DSRCData/DSRCtransferData.asn deleted file mode 100644 index cb052eaa..00000000 --- a/asn1/DSRCData/DSRCtransferData.asn +++ /dev/null @@ -1,7 +0,0 @@ -DSRCtransferData {iso(1) standard(0) dsrc(15628) dsrctransferData(1) version (1)} -DEFINITIONS::= BEGIN -IMPORTS T-APDUs -FROM DSRCData {iso(1) standard(0) dsrc(15628) dsrcData(0) version (1)}; --- EXPORTS everything; -Message::= T-APDUs -- Message is transferred over the DSRC link; -END diff --git a/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn b/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn deleted file mode 100644 index 1455feed..00000000 --- a/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn +++ /dev/null @@ -1,157 +0,0 @@ -EV-RechargingSpotReservation-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (101556) ev-rsr (4) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - -EV-RSR ::= SEQUENCE { - header ItsPduHeader, - messageBody EV-RSR-MessageBody -} - -EV-RSR-MessageBody ::= CHOICE { - preReservationRequestMessage PreReservationRequestMessage, - preReservationResponseMessage PreReservationResponseMessage, - reservationRequestMessage ReservationRequestMessage, - reservationResponseMessage ReservationResponseMessage, - cancellationRequestMessage CancellationRequestMessage, - cancellationResponseMessage CancellationResponseMessage, - updateRequestMessage UpdateRequestMessage, - updateResponseMessage UpdateResponseMessage, -... -} - -PreReservationRequestMessage ::= SEQUENCE { - evse-ID EVSE-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - rechargingType RechargingType, - batteryType BatteryType OPTIONAL, - ... -} - -PreReservationResponseMessage ::= SEQUENCE { - preReservation-ID PreReservation-ID, - availabilityStatus AvailabilityStatus, - preReservationExpirationTime TimestampUTC, - supportedPaymentTypes SupportedPaymentTypes, - ... -} - -ReservationRequestMessage ::= SEQUENCE { - currentTime TimestampUTC, - preReservation-ID PreReservation-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - eAmount EAmount, - eAmountMin EAmount, - paymentType PaymentType, - payment-ID Payment-ID, - secondPayment-ID Payment-ID OPTIONAL, - pairing-ID Pairing-ID OPTIONAL, - ... -} - -ReservationResponseMessage ::= SEQUENCE { - reservationResponseCode ReservationResponseCode, - reservation-ID Reservation-ID OPTIONAL, - reservation-Password Reservation-Password OPTIONAL, - stationDetails StationDetails OPTIONAL, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - expirationTime TimestampUTC, - freeCancelTimeLimit TimestampUTC OPTIONAL, - ... -} - -CancellationRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - currentTime TimestampUTC, - ... -} - -CancellationResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - cancellationResponseCode CancellationResponseCode, - ... -} - -UpdateRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - updatedArrivalTime TimestampUTC, - updatedDepartureTime TimestampUTC, - ... -} - -UpdateResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - updateResponseCode UpdateResponseCode, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - ... -} - - - -AvailabilityStatus ::= ENUMERATED { available, no-free-capacity } - -BatteryType ::= UTF8String (SIZE(1..16)) - -CancellationResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password } - -ChargingSpotLabel ::= UTF8String (SIZE(1..4)) - -ContractID ::= UTF8String (SIZE(1..24)) - -EAmount ::= INTEGER { oneWh(1) } (1..500000) - -ChargingPower ::= INTEGER { oneW(1) } (1..200000) - -EVSE-ID ::= OCTET STRING (SIZE(1..32)) - -ExternalIdentificationMeans ::= UTF8String (SIZE(1..24)) - -Pairing-ID ::= VisibleString (SIZE(1..64)) - -PaymentType ::= ENUMERATED {contract, externalIdentification} - -Payment-ID ::= CHOICE { - contractID ContractID, - externalIdentificationMeans ExternalIdentificationMeans -} - -RechargingType ::= SEQUENCE { - rechargingMode RechargingMode, - powerSource PowerSource -} - -RechargingMode ::= INTEGER { mode1(0), mode2(1), mode3(2), mode4(3), quickDrop(8), inductiveChargingWhileStationary(12), inductiveChargingWhileDriving(14) } (0..15) - -PowerSource::= INTEGER { notApplicable(0), ac1Phase(1), ac2Phase(2), ac3Phase(3), dcc(4), chaDeMo(5) } (0..7) -ReservationResponseCode ::= ENUMERATED {ok, invalid-EVSE-ID, payment-type-not-supported, payment-error, authentication-error, insufficient-power-availability } - -Reservation-ID ::= VisibleString (SIZE(8)) - -PreReservation-ID ::= Reservation-ID - -Reservation-Password ::= VisibleString (SIZE(8)) - - -StationDetails ::= UTF8String (SIZE(1..32)) - -SupportedPaymentTypes ::= BIT STRING { contract(0), externalIdentification (1) } (SIZE(2)) - -TimestampUTC ::= INTEGER { utcStartOf2013(0), oneSecondAfterUTCStartOf2013(1) } - -UpdateResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password, invalid-Arrival-Time, invalid-Departure-Time } - -StatusResponseCode ::= ENUMERATED { charging-Spot-Occupied, charging-Spot-Unoccupied, charging-Ongoing, reservation-Limit-Exceeded, reservation-Cancelled, unknown-Reservation-ID, expired-Reservation-ID } - -END diff --git a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn deleted file mode 100644 index b86fbb19..00000000 --- a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn +++ /dev/null @@ -1,102 +0,0 @@ --- Point of Interest (POI) notification for charging spot --- for electric vehicle --- EVCSN Message definition --- ASN.1 Start Definition - -EVCSN-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) -wg1 (1) ts (101556) evcsn (1) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader, - StationID, - TimestampIts, - ReferencePosition -FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - --- Root Message PDU: EvcsnPdu - -EvcsnPdu ::= SEQUENCE { - header ItsPduHeader, - evcsn EVChargingSpotNotificationPOIMessage -} - -EVChargingSpotNotificationPOIMessage ::= SEQUENCE { - poiHeader ItsPOIHeader, -- Specific POI Message Header - evcsnData ItsEVCSNData -- Electric Vehicle Charging Spot Data Elements -} - -ItsPOIHeader ::= SEQUENCE { - poiType POIType, -- set to "EV charging station POI ID = 1" - timeStamp TimestampIts, - relayCapable BOOLEAN -} - - -ItsEVCSNData ::= SEQUENCE { - totalNumberOfStations NumberStations, - chargingStationsData SEQUENCE (SIZE(1..256)) OF ItsChargingStationData -} - -ItsChargingStationData ::= SEQUENCE { - chargingStationID StationID, - utilityDistributorId UTF8String (SIZE(1..32)) OPTIONAL, - providerID UTF8String (SIZE(1..32)) OPTIONAL, - chargingStationLocation ReferencePosition, - address UTF8String OPTIONAL, - phoneNumber NumericString (SIZE(1..16)) OPTIONAL, - accessibility UTF8String (SIZE(1..32)), - digitalMap DigitalMap OPTIONAL, - openingDaysHours UTF8String, - pricing UTF8String, - bookingContactInfo UTF8String OPTIONAL, - payment UTF8String OPTIONAL, - chargingSpotsAvailable ItsChargingSpots, - ... -} - - -ItsChargingSpots ::= SEQUENCE (SIZE(1..16)) OF ItsChargingSpotDataElements - - -ItsChargingSpotDataElements ::= SEQUENCE { - type ChargingSpotType, - evEquipmentID UTF8String OPTIONAL, - typeOfReceptacle TypeOfReceptacle, - energyAvailability UTF8String, - parkingPlacesData ParkingPlacesData OPTIONAL -} - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -ChargingSpotType ::= BIT STRING { - standardChargeMode1(0), - standardChargeMode2(1), - standardOrFastChargeMode3(2), - fastChargeWithExternalCharger(3), - quickDrop(8), - inductiveChargeWhileStationary(12), - inductiveChargeWhileDriving(14) -} - -TypeOfReceptacle ::= BIT STRING - -ParkingPlacesData ::= SEQUENCE (SIZE(1..4)) OF SpotAvailability - -SpotAvailability ::= SEQUENCE { - maxWaitingTimeMinutes INTEGER (0..1400), -- 0 if available or max waiting - -- time (minutes) - blocking BOOLEAN -- true if the spot can be blocked -} - -POIType ::= INTEGER(0..65535) -NumberStations ::= INTEGER(1..256) - -END diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn deleted file mode 100644 index 319c1522..00000000 --- a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the In vehicle information Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -IVIM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ivim (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -IviStructure FROM IVI { iso (1) standard (0) ivi (19321) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -IVIM ::= SEQUENCE { - header ItsPduHeader, - ivi IviStructure -} - -END - diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn deleted file mode 100644 index 9496e553..00000000 --- a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn +++ /dev/null @@ -1,21 +0,0 @@ --- @brief Specification of the Map (lane topology) extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -MAPEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) mapem (1) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -MAPEM ::= SEQUENCE { - header ItsPduHeader, - map MapData -} - -END diff --git a/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn deleted file mode 100644 index 1c0ea624..00000000 --- a/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the RTCM corrections extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -RTCMEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) rtcmem (5) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -RTCMEM ::= SEQUENCE { - header ItsPduHeader, - rtcmc RTCMcorrections -} - -END - diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn deleted file mode 100644 index dbad8257..00000000 --- a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn +++ /dev/null @@ -1,37 +0,0 @@ --- @brief Specification of the Signal phase and timing extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SPATEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) spatem (0) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS --- @brief Include ISO 19091 --- Include references from @url https://standards.iso.org/iso/ts/19091/ed-2/en/ISO-TS-19091-addgrp-C-2018.asn -SPAT -FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } - --- @brief Include ETSI TS 102 894-2 --- Include references from @url https://forge.etsi.org/rep/ITS/ITS_ASN1/blob/master/CDD_TS102894-2/ITS-Container.asn -ItsPduHeader -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - --- Signal phase and timing extended Message - --- @brief Signal phase and timing extended Message Root --- This DF includes DEs for the SPATEM protocolVersion, the SPAT message type identifier _messageID_ and --- the station identifier _stationID_ of the originating ITS-S. -SPATEM ::= SEQUENCE { - -- @details header - -- The DE _protocolVersion_ is used to select the appropriate protocol decoder at the receiving ITS-S. - -- It shall be set to 2. - -- The DE _messageID_ shall be spatem(4). - header ItsPduHeader, - spat SPAT -} - -END diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn deleted file mode 100644 index a96af0e5..00000000 --- a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn +++ /dev/null @@ -1,21 +0,0 @@ --- @brief Specification of the Signal request extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SREM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) srem (3) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -SREM ::= SEQUENCE { - header ItsPduHeader, - srm SignalRequestMessage -} - -END diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn deleted file mode 100644 index 7c3069be..00000000 --- a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the Signal status extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SSEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ssem (4) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - - -SSEM ::= SEQUENCE { - header ItsPduHeader, - ssm SignalStatusMessage -} - -END diff --git a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn deleted file mode 100644 index 9fd119ba..00000000 --- a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn +++ /dev/null @@ -1,29 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14816 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/14816/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS; - -CS5::= SEQUENCE { - vin VisibleString, -- 17 characters VIN - fill BIT STRING (SIZE(9)) -- set to '000000000' -} - - - -CountryCode::= BIT STRING(SIZE(10)) - -AVIAEIIssuerIdentifier::= INTEGER(0 .. 16383) - -END diff --git a/asn1/IS/ISO_TS_14823/GDD.asn b/asn1/IS/ISO_TS_14823/GDD.asn deleted file mode 100644 index 681858c1..00000000 --- a/asn1/IS/ISO_TS_14823/GDD.asn +++ /dev/null @@ -1,140 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14823 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location (yet missing there): --- https://standards.iso.org/iso/ts/14823/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -GDD {iso (1) standard (0) gdd(14823) version1 (0)} - -DEFINITIONS AUTOMATIC TAGS::= -BEGIN - -IMPORTS -Distance, DistanceOrDuration, DestinationPlace, DestinationPlaces, DestinationRoad, DestinationRoads, MonthDay, HoursMinutes, DayOfWeek, Weight, DDD-IO, DDD-IO-LIST -FROM IVI {iso (1) standard (0) ivi (19321) version2 (2)}; - ---Definition of GDD Structure - -GddStructure::= SEQUENCE{ - pictogramCode SEQUENCE { - countryCode OCTET STRING (SIZE (2)) OPTIONAL, - serviceCategoryCode CHOICE { - trafficSignPictogram ENUMERATED {dangerWarning, regulatory, informative,...}, - publicFacilitiesPictogram ENUMERATED {publicFacilities, ...}, - ambientOrRoadConditionPictogram ENUMERATED {ambientCondition, roadCondition,...}, - ...}, - pictogramCategoryCode SEQUENCE { - nature INTEGER (1..9), - serialNumber INTEGER (0..99) -}}, - attributes GddAttributes OPTIONAL -} - --- Definition of the single ISO 14823 Attributes -GddAttributes::= SEQUENCE (SIZE(1..8),...) OF GddAttribute - -GddAttribute::= CHOICE{ - dtm InternationalSign-applicablePeriod, -- Date/Time/Period - edt InternationalSign-exemptedApplicablePeriod,-- Exemption status of Date/Time/Period - dfl InternationalSign-directionalFlowOfLane,-- Directional Flow of Lane - ved InternationalSign-applicableVehicleDimensions,-- Vehicle Dimensions - spe InternationalSign-speedLimits,-- Speed - roi InternationalSign-rateOfIncline,-- Rate of Incline - dbv InternationalSign-distanceBetweenVehicles,-- Distance Between Vehicles - ddd InternationalSign-destinationInformation,-- Destination/Direction/Distance - set InternationalSign-section, -- Section - nol InternationalSign-numberOfLane -- Number of Lanes - } - -InternationalSign-applicablePeriod::= SEQUENCE { - year SEQUENCE { -- contains yearRangeStartYear and yearRangeEndYear - yearRangeStartYear INTEGER(2000..2127,...), - yearRangeEndYear INTEGER(2000..2127,...) - } OPTIONAL, - month-day SEQUENCE { -- contains dateRangeStartMonth&Date and dateRangeEndMonth&Date - dateRangeStartMonthDay MonthDay, - dateRangeEndMonthDay MonthDay - } OPTIONAL, - repeatingPeriodDayTypes RepeatingPeriodDayTypes OPTIONAL, - hourMinutes SEQUENCE { -- contains timeRangeStartTime and timeRangeEndTime - timeRangeStartTime HoursMinutes, - timeRangeEndTime HoursMinutes - } OPTIONAL, - dateRangeOfWeek DayOfWeek OPTIONAL, - durationHourMinute HoursMinutes OPTIONAL -} - -InternationalSign-exemptedApplicablePeriod::= InternationalSign-applicablePeriod - -InternationalSign-directionalFlowOfLane::= INTEGER { - sDL (1),-- Straight Direction Only - sLT (2),-- Straight and Left Turn Only - sRT (3),-- Straight and Right Turn Only - lTO (4),-- Left Turn Only - rTO (5),-- Right Turn Only - cLL (6),-- Convergence from the Left Lane - cRI (7),-- Convergence from the Right Lane - oVL (8) -- Oncoming Vehicles Lane - } (1..8) - -InternationalSign-applicableVehicleDimensions::= SEQUENCE{ - vehicleHeight Distance OPTIONAL, - vehicleWidth Distance OPTIONAL, - vehicleLength Distance OPTIONAL, - vehicleWeight Weight OPTIONAL - } - -InternationalSign-speedLimits::= SEQUENCE{ - speedLimitMax INTEGER(0..250) OPTIONAL, - speedLimitMin INTEGER(0..250) OPTIONAL, - unit Code-Units (0..1) - } - -InternationalSign-rateOfIncline::= INTEGER(1..32) - -InternationalSign-distanceBetweenVehicles::= Distance - -InternationalSign-destinationInformation::= SEQUENCE{ - junctionDirection INTEGER(1..128) OPTIONAL, - roundaboutCwDirection INTEGER(1..128)OPTIONAL, - roundaboutCcwDirection INTEGER(1..128)OPTIONAL, - ioList DDD-IO-LIST - } - -InternationalSign-section::= SEQUENCE{ - startingPointLength Distance OPTIONAL, - continuityLength Distance OPTIONAL - } - -InternationalSign-numberOfLane::= INTEGER(0..99) - --- Definition of data elements used in ISO 14823 attributes - -Code-Units::= INTEGER { - kmperh (0), - milesperh (1), - kilometre (2), - metre (3), - decimetre (4), - centimetre (5), - mile (6), - yard (7), - foot (8), - minutesOfTime (9), - tonnes (10),--1000 kg, not Ton! - hundredkg (11), - pound (12),--lbs - rateOfIncline (13), - durationinminutes (14) - -- value 15 reserved for future use - } (0..15) - -RepeatingPeriodDayTypes::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) - -END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn deleted file mode 100644 index c4c8dd48..00000000 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ /dev/null @@ -1,627 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14906 App --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains a compile clean version of EfcDsrcApplication module --- --- Published version location: --- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcApplicationv6.asn --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} -DEFINITIONS AUTOMATIC TAGS ::= BEGIN -EXPORTS ALL; -IMPORTS -CountryCode, CS5, AVIAEIIssuerIdentifier -FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} --- defined in ISO 14816 -- -AttributeIdList, Attributes{}, AttributeList{} -FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)}; --- NOTE: The following are the definitions of the action and response --- parameters -ActualNumberOfPassengers ::= Int1 -AxleWeightLimits ::= SEQUENCE { - maxLadenweightOnAxle1 Int2, - maxLadenweightOnAxle2 Int2, - maxLadenweightOnAxle3 Int2, - maxLadenweightOnAxle4 Int2, - maxLadenweightOnAxle5 Int2 -} -AddRq::= SEQUENCE { -attributeId INTEGER(0..127,...), -value INTEGER -} -ChannelId::= INTEGER { -obu (0), -sam1 (1), -- secure application module -sam2 (2), -icc (3), -- integrated circuit(s) card -display (4), -buzzer (5), -printer (6), -serialInterface (7), -- serial interface: eg. RS232 and RS485 -parallelInterface (8), -gPS (9), -tachograph (10), -privateUse1 (11), -- free for proprietary use -privateUse2 (12), -- free for proprietary use -privateUse3 (13), -- free for proprietary use -privateUse4 (14), -- free for proprietary use -privateUse5 (15), -- free for proprietary use -bluetooth (16) --- (17-255) are reserved for future CEN use -} (0..255) -ChannelRq::= SEQUENCE{ -channelId ChannelId, -apdu OCTET STRING --- format according to the interface --- of the channelId -} -ChannelRs::= SEQUENCE{ -channelId ChannelId, -apdu OCTET STRING --- format according to the interface --- of the channelId -} -CopyRq::= SEQUENCE { -destinationEID INTEGER(0..127,...), -attributeIdList AttributeIdList -} -CreditRq::= SEQUENCE { -refund PaymentFee, -nonce OCTET STRING, -key INTEGER(0..255) -} -CreditRs ::= SEQUENCE { -creditResult ResultFin, -creditAuthenticator OCTET STRING -} -DebitRq::= SEQUENCE { -debitPaymentFee PaymentFee, -nonce OCTET STRING, -keyRef INTEGER(0..255) -} -DebitRs ::= SEQUENCE { -debitResult ResultFin, -debitAuthenticator OCTET STRING -} -GetInstanceRq ::= SEQUENCE { -posOfFirstInstance INTEGER(0..255), -- position of first instance to be retrieved -posOfLastInstance INTEGER(0..255), -- position last instance to be retrieved -attributeIdList AttributeIdList -- Ids of attributes to be retrieved -} -GetInstanceRs{Container}::= SEQUENCE (SIZE (0..127,...)) OF SEQUENCE { -attributeId INTEGER(0..127,...), --- number of instances retrieved -attributeValues Container (WITH COMPONENTS {octetstring PRESENT}) --- The octetstring shall contain the contatenation of --- the unaligned PER encodings of the values of the --- instances, with each encoding padded to an integral --- of octets as specified for a top-level type in --- ISO/IEC 8825-2 -} -GetStampedRq::= SEQUENCE { -attributeIdList AttributeIdList, -nonce OCTET STRING, -- e.g. a random number -keyRef INTEGER(0..255) -} -GetStampedRs{Container}::= SEQUENCE { -attributeList AttributeList{Container}, -authenticator OCTET STRING -} -SetInstanceRq{Container} ::= SEQUENCE { -posOfInstance INTEGER(0..255), -attribute Attributes{Container} -} -SetMMIRq::= INTEGER { -ok (0), -- operation / transaction successfully completed -nok (1), -- operation / transaction not successfully completed -contactOperator (2), -- e.g. due to low balance or battery -noSignalling (255) -- no signalling --- (3-127) are reserved for future CEN use --- (128-254) are reserved for private use -} (0..255) -SetStampedRq{Container}::= SEQUENCE { -attributeList AttributeList{Container}, -nonce OCTET STRING, -keyRef INTEGER(0..255) -} -SubRq::= SEQUENCE { -attributeId INTEGER(0..127,...), -value INTEGER -} --- NOTE: The following are the definitions of EFC attributes -CO2EmissionValue ::= Int2 -ContractSerialNumber ::= Int4 -ContractAuthenticator ::= OCTET STRING -ContractValidity ::= SEQUENCE { -contractRestrictions OCTET STRING (SIZE(4)), -contractExpiryDate DateCompact -} -- intended to support ISO/TR 1998 implemented systems -ContractVehicle ::= LPN -DateCompact::= SEQUENCE { -year INTEGER (1990..2117), -month INTEGER (0..12), -- Value zero shall not be used --- except with 1990 - see below. -day INTEGER (0..31) -- Value zero shall not be used --- except with 1990 � see below. -} --- The value "{year 1990, month 0, day 0}" is a 16-bit all-zero --- encoding, and is used to represent "no date". -DescriptiveCharacteristics ::= INTEGER { -noEntry (0), -vehicleShape1 (1), -vehicleShape2 (2), -vehicleShape3 (3), -vehicleShape4 (4), -vehicleShape5 (5), -vehicleShape6 (6), -vehicleShape7 (7), -vehicleShape8 (8), -vehicleShape9 (9), -vehicleShape10 (10), -vehicleShape11 (11), -vehicleShape12 (12), -vehicleShape13 (13), -vehicleShape14 (14), -vehicleShape15 (15), -vehicleShape16 (16), -vehicleShape17 (17), -vehicleShape18 (18), -vehicleShape19 (19), -vehicleShape20 (20), -vehicleShape21 (21), -vehicleShape22 (22), -vehicleShape23 (23), -vehicleShape24 (24), -vehicleShape25 (25), -vehicleShape26 (26), -vehicleShape27 (27), -vehicleShape28 (28), -vehicleShape29 (29), -vehicleShape30 (30), -vehicleShape31 (31), -vehicleShape32 (32), -vehicleShape33 (33), -vehicleShape34 (34), -vehicleShape35 (35), -vehicleShape36 (36), -vehicleShape37 (37), -vehicleShape38 (38), -vehicleShape39 (39), -vehicleShape40 (40), -vehicleShape41 (41), -vehicleShape42 (42), -vehicleShape43 (43), -vehicleShape44 (44), -vehicleShape45 (45), -vehicleShape46 (46), -vehicleShape47 (47), -vehicleShape48 (48), -vehicleShape49 (49), -vehicleShape50 (50) --- (1..50) are reserved for future CEN use --- (51..255) are reserved for private use -} (0..255) -DieselEmissionValues::= SEQUENCE { - particulate SEQUENCE { - unitType UnitType, - value INTEGER (0..32767) - }, -absorptionCoeff Int2 } -EFC-ContextMark ::= SEQUENCE { -contractProvider Provider, -typeOfContract OCTET STRING (SIZE(2)), -contextVersion INTEGER(0..127,...) -} - -EnvironmentalCharacteristics::= SEQUENCE { - euroValue EuroValue, - copValue CopValue -} - -EuroValue::= ENUMERATED { - noEntry (0), - euro-1 (1), - euro-2 (2), - euro-3 (3), - euro-4 (4), - euro-5 (5), - euro-6 (6), - reservedForUse1 (7), - reservedForUse2 (8), - reservedForUse3 (9), - reservedForUse4 (10), - reservedForUse5 (11), - reservedForUse6 (12), - reservedForUse7 (13), - reservedForUse8 (14), - eev (15) -} -- 4 bits, EURO-Classes as defined in EC directive 88/77/EEC, annex 1 --- and in 91/542/EEC, 96/1/EC, 1999/96/EC, 2001/27/EC, regulation No 595/2009 --- and for EEV in Section 6.2.1 of Annex I in EC directive 2005/55/EC --- EUR-Class VI as defined in Regulation (EC) No 595/2009 -CopValue::= ENUMERATED { - noEntry (0), - co2class1 (1), -- below 101 g/km - co2class2 (2), -- 101 to 120 g/km - co2class3 (3), -- 121 to 140 g/km - co2class4 (4), -- 141 to 160 g/km - co2class5 (5), -- 161 to 200 g/km - co2class6 (6), -- 201 to 250 g/km - co2class7 (7), -- above 250 g/km - reservedforUse (8) -- reserved for future CEN and ISO use -} -- 4 bits, reserved for carbon dioxide pollution values as defined in --- EC directive 2003/127/EC' - -EngineCharacteristics::= INTEGER { - noEntry (0), - noEngine (1), - petrolUnleaded (2), - petrolLeaded (3), - diesel (4), - lPG (5), - battery (6), - solar (7), - hybrid (8), - hydrogen (9) - -- (10-255) are reserved for future CEN use -} (0..255) -Engine ::= SEQUENCE{ -engineCapacity Int2, -enginePower Int2 -} -EquipmentOBUId ::= OCTET STRING -EquipmentStatus ::= BIT STRING (SIZE(16)) -ExhaustEmissionValues ::= SEQUENCE { - unitType UnitType, - emissionCO INTEGER (0..32767), - emissionHC Int2, - emissionNOX Int2, - emissionHCNOX Int2 -} -FutureCharacteristics ::= INTEGER { -noEntry (0), -airSuspension (1) --- (2..255) are reserved for future CEN use -} (0..255) -ICC-Id ::= OCTET STRING -Int1 ::= INTEGER(0..255) - -Int2 ::= INTEGER(0..65535) -Int3 ::= INTEGER(0..16777215) -Int4 ::= INTEGER(0..4294967295) -LPN::= SEQUENCE { -countryCode CountryCode, -alphabetIndicator ENUMERATED { -latinAlphabetNo1 (1), -- encoded as 00 00 00'B -latinAlphabetNo2 (2), -- encoded as 00 00 01'B etc -latinAlphabetNo3 (3), -latinAlphabetNo4 (4), -latinCyrillicAlphabet (5), -latinArabicAlphabet (6), -latinGreekAlphabet (7), -latinHebrewAlphabet (8), -latinAlphabetNo5 (9), -latinAlphabetNo6 (10), -twoOctetBMP (11), -fourOctetCanonical (12), -reservedForUse1 (13), -reservedForUse2 (14), -reservedForUse3 (15), -reservedForUse4 (16), -reservedForUse5 (17), -reservedForUse6 (18), -reservedForUse7 (19), -reservedForUse8 (20), -reservedForUse9 (21), -reservedForUse10 (22), -reservedForUse11 (23), -reservedForUse12 (24), -reservedForUse13 (25), -reservedForUse14 (26), -reservedForUse15 (27), -reservedForUse16 (28), -reservedForUse17 (29), -reservedForUse18 (30), -reservedForUse19 (31), -reservedForUse20 (32), -reservedForUse21 (33) -} -- 6 bits, latinAlphabetNo1 recommended -- , --- refer to Annex E for conversion from LatinAlphabetNo 2 --- and 5 to Latin AlphabetNo1 -licencePlateNumber OCTET STRING -} -PassengerCapacity ::= SEQUENCE{ - numberOfSeats Int1, - numberOfStandingPlaces Int1 -} -PaymentFee ::= SEQUENCE { --- The fee (toll, charge or fare) which is requested by the --- service provider for the service provided or to be provided. -paymentFeeAmount Int2, --- paymentFeeAmount is the value of the fee being charged for the --- service. If no unit (payment fee unit) is specified, then --- it is known by default. -paymentFeeUnit PayUnit --- paymentFeeUnit is the unit in which the fee is expressed. -} -PaymentMeans ::= SEQUENCE { -personalAccountNumber PersonalAccountNumber, -paymentMeansExpiryDate DateCompact, -pamentMeansUsageControl OCTET STRING(SIZE(2)) --- issuer's specified restrictions, on the geographic usage --- and services allowed for the applications -} -PaymentMeansBalance ::= SignedValue -SignedValue ::= CHOICE { -positive INTEGER (0..8388607), -negative INTEGER (-8388608..-1) -} --- corresponds to a �3 octets Signed Integer�, associated with the following --- examples of line codes: --- -8'388'608 : 80 00 00'H --- -1 : FF FF FF'H --- 0 : 00 00 00'H --- 1 : 00 00 01�H --- 8'388'607 : 7F FF FF'H -PaymentMeansUnit ::= PayUnit -PaymentSecurityData ::= OCTET STRING -PayUnit ::= OCTET STRING (SIZE(2)) --- The unique designation of a Currency as defined in ISO 4217 --- using the ISO numeric binary coded decimal representation. --- The code can also express a company specific token or a --- "charging unit code" as used in the freight.unit in which --- the fee is expressed. --- Value Assignment : --- '0xxx'H Currency in main units --- '1xxx'H Currency in minor units of 10 :1 ('dime') --- '2xxx'H Currency in minor units of 100 :1 ('cents') --- '3xxx'H Currency in minor units of 1000 :1 --- '4xxx'H Currency in 'major' units / 10 --- (e.g. 10 Belgian Francs) --- '5xxx'H Currency in 'major' units / 100 --- (e.g. 100 Italian Lire) --- '6xxx'H Currency in 'major' units / 1000 --- '7xxx'H Currency in 'major' units / 10000 --- '8xxx'H Currency in 'major' units / 100000 --- where xxx is the BCD representation of "Currency" --- as defined in ISO 4217 --- '9xxx'H Tokens --- where xxx is Purse Provider specific coding. --- 'Axxx'H Charging Unit Codes, --- denoting quantification of the service provided --- (e.g. man-hours) -PersonalAccountNumber ::= OCTET STRING (SIZE(10)) --- Personal account number structure � according to ISO/IEC 7812-1 --- Issuer identifier number (�BIN�) --- Major industry identifier (MII, 1 binary coded decimal, BCD) --- 0 : reserved for future use by ISO/TC68 --- 1 : airline sector --- 2 : extended airline sector --- 3 : travel and tourism sector --- 4 : financial banking sector --- 5 : financial banking sector --- 6 : commerce and banking sector --- 7 : petrol industry sector --- 8 : telecommunication sector --- 9 : reserved for national use --- Issuer identifier (5 BCD in the second edition of ISO/IEC 7812-1) --- Account number (max 12 BCD) --- Control digit (1 BCD) --- Padding bits, set to 1'B, in order to accomplish a --- total length of 10 octets. - -Provider ::= SEQUENCE { - countryCode CountryCode, -providerIdentifier AVIAEIIssuerIdentifier -} -PurseBalance ::= SEQUENCE { --- The balance on the (electronic) purse, consisting of --- the value and the unit in which it is expressed. -purseValue SignedValue, --- The size of a balance expressed in a currency. --- This may be positive or negative. -purseUnit PayUnit -} -ReceiptContract ::= SEQUENCE { -sessionContractProvider Provider, -sessionTypeOfContract OCTET STRING(SIZE(2)), -sessionContractSerialNumber Int4 -} -ReceiptData1 ::= ReceiptData -ReceiptData2 ::= ReceiptData -ReceiptData ::= SEQUENCE { -sessionTime DateAndTime, -sessionServiceProvider Provider, -locationOfStation Int2, -sessionLocation SessionLocation, -sessionType Int1, -sessionResult ResultOp, -sessionTariffClass Int1, -sessionClaimedClass Int1, -sessionFee PaymentFee, -sessionContractProvider Provider, -sessionTypeOfContract OCTET STRING (SIZE(2)), -sessionContextVersion INTEGER (0..127,...), -receiptDataAuthenticator OCTET STRING(SIZE(4)) -} -ReceiptDistance ::= Int3 -ReceiptFinancialPart ::= SEQUENCE { -personalAccountNumber PersonalAccountNumber, -sessionPaymentFee PaymentFee, -sessionCurrentBalance PurseBalance, -receiptFinancialSerialNumber Int4 -} -ReceiptICC-Id ::= ICC-Id -ReceiptOBUId ::= OCTET STRING -ReceiptServicePart ::= SEQUENCE { -sessionTime DateAndTime, -sessionServiceProvider Provider, -stationLocation INTEGER(0..1048575), -sessionLocation BIT STRING (SIZE(8)), -typeOfSession EFC-StationType, -sessionResultOperational ResultOp, -sessionResultFinancial ResultFin -} -ReceiptServiceSerialNumber ::= Int3 -ReceiptAuthenticator ::= OCTET STRING -ReceiptText ::= OCTET STRING -ResultFin ::= OCTET STRING (SIZE(1)) --- A code designating whether a card transaction was completed successfully --- or not. Value Assignment : Hexadecimal --- Most significant 4 bits: 0 OK : --- '0x'H OK --- Most significant 4 bits > 0 Not OK : --- '1x'H Not OK, not specified further --- '2x'H Not OK, Abnormal (First or Previous) Event --- '3x'H Not OK, Contract not accepted --- '4x'H Not OK, Account or Purse not accepted --- 'x0'H not specified further --- 'x1'H Balance close to zero --- 'x2'H Balance now negative --- 'x3'H Balance Overflow --- 'x4'H Provider not accepted --- 'x5'H Authentication failure --- x6'H Vehicle Class incorrect -ResultOp ::= INTEGER { -correctTransaction (0), -- transaction correct -obeStatusNotAccepted (1), -equipmentStatusNotAccepted (2), -contractNotInWhiteList (3), --- VST contract data not in white list -contractIdentifierInBlackList (4), -contractIdentifierNotCorrect (5), --- Luhn algorithm verification failure -expiredContract (6), -- contract expired -contractRestrictionsNotFulfilled (7), -claimedVehicleCharacteristicsNotValid (8), -vehicleClassAuthenticationFailed (9), -entryVehicleClassDifferentFromExitVehicleClass (10), -entryReceiptMissing (11), -entryReceiptNotValid (12), -entryTollStationNotValid (13), -equipmentNotCertified (14), --- manufacturer or EquipClass not recognised -timeDifference (15), --- problem with the time diff of the two latest receipts -accessCredentialsNotAccepted (16), -contractAuthenticatorNotAccepted (17), -receiptAuthenticatorNotAccepted (18), -claimedVehicleCharacteristicsMissing (19), -paymentMeansNotAccepted (20), -paymentAuthenticatorNotAccepted (21), -paymentMeansInBlackList (22), -paymentMeansNotCorrect (23), --- Luhn algorithm verification failure -expiredPaymentMeans (24), --- PaymentMeans expired -paymentMeansRestrictionsNotFulfilled (25) --- (26-255) are reserved for future CEN use -} (0..255) -SessionClass ::= SEQUENCE { -sessionTariffClass Int1, -sessionClaimedClass Int1 -} -SessionLocation ::= SEQUENCE { -ascendingKilometrage BOOLEAN, -- travel direction indicator -laneCodeNumber INTEGER(0..127) -- lane code number -} -EFC-StationType ::= ENUMERATED { -unspecified (0), -closedEntryWithPayment (1), -closedEntryWithoutPayment (2), -closedTransit (3), -closedExit (4), -closedCredit (5), -mixed (6), -passage (7), -- open exit -checkpoint (8), -reload (9), -reservedForFutureCENUse1 (10), -reservedForFutureCENUse2 (11), -reservedForFutureCENUse3 (12), -reservedForFutureCENUse4 (13), -privateUse5 (14), -privateUse6 (15) -} -DateAndTime ::= SEQUENCE { -timeDate DateCompact, -timeCompact SEQUENCE { -- expresses time of the day in hours, min, and sec -hours INTEGER (0..23), -- number of hours after midnight -mins INTEGER (0..59), -- number of minutes after the hour -double-secs INTEGER (0..30) -- number of two-seconds after the minute -} --- Midnight at the start of a day cannot be represented. --- Midnight at the end of a day is represented by --- {hours 23, mins 59, double-secs 30} --- The 16 bit zero value {hours 0, mins 0, double-secs 0} --- denotes "no time" -} - -SoundLevel ::= SEQUENCE{ - soundstationary Int1, - sounddriveby Int1 -} -TrailerDetails::= SEQUENCE { -trailerType INTEGER{ -notPresent (0), -- trailer not attached or only one trailer attached, see --- VehicleAxlesNumber for more information -trailer (1), -- also known as pull-bar trailer -semitrailer (2) -- also known as articulate trailer --- (3..31) reserved for future CEN/ISO use -} (0..31), -trailerAxles TrailerAxles -} -TrailerLicencePlateNumber ::= LPN -UnitType::= ENUMERATED { - mg-km (0), - mg-kWh (1) -} -ValidityOfContract ::= SEQUENCE { -issuerRestrictions OCTET STRING (SIZE(2)), -contractExpiryDate DateCompact -} -VehicleAuthenticator ::= OCTET STRING -VehicleAxles ::= SEQUENCE { -vehicleFirstAxleHeight Int1, -vehicleAxlesNumber SEQUENCE { -tyreType ENUMERATED{ -notSpecified (0), -singleTyre (1), -- single tyre on all axles -dualTyres (2), -- dual tyres on at least one axle -reservedForUse (3) -- reserved for future CEN use -}, -numberOfAxles SEQUENCE { -trailerAxles TrailerAxles, -tractorAxles TractorAxles -} -} -} -TrailerAxles ::= INTEGER (0..7) -- number of axles of the trailer when available -TractorAxles ::= INTEGER (0..7) -- number of axles of the tractor -VehicleClass ::= Int1 -VehicleDimensions ::= SEQUENCE { - vehicleLengthOverall Int1, - vehicleHeigthOverall Int1, - vehicleWidthOverall Int1 -} -VehicleLicencePlateNumber ::= LPN -VehicleIdentificationNumber ::= CS5 -VehicleSpecificCharacteristics ::= SEQUENCE { -environmentalCharacteristics EnvironmentalCharacteristics, -engineCharacteristics EngineCharacteristics, -descriptiveCharacteristics DescriptiveCharacteristics, -futureCharacteristics FutureCharacteristics -} -VehicleTotalDistance ::= Int4 -VehicleWeightLaden ::= Int2 -VehicleCurrentMaxTrainWeight ::= Int2 -VehicleWeightLimits ::= SEQUENCE { - vehicleMaxLadenWeight Int2, - vehicleTrainMaximumWeight Int2, - vehicleWeightUnladen Int2 -} - -END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn deleted file mode 100644 index 610bb4f8..00000000 --- a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn +++ /dev/null @@ -1,27 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14906 Generic --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location: --- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)} -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -AttributeIdList ::= SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) - -AttributeList{Container} ::= SEQUENCE (SIZE(0..127,...)) OF Attributes{Container} - -Attributes{Container} ::= SEQUENCE { - attributeId INTEGER (0..127,...), - attributeValue Container -} - - -END \ No newline at end of file diff --git a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn b/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn deleted file mode 100644 index edeab5bd..00000000 --- a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn +++ /dev/null @@ -1,44 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 17419 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/ts/17419/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -; - --- End of IMPORTS - --- Types - --- Variable length data types - -VarLengthNumber::=CHOICE{ - content [0] INTEGER(0..127), -- one octet length - extension [1] Ext1 - } - -Ext1::=CHOICE{ - content [0] INTEGER(128..16511), -- two octets length - extension [1] Ext2 -} - -Ext2::=CHOICE{ - content [0] INTEGER(16512..2113663), -- three octets length - extension [1] Ext3 - } - -Ext3::=INTEGER(2113664..270549119,...) -- four and more octets length - -END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn deleted file mode 100644 index 1fda164b..00000000 --- a/asn1/IS/ISO_TS_19091/AddGrpC.asn +++ /dev/null @@ -1,209 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the addendunm extensions for Addgrp-C (e.g. Europe) --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- ISO TS 19091 30.08.2016 - --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -AddGrpC { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) - version2 (2) - } - - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop ---DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID, LaneConnectionID, FuelType, VehicleHeight -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -Altitude, StationID, DeltaAltitude, VehicleMass FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPosition ItsStationPositionList OPTIONAL, - ... -} - -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - connectionID LaneConnectionID, - ... -} - -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... -} - -LaneAttributes-addGrpC ::= SEQUENCE { - maxVehicleHeight VehicleHeight OPTIONAL, - maxVehicleWeight VehicleMass OPTIONAL, - ... -} -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... -} - -MovementEvent-addGrpC ::= SEQUENCE { - stateChangeReason ExceptionalCondition OPTIONAL, - ... -} - -/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} -*/ - - -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... -} - -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - fuel FuelType OPTIONAL, - ... -} - -RequestorDescription-addGrpC ::= SEQUENCE { - fuel FuelType OPTIONAL, - batteryStatus BatteryStatus OPTIONAL, - ... -} - -SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - rejectedReason RejectedReason OPTIONAL, - ... -} - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data frames --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... -} - -ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition - -/*FIXME YGA Moved to DSRC-REGION_noCircular to cut circular import loop -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node -*/ - -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... -} - -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... -} - -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data elements --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -BatteryStatus ::= ENUMERATED { - unknown, - critical, - low, - good, - ... -} - -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... -} - -ExceptionalCondition ::= ENUMERATED { - unknown, - publicTransportPriority, - emergencyVehiclePriority, - trainPriority, - bridgeOpen, - vehicleHeight, - weather, - trafficJam, - tunnelClosure, - meteringActive, - truckPriority, - bicyclePlatoonPriority, - vehiclePlatoonPriority, - ... -} - -/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} -*/ - -RejectedReason ::= ENUMERATED { - unknown, - exceptionalCondition, - maxWaitingTimeExceeded, - ptPriorityDisabled, - higherPTPriorityGranted, - vehicleTrackingUnknown, - ... -} - -TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) - - - -END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn deleted file mode 100644 index 0ffbe694..00000000 --- a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn +++ /dev/null @@ -1,33 +0,0 @@ ---FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- ISO TS 19091 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ---FIXME RGY definitions are moved here from AddGrpC; created to cut circular import loops amongst ASN.1 files -AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (1) version (1) } - - -DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS -PtvRequestType -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } -; - -Control-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType, - ... -} -/* -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} -*/ -END diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn deleted file mode 100644 index c071c86d..00000000 --- a/asn1/IS/ISO_TS_19091/DSRC.asn +++ /dev/null @@ -1,1317 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY definitions moved to module DSRC-REGION-noCircular are commented our below -Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, -Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, -/*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus, Reg-RTCMcorrections -FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} - ---FIXME RGY definitions moved to DSRC-REGION-noCircular but also refernced here are re-imported -DeltaAngle, DeltaTime, LaneID, LaneConnectionID, IntersectionID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, -Velocity, NodeOffsetPointXY, NodeAttributeXY, Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Offset-B12, Offset-B09, Offset-B10, Node-LLmD-64b, NodeAttributeXYList -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - -Longitude, Latitude, StationID FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } -; - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Messages... --- This table typicaly contains message entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- - -MessageFrame ::= SEQUENCE { - messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), - value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), - ... - } - -MESSAGE-ID-AND-TYPE ::= CLASS { - &id DSRCmsgID UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -MessageTypes MESSAGE-ID-AND-TYPE ::= { - { MapData IDENTIFIED BY mapData } | - { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | - { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | - { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, - ... -- Expansion to be used only by the SAE J2735 DSRC TC - } - - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop --- Regional extensions support -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } -*/ - -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - roadSegments RoadSegmentList OPTIONAL, - dataParameters DataParameters OPTIONAL, - restrictionList RestrictionClassList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - ... -} - -RTCMcorrections ::= SEQUENCE { - msgCnt MsgCount, - rev RTCM-Revision, - timeStamp MinuteOfTheYear OPTIONAL, - anchorPoint FullPositionVector OPTIONAL, - rtcmHeader RTCMheader OPTIONAL, - msgs RTCMmessageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, - ... -} - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - intersections IntersectionStateList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... - } - -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - - requests SignalRequestList OPTIONAL, - requestor RequestorDescription, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... -} - -SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - status SignalStatusList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... -} - - - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Start of entries from table Data_Frames... --- Data frames --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - speed SpeedAdvice OPTIONAL, - confidence SpeedConfidenceDSRC OPTIONAL, - distance ZoneLength OPTIONAL, - class RestrictionClassID OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... - } - -AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed - -AntennaOffsetSet ::= SEQUENCE { - antOffsetX Offset-B12, - antOffsetY Offset-B09, - antOffsetZ Offset-B10 - } - -ComputedLane ::= SEQUENCE { - referenceLaneId LaneID, - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - rotateXY Angle OPTIONAL, - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... - } -ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection - -ConnectingLane ::= SEQUENCE { - lane LaneID, - maneuver AllowedManeuvers OPTIONAL - } - - -Connection ::= SEQUENCE { - connectingLane ConnectingLane, - remoteIntersection IntersectionReferenceID OPTIONAL, - signalGroup SignalGroupID OPTIONAL, - userClass RestrictionClassID OPTIONAL, - connectionID LaneConnectionID OPTIONAL - } - - -ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - queueLength ZoneLength OPTIONAL, - availableStorageLength ZoneLength OPTIONAL, - waitOnStop WaitOnStopline OPTIONAL, - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... - } - -DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... - } - - -DDateTime ::= SEQUENCE { - year DYear OPTIONAL, - month DMonth OPTIONAL, - day DDay OPTIONAL, - hour DHour OPTIONAL, - minute DMinute OPTIONAL, - second DSecond OPTIONAL, - offset DOffset OPTIONAL - } - -EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -FullPositionVector ::= SEQUENCE { - utcTime DDateTime OPTIONAL, -- time with mSec precision - long Longitude, - lat Latitude, - elevation Elevation OPTIONAL, - heading HeadingDSRC OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - posAccuracy PositionalAccuracy OPTIONAL, - timeConfidence TimeConfidence OPTIONAL, - posConfidence PositionConfidenceSet OPTIONAL, - speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, - ... - } - - -GenericLane ::= SEQUENCE { - laneID LaneID, - name DescriptiveName OPTIONAL, - ingressApproach ApproachID OPTIONAL, - egressApproach ApproachID OPTIONAL, - laneAttributes LaneAttributes, - maneuvers AllowedManeuvers OPTIONAL, - nodeList NodeListXY, - connectsTo ConnectsToList OPTIONAL, - overlays OverlayLaneList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, - ... - } - -IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... - } - -IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - laneSet LaneList, - preemptPriorityData PreemptPriorityList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... - } - -IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - -IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id IntersectionID - } - -IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - status IntersectionStatusObject, - moy MinuteOfTheYear OPTIONAL, - timeStamp DSecond OPTIONAL, - enabledLanes EnabledLaneList OPTIONAL, - states MovementList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... - } - -IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState - -LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, - sharedWith LaneSharing, - laneType LaneTypeAttributes, - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -LaneDataAttribute ::= CHOICE { - pathEndPointAngle DeltaAngle, - laneCrownPointCenter RoadwayCrownAngle, - laneCrownPointLeft RoadwayCrownAngle, - laneCrownPointRight RoadwayCrownAngle, - laneAngle MergeDivergeNodeAngle, - speedLimits SpeedLimitList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute -*/ - -LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -LaneSharing ::= BIT STRING { - overlappingLaneDescriptionProvided (0), - multipleLanesTreatedAsOneLane (1), - otherNonMotorizedTrafficTypes (2), - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) - } (SIZE (10)) - -LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, - crosswalk LaneAttributes-Crosswalk, - bikeLane LaneAttributes-Bike, - sidewalk LaneAttributes-Sidewalk, - median LaneAttributes-Barrier, - striping LaneAttributes-Striping, - trackedVehicle LaneAttributes-TrackedVehicle, - parking LaneAttributes-Parking, - ... - } - -ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist - -MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - timing TimeChangeDetails OPTIONAL, - speeds AdvisorySpeedList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... - } - -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - -MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState - -MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - signalGroup SignalGroupID, - state-time-speed MovementEventList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - disabled SegmentAttributeXYList OPTIONAL, - enabled SegmentAttributeXYList OPTIONAL, - data LaneDataAttributeList OPTIONAL, - dWidth Offset-B10 OPTIONAL, - dElevation Offset-B10 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXY ::= ENUMERATED { - reserved, - stopLine, - roundedCapStyleA, - roundedCapStyleB, - mergePoint, - divergePoint, - downstreamStopLine, - downstreamStartNode, - closedToTraffic, - safeIsland, - curbPresentAtStepOff, - hydrantPresent, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } - - - Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } -*/ - -NodeListXY ::= CHOICE { - nodes NodeSetXY, - computed ComputedLane, - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -NodeOffsetPointXY ::= CHOICE { - node-XY1 Node-XY-20b, - node-XY2 Node-XY-22b, - node-XY3 Node-XY-24b, - node-XY4 Node-XY-26b, - node-XY5 Node-XY-28b, - node-XY6 Node-XY-32b, - node-LatLon Node-LLmD-64b, - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - } - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - attributes NodeAttributeSetXY OPTIONAL, - ... -} - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY -*/ - -OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -PositionalAccuracy ::= SEQUENCE { - semiMajor SemiMajorAxisAccuracy, - semiMinor SemiMinorAxisAccuracy, - orientation SemiMajorAxisOrientation -} - -PositionConfidenceSet ::= SEQUENCE { - pos PositionConfidence, -- for both horizontal directions - elevation ElevationConfidence - } - - -Position3D ::= SEQUENCE { - lat Latitude, - long Longitude, - elevation Elevation OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... - } - -PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - speed Velocity - } -*/ - -RequestorDescription ::= SEQUENCE { - id VehicleID, - type RequestorType OPTIONAL, - position RequestorPositionVector OPTIONAL, - name DescriptiveName OPTIONAL, - routeName DescriptiveName OPTIONAL, - transitStatus TransitVehicleStatus OPTIONAL, - transitOccupancy TransitVehicleOccupancy OPTIONAL, - transitSchedule DeltaTime OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... - } - -RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... - } - -RequestorType ::= SEQUENCE { - role BasicVehicleRole, - subrole RequestSubRole OPTIONAL, - request RequestImportanceLevel OPTIONAL, - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... - } - -RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - users RestrictionUserTypeList - } - -RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment - -RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... - } - -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - -RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id RoadSegmentID - } - -RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - roadLaneSet RoadLaneSetList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... - } - -RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - -RTCMheader ::= SEQUENCE { - status GNSSstatus, - offsetSet AntennaOffsetSet - } - -RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY -*/ - -SignalControlZone ::= SEQUENCE { - zone RegionalExtension {{Reg-SignalControlZone}}, - ... - } - -SignalRequesterInfo ::= SEQUENCE { - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - typeData RequestorType OPTIONAL, - ... -} - -SignalRequest ::= SEQUENCE { - id IntersectionReferenceID, - requestID RequestID, - requestType PriorityRequestType, - inBoundLane IntersectionAccessPoint, - outBoundLane IntersectionAccessPoint OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... - } - -SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage - -SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... - } - -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - id IntersectionReferenceID, - sigStatus SignalStatusPackageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... - } - -SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus - -SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage - -SignalStatusPackage ::= SEQUENCE { - requester SignalRequesterInfo OPTIONAL, - inboundOn IntersectionAccessPoint, - outboundOn IntersectionAccessPoint OPTIONAL, - - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - status PrioritizationResponseStatus, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... - } - -SpeedandHeadingandThrottleConfidence ::= SEQUENCE { - heading HeadingConfidenceDSRC, - speed SpeedConfidenceDSRC, - throttle ThrottleConfidence - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, - maxSpeedInSchoolZone, - maxSpeedInSchoolZoneWhenChildrenArePresent, - maxSpeedInConstructionZone, - vehicleMinSpeed, - vehicleMaxSpeed, - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } -*/ - -TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - minEndTime TimeMark, - maxEndTime TimeMark OPTIONAL, - likelyTime TimeMark OPTIONAL, - confidence TimeIntervalConfidence OPTIONAL, - nextTime TimeMark OPTIONAL - } - -TimeMark ::= INTEGER (0..36001) - -TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity - } - -VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID - } - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- data elements --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... -} - -AllowedManeuvers ::= BIT STRING { - maneuverStraightAllowed (0), - maneuverLeftAllowed (1), - maneuverRightAllowed (2), - maneuverUTurnAllowed (3), - maneuverLeftTurnOnRedAllowed (4), - maneuverRightTurnOnRedAllowed (5), - maneuverLaneChangeAllowed (6), - maneuverNoStoppingAllowed (7), - yieldAllwaysRequired (8), - goWithHalt (9), - caution (10), - reserved1 (11) - } (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -ApproachID ::= INTEGER (0..15) - -BasicVehicleRole ::= ENUMERATED { - basicVehicle (0), - publicTransport (1), - specialTransport (2), - dangerousGoods (3), - roadWork (4), - roadRescue (5), - emergency (6), - safetyCar (7), - none-unknown (8), - truck (9), - motorcycle (10), - roadSideSource (11), - police (12), - fire (13), - ambulance (14), - dot (15), - transit (16), - slowMoving (17), - stopNgo (18), - cyclist (19), - pedestrian (20), - nonMotorized (21), - military (22), - ... - } - -DDay ::= INTEGER (0..31) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -DeltaAngle ::= INTEGER (-150..150) - -DeltaTime ::= INTEGER (-122 .. 121) -*/ - -DescriptiveName ::= IA5String (SIZE(1..63)) - -DHour ::= INTEGER (0..31) - -DMinute ::= INTEGER (0..60) - -DMonth ::= INTEGER (0..12) - -DOffset ::= INTEGER (-840..840) - -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -DSecond ::= INTEGER (0..65535) - -DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 - rtcmCorrections DSRCmsgID ::= 28 - signalPhaseAndTimingMessage DSRCmsgID ::= 19 - signalRequestMessage DSRCmsgID ::= 29 - signalStatusMessage DSRCmsgID ::= 30 - -DYear ::= INTEGER (0..4095) - -Elevation ::= INTEGER (-4096..61439) - -ElevationConfidence ::= ENUMERATED { - unavailable (0), - elev-500-00 (1), - elev-200-00 (2), - elev-100-00 (3), - elev-050-00 (4), - elev-020-00 (5), - elev-010-00 (6), - elev-005-00 (7), - elev-002-00 (8), - elev-001-00 (9), - elev-000-50 (10), - elev-000-20 (11), - elev-000-10 (12), - elev-000-05 (13), - elev-000-02 (14), - elev-000-01 (15) - } - - -GNSSstatus ::= BIT STRING { - unavailable (0), - isHealthy (1), - isMonitored (2), - baseStationType (3), - aPDOPofUnder5 (4), - inViewOfUnder5 (5), - localCorrectionsPresent (6), - networkCorrectionsPresent (7) - } (SIZE(8)) - -HeadingConfidenceDSRC ::= ENUMERATED { - unavailable (0), - prec10deg (1), - prec05deg (2), - prec01deg (3), - prec0-1deg (4), - prec0-05deg (5), - prec0-01deg (6), - prec0-0125deg (7) - } - -HeadingDSRC ::= INTEGER (0..28800) - -IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - stopTimeIsActivated (1), - failureFlash (2), - preemptIsActive (3), - signalPriorityIsActive (4), - fixedTimeOperation (5), - trafficDependentOperation (6), - standbyOperation (7), - failureMode (8), - off (9), - recentMAPmessageUpdate (10), - recentChangeInMAPassignedLanesIDsUsed (11), - noValidMAPisAvailableAtThisTime (12), - noValidSPATisAvailableAtThisTime (13) - } (SIZE(16)) - - -LaneAttributes-Barrier ::= BIT STRING { - median-RevocableLane (0), - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) - } (SIZE (16)) - -LaneAttributes-Bike ::= BIT STRING { - bikeRevocableLane (0), - pedestrianUseAllowed (1), - isBikeFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) - } (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - crosswalkRevocableLane (0), - bicyleUseAllowed (1), - isXwalkFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - hasPushToWalkButton (5), - audioSupport (6), - rfSignalRequestPresent (7), - unsignalizedSegmentsPresent (8) - } (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - parkingRevocableLane (0), - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) - } (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - sidewalk-RevocableLane (0), - bicyleUseAllowed (1), - isSidewalkFlyOverLane (2), - walkBikes (3) - } (SIZE (16)) - - -LaneAttributes-Striping ::= BIT STRING { - stripeToConnectingLanesRevocableLane (0), - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) - } (SIZE (16)) - - -LaneAttributes-TrackedVehicle ::= BIT STRING { - spec-RevocableLane (0), - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) - } (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - isVehicleRevocableLane (0), - isVehicleFlyOverLane (1), - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) - } (SIZE (8,...)) - -LaneDirection ::= BIT STRING { - ingressPath (0), - egressPath (1) - } (SIZE (2)) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -LaneID ::= INTEGER (0..255) -*/ - -LayerID ::= INTEGER (0..100) - -LayerType ::= ENUMERATED { - none, - mixedContent, - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... - } - -LaneWidth ::= INTEGER (0..32767) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -MergeDivergeNodeAngle ::= INTEGER (-180..180) -*/ - -MinuteOfTheYear ::= INTEGER (0..527040) - -MovementPhaseState ::= ENUMERATED { - unavailable (0), - dark (1), - stop-Then-Proceed (2), - stop-And-Remain (3), - pre-Movement (4), - permissive-Movement-Allowed (5), - protected-Movement-Allowed (6), - permissive-clearance (7), - protected-clearance (8), - caution-Conflicting-Traffic (9) - } - -MsgCount ::= INTEGER (0..127) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Offset-B10 ::= INTEGER (-512..511) - -Offset-B11 ::= INTEGER (-1024..1023) - -Offset-B12 ::= INTEGER (-2048..2047) - -Offset-B13 ::= INTEGER (-4096..4095) - -Offset-B14 ::= INTEGER (-8192..8191) - -Offset-B16 ::= INTEGER (-32768..32767) -*/ - -PedestrianBicycleDetect ::= BOOLEAN - -PositionConfidence ::= ENUMERATED { - unavailable (0), - a500m (1), - a200m (2), - a100m (3), - a50m (4), - a20m (5), - a10m (6), - a5m (7), - a2m (8), - a1m (9), - a50cm (10), - a20cm (11), - a10cm (12), - a5cm (13), - a2cm (14), - a1cm (15) - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - requested (1), - processing (2), - watchOtherTraffic (3), - granted (4), - rejected (5), - maxPresence (6), - reserviceLocked (7), - ... -} -*/ - -PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 - addGrpA RegionId ::= 1 - addGrpB RegionId ::= 2 - addGrpC RegionId ::= 3 -*/ - -RequestID ::= INTEGER (0..255) - -RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), - requestImportanceLevel2 (2), - requestImportanceLevel3 (3), - requestImportanceLevel4 (4), - requestImportanceLevel5 (5), - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), - requestImportanceReserved (15) - } - -RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), - requestSubRole2 (2), - requestSubRole3 (3), - requestSubRole4 (4), - requestSubRole5 (5), - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), - requestSubRoleReserved (15) - } - -RestrictionAppliesTo ::= ENUMERATED { - none, - equippedTransit, - equippedTaxis, - equippedOther, - emissionCompliant, - equippedBicycle, - weightCompliant, - heightCompliant, - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, - otherUnknownDisabilities, - ... - } - -RestrictionClassID ::= INTEGER (0..255) - -RoadRegulatorID ::= INTEGER (0..65535) - -RoadSegmentID ::= INTEGER (0..65535) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RoadwayCrownAngle ::= INTEGER (-128..127) -*/ - -RTCMmessage ::= OCTET STRING (SIZE(1..1023)) - -RTCM-Revision ::= ENUMERATED { - unknown (0), - rtcmRev2 (1), -- Std 10402.x et al - rtcmRev3 (2), -- Std 10403.x et al - reserved (3), - ... -} - -Scale-B12 ::= INTEGER (-2048..2047) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SignalGroupID ::= INTEGER (0..255) -*/ - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SegmentAttributeXY ::= ENUMERATED { - reserved , - doNotBlock , - whiteLine , - mergingLaneLeft , - mergingLaneRight , - curbOnLeft , - curbOnRight , - loadingzoneOnLeft , - loadingzoneOnRight , - turnOutPointOnLeft , - turnOutPointOnRight , - adjacentParkingOnLeft , - adjacentParkingOnRight , - adjacentBikeLaneOnLeft , - adjacentBikeLaneOnRight , - sharedBikeLane , - bikeBoxInFront , - transitStopOnLeft , - transitStopOnRight , - transitStopInLane , - sharedWithTrackedVehicle , - safeIsland , - lowCurbsPresent , - rumbleStripPresent , - audibleSignalingPresent , - adaptiveTimingPresent , - rfSignalRequestPresent , - partialCurbIntrusion , - taperToLeft , - taperToRight , - taperToCenterLine , - parallelParking , - headInParking , - freeParking , - timeRestrictionsOnParking , - costToPark , - midBlockCurbPresent , - unEvenPavementPresent , - ... - } -*/ - -SemiMajorAxisAccuracy ::= INTEGER (0..255) - -SemiMajorAxisOrientation ::= INTEGER (0..65535) - -SemiMinorAxisAccuracy ::= INTEGER (0..255) - -SpeedAdvice ::= INTEGER (0..500) - -SpeedConfidenceDSRC ::= ENUMERATED { - unavailable (0), -- Not Equipped or unavailable - prec100ms (1), -- 100 meters / sec - prec10ms (2), -- 10 meters / sec - prec5ms (3), -- 5 meters / sec - prec1ms (4), -- 1 meters / sec - prec0-1ms (5), -- 0.1 meters / sec - prec0-05ms (6), -- 0.05 meters / sec - prec0-01ms (7) -- 0.01 meters / sec - } - -TemporaryID ::= OCTET STRING (SIZE(4)) - -ThrottleConfidence ::= ENUMERATED { - unavailable (0), - prec10percent (1), - prec1percent (2), - prec0-5percent (3) - } - -TimeConfidence ::= ENUMERATED { - unavailable (0), - time-100-000 (1), - time-050-000 (2), - time-020-000 (3), - time-010-000 (4), - time-002-000 (5), - time-001-000 (6), - time-000-500 (7), - time-000-200 (8), - time-000-100 (9), - time-000-050 (10), - time-000-020 (11), - time-000-010 (12), - time-000-005 (13), - time-000-002 (14), - time-000-001 (15), - time-000-000-5 (16), - time-000-000-2 (17), - time-000-000-1 (18), - time-000-000-05 (19), - time-000-000-02 (20), - time-000-000-01 (21), - time-000-000-005 (22), - time-000-000-002 (23), - time-000-000-001 (24), - time-000-000-000-5 (25), - time-000-000-000-2 (26), - time-000-000-000-1 (27), - time-000-000-000-05 (28), - time-000-000-000-02 (29), - time-000-000-000-01 (30), - time-000-000-000-005 (31), - time-000-000-000-002 (32), - time-000-000-000-001 (33), - time-000-000-000-000-5 (34), - time-000-000-000-000-2 (35), - time-000-000-000-000-1 (36), - time-000-000-000-000-05 (37), - time-000-000-000-000-02 (38), - time-000-000-000-000-01 (39) -} - -TimeIntervalConfidence ::= INTEGER (0..15) - -TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) - } - -TransitVehicleStatus ::= BIT STRING { - loading (0), - anADAuse (1), - aBikeLoad (2), - doorOpen (3), - charging (4), - atStopLine (5) - } (SIZE(8)) - -TransmissionState ::= ENUMERATED { - neutral (0), - park (1), - forwardGears (2), - reverseGears (3), - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) - } - -VehicleType ::= ENUMERATED { - none (0), - unknown (1), - special (2), - moto (3), - car (4), - carOther (5), - bus (6), - axleCnt2 (7), - axleCnt3 (8), - axleCnt4 (9), - axleCnt4Trailer (10), - axleCnt5Trailer (11), - axleCnt6Trailer (12), - axleCnt5MultiTrailer (13), - axleCnt6MultiTrailer (14), - axleCnt7MultiTrailer (15), - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Velocity ::= INTEGER (0..8191) -*/ - -WaitOnStopline ::= BOOLEAN - -ZoneLength ::= INTEGER (0..10000) - -END diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn deleted file mode 100644 index fe9c3f4f..00000000 --- a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn +++ /dev/null @@ -1,461 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- ISO TS 19091 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ---FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files -DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS -Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - ---NodeAttributeSet-addGrpC, LaneID FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } -; - ------------------------------------------------------- ---FIXME RGY BELOW ARE DEFINITIONS MOVED FROM DSRC ------------------------------------------------------- - -FuelType ::= INTEGER (0..15) - unknownFuel FuelType ::= 0 - gasoline FuelType ::= 1 - ethanol FuelType ::= 2 - diesel FuelType ::= 3 - electric FuelType ::= 4 - hybrid FuelType ::= 5 - hydrogen FuelType ::= 6 - natGasLiquid FuelType ::= 7 - natGasComp FuelType ::= 8 - propane FuelType ::= 9 - -VehicleHeight ::= INTEGER (0..127) - -LaneID ::= INTEGER (0..255) - -LaneConnectionID ::= INTEGER (0..255) - -IntersectionID ::= INTEGER (0..65535) - -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node - -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} - -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} - -DeltaAngle ::= INTEGER (-150..150) - -- With an angle range from - -- negative 150 to positive 150 - -- in one degree steps where zero is directly - -- along the axis or the lane center line as defined by the - -- two closest points - -DeltaTime ::= INTEGER (-122 .. 121) - -- Supporting a range of +/- 20 minute in steps of 10 seconds - -- the value of -121 shall be used when more than -20 minutes - -- the value of +120 shall be used when more than +20 minutes - -- the value -122 shall be used when the value is unavailable - -LaneDataAttribute ::= CHOICE { - -- Segment attribute types and the data needed for each - pathEndPointAngle DeltaAngle, - -- adjusts final point/width slant - -- of the lane to align with the stop line - laneCrownPointCenter RoadwayCrownAngle, - -- sets the canter of the road bed - -- from centerline point - laneCrownPointLeft RoadwayCrownAngle, - -- sets the canter of the road bed - -- from left edge - laneCrownPointRight RoadwayCrownAngle, - -- sets the canter of the road bed - -- from right edge - laneAngle MergeDivergeNodeAngle, - -- the angle or direction of another lane - -- this is required to support Japan style - -- when a merge point angle is required - speedLimits SpeedLimitList, - -- Reference regulatory speed limits - -- used by all segments - - -- Add others as needed, in regional space - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -- In units of 1.5 degrees from north - -- the value -180 shall be used to represent - -- data is not available or unknown - -NodeOffsetPointXY ::= CHOICE { - -- Nodes with X,Y content - node-XY1 Node-XY-20b, -- node is within 5.11m of last node - node-XY2 Node-XY-22b, -- node is within 10.23m of last node - node-XY3 Node-XY-24b, -- node is within 20.47m of last node - node-XY4 Node-XY-26b, -- node is within 40.96m of last node - node-XY5 Node-XY-28b, -- node is within 81.91m of last node - node-XY6 Node-XY-32b, -- node is within 327.67m of last node - node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - -- node which follows is of a - -- regional definition type - } - -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } - - -Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - -- A choice of which X,Y offset value to use - -- this includes various delta values as well a regional choices - attributes NodeAttributeSetXY OPTIONAL, - -- Any optional Attributes which are needed - -- This includes changes to the current lane width and elevation - ... -} - -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - -- Attribute states which pertain to this node point - disabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are disabled at this node point - enabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are enabled at this node point - -- and which remain enabled until disabled or the lane ends - data LaneDataAttributeList OPTIONAL, - -- Attributes which require an additional data values - -- some of these are local to the node point, while others - -- persist with the provided values until changed - -- and this is indicated in each entry - dWidth Offset-B10 OPTIONAL, - -- A value added to the current lane width - -- at this node and from this node onwards, in 1cm steps - -- lane width between nodes are a linear taper between pts - -- the value of zero shall not be sent here - dElevation Offset-B10 OPTIONAL, - -- A value added to the current Elevation - -- at this node from this node onwards, in 10cm steps - -- elevations between nodes are a linear taper between pts - -- the value of zero shall not be sent here - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -NodeAttributeXY ::= ENUMERATED { - -- Various values which pertain only to the current node point - - -- General Items - reserved, - stopLine, -- point where a mid-path stop line exists - -- See also 'do not block' for segments - - -- Path finish details - roundedCapStyleA, -- Used to control final path rounded end shape - -- with edge of curve at final point in a circle - roundedCapStyleB, -- Used to control final path rounded end shape - -- with edge of curve extending 50% of width past - -- final point in a circle - - -- Topography Points (items with no concept of a distance along the path) - mergePoint, -- Japan merge with 1 or more lanes - divergePoint, -- Japan diverge with 1 or more lanes - downstreamStopLine, -- Japan style downstream intersection - -- (a 2nd intersection) stop line - downstreamStartNode, -- Japan style downstream intersection - -- (a 2nd intersection) start node - - -- Pedestrian Support Attributes - closedToTraffic, -- where a pedestrian may NOT go - -- to be used during construction events - safeIsland, -- a pedestrian safe stopping point - -- also called a traffic island - -- This usage described a point feature on a path, - -- other entries can describe a path - curbPresentAtStepOff, -- the sidewalk to street curb is NOT - -- angled where it meets the edge of the - -- roadway (user must step up/down) - - -- Lane geometry details (see standard for defined shapes) - hydrantPresent, -- Or other services access - ... - } - -Offset-B09 ::= INTEGER (-256..255) - -Offset-B10 ::= INTEGER (-512..511) - -- a range of +- 5.11 meters - -Offset-B11 ::= INTEGER (-1024..1023) - -- a range of +- 10.23 meters - -Offset-B12 ::= INTEGER (-2048..2047) - -- a range of +- 20.47 meters - -Offset-B13 ::= INTEGER (-4096..4095) - -- a range of +- 40.95 meters - -Offset-B14 ::= INTEGER (-8192..8191) - -- a range of +- 81.91 meters - -Offset-B16 ::= INTEGER (-32768..32767) - -- a range of +- 327.68 meters - -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - -- Unknown state - requested (1), - -- This prioritization request was detected - -- by the traffic controller - processing (2), - -- Checking request - -- (request is in queue, other requests are prior) - watchOtherTraffic (3), - -- Cannot give full permission, - -- therefore watch for other traffic - -- Note that other requests may be present - granted (4), - -- Intervention was successful - -- and now prioritization is active - rejected (5), - -- The prioritization or preemption request was - -- rejected by the traffic controller - maxPresence (6), - -- The Request has exceeded maxPresence time - -- Used when the controller has determined that - -- the requester should then back off and - -- request an alternative. - reserviceLocked (7), - -- Prior conditions have resulted in a reservice - -- locked event: the controller requires the - -- passage of time before another similar request - -- will be accepted - ... -} - -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 -- Use default supplied stubs - addGrpA RegionId ::= 1 -- USA - addGrpB RegionId ::= 2 -- Japan - addGrpC RegionId ::= 3 -- EU - -- NOTE: new registered regional IDs will be added here - -- The values 128 and above are for local region use - --- Regional extensions support -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } - -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - -- The type of regulatory speed which follows - speed Velocity - -- The speed in units of 0.02 m/s - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - } - -RoadwayCrownAngle ::= INTEGER (-128..127) - -- In LSB units of 0.3 degrees of angle - -- over a range of -38.1 to + 38.1 degrees - -- The value -128 shall be used for unknown - -- The value zero shall be used for angles - -- which are between -0.15 and +0.15 - - -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY - -SegmentAttributeXY ::= ENUMERATED { - -- Various values which can be Enabled and Disabled for a lane segment - - -- General Items - reserved , - doNotBlock , -- segment where a vehicle - -- may not come to a stop - whiteLine , -- segment where lane crossing not allowed - -- such as the final few meters of a lane - - -- Porous Lane states, merging, turn outs, parking etc. - - mergingLaneLeft , -- indicates porous lanes - mergingLaneRight , - - curbOnLeft , -- indicates presence of curbs - curbOnRight , - - loadingzoneOnLeft , -- loading or drop off zones - loadingzoneOnRight , - - turnOutPointOnLeft , -- opening to adjacent street/alley/road - turnOutPointOnRight , - - adjacentParkingOnLeft , -- side of road parking - adjacentParkingOnRight , - - -- Bike Lane Needs - adjacentBikeLaneOnLeft , -- presence of marked bike lanes - adjacentBikeLaneOnRight , - sharedBikeLane , -- right of way is shared with bikes - -- who may occupy entire lane width - bikeBoxInFront , - - -- Transit Needs - transitStopOnLeft , -- any form of bus/transit loading - -- with pull in-out access to lane on left - transitStopOnRight , -- any form of bus/transit loading - -- with pull in-out access to lane on right - transitStopInLane , -- any form of bus/transit loading - -- in mid path of the lane - sharedWithTrackedVehicle , -- lane is shared with train or trolley - -- not used for crossing tracks - - - -- Pedestrian Support Attributes - safeIsland , -- begin/end a safety island in path - lowCurbsPresent , -- for ADA support - rumbleStripPresent , -- for ADA support - audibleSignalingPresent , -- for ADA support - adaptiveTimingPresent , -- for ADA support - rfSignalRequestPresent , -- Supports RF push to walk technologies - partialCurbIntrusion , -- path is blocked by a median or curb - -- but at least 1 meter remains open for use - -- and at-grade passage - - -- Lane geometry details (see standard for defined shapes) - taperToLeft , -- Used to control final path shape - taperToRight , -- Used to control final path shape - taperToCenterLine , -- Used to control final path shape - - -- Parking Lane and Curb Attributes - parallelParking , -- - headInParking , -- Parking at an angle with the street - freeParking , -- no restriction on use of parking - timeRestrictionsOnParking , -- Parking is not permitted at all times - -- typically used when the 'parking' lane - -- becomes a driving lane at times - costToPark , -- Used where parking has a cost - midBlockCurbPresent , -- a protruding curb near lane edge - unEvenPavementPresent , -- a disjoint height at lane edge - ... - } - -SignalGroupID ::= INTEGER (0..255) - -- The value 0 shall be used when the ID is - -- not available or not known - -- the value 255 is reserved to indicate a - -- permanent green movement state - -- therefore a simple 8 phase signal controller - -- device might use 1..9 as its groupIDs - -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, -- Speed limit type not available - maxSpeedInSchoolZone, -- Only sent when the limit is active - maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time - maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. - -- where a reduced speed is present - vehicleMinSpeed, - vehicleMaxSpeed, -- Regulatory speed limit for general traffic - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } - -Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s - -- The value 8191 indicates that - -- velocity is unavailable - ------------------------------------------------------- ---FIXME RGY BELOW ARE DEFINITIONS MOVED FROM IS-REGION ------------------------------------------------------- - -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , - ... -} -END diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn deleted file mode 100644 index 44ec2009..00000000 --- a/asn1/IS/ISO_TS_19091/REGION.asn +++ /dev/null @@ -1,130 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: REGION --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY definitions moved to non-circularity module ---addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -NodeAttributeSet-addGrpC, addGrpC, REG-EXT-ID-AND-TYPE -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } ---FIXME RGY NodeAttributeSet-addGrpC has been moved to a non-circularity module ---NodeAttributeSet-addGrpC FROM AddGrpC-noCircular -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*NodeAttributeSet-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, LaneAttributes-addGrpC, MovementEvent-addGrpC, RequestorDescription-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC -FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) version2 (2)}; - - -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { - {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } -*/ - -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { - {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } - --- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , - ... -} -*/ - --- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } -*/ - -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { - { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } - -END diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn deleted file mode 100644 index 1183f8fa..00000000 --- a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn +++ /dev/null @@ -1,211 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 2018 --- --- This document includes three ASN.1 modules --- AddGrpC --- REGION --- DSRC --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage, RTCMcorrections --- as defined in ISO TS 19091 and basic data element referenced to SAEJ2735 --- --- It includes the addendum extensions for Addgrp-C (e.g. Europe) --- --- ISO Standards maintenance Portal: --- http://standards.iso.org/iso/ts/19091/addgrp_c/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -AddGrpC { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) - version2 (2) - } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight -FROM DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - - -Altitude, DeltaAltitude, StationID, VehicleMass -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- AddGrpC data dictionary extensions to SAEJ2735 --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPosition ItsStationPositionList OPTIONAL, - ... -} - -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - connectionID LaneConnectionID, - ... -} - -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... -} - -LaneAttributes-addGrpC ::= SEQUENCE { - maxVehicleHeight VehicleHeight OPTIONAL, - maxVehicleWeight VehicleMass OPTIONAL, - ... -} - -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... -} - -MovementEvent-addGrpC ::= SEQUENCE { - stateChangeReason ExceptionalCondition OPTIONAL, - ... -} - -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} - -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... -} - -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - fuel FuelType OPTIONAL, - ... -} - -RequestorDescription-addGrpC ::= SEQUENCE { - fuel FuelType OPTIONAL, - batteryStatus BatteryStatus OPTIONAL, - ... -} - -SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - rejectedReason RejectedReason OPTIONAL, - ... -} - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data frames --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... -} - -ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition - -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node - -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... -} - -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... -} - -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data elements --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -BatteryStatus ::= ENUMERATED { - unknown, - critical, - low, - good, - ... -} - -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... -} - -ExceptionalCondition ::= ENUMERATED { - unknown, - publicTransportPriority, - emergencyVehiclePriority, - trainPriority, - bridgeOpen, - vehicleHeight, - weather, - trafficJam, - tunnelClosure, - meteringActive, - truckPriority, - bicyclePlatoonPriority, - vehiclePlatoonPriority, - ... -} - -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} - -RejectedReason ::= ENUMERATED { - unknown, - exceptionalCondition, - maxWaitingTimeExceeded, - ptPriorityDisabled, - higherPTPriorityGranted, - vehicleTrackingUnknown, - ... -} - -TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) - -END diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn deleted file mode 100644 index 0f231d31..00000000 --- a/asn1/IS/ISO_TS_19091/original/DSRC.asn +++ /dev/null @@ -1,1257 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- Some Types renamed (added xxxDSRC) to avoid name-clashes with CDD --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -Longitude, Latitude, StationID -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - -Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, -Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-MapData, -Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, -Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-RTCMcorrections, Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatus, Reg-SignalStatusPackage, Reg-SignalRequestMessage, -Reg-SignalStatusMessage, Reg-SPAT -FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version2 (2)} - - -Iso3833VehicleType -FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1) }; - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Messages --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type -} WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) -} - -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - roadSegments RoadSegmentList OPTIONAL, - dataParameters DataParameters OPTIONAL, - restrictionList RestrictionClassList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - ... -} - -RTCMcorrections ::= SEQUENCE { - msgCnt MsgCount, - rev RTCM-Revision, - timeStamp MinuteOfTheYear OPTIONAL, - anchorPoint FullPositionVector OPTIONAL, - rtcmHeader RTCMheader OPTIONAL, - msgs RTCMmessageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, - ... -} - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - intersections IntersectionStateList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... -} - -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - requests SignalRequestList OPTIONAL, - requestor RequestorDescription, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... -} - -SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - status SignalStatusList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... -} - - - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Start of entries from table Data_Frames... --- Data frames --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - speed SpeedAdvice OPTIONAL, - confidence SpeedConfidenceDSRC OPTIONAL, - distance ZoneLength OPTIONAL, - class RestrictionClassID OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... -} - -AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed - -AntennaOffsetSet ::= SEQUENCE { - antOffsetX Offset-B12, - antOffsetY Offset-B09, - antOffsetZ Offset-B10 - } - -ComputedLane ::= SEQUENCE { - referenceLaneId LaneID, - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - rotateXY Angle OPTIONAL, - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... -} - -ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection - -ConnectingLane ::= SEQUENCE { - lane LaneID, - maneuver AllowedManeuvers OPTIONAL -} - -Connection ::= SEQUENCE { - connectingLane ConnectingLane, - remoteIntersection IntersectionReferenceID OPTIONAL, - signalGroup SignalGroupID OPTIONAL, - userClass RestrictionClassID OPTIONAL, - connectionID LaneConnectionID OPTIONAL -} - -ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - queueLength ZoneLength OPTIONAL, - availableStorageLength ZoneLength OPTIONAL, - waitOnStop WaitOnStopline OPTIONAL, - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... -} - -DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... -} - - -DDateTime ::= SEQUENCE { - year DYear OPTIONAL, - month DMonth OPTIONAL, - day DDay OPTIONAL, - hour DHour OPTIONAL, - minute DMinute OPTIONAL, - second DSecond OPTIONAL, - offset DOffset OPTIONAL - } - -EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -FullPositionVector ::= SEQUENCE { - utcTime DDateTime OPTIONAL, -- time with mSec precision - long Longitude, - lat Latitude, - elevation Elevation OPTIONAL, - heading HeadingDSRC OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - posAccuracy PositionalAccuracy OPTIONAL, - timeConfidence TimeConfidence OPTIONAL, - posConfidence PositionConfidenceSet OPTIONAL, - speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, - ... - } - - -GenericLane ::= SEQUENCE { - laneID LaneID, - name DescriptiveName OPTIONAL, - ingressApproach ApproachID OPTIONAL, - egressApproach ApproachID OPTIONAL, - laneAttributes LaneAttributes, - maneuvers AllowedManeuvers OPTIONAL, - nodeList NodeListXY, - connectsTo ConnectsToList OPTIONAL, - overlays OverlayLaneList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, - ... -} - -IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... -} - -IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - laneSet LaneList, - preemptPriorityData PreemptPriorityList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... -} - -IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - -IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id IntersectionID -} - -IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - status IntersectionStatusObject, - moy MinuteOfTheYear OPTIONAL, - timeStamp DSecond OPTIONAL, - enabledLanes EnabledLaneList OPTIONAL, - states MovementList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... -} - -IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState - -LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, - sharedWith LaneSharing, - laneType LaneTypeAttributes, - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL -} - -LaneDataAttribute ::= CHOICE { - pathEndPointAngle DeltaAngle, - laneCrownPointCenter RoadwayCrownAngle, - laneCrownPointLeft RoadwayCrownAngle, - laneCrownPointRight RoadwayCrownAngle, - laneAngle MergeDivergeNodeAngle, - speedLimits SpeedLimitList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... -} - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute - -LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -LaneSharing ::= BIT STRING { - overlappingLaneDescriptionProvided (0), - multipleLanesTreatedAsOneLane (1), - otherNonMotorizedTrafficTypes (2), - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) -} (SIZE (10)) - -LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, - crosswalk LaneAttributes-Crosswalk, - bikeLane LaneAttributes-Bike, - sidewalk LaneAttributes-Sidewalk, - median LaneAttributes-Barrier, - striping LaneAttributes-Striping, - trackedVehicle LaneAttributes-TrackedVehicle, - parking LaneAttributes-Parking, - ... -} - -ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist - -MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - timing TimeChangeDetails OPTIONAL, - speeds AdvisorySpeedList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... -} - -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - -MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState - -MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - signalGroup SignalGroupID, - state-time-speed MovementEventList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... -} - -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - disabled SegmentAttributeXYList OPTIONAL, - enabled SegmentAttributeXYList OPTIONAL, - data LaneDataAttributeList OPTIONAL, - dWidth Offset-B10 OPTIONAL, - dElevation Offset-B10 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... -} - -NodeAttributeXY ::= ENUMERATED { - reserved, - stopLine, - roundedCapStyleA, - roundedCapStyleB, - mergePoint, - divergePoint, - downstreamStopLine, - downstreamStartNode, - closedToTraffic, - safeIsland, - curbPresentAtStepOff, - hydrantPresent, - ... -} - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude -} - -Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 -} - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 -} - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 -} - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 -} - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 -} - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 -} - -NodeListXY ::= CHOICE { - nodes NodeSetXY, - computed ComputedLane, - ... -} - -NodeOffsetPointXY ::= CHOICE { - node-XY1 Node-XY-20b, - node-XY2 Node-XY-22b, - node-XY3 Node-XY-24b, - node-XY4 Node-XY-26b, - node-XY5 Node-XY-28b, - node-XY6 Node-XY-32b, - node-LatLon Node-LLmD-64b, - regional RegionalExtension {{Reg-NodeOffsetPointXY}} -} - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - attributes NodeAttributeSetXY OPTIONAL, - ... -} - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - -OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -PositionalAccuracy ::= SEQUENCE { - semiMajor SemiMajorAxisAccuracy, - semiMinor SemiMinorAxisAccuracy, - orientation SemiMajorAxisOrientation -} - -PositionConfidenceSet ::= SEQUENCE { - pos PositionConfidence, -- for both horizontal directions - elevation ElevationConfidence - } - - -Position3D ::= SEQUENCE { - lat Latitude, - long Longitude, - elevation Elevation OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... -} - -PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone - -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - speed Velocity -} - -RequestorDescription ::= SEQUENCE { - id VehicleID, - type RequestorType OPTIONAL, - position RequestorPositionVector OPTIONAL, - name DescriptiveName OPTIONAL, - routeName DescriptiveName OPTIONAL, - transitStatus TransitVehicleStatus OPTIONAL, - transitOccupancy TransitVehicleOccupancy OPTIONAL, - transitSchedule DeltaTime OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... -} - -RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... -} - -RequestorType ::= SEQUENCE { - role BasicVehicleRole, - subrole RequestSubRole OPTIONAL, - request RequestImportanceLevel OPTIONAL, - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... -} - -RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - users RestrictionUserTypeList -} - -RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment - -RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... -} - -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - -RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id RoadSegmentID -} - -RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - roadLaneSet RoadLaneSetList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... -} - -RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - -RTCMheader ::= SEQUENCE { - status GNSSstatus, - offsetSet AntennaOffsetSet - } - -RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage - -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY - -SignalControlZone ::= SEQUENCE { - zone RegionalExtension {{Reg-SignalControlZone}}, - ... -} - -SignalRequesterInfo ::= SEQUENCE { - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - typeData RequestorType OPTIONAL, - ... -} - -SignalRequest ::= SEQUENCE { - id IntersectionReferenceID, - requestID RequestID, - requestType PriorityRequestType, - inBoundLane IntersectionAccessPoint, - outBoundLane IntersectionAccessPoint OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... -} - -SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage - -SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... -} - -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - id IntersectionReferenceID, - sigStatus SignalStatusPackageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... -} - -SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus - -SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage - -SignalStatusPackage ::= SEQUENCE { - requester SignalRequesterInfo OPTIONAL, - inboundOn IntersectionAccessPoint, - outboundOn IntersectionAccessPoint OPTIONAL, - - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - status PrioritizationResponseStatus, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... -} - -SpeedandHeadingandThrottleConfidence ::= SEQUENCE { - heading HeadingConfidenceDSRC, - speed SpeedConfidenceDSRC, - throttle ThrottleConfidence - } - - -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, - maxSpeedInSchoolZone, - maxSpeedInSchoolZoneWhenChildrenArePresent, - maxSpeedInConstructionZone, - vehicleMinSpeed, - vehicleMaxSpeed, - vehicleNightMaxSpeed, - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... -} - -TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - minEndTime TimeMark, - maxEndTime TimeMark OPTIONAL, - likelyTime TimeMark OPTIONAL, - confidence TimeIntervalConfidence OPTIONAL, - nextTime TimeMark OPTIONAL -} - -TimeMark ::= INTEGER (0..36001) - -TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity -} - -VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID -} - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- data elements --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... -} - -AllowedManeuvers ::= BIT STRING { - maneuverStraightAllowed (0), - maneuverLeftAllowed (1), - maneuverRightAllowed (2), - maneuverUTurnAllowed (3), - maneuverLeftTurnOnRedAllowed (4), - maneuverRightTurnOnRedAllowed (5), - maneuverLaneChangeAllowed (6), - maneuverNoStoppingAllowed (7), - yieldAllwaysRequired (8), - goWithHalt (9), - caution (10), - reserved1 (11) -} (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -ApproachID ::= INTEGER (0..15) - -BasicVehicleRole ::= ENUMERATED { - basicVehicle (0), - publicTransport (1), - specialTransport (2), - dangerousGoods (3), - roadWork (4), - roadRescue (5), - emergency (6), - safetyCar (7), - none-unknown (8), - truck (9), - motorcycle (10), - roadSideSource (11), - police (12), - fire (13), - ambulance (14), - dot (15), - transit (16), - slowMoving (17), - stopNgo (18), - cyclist (19), - pedestrian (20), - nonMotorized (21), - military (22), - ... -} - -DDay ::= INTEGER (0..31) - -DeltaAngle ::= INTEGER (-150..150) - -DeltaTime ::= INTEGER (-122 .. 121) - -DescriptiveName ::= IA5String (SIZE(1..63)) - -DHour ::= INTEGER (0..31) - -DMinute ::= INTEGER (0..60) - -DMonth ::= INTEGER (0..12) - -DOffset ::= INTEGER (-840..840) - -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -DSecond ::= INTEGER (0..65535) - -DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 - rtcmCorrections DSRCmsgID ::= 28 - signalPhaseAndTimingMessage DSRCmsgID ::= 19 - signalRequestMessage DSRCmsgID ::= 29 - signalStatusMessage DSRCmsgID ::= 30 - -DYear ::= INTEGER (0..4095) - -Elevation ::= INTEGER (-4096..61439) - -ElevationConfidence ::= ENUMERATED { - unavailable (0), - elev-500-00 (1), - elev-200-00 (2), - elev-100-00 (3), - elev-050-00 (4), - elev-020-00 (5), - elev-010-00 (6), - elev-005-00 (7), - elev-002-00 (8), - elev-001-00 (9), - elev-000-50 (10), - elev-000-20 (11), - elev-000-10 (12), - elev-000-05 (13), - elev-000-02 (14), - elev-000-01 (15) - } - - -FuelType ::= INTEGER (0..15) - unknownFuel FuelType ::= 0 - gasoline FuelType ::= 1 - ethanol FuelType ::= 2 - diesel FuelType ::= 3 - electric FuelType ::= 4 - hybrid FuelType ::= 5 - hydrogen FuelType ::= 6 - natGasLiquid FuelType ::= 7 - natGasComp FuelType ::= 8 - propane FuelType ::= 9 - -GNSSstatus ::= BIT STRING { - unavailable (0), - isHealthy (1), - isMonitored (2), - baseStationType (3), - aPDOPofUnder5 (4), - inViewOfUnder5 (5), - localCorrectionsPresent (6), - networkCorrectionsPresent (7) - } (SIZE(8)) - -HeadingConfidenceDSRC ::= ENUMERATED { - unavailable (0), - prec10deg (1), - prec05deg (2), - prec01deg (3), - prec0-1deg (4), - prec0-05deg (5), - prec0-01deg (6), - prec0-0125deg (7) - } - -HeadingDSRC ::= INTEGER (0..28800) - -IntersectionID ::= INTEGER (0..65535) - -IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - stopTimeIsActivated (1), - failureFlash (2), - preemptIsActive (3), - signalPriorityIsActive (4), - fixedTimeOperation (5), - trafficDependentOperation (6), - standbyOperation (7), - failureMode (8), - off (9), - recentMAPmessageUpdate (10), - recentChangeInMAPassignedLanesIDsUsed (11), - noValidMAPisAvailableAtThisTime (12), - noValidSPATisAvailableAtThisTime (13) -} (SIZE(16)) - -LaneAttributes-Barrier ::= BIT STRING { - median-RevocableLane (0), - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) -} (SIZE (16)) - -LaneAttributes-Bike ::= BIT STRING { - bikeRevocableLane (0), - pedestrianUseAllowed (1), - isBikeFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) -} (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - crosswalkRevocableLane (0), - bicyleUseAllowed (1), - isXwalkFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - hasPushToWalkButton (5), - audioSupport (6), - rfSignalRequestPresent (7), - unsignalizedSegmentsPresent (8) -} (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - parkingRevocableLane (0), - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) -} (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - sidewalk-RevocableLane (0), - bicyleUseAllowed (1), - isSidewalkFlyOverLane (2), - walkBikes (3) -} (SIZE (16)) - -LaneAttributes-Striping ::= BIT STRING { - stripeToConnectingLanesRevocableLane (0), - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) -} (SIZE (16)) - -LaneAttributes-TrackedVehicle ::= BIT STRING { - spec-RevocableLane (0), - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) -} (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - isVehicleRevocableLane (0), - isVehicleFlyOverLane (1), - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) -} (SIZE (8,...)) - -LaneConnectionID ::= INTEGER (0..255) - -LaneDirection ::= BIT STRING { - ingressPath (0), - egressPath (1) -} (SIZE (2)) - -LaneID ::= INTEGER (0..255) - -LayerID ::= INTEGER (0..100) - -LayerType ::= ENUMERATED { - none, - mixedContent, - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... -} - -LaneWidth ::= INTEGER (0..32767) - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -MinuteOfTheYear ::= INTEGER (0..527040) - -MovementPhaseState ::= ENUMERATED { - unavailable (0), - dark (1), - stop-Then-Proceed (2), - stop-And-Remain (3), - pre-Movement (4), - permissive-Movement-Allowed (5), - protected-Movement-Allowed (6), - permissive-clearance (7), - protected-clearance (8), - caution-Conflicting-Traffic (9) -} - -MsgCount ::= INTEGER (0..127) - -Offset-B09 ::= INTEGER (-256..255) - -Offset-B10 ::= INTEGER (-512..511) - -Offset-B11 ::= INTEGER (-1024..1023) - -Offset-B12 ::= INTEGER (-2048..2047) - -Offset-B13 ::= INTEGER (-4096..4095) - -Offset-B14 ::= INTEGER (-8192..8191) - -Offset-B16 ::= INTEGER (-32768..32767) - -PedestrianBicycleDetect ::= BOOLEAN - -PositionConfidence ::= ENUMERATED { - unavailable (0), - a500m (1), - a200m (2), - a100m (3), - a50m (4), - a20m (5), - a10m (6), - a5m (7), - a2m (8), - a1m (9), - a50cm (10), - a20cm (11), - a10cm (12), - a5cm (13), - a2cm (14), - a1cm (15) - } - -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - requested (1), - processing (2), - watchOtherTraffic (3), - granted (4), - rejected (5), - maxPresence (6), - reserviceLocked (7), - ... -} - -PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... -} - -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 - addGrpA RegionId ::= 1 - addGrpB RegionId ::= 2 - addGrpC RegionId ::= 3 - -RequestID ::= INTEGER (0..255) - -RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), - requestImportanceLevel2 (2), - requestImportanceLevel3 (3), - requestImportanceLevel4 (4), - requestImportanceLevel5 (5), - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), - requestImportanceReserved (15) -} - -RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), - requestSubRole2 (2), - requestSubRole3 (3), - requestSubRole4 (4), - requestSubRole5 (5), - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), - requestSubRoleReserved (15) -} - -RestrictionAppliesTo ::= ENUMERATED { - none, - equippedTransit, - equippedTaxis, - equippedOther, - emissionCompliant, - equippedBicycle, - weightCompliant, - heightCompliant, - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, - otherUnknownDisabilities, - ... -} - -RestrictionClassID ::= INTEGER (0..255) - -RoadRegulatorID ::= INTEGER (0..65535) - -RoadSegmentID ::= INTEGER (0..65535) - -RoadwayCrownAngle ::= INTEGER (-128..127) - -RTCMmessage ::= OCTET STRING (SIZE(1..1023)) - -RTCM-Revision ::= ENUMERATED { - unknown (0), - rtcmRev2 (1), -- Std 10402.x et al - rtcmRev3 (2), -- Std 10403.x et al - reserved (3), - ... -} - -Scale-B12 ::= INTEGER (-2048..2047) - -SignalGroupID ::= INTEGER (0..255) - -SegmentAttributeXY ::= ENUMERATED { - reserved , - doNotBlock , - whiteLine , - mergingLaneLeft , - mergingLaneRight , - curbOnLeft , - curbOnRight , - loadingzoneOnLeft , - loadingzoneOnRight , - turnOutPointOnLeft , - turnOutPointOnRight , - adjacentParkingOnLeft , - adjacentParkingOnRight , - adjacentBikeLaneOnLeft , - adjacentBikeLaneOnRight , - sharedBikeLane , - bikeBoxInFront , - transitStopOnLeft , - transitStopOnRight , - transitStopInLane , - sharedWithTrackedVehicle , - safeIsland , - lowCurbsPresent , - rumbleStripPresent , - audibleSignalingPresent , - adaptiveTimingPresent , - rfSignalRequestPresent , - partialCurbIntrusion , - taperToLeft , - taperToRight , - taperToCenterLine , - parallelParking , - headInParking , - freeParking , - timeRestrictionsOnParking , - costToPark , - midBlockCurbPresent , - unEvenPavementPresent , - ... -} - -SemiMajorAxisAccuracy ::= INTEGER (0..255) - -SemiMajorAxisOrientation ::= INTEGER (0..65535) - -SemiMinorAxisAccuracy ::= INTEGER (0..255) - -SpeedAdvice ::= INTEGER (0..500) - -SpeedConfidenceDSRC ::= ENUMERATED { - unavailable (0), -- Not Equipped or unavailable - prec100ms (1), -- 100 meters / sec - prec10ms (2), -- 10 meters / sec - prec5ms (3), -- 5 meters / sec - prec1ms (4), -- 1 meters / sec - prec0-1ms (5), -- 0.1 meters / sec - prec0-05ms (6), -- 0.05 meters / sec - prec0-01ms (7) -- 0.01 meters / sec - } - -TemporaryID ::= OCTET STRING (SIZE(4)) - -ThrottleConfidence ::= ENUMERATED { - unavailable (0), - prec10percent (1), - prec1percent (2), - prec0-5percent (3) - } - -TimeConfidence ::= ENUMERATED { - unavailable (0), - time-100-000 (1), - time-050-000 (2), - time-020-000 (3), - time-010-000 (4), - time-002-000 (5), - time-001-000 (6), - time-000-500 (7), - time-000-200 (8), - time-000-100 (9), - time-000-050 (10), - time-000-020 (11), - time-000-010 (12), - time-000-005 (13), - time-000-002 (14), - time-000-001 (15), - time-000-000-5 (16), - time-000-000-2 (17), - time-000-000-1 (18), - time-000-000-05 (19), - time-000-000-02 (20), - time-000-000-01 (21), - time-000-000-005 (22), - time-000-000-002 (23), - time-000-000-001 (24), - time-000-000-000-5 (25), - time-000-000-000-2 (26), - time-000-000-000-1 (27), - time-000-000-000-05 (28), - time-000-000-000-02 (29), - time-000-000-000-01 (30), - time-000-000-000-005 (31), - time-000-000-000-002 (32), - time-000-000-000-001 (33), - time-000-000-000-000-5 (34), - time-000-000-000-000-2 (35), - time-000-000-000-000-1 (36), - time-000-000-000-000-05 (37), - time-000-000-000-000-02 (38), - time-000-000-000-000-01 (39) -} - -TimeIntervalConfidence ::= INTEGER (0..15) - -TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) -} - -TransitVehicleStatus ::= BIT STRING { - loading (0), - anADAuse (1), - aBikeLoad (2), - doorOpen (3), - charging (4), - atStopLine (5) -} (SIZE(8)) - -TransmissionState ::= ENUMERATED { - neutral (0), - park (1), - forwardGears (2), - reverseGears (3), - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) -} - -VehicleHeight ::= INTEGER (0..127) - -VehicleType ::= ENUMERATED { - none (0), - unknown (1), - special (2), - moto (3), - car (4), - carOther (5), - bus (6), - axleCnt2 (7), - axleCnt3 (8), - axleCnt4 (9), - axleCnt4Trailer (10), - axleCnt5Trailer (11), - axleCnt6Trailer (12), - axleCnt5MultiTrailer (13), - axleCnt6MultiTrailer (14), - axleCnt7MultiTrailer (15), - ... -} - -Velocity ::= INTEGER (0..8191) - -WaitOnStopline ::= BOOLEAN - -ZoneLength ::= INTEGER (0..10000) - -END diff --git a/asn1/IS/ISO_TS_19091/original/REGION.asn b/asn1/IS/ISO_TS_19091/original/REGION.asn deleted file mode 100644 index df216bf1..00000000 --- a/asn1/IS/ISO_TS_19091/original/REGION.asn +++ /dev/null @@ -1,115 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: REGION --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -REGION { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) - version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -addGrpC, REG-EXT-ID-AND-TYPE -FROM DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, -IntersectionState-addGrpC, LaneAttributes-addGrpC, MapData-addGrpC, -MovementEvent-addGrpC, NodeAttributeSet-addGrpC, Position3D-addGrpC, RequestorDescription-addGrpC, RestrictionUserType-addGrpC, SignalStatusPackage-addGrpC -FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version2 (2)}; - -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { - {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , - ... -} -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { - {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , - ... -} -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } - --- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC}, - ... -} - --- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { - { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC }, - ... -} - -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } - -END diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn deleted file mode 100644 index 21cb22f1..00000000 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ /dev/null @@ -1,630 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19321 --- --- This ASN.1 was generateds: 30.08.2016 --- --- Due to typos in the published version, --- small ASN.1 syntax adaptations have been executed --- --- Published version location: --- http://standards.iso.org/iso/ts/19321 --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -IVI {iso (1) standard (0) ivi (19321) version2 (2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN -IMPORTS -ItsPduHeader, Altitude, DangerousGoodsBasic , DeltaLatitude, DeltaLongitude, DeltaReferencePosition, Heading, HeadingValue, Latitude, LanePosition, Longitude, ReferencePosition, RoadType, SpecialTransportType, Speed, StationType, TimestampIts, VehicleRole -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - -AxleWeightLimits, DieselEmissionValues, ExhaustEmissionValues, EngineCharacteristics, EnvironmentalCharacteristics, PassengerCapacity , Provider, SoundLevel, VehicleDimensions, VehicleWeightLimits -FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} - -EuVehicleCategoryCode, Iso3833VehicleType -FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - - -VarLengthNumber -FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} - -; --- End of IMPORTS - - ---Definition of IVI message to be send over the air is outside of the scope and given for information only: - -IVI::= SEQUENCE { - header ItsPduHeader, - ivi IviStructure -} - ---Definition of IVI Structure - - - -IviStructure::= SEQUENCE{ - mandatory IVIManagementContainer, - optional SEQUENCE (SIZE (1..8,...)) OF IviContainer OPTIONAL - } - ---Definition of Containers - -IviContainer::= CHOICE { - glc GeographicLocationContainer, - giv GeneralIviContainer, - rcc RoadConfigurationContainer, - tc TextContainer, - lac LayoutContainer, - ... -- extension for future containers - } - --- Prefix IVI added due to naming collision with data element ManagementContainer of Module DENM-PDU-Descriptions -IVIManagementContainer::= SEQUENCE { - serviceProviderId Provider, - iviIdentificationNumber IviIdentificationNumber, - timeStamp TimestampIts OPTIONAL, - validFrom TimestampIts OPTIONAL, - validTo TimestampIts OPTIONAL, - connectedIviStructures SEQUENCE (SIZE(1..8)) OF IviIdentificationNumber OPTIONAL, - iviStatus IviStatus, - ... - } - -GeographicLocationContainer::= SEQUENCE { - referencePosition ReferencePosition, - referencePositionTime TimestampIts OPTIONAL, - referencePositionHeading Heading OPTIONAL, - referencePositionSpeed Speed OPTIONAL, - parts SEQUENCE (SIZE (1..16,...)) OF GlcPart, - ... - } - -GlcPart::= SEQUENCE { - zoneId Zid, - laneNumber LanePosition OPTIONAL, - zoneExtension INTEGER (0..255) OPTIONAL, - zoneHeading HeadingValue OPTIONAL, - zone Zone OPTIONAL, - ... - } - -GeneralIviContainer::= SEQUENCE (SIZE (1..16,...)) OF GicPart - -GicPart::= SEQUENCE { - detectionZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - its-Rrid VarLengthNumber OPTIONAL, - relevanceZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - direction Direction OPTIONAL, - driverAwarenessZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - minimumAwarenessTime INTEGER (0..255) OPTIONAL, - applicableLanes SEQUENCE (SIZE (1..8,...)) OF LanePosition OPTIONAL, - iviType IviType, - iviPurpose IviPurpose OPTIONAL, - laneStatus LaneStatus OPTIONAL, - vehicleCharacteristics SEQUENCE (SIZE (1..8, ...)) OF CompleteVehicleCharacteristics OPTIONAL, - driverCharacteristics DriverCharacteristics OPTIONAL, - layoutId INTEGER(1..4,...) OPTIONAL, - preStoredlayoutId INTEGER(1..64,...) OPTIONAL, - roadSignCodes SEQUENCE (SIZE (1..4,...)) OF RSCode, - extraText SEQUENCE (SIZE (1..4,...)) OF Text (WITH COMPONENTS {layoutComponentId, language, textContent (SIZE(1..32))}) OPTIONAL, - ... - } - -RoadConfigurationContainer::= SEQUENCE (SIZE (1..16,...)) OF RccPart - -RccPart::= SEQUENCE{ - zoneIds SEQUENCE (SIZE (1..8,...)) OF Zid, - roadType RoadType, - laneConfiguration SEQUENCE (SIZE (1..16,...)) OF LaneInformation, - ... - } - -TextContainer::= SEQUENCE (SIZE (1..16,...)) OF TcPart - -TcPart::= SEQUENCE { - detectionZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - relevanceZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid, - direction Direction OPTIONAL, - driverAwarenessZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - minimumAwarenessTime INTEGER (0..255) OPTIONAL, - applicableLanes SEQUENCE (SIZE (1..8,...)) OF LanePosition OPTIONAL, - layoutId INTEGER(1..4,...) OPTIONAL, - preStoredlayoutId INTEGER(1..64,...) OPTIONAL, - text SEQUENCE (SIZE (1..4,...)) OF Text OPTIONAL, - data OCTET STRING, - ... - } - -LayoutContainer::=SEQUENCE{ - layoutId INTEGER(1..4,...), - height INTEGER(10..73) OPTIONAL, - width INTEGER(10..265) OPTIONAL, - layoutComponents SEQUENCE SIZE (1..4,...) OF LayoutComponent, - ... - } - --- Definition of Data Frames & Elements - -AbsolutePosition::= SEQUENCE{ - latitude Latitude, - longitude Longitude - } - -AbsolutePositionWAltitude::= SEQUENCE{ - latitude Latitude, - longitude Longitude, - altitude Altitude - } - -AnyCatalogue::=SEQUENCE{ - owner Provider, - version INTEGER(0..255), - pictogramCode INTEGER(0..65535), - value INTEGER (0..65535) OPTIONAL, - unit RSCUnit OPTIONAL, - attributes ISO14823Attributes OPTIONAL - } - -ComparisonOperator ::= INTEGER { - greaterThan (0), - greaterThanOrEqualTo (1), - lessThan (2), - lessThanOrEqualTo (3) -} (0..3) - -CompleteVehicleCharacteristics::= SEQUENCE{ - tractor TractorCharacteristics OPTIONAL, - trailer SEQUENCE (SIZE (1..3)) OF TrailerCharacteristics OPTIONAL, - train TrainCharacteristics OPTIONAL - } - -ComputedSegment::= SEQUENCE { - zoneId Zid, - laneNumber LanePosition, - laneWidth IVILaneWidth, - offsetDistance INTEGER (-32768..32767) OPTIONAL, - offsetPosition DeltaReferencePosition OPTIONAL - } - -DeltaPosition::=SEQUENCE{ - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude - } - -Direction::= INTEGER{ - sameDirection (0), - oppositeDirection (1), - bothDirections (2), - valueNotUsed (3) - } (0..3) - -Distance::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (2..4|6..8) - } - -DistanceOrDuration::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (2..9) - } - -DriverCharacteristics::= INTEGER{ - unexperiencedDrivers (0), - experiencedDrivers (1), - rfu1 (2), - rfu2 (3) - } (0..3) - -GoodsType::= INTEGER { - ammunition (0), - chemicals (1), - empty (2), - fuel (3), - glass (4), - dangerous (5), - liquid (6), - liveStock (7), - dangerousForPeople (8), - dangerousForTheEnvironment (9), - dangerousForWater (10), - perishableProducts (11), - pharmaceutical (12), - vehicles (13) - -- other values reserved for future use - } (0..15,...) - - -ISO14823Attributes::= SEQUENCE (SIZE(1..8,...)) OF CHOICE{ - dtm DTM, -- Date/Time/Period - edt EDT, -- Exemption status of Date/Time/Period - dfl DFL, -- Directional Flow of Lane - ved VED, -- Vehicle Dimensions - spe SPE, -- Speed - roi ROI, -- Rate of Incline - dbv DBV, -- Distance Between Vehicles - ddd DDD -- Destination/Direction/Distance - } - -ISO14823Code ::= SEQUENCE{ - pictogramCode SEQUENCE { - countryCode OCTET STRING (SIZE (2)) OPTIONAL, - serviceCategoryCode CHOICE { - trafficSignPictogram ENUMERATED {dangerWarning, regulatory, informative,...}, - publicFacilitiesPictogram ENUMERATED {publicFacilities, ...}, - ambientOrRoadConditionPictogram ENUMERATED {ambientCondition, roadCondition,...}, - ...}, - pictogramCategoryCode SEQUENCE { - nature INTEGER (1..9), - serialNumber INTEGER (0..99) - }}, - attributes ISO14823Attributes OPTIONAL - } - -IviIdentificationNumber::= INTEGER(1..32767,...) - -IviPurpose::= INTEGER { - safety (0), - environmental (1), - trafficOptimisation (2) - } (0..3) - -IviStatus::= INTEGER { - new (0), - update (1), - cancellation (2), - negation (3) - -- other values reserved for future use - }(0..7) - -IviType::= INTEGER { - immediateDangerWarningMessages (0), - regulatoryMessages (1), - trafficRelatedInformationMessages (2), - pollutionMessages (3), - notTrafficRelatedInformationMessages (4) - -- other values reserved for future use - } (0..7) - -LaneInformation::= SEQUENCE{ - laneNumber LanePosition, - direction Direction, - validity DTM OPTIONAL, - laneType LaneType, - laneTypeQualifier CompleteVehicleCharacteristics OPTIONAL, - laneStatus LaneStatus, - laneWidth IVILaneWidth OPTIONAL, - ... - } - -LaneStatus::= INTEGER { - open (0), - closed (1), - mergeR (2), - mergeL (3), - mergeLR (4), - provisionallyOpen (5), - diverging (6) - -- value 7 reserved for future use -} (0..7, ...) - -LaneType::= INTEGER{ - traffic (0), - through (1), - reversible (2), - acceleration (3), - deceleration (4), - leftHandTurning (5), - rightHandTurning (6), - dedicatedVehicle (7), - bus (8), - taxi (9), - hov (10), - hot (11), - pedestrian (12), - bikeLane (13), - median (14), - striping (15), - trackedVehicle (16), - parking (17), - emergency (18), - verge (19) --- values 20 to 31 reserved for future use - }(0..31) - --- Prefix IVI added due to naming collision with data element LaneWidth of Module DSRC -IVILaneWidth::= INTEGER (0..1023) - -LayoutComponent::=SEQUENCE{ - layoutComponentId INTEGER(1..8,...), - height INTEGER(10..73), - width INTEGER(10..265), - x INTEGER(10..265), - y INTEGER(10..73), - textScripting INTEGER {horizontal (0), vertical (1)}(0..1) - } - -LoadType::= SEQUENCE{ - goodsType GoodsType, - dangerousGoodsType DangerousGoodsBasic, - specialTransportType SpecialTransportType - } - -PolygonalLine::= CHOICE { - deltaPositions SEQUENCE (SIZE (1..32,...)) OF DeltaPosition, - deltaPositionsWithAltitude SEQUENCE (SIZE (1..32,...)) OF DeltaReferencePosition, - absolutePositions SEQUENCE (SIZE (1..8,...)) OF AbsolutePosition, - absolutePositionsWithAltitude SEQUENCE (SIZE (1..8,...)) OF AbsolutePositionWAltitude, - ... - } - -RSCode::= SEQUENCE{ - layoutComponentId INTEGER(1..4,...) OPTIONAL, - code CHOICE { - viennaConvention VcCode, -- see Vienna Convention Annex A - iso14823 ISO14823Code, - itisCodes INTEGER (0..65535), -- see SAE J2540 - anyCatalogue AnyCatalogue, - ... - }} - -RSCUnit::= INTEGER { - kmperh (0), - milesperh (1), - kilometer (2), - meter (3), - decimeter (4), - centimeter (5), - mile (6), - yard (7), - foot (8), - minutesOfTime (9), - tonnes (10), --1000 kg, not Ton! - hundredkg (11), - pound (12), --lbs - rateOfIncline (13) - -- other value reserved for future use - } (0..15) - - -Segment::= SEQUENCE { - line PolygonalLine, - laneWidth IVILaneWidth OPTIONAL - } - -Text::= SEQUENCE { - layoutComponentId INTEGER(1..4,...) OPTIONAL, - language BIT STRING (SIZE(10)), - textContent UTF8String - } - -TractorCharacteristics::=SEQUENCE{ - equalTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues OPTIONAL, - notEqualTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues OPTIONAL, - ranges SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsRanges OPTIONAL -} - -TrailerCharacteristics::=SEQUENCE{ - equalTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues (WITH COMPONENTS {..., euroAndCo2value ABSENT, engineCharacteristics ABSENT}) OPTIONAL, - notEqualTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues (WITH COMPONENTS {..., euroAndCo2value ABSENT, engineCharacteristics ABSENT}) OPTIONAL, - ranges SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsRanges (WITH COMPONENTS {comparisonOperator, limits (WITH COMPONENTS {..., exhaustEmissionValues ABSENT, dieselEmissionValues ABSENT, soundLevel ABSENT})}) OPTIONAL - } - -TrainCharacteristics::= TractorCharacteristics - -VcClass::= INTEGER { - classA (0), - classB (1), - classC (2), - classD (3), - classE (4), - classF (5), - classG (6), - classH (7) - } (0..7) - -VcCode::= SEQUENCE { - roadSignClass VcClass, -- see Vienna Convention - roadSignCode INTEGER (1..64), - vcOption VcOption, -- e.g. the "a" in H, 3a - validity SEQUENCE (SIZE (1..8,...)) OF DTM OPTIONAL, - value INTEGER (0..65535) OPTIONAL, - unit RSCUnit OPTIONAL - } - -VcOption::= INTEGER { - none (0), - a (1), - b (2), - c (3), - d (4), - e (5), - f (6), - g (7) - } (0..7) - -VehicleCharacteristicsFixValues::= CHOICE{ - simpleVehicleType StationType, - euVehicleCategoryCode EuVehicleCategoryCode, - iso3833VehicleType Iso3833VehicleType, - euroAndCo2value EnvironmentalCharacteristics, - engineCharacteristics EngineCharacteristics, - loadType LoadType, - usage VehicleRole, - ...} - -VehicleCharacteristicsRanges::= SEQUENCE{ - comparisonOperator ComparisonOperator, - limits CHOICE{ - numberOfAxles INTEGER(0..7), - vehicleDimensions VehicleDimensions, - vehicleWeightLimits VehicleWeightLimits, - axleWeightLimits AxleWeightLimits, - passengerCapacity PassengerCapacity, - exhaustEmissionValues ExhaustEmissionValues, - dieselEmissionValues DieselEmissionValues, - soundLevel SoundLevel, - ...}} - -Weight::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (10..12) - } - -Zid::= INTEGER (1..32,...) - -Zone::= CHOICE { - segment Segment, - area PolygonalLine, - computedSegment ComputedSegment, - ... - } - --- Definition of the single ISO 14823 Attributes - - -DTM ::= SEQUENCE { - year SEQUENCE { -- contains SYR and EYR - syr INTEGER(2000..2127,...), - eyr INTEGER(2000..2127,...) - } OPTIONAL, - month-day SEQUENCE { -- contains SMD and EMD - smd MonthDay, - emd MonthDay - } OPTIONAL, - pmd PMD OPTIONAL, - hourMinutes SEQUENCE { -- contains SHM and EHM - shm HoursMinutes, - ehm HoursMinutes - } OPTIONAL, - dayOfWeek DayOfWeek OPTIONAL, -- corresponds to SDY and EDY - period HoursMinutes OPTIONAL -- corresponds to LDM -} - -MonthDay ::= SEQUENCE { - month INTEGER (1..12), - day INTEGER (1..31) -} - -PMD::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) - -HoursMinutes ::= SEQUENCE { - hours INTEGER (0..23), -- number of hours after midnight - mins INTEGER (0..59) -- number of minutes after the hour - } - --- Prefix IVI added due to naming collision with data element DayOfWeek of Module DSRC -DayOfWeek ::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) - -EDT ::= DTM - - - -DFL::= INTEGER { - sDL (1) , -- Straight Direction Only - sLT (2) , -- Straight and Left Turn Only - sRT (3) , -- Straight and Right Turn Only - lTO (4) , -- Left Turn Only - rTO (5) , -- Right Turn Only - cLL (6) , -- Convergence from the Left Lane - cRI (7) , -- Convergence from the Right Lane - oVL (8) -- Oncoming Vehicles Lane - } (1..8) - -VED::=SEQUENCE{ - hei Distance OPTIONAL, - wid Distance OPTIONAL, - vln Distance OPTIONAL, - wei Weight OPTIONAL - } - -SPE::=SEQUENCE{ - spm INTEGER(0..250) OPTIONAL, - mns INTEGER(0..250) OPTIONAL, - unit RSCUnit(0..1) - } - -ROI::= INTEGER(1..32) - -DBV::= Distance --- changes: from DDD_IO to DDD-IO -DDD::= SEQUENCE{ - dcj INTEGER(1..128) OPTIONAL, - dcr INTEGER(1..128)OPTIONAL, - tpl INTEGER(1..128)OPTIONAL, - ioList SEQUENCE (SIZE (1..8,...)) OF DDD-IO - } --- changes: from DDD_IO to DDD-IO -DDD-IO::= SEQUENCE{ - arrowDirection INTEGER(0..7), - destPlace DestinationPlaces OPTIONAL, - destRoad DestinationRoads OPTIONAL, - roadNumberIdentifier INTEGER(1..999) OPTIONAL, - streetName INTEGER(1..999) OPTIONAL, - streetNameText UTF8String OPTIONAL, - distanceToDivergingPoint DistanceOrDuration OPTIONAL, - distanceToDestinationPlace DistanceOrDuration OPTIONAL - } -DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF DDD-IO - --- changes: from DDD_DEP to DDD-DEP -DestinationPlace::= SEQUENCE{ - depType DDD-DEP, - -- Encoding problem: to be checked if the statement is ASN.1 compatible - -- depRSCode ISO14823Code (WITH COMPONENTS {..., attributes ABSENT}) OPTIONAL, - depRSCode ISO14823Code OPTIONAL, - depBlob OCTET STRING OPTIONAL, - plnId INTEGER(1..999) OPTIONAL, - plnText UTF8String OPTIONAL - } -DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF DestinationPlace --- changes: from DDD_DER to DDD-DER -DestinationRoad::=SEQUENCE{ - derType DDD-DER, - ronId INTEGER(1..999) OPTIONAL, - ronText UTF8String OPTIONAL - } -DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF DestinationRoad --- changes: from DDD_DER to DDD-DER -DDD-DER::= INTEGER { - none (0), - nationalHighway (1), - localHighway (2), - tollExpresswayMotorway (3), - internationalHighway (4), - highway (5), - expressway (6), - nationalRoad (7), - regionalProvincialRoad (8), - localRoad (9), - motorwayJunction (10), - diversion (11), - rfu1 (12), - rfu2 (13), - rfu3 (14), - rfu4 (15) - } (0..15, ...) --- changes: from DDD_DEP to DDD-DEP -DDD-DEP::= INTEGER { - none (0), - importantArea (1), - principalArea (2), - generalArea (3), - wellKnownPoint (4), - country (5), - city (6), - street (7), - industrialArea (8), - historicArea (9), - touristicArea (10), - culturalArea (11), - touristicRoute (12), - recommendedRoute (13), - touristicAttraction (14), - geographicArea (15) - } (0..15, ...) - - - -END - diff --git a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn deleted file mode 100644 index 1d5d8855..00000000 --- a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn +++ /dev/null @@ -1,85 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 24534-3:2015 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location: --- https://standards.iso.org/iso/24534/-3/ISO%2024534-3%20ASN.1%20repository/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ISO 24534-3:2015 --- Version 29.4.2015 - - -ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - --- Electronic Registration Identification (ERI)- Vehicle Data - -EuVehicleCategoryCode ::= CHOICE { - euVehicleCategoryL EuVehicleCategoryL, -- conforms to EU 2002/24 and UNECE 1999 - euVehicleCategoryM EuVehicleCategoryM, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryN EuVehicleCategoryN, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryO EuVehicleCategoryO, -- conforms to EU 2001/116 and UNECE 1999 - euVehilcleCategoryT NULL, -- conforms to UNECE 1999 - euVehilcleCategoryG NULL -- conforms to EU 2001/116 and UNECE 1999 - } - -EuVehicleCategoryL ::= ENUMERATED { l1, l2, l3, l4, l5, l6, l7 } - -EuVehicleCategoryM ::= ENUMERATED {m1, m2, m3} - -EuVehicleCategoryN ::= ENUMERATED {n1, n2, n3} - -EuVehicleCategoryO ::= ENUMERATED {o1, o2, o3, o4} - -Iso3833VehicleType ::= INTEGER { - passengerCar (0), -- term No 3.1.1 - saloon (1), -- term No 3.1.1.1 (sedan) - convertibleSaloon (2), -- term No 3.1.1.2 - pullmanSaloon (3), -- term No 3.1.1.3 - stationWagon (4), -- term No 3.1.1.4 - truckStationWagon (5), -- term No 3.1.1.4.1 - coupe (6), -- term No 3.1.1.5 (coupé) - convertible (7), -- term No 3.1.1.6 (open tourer, roadstar, spider) - multipurposePassengerCar (8), -- term No 3.1.1.7 - forwardControlPassengerCar (9), -- term No 3.1.1.8 - specialPassengerCar (10), -- term No 3.1.1.9 - bus (11), -- term No 3.1.2 - minibus (12), -- term No 3.1.2.1 - urbanBus (13), -- term No 3.1.2.2 - interurbanCoach (14), -- term No 3.1.2.3 - longDistanceCoach (15), -- term No 3.1.2.4 - articulatedBus (16), -- term No 3.1.2.5 - trolleyBus (17), -- term No 3.1.2.6 - specialBus (18), -- term No 3.1.2.7 - commercialVehicle (19), -- term No 3.1.3 - specialCommercialVehicle (20), -- term No 3.1.3.1 - specialVehicle (21), -- term No 3.1.4 - trailingTowingVehicle (22), -- term No 3.1.5 (draw-bar tractor) - semiTrailerTowingVehicle (23), -- term No 3.1.6 (fifth wheel tractor) - trailer (24), -- term No 3.2.1 - busTrailer (25), -- term No 3.2.1.1 - generalPurposeTrailer (26), -- term No 3.2.1.2 - caravan (27), -- term No 3.2.1.3 - specialTrailer (28), -- term No 3.2.1.4 - semiTrailer (29), -- term No 3.2.2 - busSemiTrailer (30), -- term No 3.2.2.1 - generalPurposeSemiTrailer (31), -- term No 3.2.2.2 - specialSemiTrailer (32), -- term No 3.2.2.3 - roadTrain (33), -- term No 3.3.1 - passengerRoadTrain (34), -- term No 3.3.2 - articulatedRoadTrain (35), -- term No 3.3.3 - doubleRoadTrain (36), -- term No 3.3.4 - compositeRoadTrain (37), -- term No 3.3.5 - specialRoadTrain (38), -- term No 3.3.6 - moped (39), -- term No 3.4 - motorCycle (40) -- term No 3.5 - } (0..255) - -END diff --git a/asn1/IS/module.mk b/asn1/IS/module.mk deleted file mode 100644 index 6e4474f9..00000000 --- a/asn1/IS/module.mk +++ /dev/null @@ -1,19 +0,0 @@ -sources := \ - ETSI_TS_103301/IVIM_PDU_Descriptions.asn \ - ETSI_TS_103301/MAPEM_PDU_Descriptions.asn \ - ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn \ - ETSI_TS_103301/SPATEM_PDU_Descriptions.asn\ - ETSI_TS_103301/SREM_PDU_Descriptions.asn \ - ETSI_TS_103301/SSEM_PDU_Descriptions.asn \ - ISO_TS_14816/AVIAEINumberingAndDataStructures.asn \ - ISO_TS_14906/EfcDsrcApplication.asn \ - ISO_TS_14906/EfcDsrcGeneric.asn \ - ISO_TS_17419/CITSapplMgmtIDs.asn \ - ISO_TS_19091/AddGrpC.asn \ - ISO_TS_19091/AddGrpC_noCircular.asn \ - ISO_TS_19091/DSRC.asn \ - ISO_TS_19091/DSRC_REGION_noCircular.asn \ - ISO_TS_19091/REGION.asn \ - ISO_TS_19321/IVI.asn \ - ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn - diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn deleted file mode 100644 index 8b6874e0..00000000 --- a/asn1/ITS-Container/ITS_Container.asn +++ /dev/null @@ -1,508 +0,0 @@ -ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS; - -ItsPduHeader ::= SEQUENCE { - protocolVersion INTEGER (0..255), - messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 - stationID StationID -} - -StationID ::= INTEGER(0..4294967295) - -ReferencePosition ::= SEQUENCE { - latitude Latitude, - longitude Longitude, - positionConfidenceEllipse PosConfidenceEllipse , - altitude Altitude -} - -DeltaReferencePosition ::= SEQUENCE { - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude, - deltaAltitude DeltaAltitude -} - -Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) - -Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) - -Altitude ::= SEQUENCE { - altitudeValue AltitudeValue, - altitudeConfidence AltitudeConfidence -} - -AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) - -AltitudeConfidence ::= ENUMERATED { - alt-000-01 (0), - alt-000-02 (1), - alt-000-05 (2), - alt-000-10 (3), - alt-000-20 (4), - alt-000-50 (5), - alt-001-00 (6), - alt-002-00 (7), - alt-005-00 (8), - alt-010-00 (9), - alt-020-00 (10), - alt-050-00 (11), - alt-100-00 (12), - alt-200-00 (13), - outOfRange (14), - unavailable (15) -} - -DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) - -DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) - -DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) - -PosConfidenceEllipse ::= SEQUENCE { - semiMajorConfidence SemiAxisLength, - semiMinorConfidence SemiAxisLength, - semiMajorOrientation HeadingValue -} - -PathPoint ::= SEQUENCE { - pathPosition DeltaReferencePosition, - pathDeltaTime PathDeltaTime OPTIONAL -} - -PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) - -PtActivation ::= SEQUENCE { - ptActivationType PtActivationType, - ptActivationData PtActivationData -} - -PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) - -PtActivationData ::= OCTET STRING (SIZE(1..20)) - -AccelerationControl ::= BIT STRING { - brakePedalEngaged (0), - gasPedalEngaged (1), - emergencyBrakeEngaged (2), - collisionWarningEngaged (3), - accEngaged (4), - cruiseControlEngaged (5), - speedLimiterEngaged (6) -} (SIZE(7)) - -SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) - -CauseCode ::= SEQUENCE { - causeCode CauseCodeType, - subCauseCode SubCauseCodeType, - ... -} - -CauseCodeType ::= INTEGER { - reserved (0), - trafficCondition (1), - accident (2), - roadworks (3), - impassability (5), - adverseWeatherCondition-Adhesion (6), - aquaplannning (7), - hazardousLocation-SurfaceCondition (9), - hazardousLocation-ObstacleOnTheRoad (10), - hazardousLocation-AnimalOnTheRoad (11), - humanPresenceOnTheRoad (12), - wrongWayDriving (14), - rescueAndRecoveryWorkInProgress (15), - adverseWeatherCondition-ExtremeWeatherCondition (17), - adverseWeatherCondition-Visibility (18), - adverseWeatherCondition-Precipitation (19), - slowVehicle (26), - dangerousEndOfQueue (27), - vehicleBreakdown (91), - postCrash (92), - humanProblem (93), - stationaryVehicle (94), - emergencyVehicleApproaching (95), - hazardousLocation-DangerousCurve (96), - collisionRisk (97), - signalViolation (98), - dangerousSituation (99) -} (0..255) - -SubCauseCodeType ::= INTEGER (0..255) - -TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) - -AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) - -RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) - -HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) - -WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) - -AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) - -AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) - -AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) - -AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) - -SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) - -StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) - -HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) - -EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) - -HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) - -HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) - -HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) - -HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) - -CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) - -SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) - -RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) - -DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) - -DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) - -VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) - -PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) - -Curvature ::= SEQUENCE { - curvatureValue CurvatureValue, - curvatureConfidence CurvatureConfidence -} - -CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) - -CurvatureConfidence ::= ENUMERATED { - onePerMeter-0-00002 (0), - onePerMeter-0-0001 (1), - onePerMeter-0-0005 (2), - onePerMeter-0-002 (3), - onePerMeter-0-01 (4), - onePerMeter-0-1 (5), - outOfRange (6), - unavailable (7) -} - -CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} - -Heading ::= SEQUENCE { - headingValue HeadingValue, - headingConfidence HeadingConfidence -} - -HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) - -HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) - -LanePosition ::= INTEGER {offTheRoad(-1), innerHardShoulder(0), -innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14) } (-1..14) - -ClosedLanes ::= SEQUENCE { - innerhardShoulderStatus HardShoulderStatus OPTIONAL, - outerhardShoulderStatus HardShoulderStatus OPTIONAL, - drivingLaneStatus DrivingLaneStatus OPTIONAL, - ... -} - -HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} - -DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) - -PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) - -SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) - -SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) - -VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) - -Speed ::= SEQUENCE { - speedValue SpeedValue, - speedConfidence SpeedConfidence -} - -DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} - -EmbarkationStatus ::= BOOLEAN - -LongitudinalAcceleration ::= SEQUENCE { - longitudinalAccelerationValue LongitudinalAccelerationValue, - longitudinalAccelerationConfidence AccelerationConfidence -} - -LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) - -AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) - -LateralAcceleration ::= SEQUENCE { - lateralAccelerationValue LateralAccelerationValue, - lateralAccelerationConfidence AccelerationConfidence -} - -LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) - -VerticalAcceleration ::= SEQUENCE { - verticalAccelerationValue VerticalAccelerationValue, - verticalAccelerationConfidence AccelerationConfidence -} - -VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) - -StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), -lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) - -ExteriorLights ::= BIT STRING { - lowBeamHeadlightsOn (0), - highBeamHeadlightsOn (1), - leftTurnSignalOn (2), - rightTurnSignalOn (3), - daytimeRunningLightsOn (4), - reverseLightOn (5), - fogLightOn (6), - parkingLightsOn (7) -} (SIZE(8)) - -DangerousGoodsBasic::= ENUMERATED { - explosives1(0), - explosives2(1), - explosives3(2), - explosives4(3), - explosives5(4), - explosives6(5), - flammableGases(6), - nonFlammableGases(7), - toxicGases(8), - flammableLiquids(9), - flammableSolids(10), - substancesLiableToSpontaneousCombustion(11), - substancesEmittingFlammableGasesUponContactWithWater(12), - oxidizingSubstances(13), - organicPeroxides(14), - toxicSubstances(15), - infectiousSubstances(16), - radioactiveMaterial(17), - corrosiveSubstances(18), - miscellaneousDangerousSubstances(19) -} - -DangerousGoodsExtended ::= SEQUENCE { - dangerousGoodsType DangerousGoodsBasic, - unNumber INTEGER (0..9999), - elevatedTemperature BOOLEAN, - tunnelsRestricted BOOLEAN, - limitedQuantity BOOLEAN, - emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, - phoneNumber PhoneNumber OPTIONAL, - companyName UTF8String (SIZE (1..24)) OPTIONAL, - ... -} - -SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) - -LightBarSirenInUse ::= BIT STRING { - lightBarActivated (0), - sirenActivated (1) -} (SIZE(2)) - -HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) - -PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) - -PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) - -PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) - -RequestResponseIndication ::= ENUMERATED {request(0), response(1)} - -SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) - -StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} - -Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) - -TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... -} - -WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) - -TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) - -PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) - -PositionOfOccupants ::= BIT STRING { - row1LeftOccupied (0), - row1RightOccupied (1), - row1MidOccupied (2), - row1NotDetectable (3), - row1NotPresent (4), - row2LeftOccupied (5), - row2RightOccupied (6), - row2MidOccupied (7), - row2NotDetectable (8), - row2NotPresent (9), - row3LeftOccupied (10), - row3RightOccupied (11), - row3MidOccupied (12), - row3NotDetectable (13), - row3NotPresent (14), - row4LeftOccupied (15), - row4RightOccupied (16), - row4MidOccupied (17), - row4NotDetectable (18), - row4NotPresent (19)} (SIZE(20)) - -PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} - -VehicleIdentification ::= SEQUENCE { - wMInumber WMInumber OPTIONAL, - vDS VDS OPTIONAL, - ... -} - -WMInumber ::= IA5String (SIZE(1..3)) - -VDS ::= IA5String (SIZE(6)) - -EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) - -VehicleLength ::= SEQUENCE { - vehicleLengthValue VehicleLengthValue, - vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication -} - -VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) - -VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} - -VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) - -PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint - -EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) - -InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) - -RoadType ::= ENUMERATED { - urban-NoStructuralSeparationToOppositeLanes(0), - urban-WithStructuralSeparationToOppositeLanes(1), - nonUrban-NoStructuralSeparationToOppositeLanes(2), - nonUrban-WithStructuralSeparationToOppositeLanes(3)} - -SteeringWheelAngle ::= SEQUENCE { - steeringWheelAngleValue SteeringWheelAngleValue, - steeringWheelAngleConfidence SteeringWheelAngleConfidence -} - -SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) - -SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) - -TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) - -VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} - -YawRate::= SEQUENCE { - yawRateValue YawRateValue, - yawRateConfidence YawRateConfidence -} - -YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) - -YawRateConfidence ::= ENUMERATED { - degSec-000-01 (0), - degSec-000-05 (1), - degSec-000-10 (2), - degSec-001-00 (3), - degSec-005-00 (4), - degSec-010-00 (5), - degSec-100-00 (6), - outOfRange (7), - unavailable (8) -} - -ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } - -RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} - -RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} - -TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) - -ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) - -ActionID ::= SEQUENCE { - originatingStationID StationID, - sequenceNumber SequenceNumber -} - -ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition - -ProtectedCommunicationZone ::= SEQUENCE { - protectedZoneType ProtectedZoneType, - expiryTime TimestampIts OPTIONAL, - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - protectedZoneRadius ProtectedZoneRadius OPTIONAL, - protectedZoneID ProtectedZoneID OPTIONAL, - ... -} - -Traces ::= SEQUENCE SIZE(1..7) OF PathHistory - -NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) - -SequenceNumber ::= INTEGER (0..65535) - -PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar - -RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType - -EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint - -EventPoint ::= SEQUENCE { - eventPosition DeltaReferencePosition, - eventDeltaTime PathDeltaTime OPTIONAL, - informationQuality InformationQuality -} - -ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone - -CenDsrcTollingZone ::= SEQUENCE { - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, - ... -} - -ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) - -ProtectedZoneID ::= INTEGER (0.. 134217727) - -CenDsrcTollingZoneID ::= ProtectedZoneID - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -OpeningDaysHours ::= UTF8String - -PhoneNumber ::= NumericString (SIZE(1..16)) -END diff --git a/asn1/ITS-Container/module.mk b/asn1/ITS-Container/module.mk deleted file mode 100644 index 0b107446..00000000 --- a/asn1/ITS-Container/module.mk +++ /dev/null @@ -1 +0,0 @@ -sources := ITS_Container.asn \ No newline at end of file diff --git a/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn b/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn deleted file mode 100644 index 44a1050b..00000000 --- a/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn +++ /dev/null @@ -1,181 +0,0 @@ -ProtocolManagementInformation {iso(1) standard(0) iso15662(15662) protocolManagementInformation(1)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -ProtocolManagementInformation ::= SEQUENCE{ - selectionOfCommunicationSysyem SelectionOfCommunicationSystem OPTIONAL, - applicationIdentifiers ApplicationIdentifiers OPTIONAL, - address Address OPTIONAL, - priority Priority OPTIONAL, - security Security OPTIONAL, - applicationExecution ApplicationExecution OPTIONAL - } - -SelectionOfCommunicationSystem ::= SEQUENCE{ --see 4.1 - responsiveness Responsiveness OPTIONAL, - directionality Directionality OPTIONAL, - usageEnvironment UsageEnvironment OPTIONAL, - serviceArea ServiceArea OPTIONAL, - serviceTime ServiceTime OPTIONAL, - bandwidth Bandwidth OPTIONAL, - connectionCost ConnectionCost OPTIONAL - } - -ApplicationIdentifiers ::= SEQUENCE{ --see 4.2 - messageIdentifier EXTERNAL OPTIONAL, - messageNumber INTEGER OPTIONAL, - timeOfMessageTransmission GeneralizedTime OPTIONAL - } - -Address ::= SEQUENCE{ --see 4.3 - addressOfOrigin EXTERNAL OPTIONAL, - addressOfDestination EXTERNAL OPTIONAL - } - -Priority ::= SEQUENCE{ --see 4.4 - interruptHandling INTEGER{ - undefined (0), - lowPriority (1), - middlePriority (2), - highPriority (3)}, - interruptHandlingLevel INTEGER OPTIONAL, - queueControl INTEGER{ - undefined-FIFO (0), - lIFO (1), - random (2), - re-try (3), - errorNotification (4) - } - } - -Security ::= BIT STRING { --see 4.5 - userAuthentication (0), - terminalAuthentication (1), - dataAuthentication (2), - consealment (3) - } - -ApplicationExecution ::= SEQUENCE{ --see 4.6 - validTime ValidTime, - timeStamp GeneralizedTime, - targetArea TargetArea - } - -Responsiveness ::= SEQUENCE{ --see 4.1.1 - responsivenessCode INTEGER{ - undefined (0), - within1Sec (1), - within30Sec (2), - oneMinute (3), - fifteenMinute (4), - other (5), - error (6) - }, - responsivenessValue UTCTime OPTIONAL - } - -Directionality ::= INTEGER{ --see 4.1.2 - undefined (0), - unidirectional (1), - bidirectional-Symmetric (2), - bidirectional-UpLarger (3), - bidirectional-DownLarger (4) - } - -UsageEnvironment ::= SEQUENCE { --see 4.1.3 - meansOfTransportation BIT STRING{ - undefined (0), - vehicle (1), - publicTransport (2), - foot (3), - bicycle (4), - motorCycle (5), - moped (6), - car (7), - truck (8), - emergencyVehicle (9), - buss (10), - tram (11), - train (12), - ferry (13), - taxi (14), - other (15) - }, - speed INTEGER{ - undefined (0), - fast (1), - middle (2), - slow (3), - stopped (4), - other (5) - }, - speedValue EXTERNAL OPTIONAL - } - -ServiceArea ::= SEQUENCE{ --see 4.1.4 - serviceAreaCode INTEGER{ - undefined (0), - continuous (1), - non-continuous (2) - }, - serviceAreaValue EXTERNAL OPTIONAL - } - -ServiceTime ::= SEQUENCE{ --see 4.1.5 - serviceTimeCode INTEGER{ - undefined (0), - start-StopTime (1), - startTime (2), - stopTime (3), - continuous (4) - }, - serviceTimeValue EXTERNAL OPTIONAL - } - -Bandwidth ::= SEQUENCE{ --see 4.1.6 - capacityOfTransmissionValue INTEGER OPTIONAL, - dataExpressionCode BIT STRING{ - undefined (0), - text (1), - audio (2), - simpleGraphic (3), - stillImage (4), - video (5), - other (6) - } - } - -ConnectionCost ::= SEQUENCE{ --see 4.1.7 - maximumCostRequirement INTEGER{ - undefined (0), - totalCost (1), - timeUnitPrice (2), - bitUnitPrice (3), - other (4) - }, - maximumCostValue EXTERNAL OPTIONAL - } - -ValidTime ::= SEQUENCE{ --see 4.6.1 - validTimeCode INTEGER{ - undefined (0), - duringReceptionOnly (1), - timeDesignated (2), - untilUpdated (3), - other (4) - }, - validTimeValue EXTERNAL OPTIONAL - } - -TargetArea ::= SEQUENCE{ --see 4.6.3 - targetAreaCode INTEGER{ - undefined (0), - spot (1), - zone (2), - interval (3), - region (4), - wideArea (5), - other (6) - }, - targetAreaValue EXTERNAL OPTIONAL - } - -END diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn deleted file mode 100644 index 43967635..00000000 --- a/asn1/Security/1609Dot2/IEEE1609dot2.asn +++ /dev/null @@ -1,310 +0,0 @@ -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)} - --- Minor version: 1 ---****************************************************************************** --- --- IEEE P1609.2 Data Types --- ---****************************************************************************** - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -EXPORTS ALL; - -IMPORTS - CrlSeries, - EccP256CurvePoint, - EciesP256EncryptedKey, - EncryptionKey, - GeographicRegion, - GroupLinkageValue, - HashAlgorithm, - HashedId3, - HashedId8, - Hostname, - IValue, - LinkageValue, - Opaque, - Psid, - PsidSsp, - PsidSspRange, - PublicEncryptionKey, - PublicVerificationKey, - SequenceOfHashedId3, - SequenceOfPsidSsp, - SequenceOfPsidSspRange, - ServiceSpecificPermissions, - Signature, - SubjectAssurance, - SymmetricEncryptionKey, - ThreeDLocation, - Time64, - Uint3, - Uint8, - Uint16, - Uint32, - ValidityPeriod -FROM IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) - standards-association-numbered-series-standards(2) wave-stds(1609) - dot2(2) base(1) base-types(2) major-version-2 (2)} - -; - --- ---********************************************************************* --- --- Structures for describing secured data --- ---********************************************************************* - --- Necessary to get certain tools to generate sample PDUs --- TestIeee1609Dot2Data ::= Ieee1609Dot2Data --- TestCertificate ::= Certificate - --- this structure belongs later in the file but putting it here avoids --- compiler errors with certain tools -SignedDataPayload ::= SEQUENCE { - data Ieee1609Dot2Data OPTIONAL, - extDataHash HashedData OPTIONAL, - ... -} - (WITH COMPONENTS {..., data PRESENT} | - WITH COMPONENTS {..., extDataHash PRESENT}) - -Ieee1609Dot2Data ::= SEQUENCE { - protocolVersion Uint8(3), - content Ieee1609Dot2Content -} - -Ieee1609Dot2Content ::= CHOICE { - unsecuredData Opaque, - signedData SignedData, - encryptedData EncryptedData, - signedCertificateRequest Opaque, - ... -} - -SignedData ::= SEQUENCE { - hashId HashAlgorithm, - tbsData ToBeSignedData, - signer SignerIdentifier, - signature Signature -} - -SignerIdentifier ::= CHOICE { - digest HashedId8, - certificate SequenceOfCertificate, - self NULL, - ... -} - -ToBeSignedData ::= SEQUENCE { - payload SignedDataPayload, - headerInfo HeaderInfo -} - -HashedData::= CHOICE { - sha256HashedData OCTET STRING (SIZE(32)), - ... -} - -HeaderInfo ::= SEQUENCE { - psid Psid, - generationTime Time64 OPTIONAL, - expiryTime Time64 OPTIONAL, - generationLocation ThreeDLocation OPTIONAL, - p2pcdLearningRequest HashedId3 OPTIONAL, - missingCrlIdentifier MissingCrlIdentifier OPTIONAL, - encryptionKey EncryptionKey OPTIONAL, - ..., - inlineP2pcdRequest SequenceOfHashedId3 OPTIONAL, - requestedCertificate Certificate OPTIONAL -} - -MissingCrlIdentifier ::= SEQUENCE { - cracaId HashedId3, - crlSeries CrlSeries, - ... -} - -Countersignature ::= Ieee1609Dot2Data (WITH COMPONENTS {..., - content (WITH COMPONENTS {..., - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS {..., - payload (WITH COMPONENTS {..., - data ABSENT, - extDataHash PRESENT - }), - headerInfo(WITH COMPONENTS {..., - generationTime PRESENT, - expiryTime ABSENT, - generationLocation ABSENT, - p2pcdLearningRequest ABSENT, - missingCrlIdentifier ABSENT, - encryptionKey ABSENT - }) - }) - }) - }) -}) - ---********************************************************************** --- --- Structures for describing encrypted data --- ---********************************************************************** - - -EncryptedData ::= SEQUENCE { - recipients SequenceOfRecipientInfo, - ciphertext SymmetricCiphertext -} -RecipientInfo ::= CHOICE { - pskRecipInfo PreSharedKeyRecipientInfo, - symmRecipInfo SymmRecipientInfo, - certRecipInfo PKRecipientInfo, - signedDataRecipInfo PKRecipientInfo, - rekRecipInfo PKRecipientInfo -} - -SequenceOfRecipientInfo ::= SEQUENCE OF RecipientInfo - -PreSharedKeyRecipientInfo ::= HashedId8 -SymmRecipientInfo ::= SEQUENCE { - recipientId HashedId8, - encKey SymmetricCiphertext -} - -PKRecipientInfo ::= SEQUENCE { - recipientId HashedId8, - encKey EncryptedDataEncryptionKey -} - -EncryptedDataEncryptionKey ::= CHOICE { - eciesNistP256 EciesP256EncryptedKey, - eciesBrainpoolP256r1 EciesP256EncryptedKey, - ... -} - -SymmetricCiphertext ::= CHOICE { - aes128ccm AesCcmCiphertext, - ... -} - -AesCcmCiphertext ::= SEQUENCE { - nonce OCTET STRING (SIZE (12)), - ccmCiphertext Opaque -- 16 bytes longer than plaintext -} - - ---********************************************************************** --- --- Certificates and other security management data structures --- ---********************************************************************** - --- Certificates are implicit (type = implicit, toBeSigned includes --- reconstruction value, signature absent) or explicit (type = explicit, --- toBeSigned includes verification key, signature present). - -Certificate ::= CertificateBase (ImplicitCertificate | ExplicitCertificate) - -SequenceOfCertificate ::= SEQUENCE OF Certificate - -CertificateBase ::= SEQUENCE { - version Uint8(3), - type CertificateType, - issuer IssuerIdentifier, - toBeSigned ToBeSignedCertificate, - signature Signature OPTIONAL -} - -CertificateType ::= ENUMERATED { - explicit, - implicit, - ... -} - -ImplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., - type(implicit), - toBeSigned(WITH COMPONENTS {..., - verifyKeyIndicator(WITH COMPONENTS {reconstructionValue}) - }), - signature ABSENT - }) - -ExplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., - type(explicit), - toBeSigned(WITH COMPONENTS {..., - verifyKeyIndicator(WITH COMPONENTS {verificationKey}) - }), - signature PRESENT - }) - -IssuerIdentifier ::= CHOICE { - sha256AndDigest HashedId8, - self HashAlgorithm, - ..., - sha384AndDigest HashedId8 -} - -ToBeSignedCertificate ::= SEQUENCE { - id CertificateId, - cracaId HashedId3, - crlSeries CrlSeries, - validityPeriod ValidityPeriod, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - certRequestPermissions SequenceOfPsidGroupPermissions OPTIONAL, - canRequestRollover NULL OPTIONAL, - encryptionKey PublicEncryptionKey OPTIONAL, - verifyKeyIndicator VerificationKeyIndicator, - ... -} -(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT} | - WITH COMPONENTS { ..., certRequestPermissions PRESENT}) - -CertificateId ::= CHOICE { - linkageData LinkageData, - name Hostname, - binaryId OCTET STRING(SIZE(1..64)), - none NULL, - ... -} - -LinkageData ::= SEQUENCE { - iCert IValue, - linkage-value LinkageValue, - group-linkage-value GroupLinkageValue OPTIONAL -} - -EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) - -PsidGroupPermissions ::= SEQUENCE { - subjectPermissions SubjectPermissions, - minChainLength INTEGER DEFAULT 1, - chainLengthRange INTEGER DEFAULT 0, - eeType EndEntityType DEFAULT {app} -} - -SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions - -SubjectPermissions ::= CHOICE { - explicit SequenceOfPsidSspRange, - all NULL, - ... -} - -VerificationKeyIndicator ::= CHOICE { - verificationKey PublicVerificationKey, - reconstructionValue EccP256CurvePoint, - ... -} - -END - diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn deleted file mode 100644 index 59ed4217..00000000 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ /dev/null @@ -1,334 +0,0 @@ -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - --- Minor version: 1 --- ---******************************************************************** --- IEEE P1609.2 Base Data Types --- ---******************************************************************** - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -EXPORTS ALL; - - --- ------------------------------------------------------------------ --- --- Integers --- --- ------------------------------------------------------------------ - - -Uint3 ::= INTEGER (0..7) -- (hex) 07 -Uint8 ::= INTEGER (0..255) -- (hex) ff -Uint16 ::= INTEGER (0..65535) -- (hex) ff ff -Uint32 ::= INTEGER (0..4294967295)---- -- (hex) ff ff ff ff -Uint64 ::= INTEGER (0..18446744073709551615) -- (hex) ff ff ff ff ff ff ff ff - -SequenceOfUint8 ::= SEQUENCE OF Uint8 -SequenceOfUint16 ::= SEQUENCE OF Uint16 - --- ------------------------------------------------------------------ --- --- OCTET STRING types --- --- ------------------------------------------------------------------ - - -Opaque ::= OCTET STRING - - -HashedId10 ::= OCTET STRING (SIZE(10)) -HashedId8 ::= OCTET STRING (SIZE(8)) -HashedId3 ::= OCTET STRING (SIZE(3)) -SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 - - --- ------------------------------------------------------------------ --- --- Time --- --- ------------------------------------------------------------------ - -Time32 ::= Uint32 -Time64 ::= Uint64 - -ValidityPeriod ::= SEQUENCE { - start Time32, - duration Duration -} - -Duration ::= CHOICE { - microseconds Uint16, - milliseconds Uint16, - seconds Uint16, - minutes Uint16, - hours Uint16, - sixtyHours Uint16, - years Uint16 -} - --- ------------------------------------------------------------------ --- --- Location --- --- ------------------------------------------------------------------ - - -GeographicRegion ::= CHOICE { - circularRegion CircularRegion, - rectangularRegion SequenceOfRectangularRegion, - polygonalRegion PolygonalRegion, - identifiedRegion SequenceOfIdentifiedRegion, - ... -} - -CircularRegion ::= SEQUENCE { - center TwoDLocation, - radius Uint16 -} - -RectangularRegion ::= SEQUENCE { - northWest TwoDLocation, - southEast TwoDLocation -} - -SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion - -PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation - -TwoDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude -} - -IdentifiedRegion ::= CHOICE { - countryOnly CountryOnly, - countryAndRegions CountryAndRegions, - countryAndSubregions CountryAndSubregions, - ... -} - -SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion - -CountryOnly ::= Uint16 - -CountryAndRegions ::= SEQUENCE { - countryOnly CountryOnly, - regions SequenceOfUint8 -} - -CountryAndSubregions ::= SEQUENCE { - country CountryOnly, - regionAndSubregions SequenceOfRegionAndSubregions -} - -RegionAndSubregions ::= SEQUENCE { - region Uint8, - subregions SequenceOfUint16 -} - -SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions - -ThreeDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude, - elevation SecElevation -} - -SecLatitude ::= NinetyDegreeInt -SecLongitude ::= OneEightyDegreeInt -SecElevation ::= ElevInt - -NinetyDegreeInt ::= INTEGER { - min (-900000000), - max (900000000), - unknown (900000001) -} (-900000000..900000001) - -KnownLatitude ::= NinetyDegreeInt (min..max) -- Minus 90deg to +90deg in microdegree intervals -UnknownLatitude ::= NinetyDegreeInt (unknown) - -OneEightyDegreeInt ::= INTEGER { - min (-1799999999), - max (1800000000), - unknown (1800000001) -} (-1799999999..1800000001) - -KnownLongitude ::= OneEightyDegreeInt (min..max) -UnknownLongitude ::= OneEightyDegreeInt (unknown) - -ElevInt ::= Uint16 -- Range is from -4096 to 61439 in units of one-tenth of a meter - --- ------------------------------------------------------------------ --- --- Crypto --- --- ------------------------------------------------------------------ - -Signature ::= CHOICE { - ecdsaNistP256Signature EcdsaP256Signature, - ecdsaBrainpoolP256r1Signature EcdsaP256Signature, - ..., - ecdsaBrainpoolP384r1Signature EcdsaP384Signature -} - -EcdsaP256Signature ::= SEQUENCE { - rSig EccP256CurvePoint, - sSig OCTET STRING (SIZE (32)) -} - -EcdsaP384Signature ::= SEQUENCE { - rSig EccP384CurvePoint, - sSig OCTET STRING (SIZE (48)) -} - -EccP256CurvePoint ::= CHOICE { - x-only OCTET STRING (SIZE (32)), - fill NULL, -- consistency with 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (32)), - compressed-y-1 OCTET STRING (SIZE (32)), - uncompressedP256 SEQUENCE { - x OCTET STRING (SIZE (32)), - y OCTET STRING (SIZE (32)) - } -} - -EccP384CurvePoint::= CHOICE { - x-only OCTET STRING (SIZE (48)), - fill NULL, -- consistency w 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (48)), - compressed-y-1 OCTET STRING (SIZE (48)), - uncompressedP384 SEQUENCE { - x OCTET STRING (SIZE (48)), - y OCTET STRING (SIZE (48)) - } -} - - -SymmAlgorithm ::= ENUMERATED { - aes128Ccm, - ... -} - -HashAlgorithm ::= ENUMERATED { - sha256, - ..., - sha384 -} - -EciesP256EncryptedKey ::= SEQUENCE { - v EccP256CurvePoint, - c OCTET STRING (SIZE (16)), - t OCTET STRING (SIZE (16)) -} - -EncryptionKey ::= CHOICE { - public PublicEncryptionKey, - symmetric SymmetricEncryptionKey -} - -PublicEncryptionKey ::= SEQUENCE { - supportedSymmAlg SymmAlgorithm, - publicKey BasePublicEncryptionKey -} - -BasePublicEncryptionKey ::= CHOICE { - eciesNistP256 EccP256CurvePoint, - eciesBrainpoolP256r1 EccP256CurvePoint, - ... -} - -PublicVerificationKey ::= CHOICE { - ecdsaNistP256 EccP256CurvePoint, - ecdsaBrainpoolP256r1 EccP256CurvePoint, - ..., - ecdsaBrainpoolP384r1 EccP384CurvePoint -} - -SymmetricEncryptionKey ::= CHOICE { - aes128Ccm OCTET STRING(SIZE(16)), - ... -} - --- ------------------------------------------------------------------ --- --- PSID / ITS-AID --- --- ------------------------------------------------------------------ - - -PsidSsp ::= SEQUENCE { - psid Psid, - ssp ServiceSpecificPermissions OPTIONAL -} - -SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp - -Psid ::= INTEGER (0..MAX) - -SequenceOfPsid ::= SEQUENCE OF Psid - -ServiceSpecificPermissions ::= CHOICE { - opaque OCTET STRING (SIZE(0..MAX)), - ..., - bitmapSsp BitmapSsp -} - -BitmapSsp ::= OCTET STRING (SIZE(0..31)) - -PsidSspRange ::= SEQUENCE { - psid Psid, - sspRange SspRange OPTIONAL -} - -SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange - -SspRange ::= CHOICE { - opaque SequenceOfOctetString, - all NULL, - ... , - bitmapSspRange BitmapSspRange -} - -BitmapSspRange ::= SEQUENCE { - sspValue OCTET STRING (SIZE(1..32)), - sspBitmask OCTET STRING (SIZE(1..32)) -} - -SequenceOfOctetString ::= SEQUENCE (SIZE (0..MAX)) OF - OCTET STRING (SIZE(0..MAX)) - - --- ------------------------------------------------------------------ --- --- Goes in certs --- --- ------------------------------------------------------------------ - -SubjectAssurance ::= OCTET STRING (SIZE(1)) - -CrlSeries ::= Uint16 - - --- ------------------------------------------------------------------ --- --- Pseudonym Linkage --- --- ------------------------------------------------------------------ - -IValue ::= Uint16 -Hostname ::= UTF8String (SIZE(0..255)) -LinkageValue ::= OCTET STRING (SIZE(9)) -GroupLinkageValue ::= SEQUENCE { - jValue OCTET STRING (SIZE(4)), - value OCTET STRING (SIZE(9)) -} - -LaId ::= OCTET STRING (SIZE(2)) -LinkageSeed ::= OCTET STRING (SIZE(16)) - -END - diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn deleted file mode 100644 index 7b000601..00000000 --- a/asn1/Security/EtsiTs103097Module.asn +++ /dev/null @@ -1,103 +0,0 @@ -EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) v1(0) } - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -IMPORTS - -Ieee1609Dot2Data, ExplicitCertificate - -FROM - -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)}; - -EtsiTs103097Certificate::= ExplicitCertificate (WITH COMPONENTS{..., - toBeSigned (WITH COMPONENTS{..., - id (WITH COMPONENTS{..., - linkageData ABSENT, - binaryId ABSENT - }), - certRequestPermissions ABSENT, - canRequestRollover ABSENT - }) - }) - -SingleEtsiTs103097Certificate ::= SEQUENCE { - only EtsiTs103097Certificate -} - - -EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., - content (WITH COMPONENTS {..., - signedData (WITH COMPONENTS {..., -- constraints on signed data headers - tbsData (WITH COMPONENTS { - headerInfo (WITH COMPONENTS {..., - generationTime PRESENT, - p2pcdLearningRequest ABSENT, - missingCrlIdentifier ABSENT - }) - }), - signer (WITH COMPONENTS {..., --constraints on the certificate - certificate --(WITH COMPONENT (SingleEtsiTs103097Certificate)) - }) - }), - encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers - recipients (WITH COMPONENT ( - (WITH COMPONENTS {..., - symmRecipInfo ABSENT, - rekRecipInfo ABSENT - }) - )) - }), - signedCertificateRequest ABSENT - }) -}) - -EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - unsecuredData (CONTAINING ToBeSignedDataContent) - }) - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - extDataHash (WITH COMPONENTS { - sha256HashedData PRESENT - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - ciphertext (WITH COMPONENTS {..., - aes128ccm (WITH COMPONENTS {..., - ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) - }) - }) - }) - }) -}) - - -EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} - -END diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn deleted file mode 100644 index 20eacfa8..00000000 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ /dev/null @@ -1,77 +0,0 @@ -EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS -HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature -FROM -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - - CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, - ValidityPeriod, GeographicRegion -FROM -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (1) schema (1) major-version-2(2)} - - EtsiTs103097Data, EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, -EtsiTs103097Data-SignedExternalPayload -FROM - EtsiTs103097Module { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} -; - -CertificateFormat::= INTEGER { - ts103097v131 (1) - }(1..255) - -CertificateSubjectAttributes ::= SEQUENCE { - id CertificateId OPTIONAL, - validityPeriod ValidityPeriod OPTIONAL, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - ... - }(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT}) - -EcSignature::= CHOICE { - encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, - ecSignature EtsiTs103097Data-SignedExternalPayload - } - -PublicKeys ::= SEQUENCE { - verificationKey PublicVerificationKey, - encryptionKey PublicEncryptionKey OPTIONAL - } - -Version ::= INTEGER {v1(1)} - -EtsiTs103097Data-Unsecured {ToBeSentDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - unsecuredData (CONTAINING ToBeSentDataContent) - }) -}) - -EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted { EtsiTs103097Data-Unsecured{ToBeEncryptedDataContent}} -(WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - recipients (SIZE(1)) - }) - }) -}) - -EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} -(WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - recipients (SIZE(1)) - }) - }) -}) - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn deleted file mode 100644 index 6c4df67b..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941Messages module containing all possible PKI messages. - It should be used when all PKI messages needs to be implemented (for example, for CA development) -**************************************************************************************/ -EtsiTs102941MessagesCa - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed, ---EtsiTs103097Data-Encrypted, -EtsiTs103097Data-SignedExternalPayload ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -Version, -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -AuthorizationValidationRequest, AuthorizationValidationResponse -FROM EtsiTs102941TypesAuthorizationValidation -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2) } - -CaCertificateRequest -FROM EtsiTs102941TypesCaManagement -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2) } - -; - -/************ --- Messages -************/ -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} -AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} -AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} -CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} -CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), --(1..255) Required for TITAN - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - authorizationValidationRequest AuthorizationValidationRequest, - authorizationValidationResponse AuthorizationValidationResponse, - caCertificateRequest CaCertificateRequest, - ... - } - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn deleted file mode 100644 index cffcef73..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the - same subset of messages as the EtsiTs102941MessagesItss module. - It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss - - This module allows the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss-OptionalPrivacy - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), --(1..255) Required for TITAN - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn deleted file mode 100644 index 1ff502bb..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset - of messages defined in the module EtsiTs102941MessagesCA - It should never be imported together with the module EtsiTs102941MessagesCA. - Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. - - This module blocks the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version, - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } (WITH COMPONENTS{..., - authorizationRequest (WITH COMPONENTS{..., - ecSignature (WITH COMPONENTS{..., - encryptedEcSignature PRESENT - }) - }) - }) - -END diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn deleted file mode 100644 index 1f7469dd..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ /dev/null @@ -1,142 +0,0 @@ -EtsiTs102941TrustLists - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -HashedId8, Time32, Version --, CertificateAuthorityConstraints -FROM EtsiTs102941BaseTypes -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} - -; - -/************ --- CRL -************/ -ToBeSignedCrl ::= SEQUENCE { - version Version, - thisUpdate Time32, - nextUpdate Time32, - entries SEQUENCE OF CrlEntry, - ... -} - -CrlEntry ::= HashedId8 - -/************ --- TLM CTL -************/ - -ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - ea ABSENT, - aa ABSENT - }) - }) - )) -}) - -/************ --- RCA CTL -************/ - -ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - rca ABSENT, - tlm ABSENT - }) - }) - )) -}) - -/************ --- CTL -************/ - -FullCtl::= CtlFormat ( WITH COMPONENTS {..., - isFullCtl ( TRUE ), - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - delete ABSENT - }) - )) -}) - -DeltaCtl::= CtlFormat (WITH COMPONENTS {..., - isFullCtl(FALSE) -}) - - -CtlFormat ::= SEQUENCE { - version Version, - nextUpdate Time32, - isFullCtl BOOLEAN, - ctlSequence INTEGER (0..255), - ctlCommands SEQUENCE OF CtlCommand, - ... -} - -CtlCommand ::= CHOICE { - add CtlEntry, - delete CtlDelete, - ... -} - -CtlEntry ::= CHOICE { - rca RootCaEntry, - ea EaEntry, - aa AaEntry, - dc DcEntry, - tlm TlmEntry, - ... -} - -CtlDelete ::= CHOICE { - cert HashedId8, - dc DcDelete, - ... -} - -TlmEntry::= SEQUENCE { - selfSignedTLMCertificate EtsiTs103097Certificate, - linkTLMCertificate EtsiTs103097Certificate OPTIONAL, - accessPoint Url -} - -RootCaEntry ::= SEQUENCE { - selfsignedRootCa EtsiTs103097Certificate, - linkRootCaCertificate EtsiTs103097Certificate OPTIONAL -} - -EaEntry ::= SEQUENCE { - eaCertificate EtsiTs103097Certificate, - aaAccessPoint Url, - itsAccessPoint Url OPTIONAL -} - -AaEntry ::= SEQUENCE { - aaCertificate EtsiTs103097Certificate, - accessPoint Url -} - -DcEntry ::= SEQUENCE { - url Url, - cert SEQUENCE OF HashedId8 -} - -DcDelete ::= Url - -Url::= IA5String - -END diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn deleted file mode 100644 index 3ea56ef7..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn +++ /dev/null @@ -1,91 +0,0 @@ -EtsiTs102941TypesAuthorization - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -; - -/************ --- AuthorizationRequest/Response -************/ - -AuthorizationResponseCode ::= ENUMERATED { - ok(0), - -- ITS->AA - its-aa-cantparse, -- valid for any structure - its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - its-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - its-aa-keysdontmatch, -- HMAC keyTag verification fails - its-aa-incompleterequest, -- some elements are missing - its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad - its-aa-outofsyncrequest, -- signingTime is outside acceptable limits - its-aa-unknownea, -- the EA identified by eaId is unknown to me - its-aa-invalidea, -- the EA certificate is revoked - its-aa-deniedpermissions, -- I, the AA, deny the requested permissions - -- AA->EA - aa-ea-cantreachea, -- the EA is unreachable (network error?) - -- EA->AA - ea-aa-cantparse, -- valid for any structure - ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - ea-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - -- TODO: to be continued... - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can't validate the request signature - wrongea, -- the encrypted signature doesn't designate me as the EA - unknownits, -- can't retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the key is bad - deniedpermissions, -- permissions not granted - deniedtoomanycerts, -- parallel limit - ... } - - -InnerAtRequest ::= SEQUENCE { - publicKeys PublicKeys, - hmacKey OCTET STRING (SIZE(32)), - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -SharedAtRequest ::= SEQUENCE { - eaId HashedId8, - keyTag OCTET STRING (SIZE(16)), - certificateFormat CertificateFormat, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{...,certIssuePermissions ABSENT}), - ... - } - -InnerAtResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn deleted file mode 100644 index e73dcdca..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn +++ /dev/null @@ -1,67 +0,0 @@ -EtsiTs102941TypesAuthorizationValidation - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -SharedAtRequest -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} - -; - -/************ --- AuthorizationValidationRequest/Response -************/ - -AuthorizationValidationResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest - imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can't validate the request signature - wrongea, -- the encrypted signature doesn't designate me as the EA - unknownits, -- can't retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - deniedpermissions, -- requested permissions not granted - deniedtoomanycerts, -- parallel limit - deniedrequest, -- any other reason? - ... } - -AuthorizationValidationRequest ::= SEQUENCE { - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -AuthorizationValidationResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationValidationResponseCode, - confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}) OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), confirmedSubjectAttributes PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), confirmedSubjectAttributes ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn deleted file mode 100644 index 135f99be..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn +++ /dev/null @@ -1,31 +0,0 @@ -EtsiTs102941TypesCaManagement - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -PublicKeys, CertificateSubjectAttributes -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} - -; - -/************ --- CA certificate request -************/ - -CaCertificateRequest ::= SEQUENCE { - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes, - ... -} - -END - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn deleted file mode 100644 index a538bcdb..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn +++ /dev/null @@ -1,67 +0,0 @@ -EtsiTs102941TypesEnrolment - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -; - -/************ --- EnrolmentRequest/Response -************/ - -EnrolmentResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not enrolmentrequest - imnottherecipient, -- the "recipients" doesn't include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - unknownits, -- can't retrieve the ITS from the itsId - invalidsignature, -- signature verification of the request fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - baditsstatus, -- revoked, not yet active - incompleterequest, -- some elements are missing - deniedpermissions, -- requested permissions are not granted - invalidkeys, -- either the verification_key of the encryption_key is bad - deniedrequest, -- any other reason? - ... } - -InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} - -InnerEcRequest ::= SEQUENCE { - itsId OCTET STRING, - certificateFormat CertificateFormat, - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}), - ... - } - -InnerEcResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode EnrolmentResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/module.mk b/asn1/Security/module.mk deleted file mode 100644 index d3f7b469..00000000 --- a/asn1/Security/module.mk +++ /dev/null @@ -1,12 +0,0 @@ -sources := \ - ./1609Dot2/IEEE1609dot2.asn \ - ./1609Dot2/IEEE1609dot2BaseTypes.asn \ - ./EtsiTs103097Module.asn \ - ./TS102921/EtsiTs102941BaseTypes.asn \ - ./TS102921/EtsiTs102941MessagesCa.asn \ - ./TS102921/EtsiTs102941TrustLists.asn \ - ./TS102921/EtsiTs102941TypesAuthorization.asn \ - ./TS102921/EtsiTs102941TypesAuthorizationValidation.asn \ - ./TS102921/EtsiTs102941TypesCaManagement.asn \ - ./TS102921/EtsiTs102941TypesEnrolment.asn \ - diff --git a/asn1/TransportAddressMib/TransportAddressMib.asn b/asn1/TransportAddressMib/TransportAddressMib.asn deleted file mode 100644 index 82740380..00000000 --- a/asn1/TransportAddressMib/TransportAddressMib.asn +++ /dev/null @@ -1,12 +0,0 @@ -TRANSPORT-ADDRESS-MIB - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - --- this is only a dummy module to resolve the two elements in IMPORT statements of other modules - -TransportAddressType ::= OCTET STRING (SIZE(6)) - -TransportAddress ::= OCTET STRING (SIZE(6)) - -END - diff --git a/asn1/cdd b/asn1/cdd deleted file mode 160000 index cabf82ff..00000000 --- a/asn1/cdd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cabf82ff5275e77dd427f5de86316bc3c198a32c diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn deleted file mode 100644 index e4f6332e..00000000 --- a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn +++ /dev/null @@ -1,30 +0,0 @@ -module LibItsBtp_EncdecDeclarations { - - // LibItsBtp - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_TestSystem all; - - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) - external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer - with {extension "prototype(sliding) decode(LibItsBtp)"} - */ - - external function fx_enc_BtpReq (BtpReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_enc_BtpInd (BtpInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpInd (inout bitstring b, out BtpInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_BtpReq (inout bitstring b, out BtpReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_BtpPacket (BtpPacket p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpPacket (inout bitstring b, out BtpPacket p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - -} // End of module LibItsBtp_EncdecDeclarations diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn deleted file mode 100644 index fab68591..00000000 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Functions.ttcn $ - * $Id: LibItsBtp_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing functions for basic Transport Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ - - module LibItsBtp_Functions { - - // LibCommon - import from LibCommon_Sync all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - // LibItsBtp - import from LibItsBtp_TestSystem all; - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_Templates all; - import from LibItsBtp_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtBtpInitialize p_init) runs on ItsBtp { - - //deactivate btpPort default alts - vc_btpDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtBtpResults: { utBtpInitializeResult := true}) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate btpPort default alts - vc_btpDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtBtpTrigger p_event) runs on ItsBtp { - - //deactivate btpPort default alts - vc_btpDefaultActive := false; - - utPort.send(p_event); - alt { - [] utPort.receive(UtBtpResults: { utBtpTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive { - tc_wait.stop; - } - [] tc_wait.timeout { - } - } - - //activate btpPort default alts - vc_btpDefaultActive := true; - - } - - } // End of group utFunctions - - group configurationFunctions { - - /** - * @desc Setups default configuration - */ - function f_cfUp() runs on ItsBtp system ItsBtpSystem { - - map(self:utPort, system:utPort); - map(self:btpPort, system:btpPort); - f_connect4SelfOrClientSync(); - - } // end f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsBtp system ItsBtpSystem { - - unmap(self:utPort, system:utPort); - unmap(self:btpPort, system:btpPort); - f_disconnect4SelfOrClientSync(); - - } // end f_cfDown - - } // end configurationFunctions - - group btpAltsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsBtp { - - [vc_btpDefaultActive] btpPort.receive { - log("*** a_default: ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** a_default: INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_default: INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsBtp { - var UtBtpEventInd v_ind; - [vc_utDefaultActive] utPort.receive(UtBtpEventInd:?) -> value v_ind { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_ind; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } //end btpAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsBtp { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - */ - function f_prInitialState() runs on ItsBtp { - - f_utInitializeIut(m_btpInitialize); - f_prDefault(); - - } - - } // end of group preambles - - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsBtp { - //empty - } - - } // end postambles - - group getFunctions { - - /** - * @desc Gets the BTP source port of the IUT. - * @return BTP source port ID - */ - function f_getBtpSrcPort() return BtpPortId { - return PX_SOURCE_PORT; - } - - /** - * @desc Gets the BTP destination port of the IUT. - * @return BTP destination port ID - */ - function f_getBtpDstPort() return BtpPortId { - return PX_DESTINATION_PORT; - } - - /** - * @desc Gets a unknown BTP destination port of the IUT. - * @return Unknown BTP destination port ID - */ - function f_getBtpUnknownDstPort() return BtpPortId { - return PX_UNKNOWN_DESTINATION_PORT; - } - - /** - * @desc Gets the BTP destination port info of the IUT. - * @return BTP destination port info - */ - function f_getBtpDstPortInfo() return BtpPortId { - return PX_DESTINATION_PORT_INFO; - } - - /** - * @desc Gets the BTP payload to use. - * @return BTP payload - */ - function f_getBtpPayload() return BtpRawPayload { - return PX_PAYLOAD; - } - - } // end getFunctions -} // end LibItsBtp_Functions diff --git a/ttcn/BTP/LibItsBtp_Pixits.ttcn b/ttcn/BTP/LibItsBtp_Pixits.ttcn deleted file mode 100644 index cd8dfc1c..00000000 --- a/ttcn/BTP/LibItsBtp_Pixits.ttcn +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Pixits.ttcn $ - * $Id: LibItsBtp_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Basic Transport Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_Pixits { - - // LibIts - import from LibItsBtp_TypesAndValues all; - - - /** - * @desc BTP source port of the IUT - * - */ - modulepar BtpPortId PX_SOURCE_PORT := 0; - - /** - * @desc BTP Destination port of the IUT - * - */ - modulepar BtpPortId PX_DESTINATION_PORT := 0; - - /** - * @desc BTP Unknown Destination port of the IUT - * - */ - modulepar BtpPortId PX_UNKNOWN_DESTINATION_PORT := 0; - - /** - * @desc BTP Destination port Info of the IUT - * - */ - modulepar BtpPortId PX_DESTINATION_PORT_INFO := 0; - - /** - * @desc Payload to be sent to the IUT for testing matter - * - */ - modulepar BtpRawPayload PX_PAYLOAD := '0102030405'O ; - - -} // end LibItsBtp_Pixits \ No newline at end of file diff --git a/ttcn/BTP/LibItsBtp_Templates.ttcn b/ttcn/BTP/LibItsBtp_Templates.ttcn deleted file mode 100644 index fe930380..00000000 --- a/ttcn/BTP/LibItsBtp_Templates.ttcn +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Templates.ttcn $ - * $Id: LibItsBtp_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Basic Transport Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_Templates { - - // LibIts - import from LibItsBtp_TestSystem all; - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_Pixits all; - import from LibItsCommon_TypesAndValues all; - - group btpPrimitivesTemplates { - - /** - * @desc Send template for BTP packet (BtpPort Primitive) - * @param p_btpPkt BTP Packet to be sent - */ - template (value) BtpReq m_btpReq( - template (value) BtpPacket p_btpPkt - ) := { - msgOut := p_btpPkt - } - - /** - * @desc Receive template for BTP packet (BtpPort Primitive) - * @param p_btpPkt BTP Packet to be received - */ - template BtpInd mw_btpInd( - template (present) BtpPacket p_btpPkt - ) := { - msgIn := p_btpPkt - } - - group utPrimitives { - - /** - * @desc Initializes the BTP IUT. - */ - template (value) UtBtpInitialize m_btpInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Generate a BTP A packet - * @param p_destPort The destination port - * @param p_srcPort The source port - */ - template (value) UtBtpTrigger m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { - btpA := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - } - } - - /** - * @desc Generate a BTP B packet - * @param p_destPort The destination port - * @param p_destPortInfo The destination port information - */ - template (value) UtBtpTrigger m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { - btpB := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - } - } - - } // end utPrimitives - - } // btpPrimitivesTemplates - - group btpPduTemplates { - - /** - * @desc Send template for BTP-A packet - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template (value) BtpPacket m_btpA ( - template (value) BtpRawPayload p_payload - ):= { - header := { - btpAHeader := { - destinationPort := PX_DESTINATION_PORT, - sourcePort := PX_SOURCE_PORT - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-B packet - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template( value) BtpPacket m_btpB ( - template (value) BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := PX_DESTINATION_PORT, - destinationPortInfo := 0 - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-A packet with port parameters - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template (value) BtpPacket m_btpAWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortId p_srcPort, - template (value) BtpRawPayload p_payload - ):= { - header := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-B packet with port parameters - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template( value) BtpPacket m_btpBWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortInfo p_destPortInfo, - template (value) BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - }, - payload := p_payload - } - - /** - * @desc Receive template for BTP-A packet - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template BtpPacket mw_btpA ( - template (present) BtpPortId p_destPort, - template (present) BtpPortId p_srcPort, - template BtpRawPayload p_payload - ) := { - header := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - }, - payload := p_payload - } - - /** - * @desc Receive template for BTP-B packet - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template BtpPacket mw_btpB ( - template (present) BtpPortId p_destPort, - template (present) BtpPortInfo p_destPortInfo, - template BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - }, - payload := p_payload - } - - } // end btpPduTemplates - - -} // end LibItsBtp_Templates diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn deleted file mode 100644 index 39a3ca05..00000000 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TestSystem.ttcn $ - * $Id: LibItsBtp_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS BTP - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_TestSystem { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - - // LibIts - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsBtp_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtBtpInitialize, UtBtpTrigger; - in - UtBtpResults, UtBtpEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt1Ports { - - /** - * @desc NT1 BTP Port (BTP/GeoNet/G5) - */ - type port BtpPort message { - in BtpInd; - out BtpReq; - } // end BtpPort - - } // End of group nt1Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsBtpSystem { - - port UpperTesterPort utPort; - - // NT1 ports - port BtpPort btpPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsBtp extends ItsBaseComponent { - - port UpperTesterPort utPort; - - // NT1 ports - port BtpPort btpPort; - - // timers - - var UtBtpEventIndList vc_utEvents := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_btpDefaultActive := true; - - } // End of component ItsBtp - - group networkAndTransportPrimitives { - - group nt1Primitives { - - /** - * @desc NT1 BTP Indication Primitive - */ - type record BtpInd { - BtpPacket msgIn - } - - /** - * @desc NT1 BTP Request Primitive - */ - type record BtpReq { - BtpPacket msgOut - } - - } // end nt1Primitives - - } // End of group networkAndTransportPrimitives - with { - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsBtp_TestSystem diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn deleted file mode 100644 index 7be36267..00000000 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn $ - * $Id: LibItsBtp_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for Basic Transport Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - type octetstring BtpRawPayload; - - group btpPdus { - - /** - * @desc BTP Packet - * @see ETSI TS 102 636-5-1 chapter 6 - * @member header - * @member payload - */ - type record BtpPacket { - BtpHeader header, - BtpRawPayload payload optional - } - with { - encode "LibIts_Interface" - variant "FIELDORDER(msb)" - } - - } // end btpPdus - - group btpHeaders { - - /** - * @desc BTP Header - * @see ETSI TS 102 636-5-1 chapter 7.1 - * @member btpAHeader - * @member btpBHeader - */ - type union BtpHeader { - BtpAHeader btpAHeader, - BtpBHeader btpBHeader - } with { - variant "FIELDORDER(msb)" - } - - - /** - * @desc BTP-A Header - * @see ETSI TS 102 636-5-1 chapter 7.2 - * @member destinationPort - * @member sourcePort - */ - type record BtpAHeader { - BtpPortId destinationPort, - BtpPortId sourcePort - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc BTP-B Header - * @see ETSI TS 102 636-5-1 chapter 7.3 - * @member destinationPort - * @member destinationPortInfo - */ - type record BtpBHeader { - BtpPortId destinationPort, - BtpPortInfo destinationPortInfo - } with { - variant "FIELDORDER(msb)" - } - - - /** - * @desc BTP Port ID - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortId; - - /** - * @desc BTP-B Port info - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortInfo; - - } // end btpHeaders - - group utPrimitives { - - group utCommonPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtBtpInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Btp IUT - * @member utBtpInitialize - - * @member utBtpTriggerResult - - */ - type union UtBtpResults { - boolean utBtpInitializeResult, - boolean utBtpTriggerResult - } with { - variant "" - } - - /** - * @desc UT primitives for BTP - * @member btpA - - * @member btpB - - */ - type union UtBtpTrigger { - GenerateBtpA btpA, - GenerateBtpB btpB - } with { - variant "" - } - - /** - * @desc Upper Tester message to request triggering of an BTPA message at IUT - */ - type record GenerateBtpA { - BtpAHeader btpAHeader - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request triggering of an BTPB message at IUT - */ - type record GenerateBtpB { - BtpBHeader btpBHeader - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on BTP IUT - */ - type record UtBtpEventInd { - BtpRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtBtpEventInd UtBtpEventIndList; - - } - - } // end utPrimitives - with { - variant "" - encode "UpperTester" - } - -} with { - variant "" - encode "LibItsBtp" -} - diff --git a/ttcn/BTP/module.mk b/ttcn/BTP/module.mk deleted file mode 100644 index f1c9679f..00000000 --- a/ttcn/BTP/module.mk +++ /dev/null @@ -1,6 +0,0 @@ -sources := LibItsBtp_EncdecDeclarations.ttcn \ - LibItsBtp_Functions.ttcn \ - LibItsBtp_Pixits.ttcn \ - LibItsBtp_Templates.ttcn \ - LibItsBtp_TestSystem.ttcn \ - LibItsBtp_TypesAndValues.ttcn diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn deleted file mode 100644 index 9d37043d..00000000 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ /dev/null @@ -1,40 +0,0 @@ -module LibItsCam_EncdecDeclarations { - - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCam - import from LibItsCam_TypesAndValues all; - import from LibItsCam_TestSystem all; - - external function fx_enc_CamReq (CamReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_CamInd (inout bitstring b, out CamInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_CAM (CAM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CAM (inout bitstring b, out CAM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamChangePosition (UtCamChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamTrigger (UtCamTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtCamResults (inout bitstring b, out UtCamResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtCamEventInd (inout bitstring b, out UtCamEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn deleted file mode 100644 index 204b0356..00000000 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ /dev/null @@ -1,614 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Functions.ttcn $ - * $Id: LibItsCam_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing common functions for ITS CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Functions { - - // LibCommon - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Pixits all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - - // LibItsCam - import from LibItsCam_TestSystem all; - import from LibItsCam_Templates all; - import from LibItsCam_TypesAndValues all; - import from LibItsCam_Pics all; - import from LibItsCam_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtCamInitialize p_init) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtCamResults: { utCamInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtCamTrigger p_event) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtCamResults: { utCamTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive { - tc_wait.stop; - } - [] tc_wait.timeout { - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - /** - * @desc Changes the position of the IUT - * @param p_position - */ - function f_utChangePosition(template (value) UtCamChangePosition p_position) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_position); - alt { - [] utPort.receive(UtCamResults: { utCamChangePositionResult := true}) { - tc_wait.stop; - } - [] utPort.receive(UtCamResults: { utCamChangePositionResult := ? }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsCam { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsCam { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssResponseError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(in Scenario p_scenario) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitDistanceCovered(float p_distanceToCover) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - - tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); - alt { - [] acPort.receive(m_acGnssDistanceCoveredSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssDistanceCoveredError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitDistanceCovered - - function f_acAwaitSpeed( - float p_speed, - SpeedTrend p_speedTrend := e_accelerate, - boolean p_stopCamPort := true, - boolean p_deactivateCamDefault := false - ) runs on ItsCam system ItsCamSystem return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - - if (p_stopCamPort) { - unmap(self:camPort, system:camPort); - } - - if (p_deactivateCamDefault) { - vc_camDefaultActive := false; - } - - f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); - - tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); - alt { - [] acPort.receive(m_acGnssSpeedReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssSpeedReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - if (p_stopCamPort) { - map(self:camPort, system:camPort); - } - - if (p_deactivateCamDefault) { - vc_camDefaultActive := true; - } - } - return v_ret; - } // End of function f_acAwaitSpeed - - function f_acChangeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { -// f_acTriggerGnssEvent(m_changeScenarioSpeed(p_deltaSpeedValue)); - } - } // End of function f_acChangeSpeed - - function f_acChangeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_changeScenarioHeading(p_deltaHeadingValue)); - } - } // End of function f_acChangeHeading - - function f_acAwaitTimeInRunningScenario( - integer p_time, - boolean p_stopOnCamMessage := true - ) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [p_stopOnCamMessage] camPort.check(receive(mw_camInd ( mw_camMsg_any ))) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // end f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group camConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsCam system ItsCamSystem { - - map(self:utPort, system:utPort); - map(self:acPort, system:acPort); - map(self:camPort, system:camPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsCam system ItsCamSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:camPort, system:camPort); - - f_acStopScenario(); - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } // End of camConfigurationFunctions - - group defaults { - - /** - * @desc basic default behaviour handling - */ - altstep a_default() runs on ItsCam { - - [vc_camDefaultActive] camPort.receive(mw_camInd ( mw_camMsg_any )){ - log("*** a_default: INFO: CAM message received in default ***"); - vc_camReceived := true; - repeat; - } - [vc_camDefaultActive] camPort.receive { - log("*** a_default: ERROR: event received on CAM port in default ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) { - log("*** a_default: INFO: TimeReached event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ? }) { - log("*** a_default: INFO: SpeedReached event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ? }) { - log("*** a_default: INFO: DistanceCovered event received on AC port in default ***"); - repeat; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** a_default: INCONC: a timer expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - }//end altstep a_basicDefault - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsCam { - var UtCamEventInd v_event; - [] utPort.receive(UtCamEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of defaults - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsCam { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Initialize the IUT - * @remark No specific actions specified in the base standard - */ - function f_prInitialState( - in Scenario p_scenario := e_staticPosition, - in boolean p_awaitInitialCAM := true, - in template (value) UtCamInitialize p_camInitialize := m_camInitialize, - in boolean p_awaitTimeInRunningScenario := true - ) runs on ItsCam { - - f_utInitializeIut(p_camInitialize); - - f_prDefault(); - - f_acLoadScenario(p_scenario); - - //Allow burst mode at the beginning - f_sleep(1.0); - - camPort.clear; - - f_acStartScenario(); - if (p_awaitTimeInRunningScenario) { - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - if (p_awaitInitialCAM) { - tc_ac.start; - alt { - [] camPort.receive(mw_camInd ( mw_camMsg_any )){ - tc_ac.stop; - log("*** " & testcasename() & ": INFO: Received initial CAM ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Initial CAM not received ***"); - f_selfOrClientSyncAndVerdictPreamble("error", e_timeout); - } - } // End of 'alt' statement - } - - } // End of function f_prInitialState - - } // End of preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCam { - } - - } // End of group postambles - - group camPositionFunctions { - - /** - * @desc Compute a position using a reference position, a distance - * and an orientation - * - * @param p_referencePosition The base reference position. - * @param p_offSet Distance to the reference position (in meter). - * - * @return The new reference position. - */ - function f_computePositionUsingDistance(in ReferencePosition p_referencePosition, in float p_offSet) return ReferencePosition { - var ReferencePosition v_referencePosition := p_referencePosition; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance( - p_referencePosition.latitude, - p_referencePosition.longitude, - p_offSet, - p_referencePosition.positionConfidenceEllipse.semiMajorOrientation, - v_referencePosition.latitude, - v_referencePosition.longitude - ); - return v_referencePosition; - } - - /** - * @desc Compute distance between two points - * @param p_pointA First point - * @param p_pointB Second point - * @return Computed distance in meters - * @see fx_computeDistance - */ - function f_distance( - in ReferencePosition p_pointA, - in ReferencePosition p_pointB - ) return float { - return fx_computeDistance(p_pointA.latitude, p_pointA.longitude, p_pointB.latitude, p_pointB.longitude); - } - - } // end group camPositionFunctions - - group camAuxilaryFunctions { - - function f_changeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam { - if (PX_GNSS_SCENARIO_SUPPORT == false) { - f_utTriggerEvent(m_changeSpeed(p_deltaSpeedValue)); - } - else { - f_acChangeSpeed(p_deltaSpeedValue); - } - } - - function f_changeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam { - if (PX_GNSS_SCENARIO_SUPPORT == false) { - f_utTriggerEvent(m_changeHeading(p_deltaHeadingValue)); - } - else { - f_acChangeHeading(p_deltaHeadingValue); - } - } - - } // End group camAuxilaryFunctions - - group camGenerators { - function f_generateDefaultCam() - return octetstring { - return bit2oct( - encvalue( - m_camReq( - m_camMsg_vehicle( - f_getTsStationId(), - f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime - m_tsPosition - ) - ) - ) - ); - } - } // End of group camGenerators - -} // End of LibItsCam_Functions diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn deleted file mode 100644 index 95028e84..00000000 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pics.ttcn $ - * $Id: LibItsCam_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc CAM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - group camPics { - - /** - * @desc Is the IUT RSU? - * @see ETSI TS 102 868-1 Table A.1 - */ - modulepar boolean PICS_RSU := false; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 102 868-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Is IUT a public transport vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_PUBLICTRANS := false; - - /** - * @desc Is IUT a special transport vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SPECIALTRANS := false; - - /** - * @desc Is IUT a dangerous goods vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_DANGEROUSGOODS := false; - - /** - * @desc Is IUT a road works vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_ROADWORKS := false; - - /** - * @desc Is IUT a rescue vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_RESCUE := false; - - /** - * @desc Is IUT an emergency vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_EMERGENCY := false; - - /** - * @desc Is IUT a safety car vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SAFETY_CAR := false; - - /** - * @desc Does IUT support 'specialVehicleContainer' in CamParameters? - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SPECIALVEHICLECONTAINER := true; - - /** - * @desc Maximum time interval between CAM generations (in seconds). - * Default value, as per base standard: 1.0s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMMAX := 1.000; - - /** - * @desc Minimum time interval between CAM generations (in seconds). - * Default value, as per base standard: 0.1s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMMIN := 0.100; - - /** - * @desc Minimum time interval between CAM generations (in seconds) - * according to the requirements of the - * Decentralized Congestion Control(DCC). - * Default value, as per base standard: 0.1s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMDCC := 0.100; - - /** - * @desc Support for CAM generation - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar boolean PICS_CAM_GENERATION := true; - - /** - * @desc Support for CAM reception - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar boolean PICS_CAM_RECEPTION := true; - - } // end camPics - - group radioComm { - - type enumerated RadioAccess { - e_its_g5, - e_lte_cv2x - } - - /** - * @desc Does radio communication use ITS-G5 or LTE-V2X? - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar RadioAccess PICS_RADIO_COMM := e_its_g5; - - } // End of group radioComm -} // end LibItsCam_Pics diff --git a/ttcn/CAM/LibItsCam_Pixits.ttcn b/ttcn/CAM/LibItsCam_Pixits.ttcn deleted file mode 100644 index 59ccb581..00000000 --- a/ttcn/CAM/LibItsCam_Pixits.ttcn +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pixits.ttcn $ - * $Id: LibItsCam_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - -} // End of module LibItsSecurity_Pixits \ No newline at end of file diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn deleted file mode 100644 index f1dbab60..00000000 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ /dev/null @@ -1,879 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Templates.ttcn $ - * $Id: LibItsCam_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing base template definitions for CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from CAM_PDU_Descriptions language "ASN.1:1997" all; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsCam - import from LibItsCam_TestSystem all; - import from LibItsCam_TypesAndValues all; - - group camPrimitives { - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - */ - template CamInd mw_camInd ( - in template (present) CAM p_camMsg - ) := { - msgIn := p_camMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - }; - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template CamInd mw_camIndWithGnParameters ( - in template (present) CAM p_camMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_camInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - }; - - /** - * @desc Receive template for CA Message (DenmPort Primitive) - * @param p_caMsg The expected CA Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template CamInd mw_camIndWithSecurityParameters( - template (present) CAM p_camMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := c_its_aid_CAM - ) modifies mw_camInd := { - ssp := p_ssp, - its_aid := p_its_aid - }; - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template CamInd mw_camIndWithBtpParameters ( - in template (present) CAM p_camMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * - ) modifies mw_camInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Send template for CAM Message (CamPort Primitive) - * @param p_camMsg CAM Message to be received - */ - template (value) CamReq m_camReq ( - in template (value) CAM p_camMsg - ) := { - msgOut := p_camMsg - }; - - group camUtPrimitives { - - /** - * @desc Initializes the CAM IUT. - */ - template (value) UtCamInitialize m_camInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Change the curvature - * @param p_offset The curvature value offset - */ - template (value) UtCamTrigger m_changeCurvature(CurvatureValue p_changeCurvature) := { - changeCurvature := p_changeCurvature - } - - /** - * @desc Change the speed - * @param p_offset The speed value offset - */ - template (value) UtCamTrigger m_changeSpeed(Int16 p_changeSpeed) := { - changeSpeed := p_changeSpeed - } - - /** - * @desc Set the acceleration control status - * @param p_status The status to set - */ - template (value) UtCamTrigger m_setAccelerationControlStatus(AccelerationControl p_status) := { - setAccelerationControlStatus := p_status - } - - /** - * @desc Set the exterior lights status - * @param p_status The status to set - */ - template (value) UtCamTrigger m_setExteriorLightsStatus(ExteriorLights p_status) := { - setExteriorLightsStatus := p_status - } - - /** - * @desc Change the heading - * @param p_offset The heading value offset - */ - template (value) UtCamTrigger m_changeHeading(HeadingValue p_changeHeading) := { - changeHeading := p_changeHeading - } - - /** - * @desc Set the drive direction - * @param p_driveDirection The drive direction - */ - template (value) UtCamTrigger m_setDriveDirection(DriveDirection p_driveDirection) := { - setDriveDirection := p_driveDirection - } - - /** - * @desc Change the yaw rate - * @param p_offset The yaw rate value offset - */ - template (value) UtCamTrigger m_changeYawRate(YawRateValue p_changeYawRate) := { - changeYawRate := p_changeYawRate - } - - /** - * @desc Set the vehicle role - * @param p_vehicleRole The vehicle role - */ - template (value) UtCamTrigger m_setVehicleRole(VehicleRole p_vehicleRole) := { - setVehicleRole := p_vehicleRole - } - - /** - * @desc Set the dangerous good description - * @param p_dangerousGoods The dangerous good description - */ - template (value) UtCamTrigger m_setDangerousGoods(DangerousGoodsBasic p_dangerousGoods) := { - setDangerousGoods := p_dangerousGoods - } - - } // end utPrimitives - - } // end group Primitives - - group positionTemplates { - - /** - * @desc The test system reference position. - */ - template (value) ReferencePosition m_tsPosition := { - latitude := f_integer2Latitude(f_getTsLatitude()), - longitude := f_integer2Longitude(f_getTsLongitude()), - positionConfidenceEllipse := { - semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ - }, - altitude := { - altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, - altitudeConfidence := unavailable - } - } - - /** - * @desc Reference position for given latitude and longitude. - */ - template (present) ReferencePosition mw_refPositionWithDelta( - in ReferencePosition p_origRefPos, - in integer p_jitter := 100 - ) := { - latitude := (p_origRefPos.latitude - p_jitter..p_origRefPos.latitude + p_jitter), - longitude := (p_origRefPos.longitude - p_jitter..p_origRefPos.longitude + p_jitter), - positionConfidenceEllipse := p_origRefPos.positionConfidenceEllipse, - altitude := p_origRefPos.altitude - } - - } // end positionTemplates - - /** - * @desc Default Receive template for CAM PDU - */ - template (present) CAM mw_camMsg_any := { - header := { - protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, - stationID := ? - }, - cam := { - generationDeltaTime := ?, - camParameters := ? - } - } - - group camBasicContainer { - - /** - * @desc - * Receive template for CAM PDU including basic container with - * given reference position - * @param p_referencePosition The reference position - */ - template (present) CAM mw_camMsg_BC_refPos( - in template(present) ReferencePosition p_referencePosition - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := { - stationType := ?, - referencePosition := p_referencePosition - }, - highFrequencyContainer := ?, - lowFrequencyContainer := *, - specialVehicleContainer := * - } - } - } - - } // end group camBasicContainer - - group camHighFrequencyContainer { - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_basicVehicleContainer The including basic vehicle container - */ - template (present) CAM mw_camMsg_HF_BV( - in template(present) BasicVehicleContainerHighFrequency p_basicVehicleContainer - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := { - basicVehicleContainerHighFrequency := p_basicVehicleContainer - }, - lowFrequencyContainer := *, - specialVehicleContainer := * - } - } - } - - /** - * @desc Default Receive template for basic vehicle container in - * the high frequency container - */ - template (present) BasicVehicleContainerHighFrequency mw_HF_BV_any := { - heading := ?, - speed := ?, - driveDirection := ?, - vehicleLength := ?, - vehicleWidth := ?, - longitudinalAcceleration := ?, - curvature := ?, - curvatureCalculationMode := ?, - yawRate := ?, - accelerationControl := *, - lanePosition := *, - steeringWheelAngle := *, - lateralAcceleration := *, - verticalAcceleration := *, - performanceClass := *, - cenDsrcTollingZone := * - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_curvatureValue The curvature - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_curvature( - in template(present) CurvatureValue p_curvatureValue - ) modifies mw_HF_BV_any := - { - curvature := { - curvatureValue := p_curvatureValue, - curvatureConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_accCtrl The acceleration control - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_accCtrl( - in template AccelerationControl p_accCtrl - ) modifies mw_HF_BV_any := - { - accelerationControl := p_accCtrl - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_headingValue The heading - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_heading( - in template(present) HeadingValue p_headingValue - ) modifies mw_HF_BV_any := - { - heading := { - headingValue := p_headingValue, - headingConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_speedValue The speed - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_speed( - in template(present) SpeedValue p_speedValue - ) modifies mw_HF_BV_any := - { - speed := { - speedValue := p_speedValue, - speedConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_driveDirection The drive direction - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_driveDirection( - in template(present) DriveDirection p_driveDirection - ) modifies mw_HF_BV_any := - { - driveDirection := p_driveDirection - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_yawRateValue The yaw rate - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_yawRate( - in template(present) YawRateValue p_yawRateValue - ) modifies mw_HF_BV_any := - { - yawRate := { - yawRateValue := p_yawRateValue, - yawRateConfidence := ? - } - } - - } // end group camHighFrequencyContainer - - group camLowFrequencyContainer { - - /** - * @desc Default Receive template for CAM PDU including - * optional lowFrequencyContainer - */ - template (present) CAM mw_camMsg_LF_any modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := ?, - specialVehicleContainer := * - } - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_basicVehicleContainer The including basic vehicle container - */ - template (present) CAM mw_camMsg_LF_BV( - in template(present) BasicVehicleContainerLowFrequency p_basicVehicleContainer := ? - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := p_basicVehicleContainer - }, - specialVehicleContainer := * - } - } - } - - /** - * @desc Default Receive template for basic vehicle container in - * the low frequency container - */ - template (present) BasicVehicleContainerLowFrequency mw_LF_BV_any := { - vehicleRole := ?, - exteriorLights := ?, - pathHistory := ? - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_extLights The exterior lights - */ - template(present) BasicVehicleContainerLowFrequency mw_LF_BV_extLights( - in template (present) ExteriorLights p_extLights - ) modifies mw_LF_BV_any := - { - exteriorLights := p_extLights - } - - } // end group camLowFrequencyContainer - - group camSpecialVehicleContainer { - - /** - * @desc Default Receive template for CAM PDU including - * optional specialVehicleContainer - */ - template (present) CAM mw_camMsg_SVC_any modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := *, - specialVehicleContainer := ? - } - } - } - - /** - * @desc Receive template for CAM PDU including optional specialVehicleContainer - * @param p_specialVehicleContainer The expected specialVehicleContainer - */ - template (present) CAM mw_camMsg_SVC( - in template (present) SpecialVehicleContainer p_specialVehicleContainer - ) modifies mw_camMsg_SVC_any := { - cam := { - camParameters := { - specialVehicleContainer := p_specialVehicleContainer - } - } - } - - /** - * @desc Receive template for specialVehicleContainer public transport - */ - template (present) SpecialVehicleContainer mw_publicTransport_any := { - publicTransportContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer special transport - */ - template (present) SpecialVehicleContainer mw_specialTransport_any := { - specialTransportContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer dangerous goods - */ - template (present) SpecialVehicleContainer mw_dangerousGoods_any := { - dangerousGoodsContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer road works - */ - template (present) SpecialVehicleContainer mw_roadWorks_any := { - roadWorksContainerBasic := ? - } - - /** - * @desc Receive template for specialVehicleContainer rescue - */ - template (present) SpecialVehicleContainer mw_rescue_any := { - rescueContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer emergency - */ - template (present) SpecialVehicleContainer mw_emergency_any := { - emergencyContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer safety car - */ - template (present) SpecialVehicleContainer mw_safetyCar_any := { - safetyCarContainer := ? - } - - } //end group camSpecialVehicleContainer - - group camAnyVehicle { - - /** - * @desc Send template for Vehicle CAM PDU - * @param p_stationId Station ID of the source - * @param p_generationTime Timestamp of the generated message - * @param p_referencePosition Position of the sending station - */ - template (value) CAM m_camMsg_vehicle_HF_BV( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) := { - header := { - protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, - stationID := p_stationId - }, - cam := { - generationDeltaTime := p_generationTime, - camParameters := { - basicContainer := { - stationType := LibItsCommon_ASN1_NamedNumbers.StationType_passengerCar_, - referencePosition := p_referencePosition - }, - highFrequencyContainer := { - basicVehicleContainerHighFrequency := { - heading := { - headingValue := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_, //0 - headingConfidence := 10 - }, - speed := { - speedValue := 45, - speedConfidence := 5 - }, - driveDirection := forward, - vehicleLength := { - vehicleLengthValue := 50, - vehicleLengthConfidenceIndication := noTrailerPresent - }, - vehicleWidth := 21, - longitudinalAcceleration := { - longitudinalAccelerationValue := LibItsCommon_ASN1_NamedNumbers.LongitudinalAccelerationValue_unavailable_, - longitudinalAccelerationConfidence := LibItsCommon_ASN1_NamedNumbers.AccelerationConfidence_unavailable_ - }, - curvature := { - curvatureValue := LibItsCommon_ASN1_NamedNumbers.CurvatureValue_straight_, - curvatureConfidence := unavailable - }, - curvatureCalculationMode := yawRateUsed, - yawRate := { - yawRateValue := LibItsCommon_ASN1_NamedNumbers.YawRateValue_straight_, - yawRateConfidence := unavailable - }, - accelerationControl := omit, - lanePosition := omit, - steeringWheelAngle := omit, - lateralAcceleration := omit, - verticalAcceleration := omit, - performanceClass := omit, - cenDsrcTollingZone := omit - } - }, - lowFrequencyContainer := omit, - specialVehicleContainer := omit - } - } - }; // End of template m_camMsg_vehicle_HF_BV - - /** - * @desc Send template for Vehicle CAM PDU - * @param p_stationId Station ID of the source - * @param p_generationTime Timestamp of the generated message - * @param p_referencePosition Position of the sending station - */ - template (value) CAM m_camMsg_vehicle( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle_HF_BV := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := default_, - exteriorLights := LibItsCommon_ASN1_NamedNumbers.ExteriorLights_daytimeRunningLightsOn_, - pathHistory := {} - } - } - } - } - }; - - template (value) CAM m_camMsg_publicTransport( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := publicTransport - } - }, - specialVehicleContainer := { - publicTransportContainer := { - embarkationStatus := true, - ptActivation := omit - } - } - } - } - }; - - template (value) CAM m_camMsg_specialTransport( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := specialTransport - } - }, - specialVehicleContainer := { - specialTransportContainer := { - specialTransportType := '1000'B/* length(4)*/, // heavyLoad - lightBarSirenInUse := '11'B/* length(2)*/ // siren and lightBar - } - } - } - } - }; - } // end camAnyVehicle - - group camAccelerationControlTemplates { - - /** - * @desc Receive template for acceleration control with brake padel active on - */ - template AccelerationControl mw_brakePedalActive_On := '1*'B length(7); - - /** - * @desc Receive template for acceleration control with brake padel active off - */ - template AccelerationControl mw_brakePedalActive_Off := '0*'B length(7); - - /** - * @desc Receive template for acceleration control with gas padel active on - */ - template AccelerationControl mw_gasPedalActive_On := '?1*'B length(7); - - /** - * @desc Receive template for acceleration control with gas padel active off - */ - template AccelerationControl mw_gasPedalActive_Off := '?0*'B length(7); - - /** - * @desc Receive template for acceleration control with emergency brake active on - */ - template AccelerationControl mw_emergencyBrakeActive_On := '??1*'B length(7); - - /** - * @desc Receive template for acceleration control with emergency brake active off - */ - template AccelerationControl mw_emergencyBrakeActive_Off := '??0*'B length(7); - - /** - * @desc Receive template for acceleration control with collision warning active on - */ - template AccelerationControl mw_collisionWarningActive_On := '???1*'B length(7); - - /** - * @desc Receive template for acceleration control with collision warning active off - */ - template AccelerationControl mw_collisionWarningActive_Off := '???0*'B length(7); - - /** - * @desc Receive template for acceleration control with adaptive cruise control active on - */ - template AccelerationControl mw_accActive_On := '????1*'B length(7); - - /** - * @desc Receive template for acceleration control with adaptive cruise control active off - */ - template AccelerationControl mw_accActive_Off := '????0*'B length(7); - - /** - * @desc Receive template for acceleration control with cruise control active on - */ - template AccelerationControl mw_cruiseControl_On := '?????1*'B length(7); - - /** - * @desc Receive template for acceleration control with cruise control active off - */ - template AccelerationControl mw_cruiseControl_Off := '?????0*'B length(7); - - /** - * @desc Receive template for acceleration control with speed limiter active on - */ - template AccelerationControl mw_speedLimiterActive_On := '*1'B length(7); - - /** - * @desc Receive template for acceleration control with speed limiter active off - */ - template AccelerationControl mw_speedLimiterActive_Off := '*0'B length(7); - - } // end group camAccelerationControlTemplates - - group camExteriorLightsTemplates { - - /** - * @desc Receive template for exterior lights with low beam lights off - */ - template ExteriorLights mw_lowBeamLightsOff := '0*'B length (8); - - /** - * @desc Receive template for exterior lights with low beam lights on - */ - template ExteriorLights mw_lowBeamLightsOn := '1*'B length(8); - - /** - * @desc Receive template for exterior lights with high beam lights off - */ - template ExteriorLights mw_highBeamLightsOff := '?0*'B length(8); - - /** - * @desc Receive template for exterior lights with high beam lights on - */ - template ExteriorLights mw_highBeamLightsOn := '?1*'B length(8); - - /** - * @desc Receive template for exterior lights with left turn signal off - */ - template ExteriorLights mw_leftTurnSignalOff := '??0*'B length(8); - - /** - * @desc Receive template for exterior lights with left turn signal on - */ - template ExteriorLights mw_leftTurnSignalOn := '??1*'B length(8); - - /** - * @desc Receive template for exterior lights with right turn signal off - */ - template ExteriorLights mw_rightTurnSignalOff := '???0*'B length(8); - /** - * @desc Receive template for exterior lights with right turn signal on - */ - template ExteriorLights mw_rightTurnSignalOn := '???1*'B length(8); - - /** - * @desc Receive template for exterior lights with day time running lights off - */ - template ExteriorLights mw_daytimeRunningLightsOff := '????0*'B length(8); - /** - * @desc Receive template for exterior lights with day time running lights on - */ - template ExteriorLights mw_daytimeRunningLightsOn := '????1*'B length(8); - - /** - * @desc Receive template for exterior lights with reverse light off - */ - template ExteriorLights mw_reverseLightOff := '?????0*'B length(8); - - /** - * @desc Receive template for exterior lights with reverse light on - */ - template ExteriorLights mw_reverseLightOn := '?????1*'B length(8); - - /** - * @desc Receive template for exterior lights with fog light off - */ - template ExteriorLights mw_fogLightOff := '??????0*'B length(8); - - /** - * @desc Receive template for exterior lights with fog light on - */ - template ExteriorLights mw_fogLightOn := '??????1*'B length(8); - - /** - * @desc Receive template for exterior lights with parking lights off - */ - template ExteriorLights mw_parkingLightsOff := '*0'B length(8); - - /** - * @desc Receive template for exterior lights with parking lights on - */ - template ExteriorLights mw_parkingLightsOn := '*1'B length(8); - - /** - * @desc Receive template for exterior lights with hazard lights on - */ - template ExteriorLights mw_hazardConditionOn := '??11*'B length(8); - - } // end group exteriorLights - - group camTemplateFunctions { - - /** - * @desc Converts an integer to Longitude - * @param p_longitude The integer value - * @return The longitude value - */ - function f_integer2Longitude(in integer p_longitude) return Longitude { - - var Longitude v_longitude := f_abs(p_longitude); - - return v_longitude; - } - - /** - * @desc Converts an integer to Latitude - * @param p_latitude The integer value - * @return The latitude value - */ - function f_integer2Latitude(in integer p_latitude) return Latitude { - - var Latitude v_latitude := f_abs(p_latitude); - - return v_latitude; - } - - } // end camTemplateFunctions - -} // end LibItsCam_Templates diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn deleted file mode 100644 index fd3727e8..00000000 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TestSystem.ttcn $ - * $Id: LibItsCam_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Testing" { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsCam - import from LibItsCam_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtCamInitialize, UtCamTrigger, UtCamChangePosition, UtActivatePositionTime, UtDeactivatePositionTime; - in - UtCamResults, UtCamEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 CAM Port (CAM/BTP/GeoNet/G5) - */ - type port CamPort message { - in CamInd; - out CamReq; - } // End of port CamPort - - } // end fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsCamSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port CamPort camPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsCam extends ItsBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port CamPort camPort; - //timers - - //component variables - var CamInd vc_camMsg; - - //default - var default vc_default := null; - - //global variables - var boolean vc_camReceived := false; - - var UtCamEventIndList vc_utEvents := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_camDefaultActive := true; - - } // End of component ItsCam - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 CAM Indication Primitive - */ - type record CamInd { - CAM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 CAM Request Primitive - */ - type record CamReq { - CAM msgOut - } - with { - encode (msgOut) "PER" - } - - } // end fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsCam_TestSystem diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn deleted file mode 100644 index d78ddde8..00000000 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TypesAndValues.ttcn $ - * $Id: LibItsCam_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for CAM Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - // import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - group camValues { - - const float c_lowFrequencyGenerationTime := 0.5; //500 ms - const float c_specialVehicleGenerationTime := 0.5; //500 ms - - const AccelerationControl c_accCtrlIdle := '0000000'B; - - const ExteriorLights c_elAllLightsOff := '00000000'B; - - const VehicleRole c_vehicleRole_publicTransport := publicTransport; - const VehicleRole c_vehicleRole_specialTransport := specialTransport; - const VehicleRole c_vehicleRole_dangerousGoods := dangerousGoods; - const VehicleRole c_vehicleRole_roadWork := roadWork; - const VehicleRole c_vehicleRole_rescue := rescue; - const VehicleRole c_vehicleRole_emergency := emergency; - const VehicleRole c_vehicleRole_safetyCar := safetyCar; - - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives1 := explosives1; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives2 := explosives2; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives3 := explosives3; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives4 := explosives4; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives5 := explosives5; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives6 := explosives6; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableGases := flammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_nonFlammableGases := nonFlammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicGases := toxicGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableLiquids := flammableLiquids; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableSolids := flammableSolids; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesLiableToSpontaneousCombustion := substancesLiableToSpontaneousCombustion; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesEmittingFlammableGasesUponContactWithWater := substancesEmittingFlammableGasesUponContactWithWater; - const DangerousGoodsBasic c_dangerousGoodsBasic_oxidizingSubstances := oxidizingSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_organicPeroxides := organicPeroxides; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicSubstances := toxicSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_infectiousSubstances := infectiousSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_radioactiveMaterial := radioactiveMaterial; - const DangerousGoodsBasic c_dangerousGoodsBasic_corrosiveSubstances := corrosiveSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_miscellaneousDangerousSubstances := miscellaneousDangerousSubstances; - - } // end group camValues - - group certificates { - - const charstring PX_CERT_IUT_CAM_02 := "CERT_IUT_CAM_BO_02_AT"; - const charstring PX_CERT_IUT_CAM_03 := "CERT_IUT_CAM_BO_03_AT"; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtCamInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the CAM IUT - * @member utCamInitialize - - * @member utCamTriggerResult - - * @member utCamChangePositionResult - - * @member utActivatePositionTimeResult - - * @member utDeactivatePositionTimeResult - - */ - type union UtCamResults { - boolean utCamInitializeResult, - boolean utCamTriggerResult, - boolean utCamChangePositionResult, - boolean utActivatePositionTimeResult, - boolean utDeactivatePositionTimeResult - } with { - variant "" - } // End of type UtCamResults - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtCamChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc - * @member changeCurvature Changes the curvature. - * @member changeSpeed Changes the speed in cm/s. - * @member setAccelerationControlStatus Sets the acceleration control status. - * @member setExteriorLightsStatus Sets the exterior lights status. - * @member changeHeading Changes the heading. - * @member setDriveDirection Sets the drive direction. - * @member setStationType - * @member setVehicleRole - * @member setEmbarkationStatus - * @member setPtActivation - * @member setDangerousGoods - * @member setLightBarSireneStatus - * @member changeYawRate Changes the yaw rate in offsets of 0.01 degrees per second. - */ - type union UtCamTrigger { - CurvatureValue changeCurvature, - Int16 changeSpeed, - AccelerationControl setAccelerationControlStatus, - ExteriorLights setExteriorLightsStatus, - HeadingValue changeHeading, - DriveDirection setDriveDirection, - YawRateValue changeYawRate, - StationType setStationType, - VehicleRole setVehicleRole, - EmbarkationStatus setEmbarkationStatus, - PtActivation setPtActivation, - DangerousGoodsBasic setDangerousGoods, - LightBarSirenInUse setLightBarSirene - } with { - variant "" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtActivatePositionTime { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to deactivate position and/or time - */ - type record UtDeactivatePositionTime { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on CAM IUT - */ - type record UtCamEventInd { - CAM camMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd - } with { - encode (camMsg) "LibItsCam_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtCamEventInd UtCamEventIndList; - - } with { - encode "UpperTester" - variant "" - } // end utPrimitives -} -with { - encode "LibItsCam" - } diff --git a/ttcn/CAM/module.mk b/ttcn/CAM/module.mk deleted file mode 100644 index 52c19ced..00000000 --- a/ttcn/CAM/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsCam_EncdecDeclarations.ttcn \ - LibItsCam_Functions.ttcn \ - LibItsCam_Pics.ttcn \ - LibItsCam_Pixits.ttcn \ - LibItsCam_Templates.ttcn \ - LibItsCam_TestSystem.ttcn \ - LibItsCam_TypesAndValues.ttcn diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn deleted file mode 100644 index 8a4b903e..00000000 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ /dev/null @@ -1,49 +0,0 @@ -module LibItsDenm_EncdecDeclarations { - - // LibIts - import from LibItsDenm_TypesAndValues all; - - // LibItsDenm - import from LibItsDenm_TestSystem all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - external function fx_enc_DenmReq (DenmReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_DENM (DENM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_DENM (inout bitstring b, out DENM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePosition (UtDenmChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTrigger (UtDenmTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmUpdate (UtDenmUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTermination (UtDenmTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtDenmEventInd (inout bitstring b, out UtDenmEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn deleted file mode 100644 index bf04d058..00000000 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ /dev/null @@ -1,669 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Functions.ttcn $ - * $Id: LibItsDenm_Functions.ttcn,v 1.5 2018/05/31 15:57:07 dte Exp $ - * @desc Module containing functions for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_VerdictControl all; - import from LibCommon_Time { modulepar PX_TNOAC ; function f_sleep }; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Templates all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibIts - import from LibItsDenm_TestSystem all; - import from LibItsDenm_TypesAndValues all; - import from LibItsDenm_Templates all; -// import from LibItsDenm_Pixits all; - import from LibItsDenm_Pics all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtDenmInitialize p_init) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Requests to change the IUT with a new pseudonym - * @param p_change The change to trigger. - */ - function f_utChangePseudonym ( template (value) UtDenmChangePseudonym p_change ) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_change); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := true}) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); - } - [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := false}) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT pseudonym unchanged ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(in template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { - var ActionID v_actionId; - var UtDenmResults v_result; - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmTriggerResult := ? }) -> value v_result { - tc_wait.stop; - v_actionId := v_result.utDenmTriggerResult.actionId; - if ( not v_result.utDenmTriggerResult.result ) { - f_selfOrClientSyncAndVerdict("DENM Trigger failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - return v_actionId; - } - - /** - * @desc Updates an event at the application layer - * @param p_event The event to update. - */ - function f_utUpdateEvent(template (value) UtDenmUpdate p_event) runs on ItsDenm return ActionID { - var ActionID v_actionId; - var UtDenmResults v_result; - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmUpdateResult := ? }) -> value v_result { - tc_wait.stop; - v_actionId := v_result.utDenmUpdateResult.actionId; - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - return v_actionId; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtDenmTermination p_event) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmTerminationResult := ?}) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Changes the position of the IUT - * @param p_latitude - * @param p_longitude - * @param p_elevation - */ - function f_utChangePosition(template (value) UtDenmChangePosition p_position) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_position); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmChangePositionResult := ? }) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsDenm { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsDenm { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitDistanceCovered(float p_distanceToCover) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - - tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); - alt { - [] acPort.receive(m_acGnssDistanceCoveredSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssDistanceCoveredError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitDistanceCovered - - function f_acAwaitSpeed(float p_speed, SpeedTrend p_speedTrend := e_accelerate) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); - - tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); - alt { - [] acPort.receive(m_acGnssSpeedReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssSpeedReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitSpeed - - function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // end f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group denmConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsDenm system ItsDenmSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:denmPort, system:denmPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsDenm system ItsDenmSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:denmPort, system:denmPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } //end denmConfigurationFunctions - - group altsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsDenm { - [vc_denmDefaultActive] denmPort.receive(mw_denmInd(mw_denmPdu(mw_anyDenm))) { - log("*** " & testcasename() & ": INFO: DENM message received in default ***"); - vc_denmReceived := true; - repeat; - } - [vc_denmDefaultActive] denmPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsDenm { - var UtDenmEventInd v_event; - [vc_utDefaultActive] utPort.receive(UtDenmEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // end group altsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsDenm { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in Scenario p_scenario := e_staticPosition, - in template (value) UtDenmInitialize p_denmInitialize := m_denmInitialize, - in boolean p_awaitTimeInRunningScenario := true - ) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - f_utInitializeIut(p_denmInitialize); - - f_acLoadScenario(valueof(p_scenario)); - f_acStartScenario(); - if (p_awaitTimeInRunningScenario) { - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - f_prDefault(); - - return v_ret; - } - - } // end group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsDenm { - var FncRetCode v_ret := e_success; - f_acStopScenario(); - } - - /** - * @desc Postamble including cancellation of an event. - * @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets) - * or at the application layer of the IUT(e_iut). - * @param p_actionId The action ID of the event to be cancelled - */ - function f_poCancelEvent(template (value) Trigger p_trigger, template (value) ActionID p_actionId) - runs on ItsDenm { - var FncRetCode v_ret := e_success; - - if (valueof(p_trigger) == e_ets) { - f_sendDenMessage( m_denmCancellation ( p_actionId , f_getTsStationType( ) ) ); - f_sleep(PX_TNOAC); - } - else { - f_utTerminateEvent(m_utEventCancellation(p_actionId)); - } - - f_poDefault(); - } - - } // end group postambles - - group sendFunctions { - - /** - * @desc Sends a DEN message - * @param p_sendMsg The DEN message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendDenMessage(template (value) DecentralizedEnvironmentalNotificationMessage p_denm, boolean p_overrideSeqNo := true) runs on ItsDenm return ActionID { - - if (p_overrideSeqNo) { - p_denm.management.actionID.sequenceNumber := vc_sequenceNo; - } - - denmPort.send( - m_denmReq( - m_denmPdu( - p_denm - ) - ) - ); - - return valueof(p_denm.management.actionID); - } - - } // end sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a DEN message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitDenMessage(in template (present) DenmInd p_rcvMsg, out DenmInd p_rcvdMsg) runs on ItsDenm { - - tc_ac.start; - alt { - [] denmPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // end receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the sequence number and handles the special case where the - * sequence number reaches the limit of 65535 and will be reset to 0. - * @param p_sequenceNumber The sequence number to increase. - * @return The increased sequence number. - */ - function f_increaseSequenceNumber(in SequenceNumber p_sequenceNumber) return SequenceNumber { - // if maximum number of 65535 reached, reset it to 0 - return ((p_sequenceNumber + 1) mod 65536); - } - - } // end group miscellaneousFunctions - -} // end LibItsDenm_Functions diff --git a/ttcn/DENM/LibItsDenm_Pics.ttcn b/ttcn/DENM/LibItsDenm_Pics.ttcn deleted file mode 100644 index 42ec0240..00000000 --- a/ttcn/DENM/LibItsDenm_Pics.ttcn +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pics.ttcn $ - * $Id: LibItsDenm_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc DENM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Pics { - - group denmPics { - - /** - * @desc Support for DENM generation - * @see ETSI TS 102 869-1 Table A.1 - */ - modulepar boolean PICS_DENM_GENERATION := true; - - /** - * @desc Support for DENM RECEPTION - * @see ETSI TS 102 869-1 Table A.1 - */ - modulepar boolean PICS_DENM_RECEPTION := true; - - /** - * @desc Support for DENM update - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_UPDATE := true; - - /** - * @desc Support for DENM repetition - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_REPETITION := true; - - /** - * @desc Support for DENM cancellation - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_CANCELLATION := true; - - /** - * @desc Support for DENM NEGATION - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_NEGATION := false; - - /** - * @desc Support for Keep-Alive Forwarding - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_KAF := false; - - /** - * @desc Support for impact recuction - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_IMPACT_REDUCTION := true; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 102 869-1 Table A.3 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - } // end denmPics - -} \ No newline at end of file diff --git a/ttcn/DENM/LibItsDenm_Pixits.ttcn b/ttcn/DENM/LibItsDenm_Pixits.ttcn deleted file mode 100644 index d9585adc..00000000 --- a/ttcn/DENM/LibItsDenm_Pixits.ttcn +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pixits.ttcn $ - * $Id: LibItsDenm_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - -} // End of module LibItsDenm_Pixits \ No newline at end of file diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn deleted file mode 100644 index e20714b3..00000000 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ /dev/null @@ -1,824 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Templates.ttcn $ - * $Id: LibItsDenm_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing base template definitions for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsDenm - import from LibItsDenm_TestSystem all; - import from LibItsDenm_TypesAndValues all; - - group asn1Constants { - - const integer HeadingValue_wgs84North := 0; - const integer HeadingValue_wgs84East := 900; - const integer HeadingValue_wgs84South := 1800; - const integer HeadingValue_wgs84West := 2700; - const integer HeadingValue_unavailable := 3600; - - const integer HeadingConfidence_withinZeroPointOneDegree := 1; - const integer HeadingConfidence_withinOneDegree := 10; - const integer HeadingConfidence_outOfRange := 126; - const integer HeadingConfidence_unavailable := 127; - - } // End of group asn1Constants - - group primitivesTemplates { - - /** - * @desc Send template for DEN Message (DenmPort Primitive) - * @param p_denMsg The DEN Message to be sent - */ - template (value) DenmReq m_denmReq( - template (value) DENM p_denMsg - ) := { - msgOut := p_denMsg - } - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - */ - template (present) DenmInd mw_denmInd( - template (present) DENM p_denMsg - ) := { - msgIn := p_denMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template(present) DenmInd mw_denmIndWithGnParameters ( - template (present) DENM p_denMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_denmInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - }; - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template (present) DenmInd mw_denmIndWithSecurityParameters( - template (present) DENM p_denMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := c_its_aid_DENM - ) modifies mw_denmInd := { - ssp := p_ssp, - its_aid := p_its_aid - }; - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template(present) DenmInd mw_denmIndWithBtpParameters ( - template (present) DENM p_denMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * - ) modifies mw_denmInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - */ - template (value) UtDenmInitialize m_denmInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Send template for Upper Tester event changePseudonym - */ - template (value) UtDenmChangePseudonym m_utDenmChangePseudonym := { - } - - /** - * @desc Send template for Upper Tester Trigger event - * @param p_situation The Situation Container - * @param p_location The Location Container - * @param p_validityDuration The validity duration (Default: omit) - * @param p_repetitionDuration The repetition duration (Default: omit) - * @param p_repetitionInterval The repetition interval (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_alacarte The Alacarte container (Default: omit) - */ - template (value) UtDenmTrigger m_utTriggerEvent( - template (value) SituationContainer p_situation, - template (omit) ValidityDuration p_validityDuration := c_duration_2sec, - template (omit) ValidityDuration p_repetitionDuration := omit, - template (omit) TransmissionInterval p_repetitionInterval := omit, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - detectionTime := f_getCurrentTime(), - validityDuration := p_validityDuration, - repetitionDuration := p_repetitionDuration, - situation := p_situation, - relevanceDistance := lessThan50m, - relevanceTrafficDirection := allTrafficDirections, - transmissionInterval := p_transmissionInterval, - repetitionInterval := p_repetitionInterval, - alacarte := p_alacarte - } - - /** - * @desc Send template for Upper Tester event update - * @param p_actionId The action id - * @param p_situation The Situation Container (Default: omit) - * @param p_location The Location Container (Default: omit) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_relevanceDistance The relevance distance (Default: omit) - * @param p_relevanceTrafficDirection The relevance traffic direction (Default: omit) - * @param p_trafficClass The traffic class (Default: omit) - * @param p_repetitionInterval The repetition interval (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_alacarte The Alacarte Container (Default: omit) - */ - template (value) UtDenmUpdate m_utUpdateEvent( - template (value) ActionID p_actionId, - template (omit) SituationContainer p_situation := omit, - template (omit) LocationContainer p_location := omit, - template (omit) ValidityDuration p_validityDuration := omit, - template (omit) RelevanceDistance p_relevanceDistance := omit, - template (omit) RelevanceTrafficDirection p_relevanceTrafficDirection := omit, - template (omit) ValidityDuration p_repetitionDuration := omit, - template (omit) TransmissionInterval p_repetitionInterval := omit, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - actionId := p_actionId, - detectionTime := f_getCurrentTime(), - validityDuration := p_validityDuration, - situation := p_situation, - location := p_location, - relevanceDistance := p_relevanceDistance, - relevanceTrafficDirection := p_relevanceTrafficDirection, - transmissionInterval := p_transmissionInterval, - repetitionInterval := p_repetitionInterval, - alacarte := p_alacarte - } - - /** - * @desc Send template for Upper Tester event cancellation - * @param p_actionId The action id - */ - template (value) UtDenmTermination m_utEventCancellation( - template (value) ActionID p_actionId - ) := { - actionId := p_actionId - } - - /** - * @desc Send template for Upper Tester event change position - * @param p_latitude The new latitude - * @param p_longitude The new longitude - * @param p_elevation The new elevation (Default: 0) - */ - template (value) UtDenmChangePosition m_utDenmChangePosition( - template (value) integer p_latitude, - template (value) integer p_longitude, - template (value) integer p_elevation := 0 - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } - - } // end utPrimitives - - } // end primitives - - group denmPduTemplates { - - /** - * @desc Send template for DENM PDU - * @param p_denm The DEN Message - */ - template (value) DENM m_denmPdu( - template (value) DecentralizedEnvironmentalNotificationMessage p_denm - ) := { - header := m_itsPduHeader, - denm := p_denm - } - - /** - * @desc Default receive template for DENM PDU - * @param p_itsPduHeader The expected ITS PDU header (Default: any) - * @param p_denm The expected DEN Message (Default: any) - */ - template DENM mw_anyDenmPdu( - template (present) ItsPduHeader p_itsPduHeader := ?, - template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ? - ) := { - header := p_itsPduHeader, - denm := p_denm - } - - /** - * @desc Receive template for DENM PDU - * @param p_denm The expected DEN Message - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current DEN protocol version) - * @param p_messageID The expected message id (Default: DEN message id) - */ - template (present) DENM mw_denmPdu( - template (present) DecentralizedEnvironmentalNotificationMessage p_denm, - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), - denm := p_denm - } - - } // end denmPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current DEN protocol version) - * @param p_messageID The message Id (Default: DEN message id) - */ - template (value) ItsPduHeader m_itsPduHeader( - template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current DEN protocol version) - * @param p_messageID The expected message id (Default: DEN message id) - */ - template (present) ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // end headerTemplates - - group timeTemplates { - - /** - * @desc Receive template for TimestampIts check with delta - * @param p_time The expected timestamp - */ - template TimestampIts mw_timestampIts_withDelta( - in template (value) TimestampIts p_time - ) := (valueof(p_time)-PX_TIME_DELTA .. valueof(p_time)+PX_TIME_DELTA); - - } // end timeTemplates - - group positionTemplates { - - /** - * @desc Send template for the test system position - * @param p_longitude The longitude (Default: Test system's longitude) - * @param p_latitude The latitude (Default: Test system's latitude) - * @see m_posConfidenceEllipse - * @see m_elevation - */ - template (value) ReferencePosition m_tsPosition( - template (value) Longitude p_longitude := f_getTsLongitude(), - template (value) Latitude p_latitude := f_getTsLatitude() - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := m_posConfidenceEllipse, - altitude := m_altitude - } - - /** - * @desc Send template for the position confidence - * @param p_semiMajorConfidence The major confidence (Default: 1cm) - * @param p_semiMinorConfidence The minor confidence (Default: 1cm) - * @param p_semiMajorOrientation The major orientation (Default: HeadingValue_wgs84North) - */ - template (value) PosConfidenceEllipse m_posConfidenceEllipse( - template (value) SemiAxisLength p_semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - template (value) SemiAxisLength p_semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - template (value) HeadingValue p_semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ - ) := { - semiMajorConfidence := p_semiMajorConfidence, - semiMinorConfidence := p_semiMinorConfidence, - semiMajorOrientation := p_semiMajorOrientation - } - - /** - * @desc Send template for altitude - * @param p_altitudeValue The altitude (Default: Sea level) - * @param p_altitudeConfidence The confidence of the elevation (Default: within one meter) - */ - template (value) Altitude m_altitude( - template (value) AltitudeValue p_altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, - template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01 - ) := { - altitudeValue := p_altitudeValue, - altitudeConfidence := p_altitudeConfidence - } - - } // end positionTemplates - - group decentralizedEnvironmentalNotificationMessageTemplates { - - /** - * @desc Send template for DEN Message - * @param p_management The Management Container - * @param p_situation The Situation Container - * @param p_location The Location Container - * @param p_alacarte The Alacarte Container (Default: omit) - */ - template (value) DecentralizedEnvironmentalNotificationMessage m_denm( - template (value) ManagementContainer p_management, - template (omit) SituationContainer p_situation, - template (omit) LocationContainer p_location, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - management := p_management, - situation := p_situation, - location := p_location, - alacarte := p_alacarte - } - - /** - * @desc Default receive template for DEN Message - */ - template (present) DecentralizedEnvironmentalNotificationMessage mw_anyDenm := { - management := ?, - situation := *, - location := *, - alacarte := * - } - - /** - * @desc Receive template for DEN Message - * @param p_management The expected Management Container (Default: any) - * @param p_situation The expected Situation Container (Default: any or omit) - * @param p_location The expected location Container (Default: any or omit) - * @param p_alacarte The expected Alacarte Container (Default: any or omit) - */ - template DecentralizedEnvironmentalNotificationMessage mw_denm( - template (present) ManagementContainer p_management := ?, - template SituationContainer p_situation := *, - template LocationContainer p_location := *, - template AlacarteContainer p_alacarte := * - ) modifies mw_anyDenm := { - management := p_management, - situation := p_situation, - location := p_location, - alacarte := p_alacarte - } - - /** - * @desc Send template for DEN Message for event termination. - * @param p_actionID The action id - */ - template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation( - template (value) ActionID p_actionID, - template (value) StationType p_stationType - ) := { - management := m_denmMgmtConTermination(p_actionID, p_stationType, 1, -, -, -, isCancellation), - situation := omit, - location := omit, - alacarte := omit - } - - } // end group decentralizedEnvironmentalNotificationMessageTemplates - - group decentralizedManagementTemplates { - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template (value) ManagementContainer m_denmMgmtCon( - template (value) ActionID p_actionID, - template (value) StationType p_stationType := f_getTsStationType(), - template (value) ValidityDuration p_validityDuration := defaultValidity, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (value) TimestampIts p_detectionTime := f_getCurrentTime(), - template (value) TimestampIts p_referenceTime := f_getCurrentTime() - ) := { - actionID := p_actionID, - detectionTime := p_detectionTime, - referenceTime := p_referenceTime, - termination := omit, - eventPosition := m_tsPosition, - relevanceDistance := lessThan50m, - relevanceTrafficDirection := allTrafficDirections, - validityDuration := p_validityDuration, - transmissionInterval := p_transmissionInterval, - stationType := p_stationType - } - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_isCancellation The cancellation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template (omit) ManagementContainer m_denmMgmtConTermination ( - template (value) ActionID p_actionID, - template (value) StationType p_stationType := f_getTsStationType(), - template (value) ValidityDuration p_validityDuration := defaultValidity, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (value) TimestampIts p_detectionTime := f_getCurrentTime(), - template (value) TimestampIts p_referenceTime := f_getCurrentTime(), - template (value) Termination p_termination - ) modifies m_denmMgmtCon := { - termination := p_termination - } - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_isCancellation The cancellation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template ManagementContainer mw_denmMgmtConTermination ( - template (present) ActionID p_actionID, - template (present) StationType p_stationType := f_getIutStationType(), - template (present) TimestampIts p_referenceTime := ?, - template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit - template TransmissionInterval p_transmissionInterval := *, - template Termination p_termination := * - ) modifies mw_denmMgmtCon := { - termination := p_termination - } - - /** - * @desc Receive template for Management Container - * @param p_actionID The expected action id - * @param p_referenceTime The reference time (Default: any) - * @param p_isNegation The expected negation flag (Default: false) - * @param p_validityDuration The expected validity duration (Default: any or omit) - * @param p_transmissionInterval The expected transmission interval (Default: any or omit) - */ - template ManagementContainer mw_denmMgmtCon( - template (present) ActionID p_actionID, - template (present) StationType p_stationType := f_getIutStationType(), - template (present) TimestampIts p_referenceTime := ?, - template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit - template TransmissionInterval p_transmissionInterval := *, - template Termination p_termination := * - ) := { - actionID := p_actionID, - detectionTime := ?, - referenceTime := p_referenceTime, - termination := p_termination, - eventPosition := ?, - relevanceDistance := *,//?, - relevanceTrafficDirection := *,//?, - validityDuration := p_validityDuration, - transmissionInterval := p_transmissionInterval, - stationType := p_stationType - } - - /** - * @desc Send template for Test system ActionID - * @param p_sequenceNumber The sequence number (Default: 0) - */ - template (value) ActionID m_tsActionId( - template (value) SequenceNumber p_sequenceNumber := 0 - ) := { - originatingStationID := f_getTsStationId(), - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Default receive template for Management Container - */ - template (present) ManagementContainer mw_anyDenmMgmtCon := { - actionID := ?, - detectionTime := ?, - referenceTime := ?, - termination := *, - eventPosition := ?, - relevanceDistance := *, - relevanceTrafficDirection := *, - validityDuration := ?, - transmissionInterval := *, - stationType := ? - } - - /** - * @desc Receive template for Management Container with the given action id - * @param p_actionId The expected action id (Default: any) - */ - template (present) ManagementContainer mw_denmMgmtConWithActionID( - template (present) ActionID p_actionId := ? - ) modifies mw_anyDenmMgmtCon := { - actionID := p_actionId - } - - /** - * @desc Receive template for Management Container with the given data version - * @param p_referenceTime The expected reference time (Default: any) - */ - template (present) ManagementContainer mw_denmMgmtConWithReferenceTime( - template (present) TimestampIts p_referenceTime := ? - ) modifies mw_anyDenmMgmtCon := { - referenceTime := p_referenceTime - } - - /** - * @desc Send template for ActionID - * @param p_sequenceNumber The sequence number - * @param p_originatorStationID The originator station id (Default: IUT's station id) - */ - template (value) ActionID m_actionId( - template (value) SequenceNumber p_sequenceNumber, - template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId() - ) := { - originatingStationID := p_originatorStationID, - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Receive template for ActionID - * @param p_originatorStationID The expected originator station id (Default: any) - * @param p_sequenceNumber The expected sequence number (Default: any) - */ - template (present) ActionID mw_actionId( - template (present) ITS_Container.StationID p_originatorStationID := ?, - template (present) SequenceNumber p_sequenceNumber := ? - ) := { - originatingStationID := p_originatorStationID, - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Default receive template for any ActionID - */ - template (present) ActionID mw_anyActionId := ?; - - } // end group decentralizedManagementTemplates - - group decentralizedSituationTemplates { - - group situationTemplates { - - /** - * @desc Send template for Situation Container - * @param p_cause The cause code - * @param p_subCause The sub-cause code - * @param p_informationQuality The information quality (Default: 0) - */ - template (value) SituationContainer m_situation( - template (value) CauseCodeType p_cause, - template (value) SubCauseCodeType p_subCause, - template (value) InformationQuality p_informationQuality := 0 - ) := { - informationQuality := p_informationQuality, - eventType := { - causeCode := p_cause, - subCauseCode := p_subCause - }, - linkedCause := omit, - eventHistory := omit - } - - /** - * @desc Receive template for Situation Container - * @param p_cause The expected cause code - * @param p_subCause The expected sub-cause code - * @param p_informationQuality The expected information quality (Default: any) - */ - template (present) SituationContainer mw_situation( - template (present) CauseCodeType p_cause, - template (present) SubCauseCodeType p_subCause, - template (present) InformationQuality p_informationQuality := ? - ) := { - informationQuality := p_informationQuality, - eventType := { - causeCode := p_cause, - subCauseCode := p_subCause - }, - linkedCause := *, - eventHistory := * - } - - /** - * @desc Default receive template for Situation Container - */ - template (present) SituationContainer mw_anySitutation := ?; - - } // end group situationTemplates - - } // end group decentralizedSituationTemplates - - group decentralizedLocationTemplates { - - /** - * @desc Send template for Location Container where no delta is given - */ - template (value) LocationContainer m_denmLocation_zeroDelta := { - eventSpeed := omit, - eventPositionHeading := omit, - traces := { - { - { - pathPosition := { - deltaLatitude := 0, - deltaLongitude := 0, - deltaAltitude := 0 - }, - pathDeltaTime := 1 - } - } - }, - roadType := omit - } - - /** - * @desc Default receive template for Location Container - */ - template (present) LocationContainer mw_anyDenmLocation := { - eventSpeed := *, - eventPositionHeading := *, - traces := ?, - roadType := * - } - - /** - * @desc Receive template for Location Container with the given traces - * @param p_traces The expected traces. - */ - template (present) LocationContainer mw_denmLocationWithTrace( - template (present) Traces p_traces - ) := { - eventSpeed := *, - eventPositionHeading := *, - traces := p_traces, - roadType := * - } - - } // end group decentralizedLocationTemplates - - group alacarteTemplates { - - /** - * @desc Send template for Alacarte Container including lanePosition - */ - template (value) AlacarteContainer m_alacarteConLaneCount := { - lanePosition := 0, - impactReduction := omit, - externalTemperature := omit, - roadWorks := omit, - positioningSolution := omit, - stationaryVehicle := omit - } - - /** - * @desc Send template for Alacarte Container including impactReduction - */ - template (value) AlacarteContainer m_alacarteConImpactReduction := { - lanePosition := omit, - impactReduction := m_impactReduction, - externalTemperature := omit, - roadWorks := omit, - positioningSolution := omit, - stationaryVehicle := omit - } - - /** - * @desc Send template for ImpactReduction Container - */ - template (value) ImpactReductionContainer m_impactReduction := { - heightLonCarrLeft := 100, - heightLonCarrRight := 100, - posLonCarrLeft := 127, - posLonCarrRight := 127, - positionOfPillars := { 30 }, - posCentMass := 63, - wheelBaseVehicle := 127, - turningRadius := 255, - posFrontAx := 20, - positionOfOccupants := '00000000000000000000'B, - vehicleMass := 1024, - requestResponseIndication := request - } - - /** - * @desc Receive template for Alacarte Container including impactReduction - */ - template (present) AlacarteContainer mw_alacarteConImpactReduction := { - lanePosition := *, - impactReduction := mw_impactReduction, - externalTemperature := *, - roadWorks := *, - positioningSolution := *, - stationaryVehicle := * - } - - /** - * @desc Receive template for ImpactReductio nContainer - */ - template (present) ImpactReductionContainer mw_impactReduction := { - heightLonCarrLeft := ?, - heightLonCarrRight := ?, - posLonCarrLeft := ?, - posLonCarrRight := ?, - positionOfPillars := ?, - posCentMass := ?, - wheelBaseVehicle := ?, - turningRadius := ?, - posFrontAx := ?, - positionOfOccupants := ?, - vehicleMass := ?, - requestResponseIndication := response - } - - } // end alacarteTemplates - - group sspTemplates { - - template (present) bitstring mw_sspNoTrafficCondition := '*0'B; - template (present) bitstring mw_sspNoAccident := '*0?'B; - template (present) bitstring mw_sspNoRoadworks := '*0??'B; - } // end sspTemplates - -} // end LibItsDenmTemplates diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn deleted file mode 100644 index 8a7cc869..00000000 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TestSystem.ttcn $ - * $Id: LibItsDenm_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_TestSystem { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsDenm - import from LibItsDenm_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtDenmInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtDenmChangePosition, UtDenmChangePseudonym; - in - UtDenmResults, UtDenmEventInd; - } // end UpperTesterPort - - } // end portDefinitions - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 DENM Port (DENM/BTP/GeoNet/G5) - */ - type port DenmPort message { - in DenmInd; - out DenmReq; - } // End of port DenmPort - - } // End of group fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsDenmSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port DenmPort denmPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsDenm extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - - // FA1 ports - port DenmPort denmPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - var SequenceNumber vc_sequenceNo := 0; - var boolean vc_denmReceived := false; - - var UtDenmEventIndList vc_utEvents := {}; - - var UtDenmActionIDList vc_utActionIDs := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_denmDefaultActive := true; - - } // End of component ItsDenm - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 DENM Indication Primitive - * - * @member denmMsg - */ - type record DenmInd { - DENM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 DENM Request Primitive - * - * @member denmMsg - */ - type record DenmReq { - DENM msgOut - } - with { - encode (msgOut) "PER" - } - - } // End of group fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsDenm_TestSystem diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn deleted file mode 100644 index 5a5b1eb5..00000000 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn $ - * $Id: LibItsDenm_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing type and value definitions for DENM - * - */ -module LibItsDenm_TypesAndValues { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - group actionTypes { - - /** - * @desc Indication of whether event cancellation has to be raised by the test system or iut - */ - type enumerated Trigger { - e_ets(0), - e_iut(1) - } - - } // end group actionTypes - - group otherTypes { - - /** - * @desc List of SituationContainers used in behaviours - */ - type record of SituationContainer SituationContainerList; - - /** - * @desc List of ActionIDs used in behaviours - */ - type record of ActionID ActionIDList; - - } - - group denmConstants { - - const ValidityDuration c_duration_2sec := 2; - const ValidityDuration c_duration_5sec := 5; - const ValidityDuration c_duration_10sec := 10; - - const TransmissionInterval c_interval_1sec := 1000; - const TransmissionInterval c_interval_2sec := 2000; - const TransmissionInterval c_interval_4sec := 4000; - const TransmissionInterval c_interval_5sec := 5000; - const TransmissionInterval c_interval_10sec := 10000; - - } // end group denmConstants - - group certificates { - - const charstring PX_CERT_IUT_DENM_01 := "CERT_IUT_DENM_BO_01_AT"; - const charstring PX_CERT_IUT_DENM_02 := "CERT_IUT_DENM_BO_02_AT"; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtDenmInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the DENM IUT - * @member utDenmInitialize - - * @member utDenmTriggerResult - - * @member utDenmUpdateResult, - - * @member utDenmChangePositionResult - - * @member utDenmChangePseudonymResult - - */ - type union UtDenmResults { - boolean utDenmInitializeResult, - UtDenmTriggerResult utDenmTriggerResult, - UtDenmUpdateResult utDenmUpdateResult, - boolean utDenmTerminationResult, - boolean utDenmChangePositionResult, - boolean utDenmChangePseudonymResult - } with { - variant "" - } // End of type UtDenmResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtDenmTrigger { - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - ValidityDuration repetitionDuration optional, - SituationContainer situation, - RelevanceDistance relevanceDistance, - RelevanceTrafficDirection relevanceTrafficDirection, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtDenmTriggerResult { - boolean result, - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to update an event at IUT - */ - type record UtDenmUpdate { - ActionID actionId, - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - SituationContainer situation optional, - LocationContainer location optional, - RelevanceDistance relevanceDistance optional, - RelevanceTrafficDirection relevanceTrafficDirection optional, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of an update request of an event on DENM IUT - */ - type record UtDenmUpdateResult { - boolean result, - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request the termination of an event at IUT - */ - type record UtDenmTermination { - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtDenmChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to change the pseudonym of the DENM IUT - */ - type record UtDenmChangePseudonym { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on DENM IUT - */ - type record UtDenmEventInd { - DENM denMsg - } with { - encode (denMsg) "LibItsDenm_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on DENM IUT - */ - type record of UtDenmEventInd UtDenmEventIndList; - - /** - * @desc List of ActionID received in response to the Upper Tester triggered messages - */ - type record of ActionID UtDenmActionIDList; - - } - with { - encode "UpperTester" - variant "" - } -} -with { - encode "LibItsDenm" - } diff --git a/ttcn/DENM/module.mk b/ttcn/DENM/module.mk deleted file mode 100644 index 643df797..00000000 --- a/ttcn/DENM/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsDenm_EncdecDeclarations.ttcn \ - LibItsDenm_Functions.ttcn \ - LibItsDenm_Pics.ttcn \ - LibItsDenm_Pixits.ttcn \ - LibItsDenm_Templates.ttcn \ - LibItsDenm_TestSystem.ttcn \ - LibItsDenm_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn deleted file mode 100644 index 6ade6909..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ /dev/null @@ -1,47 +0,0 @@ -module LibItsGeoNetworking_EncdecDeclarations { - - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TestSystem all; - - external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - /* - external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - */ - - external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - -} // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn deleted file mode 100644 index 79bb7cf5..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ /dev/null @@ -1,2836 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF 538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn $ - * $Id: LibItsGeoNetworking_Functions.ttcn 1329 2017-02-21 14:48:18Z berge $ - * @desc Module containing functions for GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - // import from LibItsCommon_TestSystem all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - import from LibItsSecurity_Functions all; - import from LibItsSecurity_Pixits all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_Pics all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Requests to change the position of the IUT - */ - function f_utChangePosition() runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(m_changePosition); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position changed ***"); - } - [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { - - // Variables - var boolean v_return := true; - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { - tc_wait.stop; - log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - v_return := false; - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - return v_return; - } - - } // End of group utFunctions - - group geoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - */ - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:geoNetworkingPort, system:geoNetworkingPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(); - - //Initialze the IUT - f_initialState(p_scenario); - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - - } // End of function f_cf01Up - - function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - f_uninitialiseSecuredMode(); - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:geoNetworkingPort, system:geoNetworkingPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of function f_cf01Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeB and NodeD - * NodeB being close to the area center - * - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf02Up - - /** - * @desc Deletes configuration cf02 - */ - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf02Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA (NodeB) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf03Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf03Up - - /** - * @desc Deletes configuration cf03 - */ - function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf03Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA and having - * shortest distance to NodeA (NodeB) - * - one ITS node in direction of NodeA (NodeD) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeA, NodeB and NodeD - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf04Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf04Up - - /** - * @desc Deletes configuration cf04 - */ - function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf04Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * longest distance to NodeB (NodeE) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf05Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf05 - */ - function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf05Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * shortest distance to NodeB (NodeF) - * - Area1 which only includes NodeB, NodeD and IUT - * - IUT not in sectorial area of NodeB-NodeF - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf06Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf06Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node in direction of NodeB and having - * shortest distance to NodeB (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf07Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf07Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_positionTable Table containing position vectors of all nodes - * @param p_areaTable Table containing all defined geoAreas - * @param p_componentName Name of the component - */ - function f_initialiseComponent( - in PositionTable p_positionTable, - in GeoAreaTable p_areaTable, - in charstring p_componentName) - runs on ItsGeoNetworking { - - vc_positionTable := p_positionTable; - vc_areaTable := p_areaTable; - vc_componentName := p_componentName; - - vc_localSeqNumber := f_getInitialSequenceNumber(); - vc_multipleMessagesCount := f_getMessageCount(); - - } // End of function f_initialiseComponent - - /** - * @desc Makes the simulated ITS node behave as a neighbour of IUT - */ - function f_startBeingNeighbour() runs on ItsGeoNetworking { - - vc_neighbourDefault := activate(a_neighbourDefault()); - f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); - f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // End of function f_startBeingNeighbour - - /** - * @desc Makes the simulated ITS node behave as not being a neighbour of IUT - */ - function f_stopBeingNeighbour() runs on ItsGeoNetworking { - - f_acTriggerEvent(m_stopBeaconing); - if (PICS_GN_SECURITY == true) { - deactivate(vc_neighbourDefault); - } - } // End of function f_stopBeingNeighbour - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY == true) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - } else if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acEnableSecurity()){ - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - f_acDisableSecurity(); - } - } // End of function f_uninitialiseSecuredMode() - - } // End of group geoConfigurationFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsGeoNetworking { - - var ItsGeoNetworking v_return := null; - var integer i := 0; - - for (i:=0; i value v_ind { - //store every upper tester indication received - //log("################# v_ind: ", v_ind); - vc_utInds[lengthof(vc_utInds)] := v_ind; - //log("################# vc_utInds: ", vc_utInds); - //log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); - repeat; - } - } - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsGeoNetworking { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf03 de-initialisation. - */ - altstep a_cf03Down() runs on ItsMtc { - [] a_shutdown() { - f_cf03Down(); - log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf04 de-initialisation. - */ - altstep a_cf04Down() runs on ItsMtc { - [] a_shutdown() { - f_cf04Down(); - log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf05 de-initialisation. - */ - altstep a_cf05Down() runs on ItsMtc { - [] a_shutdown() { - f_cf05Down(); - log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf06 de-initialisation. - */ - altstep a_cf06Down() runs on ItsMtc { - [] a_shutdown() { - f_cf06Down(); - log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf07 de-initialisation. - */ - altstep a_cf07Down() runs on ItsMtc { - [] a_shutdown() { - f_cf07Down(); - log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - group geoGeoUnicastAltsteps { - - /** - * @desc Receive GeoUnicast packet - * @param p_sourceLongPosVec Expected source position vector - * @param p_destinationShortPosVec Expected destination position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoUnicast( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( - p_destinationShortPosVec, - p_seqNumber)))) { - } - } - - /** - * @desc Receive GeoUnicast packet for specific destination - * @param p_destinationShortPosVec Expected destination position vector - */ - altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} - } - - /** - * @desc Receive any GeoUnicast packet - */ - altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} - } - - } // End of group geoGeoUnicastAltsteps - - group geoGeoBroadcastAltsteps { - - /** - * @desc Receive GeoBroadcast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoBroadcast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoBroadcast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - * @param p_routerHopLimit Expected router hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoBroadcastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_routerHopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea, - p_maxHopLimit - ), - -, - p_routerHopLimit - ))) { - } - } - - /** - * @desc Receive GeoBroadcast packet for specific Geobroadcast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - */ - altstep a_receiveGeoBroadcastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea - )))) { - } - } - - } // End of group geoGeoBroadcastAltsteps - - group geoGeoAnycastAltsteps { - - /** - * @desc Receive GeoAnycast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoAnycast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) LongPosVector p_senderLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoAnycast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - * @param p_hopLimit Expected hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoAnycastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_hopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - ), - -, - p_hopLimit - ))) { - } - } - - /** - * @desc Receive GeoAnycast packet for specific GeoAnycast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - */ - altstep a_receiveGeoAnycastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - )))) { - } - } - - } // End of group geoGeoAnycastAltsteps - - group geoLocationServiceAltsteps { - - /** - * @desc Receive Location Service Request - * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_mid GN address expected in received LS Request - * @param p_reqSrcPosVector Expected source position vector of the received LS Request - */ - altstep a_receiveLsRequest( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid, - out LongPosVector p_reqSrcPosVector - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_msg; - - [vc_gnDefaultActive] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsRequestPacket( - p_seqNumber, - p_mid - ) - ) - ) - ) -> value v_msg { - p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); - } - } - - /** - * @desc Receive any Location Service Request - */ - altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { - var LongPosVector v_reqSrcPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} - } - - /** - * @desc Receive any Location Service Reply - */ - altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { - //ignore and repeat - repeat; - } - } - - /** - * @desc Receive Location Service Request and send Location Service Reply - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - */ - altstep a_receiveLsRequestAndReply( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking { - var LongPosVector v_repDstPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( - m_geoNwLsReplyPacket( - p_repSrcPosVector, - f_longPosVector2ShortPosVector(v_repDstPosVector), - vc_localSeqNumber - ))))); - } - } - - } // End of group geoLocationServiceAltsteps - - - } // End of group geoAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsGeoNetworking { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Preamble for non-neighbour nodes - */ - function f_prNonNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - } - - /** - * @desc Preamble for neighbour nodes - */ - function f_prNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - f_startBeingNeighbour(); - f_sleep(0.5); - } - - /** - * @desc Brings the IUT into an initial state. - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { - - if (PICS_GN_SECURITY) { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - if (oct2int(v_hashedId8ToBeUsed) == 0) { - v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates - } - f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); - } // else, default behavior - else { - f_utInitializeIut(m_gnInitialize); - } - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - f_acLoadScenario(p_scenario); - f_acStartScenario(); - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - /** - * @desc Receive and reply to LS Requests - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - function f_handleLocationService( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - - tc_ac.start; - alt { - [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector) {//Spirent removed, p_repSenderPosVector) { - tc_ac.stop; - } - } - - } - - /** - * @desc Send LS request and receive LS Reply - * @param p_reqSrcPosVector Source position vector of the sent LS Request - * @param p_reqSeqNumber Sequence number of the sent LS Request - * @param p_gnAddress GN address for which the LS Request is sent - * @param p_repSrcPosVector Expected source position vector in received LS Response - * @return FncRetCode - */ - function f_processLocationService( - in template (value) LongPosVector p_reqSrcPosVector, - in template (value) UInt16 p_reqSeqNumber, - in template (value) GN_Address p_gnAddress, - out LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_error; - var GeoNetworkingInd v_msg; - - f_sendGeoNetMessage( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress - ) - ) - ) - ) - ); - - tc_ac.start; - alt { - [] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsReplyPacket( - ?, - mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) - ) - ) - ) - ) -> value v_msg { - tc_ac.stop; - p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); - v_ret := e_success; - } - } - - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsGeoNetworking { - f_acStopScenario(); - } - - /** - * @desc Postamble for neighbour nodes - */ - function f_poNeighbour() runs on ItsGeoNetworking { - f_stopBeingNeighbour(); - f_poDefault(); - } - - } // End of group postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - - return v_ret; - } - - /** - * @desc Get the position vector corresponding to a specific GN address - * @param p_gnAddress GN address for which the search is performed - * @return LongPosVector - IUT's position - */ - function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { - var AcGnResponse v_result; - - f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); - tc_ac.start; - alt { - [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_result.getLongPosVector; - } - - /** - * @desc Triggers test adapter to send beacons for multiple neighbours - * @param p_numberOfNeighbour Number of neighbours to simulate - * @return FncRetCode - */ - function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { - - return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); - - } - - /** - * @desc Triggers test adapter to enable security support - * @return FncRetCode - */ - function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - return e_error; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); - } - return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); - } - - /** - * @desc Triggers test adapter to disable security support - * @return FncRetCode - */ - function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - f_unloadCertificates(); - - return f_acTriggerSecEvent(m_acDisableSecurity); - - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group commonFunctions { - - /** - * @desc Gets the value of the lifetime in seconds. - * @param p_lifetime Lifetime to be converted - * @return Lifetime in seconds - */ - function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { - var float v_lifetime := 0.0; - - select (p_lifetime.ltBase) { - case (e_50ms) { - v_lifetime := int2float(p_lifetime.multiplier) * 0.5; - } - case (e_1s) { - v_lifetime := int2float(p_lifetime.multiplier) * 1.0; - } - case (e_10s) { - v_lifetime := int2float(p_lifetime.multiplier) * 10.0; - } - case (e_100s) { - v_lifetime := int2float(p_lifetime.multiplier) * 100.0; - } - } - - return v_lifetime; - } - - /** - * @desc Computes GN timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - function f_computeGnTimestamp() return UInt32 { - - // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) - var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; - return v_timestamp; - } - - } // End of group commonFunctions - - group testerFunctions { - - /** - * @desc Gets the tester GN local address for a specific node - * @param p_node Simulated node - * @return GN address of simulated node - */ - function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { - var GN_Address v_gnAddr := valueof(m_dummyGnAddr); - - select (p_node) { - case (c_compNodeA) { - v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; - } - case (c_compNodeB) { - v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; - } - case (c_compNodeC) { - v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; - } - case (c_compNodeD) { - v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; - } - case (c_compNodeE) { - v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; - } - case (c_compNodeF) { - v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; - } - case else { - log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); - } - } - - return v_gnAddr; - } - - /** - * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - */ - function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - * @param p_payload The payload to include. - */ - function f_sendGeoNetMessageWithPayload( - in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) GnRawPayload p_payload - ) runs on ItsGeoNetworking { - p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetInd The message to receive. - * @param p_payload The payload to include. - */ - function f_receiveGeoNetMessageWithPayload( - in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) GnRawPayload p_payload - ) return template (present) GeoNetworkingInd { - var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; - - v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; - - return v_geoNetInd; - } - - /** - * @desc Sets the value of the sequence number for the next event. - */ - function f_setLocalSequenceNumber() runs on ItsGeoNetworking { - vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; - } - - /** - * @desc Creates an initial seqence number - * @return Time based initial sequence number (increasing with time) - */ - function f_getInitialSequenceNumber() return UInt16 { - - return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; - } - - /** - * @desc Number of messages to be sent - * @return Number of messages to be sent - */ - function f_getMessageCount() return integer { - return PX_MESSAGE_COUNT; - } - - } // End of group testerFunctions - - group iutFunctions { - - /** - * @desc Gets the IUT GN local address - * @return IUT's GN_Address - * @see PICS_GN_LOCAL_GN_ADDR - */ - function f_getIutGnLocalAddress() return GN_Address { - - return PICS_GN_LOCAL_GN_ADDR; - } - - /** - * @desc Gets the IUT GN local address configuration method - * @return GnAddressConfigurationMethod - IUT's GN local address configuration method - * @see PICS_GN_LOCAL_ADDR_CONF_METHOD - */ - function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { - return PICS_GN_LOCAL_ADDR_CONF_METHOD; - } - - /** - * @desc Gets the IUT MAc address - * @return MacAddress - IUT's MAc Address - * @see PICS_IUT_MAC_ADDRESS - */ - function f_getIutMacAddress() return MacAddress { - return PICS_IUT_MAC_ADDRESS; - } - - /** - * @desc Gets the GeoUnicast forwarding algorithm - * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_NON_AREA_FORWARDING_ALGORITHM - */ - function f_getNonAreaForwardingAlgorithm() return NonAreaForwardingAlgorithm { - return PICS_GN_NON_AREA_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the GeoBroadcast forwarding algorithm - * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_AREA_FORWARDING_ALGORITHM - */ - function f_getAreaForwardingAlgorithm() return AreaForwardingAlgorithm { - return PICS_GN_AREA_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the IUT default hop limit - * @return IUT's default hop limit - * @see PICS_GN_DEFAULT_HOP_LIMIT - */ - function f_getDefaultHopLimit() return UInt8 { - return PICS_GN_DEFAULT_HOP_LIMIT; - } - - /** - * @desc Is the ITS-S mobile or stationary? - * @return Flags indicating whether the ITS-S is mobile or stationary. - * @see PICS_GN_IS_MOBILE - */ - function f_isMobile() return Bit8 { - if (PICS_GN_IS_MOBILE) { - return '10000000'B; - } - return '00000000'B; - } - - /** - * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). - * @return LS retransmission timer in seconds - * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER - */ - function f_getLsRetransmitTimer() return float { - var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationServiceRetransmitTimer; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). - * @return LS retransmission timer (medium) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM - */ - function f_getLsRetransmitTimerMedium() return float { - var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). - * @return LS retransmission timer (maximum) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM - */ - function f_getLsRetransmitTimerMaximum() return float { - var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). - * @return App retransmission timer in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER - */ - function f_getAppRetransmitTimer() return float { - var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationApplicationRetransmitTimer; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). - * @return App retransmission timer (medium) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM - */ - function f_getAppRetransmitTimerMedium() return float { - var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMedium; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). - * @return App retransmission timer (maximum) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM - */ - function f_getAppRetransmitTimerMaximum() return float { - var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMaximum; - } - - /** - * @desc Gets the LS maximum retransmission number. - * @return LS maximum retransmission number - * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS - */ - function f_getLsMaxRetrans() return integer { - var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; - - return v_itsGnLocationServiceMaxRetrans; - } - - /** - * @desc Gets the Application maximum retransmission number. - * @return Application maximum retransmission number - * @see PX_GN_APPLICATION_MAX_RETRANS - */ - function f_getAppMaxRetrans() return integer { - var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; - - return v_itsGnApplicationMaxRetrans; - } - - /** - * @desc Gets the Location Service packet buffer size. - * @return Location Service packet buffer size in Kbytes - * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE - */ - function f_getLsPacketBufferSize() return integer { - var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; - - return v_itsGnLocationServicePacketBufferSize; - } // End of function f_getLsPacketBufferSize - - /** - * @desc Gets the UC forwarding packet buffer size. - * @return UC forwarding packet buffer size in bytes - * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getUcForwardingPacketBufferSize() return integer { - var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnUcForwardingPacketBufferSize * 1024; - } // End of function f_getUcForwardingPacketBufferSize - - /** - * @desc Gets the BC forwarding packet buffer size. - * @return BC forwarding packet buffer size in bytes - * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getBcForwardingPacketBufferSize() return integer { - var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnBcForwardingPacketBufferSize * 1024; - } // End of function f_getBcForwardingPacketBufferSize - - /** - * @desc Gets the maximum lifetime of a packet. - * @return Maximum lifetime of a packet in seconds - * @see PICS_GN_MAX_PACKET_LIFETIME - */ - function f_getMaxPacketLifeTime() return float { - var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); - - return v_itsGnMaxPacketLifetime; - } - - /** - * @desc Gets delta for timers. - * @return Delta for timers in seconds - * @see PX_T_DELTA - */ - function f_getDeltaTimer() return float { - var float v_deltaTimer := PX_T_DELTA; - - return v_deltaTimer; - } - - /** - * @desc Gets the beacon service retransmit timer. - * @return Beacon service retransmit timer - */ - function f_getBsRetransmitTimer() return float { - var float v_itsGnBeaconServiceRetransmitTimer; - - v_itsGnBeaconServiceRetransmitTimer := int2float( - (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); - - return v_itsGnBeaconServiceRetransmitTimer; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). - * @return Beacon service retransmit timer (medium) - */ - function f_getBsRetransmitTimerMedium() return float { - var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) - - v_itsGnBeaconServiceRetransmitTimerMedium := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). - * @return Beacon service retransmit timer (maximum) - */ - function f_getBsRetransmitTimerMaximum() return float { - var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) - - v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the maximum beacon service jitter. - * @return Maximum beacon service jitter - */ - function f_getBsMaxJitter() return float { - var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; - - return v_itsGnBeaconServiceMaxJitter; - } - - /** - * @desc Gets the Lifetime of a Location Table Entry. - * @return Lifetime of a Location Table Entry in seconds - * @see PICS_GN_LIFETIME_LOC_TE - */ - function f_getLifetimeLocTableEntry() return float { - var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); - - return v_itsGnLifetimeLocTableEntry; - } // End of function f_getLifetimeLocTableEntry - - /** - * @desc Gets the maximum communication range for CBF algorithm - * @return Maximum communication range for CBF algorithm in meters - * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE - */ - function f_getCbfMaxCommunicationRange() return integer { - var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; - - return v_maxCommunicationRange; - } // End of function f_getCbfMaxCommunicationRange - - function f_getCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // End of function f_getCbfMaxTime - - function f_getCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_CBF_MIN_TIME; - - return v_cbfMinTime; - } // End of function f_getCbfMinTime - - function f_getGnMaxAreaSize() return float { - var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; - - return v_maxAreaSize; - } // End of function f_getGnMaxAreaSize - - function f_getAdvancedGbcForwardingMaxCounter() return integer { - var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; - - return v_maxCounter; - } - - /** - * @desc Set the number of neighbour in the Location Table. - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableDefault - - /** - * @desc Set the number of neighbour in the Location Table (medium). - * @see PX_MIN_NR_NEIGHBOUR - * @see PX_MAX_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableMedium - - /** - * @desc Set the number of neighbour in the Location Table (maximum). - * @see PX_MAX_NR_NEIGHBOUR - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableMaximum - - } // End of group iutFunctions - - group posVectorFunctions { - - /** - * @desc Convert long position vector to short position vector - * @param p_longPosVector Long position vector to be converted - * @return Short position vector - */ - function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { - var ShortPosVector v_shortPosVector; - - v_shortPosVector := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := p_longPosVector.timestamp_, - latitude := p_longPosVector.latitude, - longitude := p_longPosVector.longitude - }; - - return v_shortPosVector; - } - - /** - * @desc Get IUT's long position vector - * @return IUT's long position vector - */ - function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { - return f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { - p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - - /** - * @desc Get IUT's short position vector - * @return IUT's short position vector - */ - function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { - var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); - - if (not isbound(v_longPosVectorIut)) { - v_longPosVectorIut := f_getIutLongPosVector(); - } - return f_longPosVector2ShortPosVector(v_longPosVectorIut); - } - - /** - * @desc Compute a position using a reference position, a distance and an orientation - * @param p_iutLongPosVector Reference position - * @param p_distance Distance to the reference position (in meter) - * @param p_orientation direction of the computed position (0 to 359; 0 means North) - * @return LongPosVector - */ - function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) - return LongPosVector { - var LongPosVector v_result := p_iutLongPosVector; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); - - return v_result; - } - - } // End of group posVectorFunctions - - group externalFunctions { - - /** - * @desc External function to compute timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - external function fx_computeGnTimestamp() return UInt32; - - } // End of group externalFunctions - - group security { - - /** - * @desc Waiting for the GN message with Security - * @param p_InSecMsg SecurityMessage template - * @param p_received returns received SecurityMessage - */ - altstep a_securedMessage ( - in template (present) EtsiTs103097Data p_InSecMsg, - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_geoNw; - [] geoNetworkingPort.receive(mw_geoNwInd( - mw_geoNwSecPdu( - p_InSecMsg, - mw_geoNwAnyPacket_withPayload(?) - ))) -> value v_geoNw { - p_received := f_getSecuredMessage(v_geoNw.msgIn); - } - } // End of 'altstep' statement - - /** - * @desc Receive GN message with security containing certificate as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificate( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_certificate // containing certificate - ) - ), - p_received - ) { - // Nothing to do - } - } // End of 'altstep' a_securedMessageWithCertificate - - /** - * @desc Receive GN message with security containing digest as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithDigest( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_digest // containing digest - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithDigest - - } // End of group altSteps - - group waitingHelpers { - - /** - * @desc Wait for GN message with security containing certificate as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificate( - out EtsiTs103097Certificate p_cert - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - if (ischosen(v_signerIdentifier.certificate)) { - p_cert := v_signerIdentifier.certificate[0]; - v_ret := true; - } - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForCertificate - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askForCertificateChain( - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate - if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer - if(tc_ac.running) { - tc_ac.stop; - tc_ac.start; - } - v_ret := true; - } - } - } - } - return v_ret; - } // End of function f_askForCertificateChain - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askAndWaitForCertificateChain( - out SequenceOfCertificate p_chain, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - var SignerIdentifier v_signerIdentifier; - var boolean v_ret := false; - - f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer - alt { - [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate - tc_ac.stop; - - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - p_chain := v_signerIdentifier.certificate; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_askAndWaitForCertificateChain - - /** - * @desc Send a CAM message with a certificate and wait the certificate chain request message - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - */ - function f_sendCertificateAndWaitForCertificateChainRequest( - in charstring p_certificate, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - - f_sendCertificate(p_certificate, p_CamPayload); - /* FIXME To be reviewed alt { - [] a_securedMessage ( - mw_securedMessage( - superset( - mw_header_field_unrecognised_certificate - )), - v_recv - ) { - // Nothing to do - log("*** " & testcasename() & ": DEBUG: Receive certificate ***") - } - }*/ // End of 'alt' statement - - return true; - } // End of function f_sendCertificateAndWaitForCertificateChainRequest - - } // End of group waitingHelpers - - group CertRequests{ - - function f_sendCertificateRequest( - in template (value) HashedId8 p_digest, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - /* FIXME To be reviewed f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - { - m_header_field_unrecognised_certificate( - f_HashedId3FromHashedId8( - valueof(p_digest) - )) - }, - "" - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificateRequest - - /** - * @desc Send a CAM message with a certificate - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - * @see f_sendCertificateAndWaitForCertificateChainRequest - */ - function f_sendCertificate( - in charstring p_certificate, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - -, - p_certificate - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificate - - } // End of group CertRequests - - group messageGetters { - - /** - * @desc return EtsiTs103097Data field of GeoNetworking packet - * @param p_msg GeoNetworking packet - * @return the EtsiTs103097Data if any - */ - function f_getSecuredMessage( - in GeoNetworkingPdu p_msg - ) return EtsiTs103097Data { - return p_msg.gnPacket.securedMsg; - } - - } - -} // End of module LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn deleted file mode 100644 index 16d13115..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group geoNwPics { - - /** - * @desc GeoNetworking address of the GeoAdhoc router - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar GN_Address PICS_GN_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := c_6ZeroBytes - }; - - /** - * @desc Is address manually configured - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar GnAddressConfigurationMethod PICS_GN_LOCAL_ADDR_CONF_METHOD := e_anonymous; - - /** - * @desc Is the IUT mobile? - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_IS_MOBILE := true; - - /** - * @desc Minimum update frequency of local position vector (LPV) in ms - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MINIMUM_UPDATE_FREQUENCY_LPV := 1000; - - /** - * @desc Maximum size of GN-SDU [bytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_SDU_SIZE := 1398; - - /** - * @desc GN_MAX: Maximum size of GeoNetworking header [bytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_GN_HEADER_SIZE := 88; - - /** - * @desc Lifetime of location table entry [s] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LIFETIME_LOC_TE := 20; - - /** - * @desc GN Security support enabled or disabled - * @see ETSI TS 102 871-1 Table 1 - * @remark This PIC is different than PICS_IS_IUT_SECURED. - * When set to true, this PIC indicates that the GeoNetworking is running with security ATS - * UtInitialse shall indicate which certificate the IUT shall use - */ - modulepar boolean PICS_GN_SECURITY := false; - - /** - * @desc Maximum number of retransmissions of LS_REQUEST packets - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_MAX_RETRANS := 10; - - /** - * @desc Duration of Location service retransmit timer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER := 1000; - - /** - * @desc Size of Location service packet buffer [Byte] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE := 1024; - - /** - * @desc Duration of Beacon service retransmit timer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER := 3000; - - /** - * @desc Maximum beacon jitter [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BEACON_SERVICE_MAX_JITTER := 750; - - /** - * @desc Default hop limit indicating the maximum number of hops a packet travels - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar UInt8 PICS_GN_DEFAULT_HOP_LIMIT := 10; - - /** - * @desc Upper limit of the maximum lifetime [s] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_PACKET_LIFETIME := 600; - - /** - * @desc Lower limit of the packet repetition interval [km^2] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar float PICS_GN_MAX_GEO_AREA_SIZE:= 10.0; - - /** - * @desc Lower limit of the packet repetition interval [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MIN_PACKET_REPETITION_INTERVAL := 100; - - /** - * @desc Default NON-AREA forwarding algorithm - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar NonAreaForwardingAlgorithm PICS_GN_NON_AREA_FORWARDING_ALGORITHM := e_greedy; - - /** - * @desc Default AREA forwarding algorithm - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar AreaForwardingAlgorithm PICS_GN_AREA_FORWARDING_ALGORITHM := e_cbf; - - /** - * @desc Minimum duration a packet shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_CBF_MIN_TIME := 1; - - /** - * @desc Maximum duration a packet shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_CBF_MAX_TIME := 100; - - /** - * @desc Default theoretical maximum communication range [m] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE := 1000; - - /** - * @desc Size of UC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE := 256; - - /** - * @desc Size of BC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE := 1024; - - /** - * @desc Support for Basic header - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BASIC_HEADER := true; - - /** - * @desc Support for Common header - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_COMMON_HEADER := true; - - /** - * @desc Support for Beacon source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BEACON_SRC := true; - - /** - * @desc Support for Beacon destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BEACON_DST := true; - - /** - * @desc Support for GUC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC := true; - - /** - * @desc Support for GUC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_SRC := true; - - /** - * @desc Support for GUC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_DST := true; - - /** - * @desc Support for GUC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_FWD := true; - - /** - * @desc Support for GBC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC := true; - - /** - * @desc Support for GBC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_SRC := true; - - /** - * @desc Support for GBC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_DST := true; - - /** - * @desc Support for GBC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_FWD := true; - - /** - * @desc Support for GAC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC := true; - - /** - * @desc Support for GAC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_SRC := true; - - /** - * @desc Support for GAC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_DST := true; - - /** - * @desc Support for GAC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_FWD := true; - - /** - * @desc Support for SHB operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB := true; - - /** - * @desc Support for SHB source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB_SRC := true; - - /** - * @desc Support for SHB destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB_DST := true; - - /** - * @desc Support for TSB operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB := true; - - /** - * @desc Support for TSB source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_SRC := true; - - /** - * @desc Support for TSB destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_DST := true; - - /** - * @desc Support for TSB forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_FWD := true; - - /** - * @desc Support for LS Request source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_SRC := true; - - /** - * @desc Support for LS Request retransmission - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_RETRANSMISSION := true; - - /** - * @desc Support for LS Request destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_DST := true; - - /** - * @desc Support for LS Reply destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REP_DST := true; - - /** - * @desc Support for LS forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_FWD := true; - - /** - * @desc Support for automatic address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_AUTO := true; - - /** - * @desc Support for Managed address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_MANAGED := true; - - /** - * @desc Support for Anonymous address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_ANONYMOUS := true; - - /** - * @desc Support for DAD - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_DAD := true; - - /** - * @desc MAX_COUNTER used in Advanced GBC forwarding - * @see FIXME: not defined as protocol constant in base spec - */ - modulepar integer PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER := 3; - - /** - * @desc IUT's Mac address - */ - modulepar MacAddress PICS_IUT_MAC_ADDRESS := 'FFFFFFFFFFFF'O; - - } // end geoNwPics - - /** - * @desc Is the IUT running in secured mode? - * @remark This PIC is different than PICS_GN_SECURITY. - * When set to true, this PIC indicates that the GeoNetworking is running without security against a secured device - * UtInitialse does not indicate any certificate - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - -} // End of module LibItsGeoNetworking_Pics diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn deleted file mode 100644 index 768ee778..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn $ - * $Id: LibItsGeoNetworking_Pixits.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ - * @desc GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Pixits { - - // LibCommon -// import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - - group geoNetworkingPixits { - - group gnAddresses { - - /** - * @desc GeoNetworking address of the GeoAdhoc router node A - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_A_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(10,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node B - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_B_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(11,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node C - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_C_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(12,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node D - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_D_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(13,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node E - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_E_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(14,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node F - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_F_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(15,6) - }; - - } // end gnAddresses - - group congestionControl { - - /** - * @desc Nr of neighbour limit to enter the "medium" congestion status value - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MIN_NR_NEIGHBOUR := 50; - - /** - * @desc Nr of neighbour limit to enter the "maximum" congestion status value - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MAX_NR_NEIGHBOUR := 50; - - /** - * @desc Maximum number of application retransmissions - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_MAX_RETRANS := 10; - - } // end congestionControl - - group timers { - - /** - * @desc Delta for timers to reflect processing time - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar float PX_T_DELTA := 0.1; - - /** - * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = medium (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_BEACON_SERVICE_TIMER_MEDIUM := 5000; - - /** - * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = maximum (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_BEACON_SERVICE_TIMER_MAXIMUM := 8000; - - /** - * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = medium (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MEDIUM := 2000; - - /** - * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = maximum (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM := 3000; - - /** - * @desc Duration of Application retransmit timer [ms] - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER := 1000; - - /** - * @desc Duration of Application retransmit timer [ms] - medium - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM := 2000; - - /** - * @desc Duration of Application retransmit timer [ms] - maximum - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM := 3000; - - /** - * @desc The allowed delta for position checking. - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_POS_DELTA := 1; - } - - group upperLayer { - - /** - * @desc The IUT's upper layer - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar NextHeader PX_GN_UPPER_LAYER := e_any; - - /** - * @desc Is BTP header present in IUT's UT indication. Only applicable if PX_GN_UPPER_LAYER == e_btpA or e_btpB. - * @remark It may happen that IUT do not report BTP header in UT indications (due to GN/BTP merge) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar boolean PX_BTP_IN_UT_IND := true; - - } - - group parametrisation { - - /** - * @desc Number of messages to be sent - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MESSAGE_COUNT := 5; - - /** - * @desc Time necessary for IUT to detect neighbours - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar float PX_NEIGHBOUR_DISCOVERY_DELAY := 1.0 - - } - - } // end geoNetworkingPixits - -} // end LibItsGeoNetworking_Pixits diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn deleted file mode 100644 index 440339eb..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ /dev/null @@ -1,2320 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn $ - * $Id: LibItsGeoNetworking_Templates.ttcn,v 1.5 2018/05/31 15:57:10 dte Exp $ - * @desc GeoNetworking Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Templates { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - // LibItsBtp - // import from LibItsBtp_Templates all; -// import from LibItsBtp_EncdecDeclarations all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; -// import from LibItsSecurity_Pixits all; - - // LibItsIpv6OverGeoNetworking - //import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - //import from LibItsIpv6OverGeoNetworking_Templates all; - - // AtsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_Pixits all; -// import from LibItsGeoNetworking_EncdecDeclarations all; - - group geoNwPrimitivesTemplates { - - /** - * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be sent - * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused - */ - template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0 - ) := { - msgOut := p_geoNwMsg, - macDestinationAddress := c_llBroadcast, - its_aid := p_its_aid - } - - /** - * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be sent - * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused - * @param p_llDestinationAdress Link-layer destination address - */ - template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0, - in template (value) MacAddress p_llDestinationAdress - ) modifies m_geoNwReq_linkLayerBroadcast := { - macDestinationAddress := p_llDestinationAdress - } - - /** - * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be received - */ - template(present) GeoNetworkingInd mw_geoNwInd( - template (present) GeoNetworkingPdu p_geoNwMsg := ? - ) := { - msgIn := p_geoNwMsg, - macDestinationAddress := ?, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be received - * @param p_llDestinationAdress Link-layer destination address - */ - template (present) GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination( - template (present) GeoNetworkingPdu p_geoNwMsg := ?, - template (present) MacAddress p_llDestinationAdress := ? - ) modifies mw_geoNwInd := { - macDestinationAddress := p_llDestinationAdress - } - - group utPrimitives { - - /** - * @desc Initializes the GN IUT. - */ - template (value) UtGnInitialize m_gnInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination - * @param p_destinationGnAddr Destination of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := { - geoUnicast := { - gnAddress := p_destinationGnAddr, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithTrafficClass( - GN_Address p_destinationGnAddr, - TrafficClass p_trafficClass - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_lifetime Lifetime of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetime( - GN_Address p_destinationGnAddr, - UInt16 p_lifetime - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with a payload - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_payload Payload of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithPayload( - GN_Address p_destinationGnAddr, - octetstring p_payload - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime with specific payload - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_lifetime Lifetime of the GeoUnicast message - * @param p_payload Payload of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload( - GN_Address p_destinationGnAddr, - UInt16 p_lifetime, - octetstring p_payload - ) modifies m_generateGeoUnicastMessageWithLifetime := { - geoUnicast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessage( - GeoArea p_geoArea - ) := { - geoBroadcast := { - shape := p_geoArea.shape, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - reserved := c_uInt24Zero, - area := p_geoArea.area, - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - * @param p_trafficClass TrafficClass of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithTrafficClass( - GeoArea p_geoArea, - TrafficClass p_trafficClass - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - * @param p_lifetime Packet's lifetime - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithLifetime( - GeoArea p_geoArea, - UInt16 p_lifetime - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_payload Payload of the GeoBroadcast message - * @see m_generateGeoBroadcastMessage - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithPayload( - GeoArea p_geoArea, - octetstring p_payload - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area - * @param p_geoArea Destination area of the message - */ - template (value) UtGnTrigger m_generateGeoAnycastMessage( - GeoArea p_geoArea - ) := { - geoAnycast := { - shape := p_geoArea.shape, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - reserved := c_uInt24Zero, - area := p_geoArea.area, - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateGeoAnycastMessage - */ - template (value) UtGnTrigger m_generateGeoAnycastMessageWithTrafficClass( - GeoArea p_geoArea, - TrafficClass p_trafficClass - ) modifies m_generateGeoAnycastMessage := { - geoAnycast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_payload Payload of the GeoAnycast message - * @see m_generateGeoAnycastMessage - */ - template (value) UtGnTrigger m_generateGeoAnycastMessageWithPayload( - GeoArea p_geoArea, - octetstring p_payload - ) modifies m_generateGeoAnycastMessage := { - geoAnycast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a SHB message - */ - template (value) UtGnTrigger m_generateShbMessage := { - shb := { - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a SHB message with a payload - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateShbMessage - */ - template (value) UtGnTrigger m_generateShbMessageWithTrafficClass( - TrafficClass p_trafficClass - ) modifies m_generateShbMessage := { - shb := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a SHB message with a payload - * @param p_payload Payload of the SHB message - * @see m_generateShbMessage - */ - template (value) UtGnTrigger m_generateShbMessageWithPayload( - octetstring p_payload - ) modifies m_generateShbMessage := { - shb := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a TSB message - */ - template (value) UtGnTrigger m_generateTsbMessage := { - tsb := { - nbHops := 10, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a TSB message - * @param p_lifetime Packet's lifetime - */ - template (value) UtGnTrigger m_generateTsbMessageWithLifetime( - UInt16 p_lifetime - ) modifies m_generateTsbMessage := { - tsb := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a TSB message - * @param p_trafficClass TrafficClass of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateTsbMessageWithTrafficClass( - TrafficClass p_trafficClass - ) modifies m_generateTsbMessage := { - tsb := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to change its position - */ - template (value) UtGnChangePosition m_changePosition := { - latitude := 1000, - longitude := 0, - elevation := 0 - } - - } // end utPrimitives - - group taPrimitives { - - /** - * @desc Testsystem will start beaconing for the given neighbor - * @param p_beaconHeader The neighbor information - */ - template (value) AcGnPrimitive m_startBeaconing( - template (value) BeaconHeader p_beaconHeader - ) := { - startBeaconing := { - beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1) - } - } - - /** - * @desc Testsystem will stop beaconing for the given neighbor - * @param p_compName The neighbor - */ - template AcGnPrimitive m_stopBeaconing := { - stopBeaconing:= { - } - } - - /** - * @desc Testsystem will pass received to the TTCN-3 - * @param p_beaconHeader The neighbor information - */ - template (value) AcGnPrimitive m_startPassBeaconing( - in template (value) BeaconHeader p_beaconHeader - ) := { - startPassBeaconing := { - beaconHeader := p_beaconHeader - } - } - - /** - * @desc Testsystem will stop passing beacon information to the TTCN-3 - */ - template (value) AcGnPrimitive m_stopPassBeaconing := { - stopPassBeaconing := { - } - } - - /** - * @desc Testsystem will start beaconing for multiple neighbors - * @param p_beaconHeader The neighbor information - * @param p_numberOfNeighbour The number of ITS stations for which TS will send beacons - */ - template (value) AcGnPrimitive m_startBeaconingMultipleNeighbour( - template (value) BeaconHeader p_beaconHeader, - integer p_numberOfNeighbour - ) := { - startBeaconingMultipleNeighbour := { - beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1), - numberOfNeighbour := p_numberOfNeighbour - } - } - - /** - * @desc Testsystem will stop beaconing for multiple neighbors - * @param p_compName The neighbor - */ - template (value) AcGnPrimitive m_stopBeaconingMultipleNeighbour := { - stopBeaconingMultipleNeighbour:= { - } - } - - /** - * @desc Testsystem will reply the LongPosVector including the requested GN address - * found in received beacon information to the TTCN-3 - * @param p_gnAddress The GN address included in the LongPosVector - */ - template (value) AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := { - getLongPosVector := { - gnAddress := p_gnAddress - } - } - - /** - * @desc Receive template adapter control result for long position vector with specific GN_Address - * @param p_gnAddress GN_Address to be contained in the long position vector - */ - template AcGnResponse mw_getLongPosVectorAny(template (present) GN_Address p_gnAddress) := { - getLongPosVector := mw_longPosVectorAny(p_gnAddress) - } - - } // end taPrimitives - - } // geoNwPrimitivesTemplates - - group geoNwPduTemplates { - - /** - * @desc Send template for GeoNetworking PDU - * @param p_packet GnNonSecuredPacket of GeoNetworking message - * @param p_lifeTime Lifetime of GeoNetworking message (Default: m_defaultLifetime) - * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: c_defaultHopLimit) - */ - template (value) GeoNetworkingPdu m_geoNwPdu( - in template (value) GnNonSecuredPacket p_packet, - in template (value) Lifetime p_lifeTime := m_defaultLifetime, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - basicHeader := m_basicHeader(p_lifeTime, p_hopLimit), - gnPacket := { - packet := p_packet, - securedMsg := omit - } - } - - /** - * @desc Receive template for GeoNetworking PDU - * @param p_packet GnNonSecuredPacket of GeoNetworking message - * @param p_lifeTime Lifetime of GeoNetworking message (Default: ?) - * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: ?) - */ - template (present) GeoNetworkingPdu mw_geoNwPdu( - template (present) GnNonSecuredPacket p_packet, - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - basicHeader := mw_basicHeader(p_lifeTime, p_hopLimit), - gnPacket := { - packet := p_packet, - securedMsg := * - } - } - - /** - * @desc Receive template for secured GeoNetworking PDU - * @param p_secMsg Secured message - * @param p_packet Clear-text version of the packet - */ - template (present) GeoNetworkingPdu mw_geoNwSecPdu( - template (present) EtsiTs103097Data p_secMsg, - template (present) GnNonSecuredPacket p_packet := ? - ) := { - basicHeader := mw_securedBasicHeader(), - gnPacket := { - packet := p_packet, - securedMsg := p_secMsg - } - } - - /** - * @desc Send template for secured GeoNetworking PDU - * @param p_packet Clear-text version of the packet - * @param p_secMsg Secured message - */ - template (value) GeoNetworkingPdu m_geoNwSecPdu( - in template (value) GnNonSecuredPacket p_packet, - in template (value) EtsiTs103097Data p_secMsg - ) := { - basicHeader := m_securedBasicHeader(), - gnPacket := { - packet := p_packet, - securedMsg := p_secMsg - } - } - - } // end geoNwPduTemplates - - group geoNwPacketTemplates { - - /** - * @desc Send template for GeoNetworking Packet - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - */ - template (value) GeoNetworkingPacket m_geoNwPacket( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader - ) := { - packet := { - commonHeader := valueof(p_commonHeader), - extendedHeader := valueof(p_extHeader), - payload := char2oct("DEFAULT_PAYLOAD") - }, - securedMsg := omit - } - - /** - * @desc Send template for GeoNetworking Packet with no payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * - * @see m_geoNwPacket - */ - template (value) GeoNetworkingPacket m_geoNwPacketNoPayload( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader - ) modifies m_geoNwPacket := { - packet := { - payload := omit - } - } - - /** - * @desc Send template for GeoNetworking Packet with payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Payload - * - * @see m_geoNwPacket - */ - template (value) GeoNetworkingPacket m_geoNwPacketWithPayload( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader, - in template (value) GnRawPayload p_payload - ) modifies m_geoNwPacket := { - packet := { - payload := p_payload - } - } - - /** - * @desc Receive template for GeoNetworking Packet - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - */ - template (present) GeoNetworkingPacket mw_geoNwPacket( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ? - ) := { - packet := { - commonHeader := p_commonHeader, - extendedHeader := p_extHeader, - payload := * - }, - securedMsg := * - } - - /** - * @desc Receive template for GeoNetworking Packet with any payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := ? - } - } - - /** - * @desc Receive template for GeoNetworking PDU with octetstring payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Octetstring payload - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ?, - template (present) octetstring p_payload := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := p_payload - } - } - - /** - * @desc Receive template for GeoNetworking PDU with payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Payload - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ?, - template (present) GnRawPayload p_payload := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := p_payload - } - } - - group geoNwPacketTemplates_ { - - /** - * @desc Receive template for any GeoNetworking Packet - */ - template (present) GnNonSecuredPacket mw_geoNwAnyPacket := { - commonHeader := mw_commonHeader( - ?, - ? - ), - extendedHeader := *, - payload := * - } - - /** - * @desc Receive template for any GeoNetworking Packet with Payload - * @param payload Expected GN payload - */ - template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload( - template (present) GnRawPayload p_payload := ? - ) := { - commonHeader := mw_commonHeader( - ?, - ? - ), - extendedHeader := *, - payload := p_payload - } - - } // end group geoNwPacketTemplates_ - - group geoNwPacketUnicastTemplates { - - /** - * @desc Send template for GeoNetworking Unicast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwUnicastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationShortPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoUnicastHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoUnicastHeader( - p_sourceLongPosVec, - p_destinationShortPosVec, - p_seqNumber - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Send template for GeoNetworking Unicast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwUnicastPacket_with_payload( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationShortPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass, - in template (value) GnRawPayload p_payload - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoUnicastHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoUnicastHeader( - p_sourceLongPosVec, - p_destinationShortPosVec, - p_seqNumber - )), - payload := valueof(p_payload) - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacket( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoUnicastHeaderType - ), - extendedHeader := mw_geoUnicastHeader( - p_destinationShortPosVec, - p_seqNumber - ), - payload := * - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: ?) - * @see mw_geoNwUnicastPacket - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithHl( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_geoNwUnicastPacket := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoUnicastHeaderType, - p_hopLimit - ), - extendedHeader := mw_geoUnicastHeader( - p_destinationShortPosVec, - p_seqNumber - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_srcLongPosVec Long position vector of source - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithSourcePv( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) LongPosVector p_srcLongPosVec - ) modifies mw_geoNwUnicastPacket := { - extendedHeader := mw_geoUnicastHeaderWithSourcePv( - p_destinationShortPosVec, - p_seqNumber, - p_srcLongPosVec - ) - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithNextHeader( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwUnicastPacket := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketUnicastTemplates - - group geoNwPacketAnycastTemplates { - - /** - * @desc Send template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwAnycastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoAnycastArea p_anycastArea, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoAnycastHeaderType(valueof(p_anycastArea.geoAnycastSubType)), - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoAnycastHeader( - p_sourceLongPosVec, - p_seqNumber, - p_anycastArea - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderType - ), - extendedHeader := mw_geoAnycastHeader( - p_sourceLongPosVec, - p_seqNumber - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithArea( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoAnycastArea p_anycastArea := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType) - ), - extendedHeader := mw_geoAnycastHeaderWithArea( - p_sourceLongPosVec, - p_seqNumber, - p_anycastArea - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_maxHopLimit Maximum number of hops (Default := ?) - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaAndHl( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoAnycastArea p_anycastArea, - template (present) UInt8 p_maxHopLimit := ? - ) modifies mw_geoNwAnycastPacketWithArea := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType), - p_maxHopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoAnycastArea p_anycastArea, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwAnycastPacketWithArea := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketAnycastTemplates - - group geoNwPacketBroadcastTemplates { - - /** - * @desc Send template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwBroadcastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoBroadcastArea p_broadcastArea, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoBroadcastHeaderType(valueof(p_broadcastArea.geoBroadcastSubType)), - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoBroadcastHeader( - p_sourceLongPosVec, - p_seqNumber, - p_broadcastArea - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderType - ), - extendedHeader := mw_geoBroadcastHeader( - p_sourceLongPosVec, - p_seqNumber - ), - payload := * - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeader( - p_nextHeader, - mw_geoBroadcastHeaderType - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_nextHeader Id of next header - * @param p_payload payload - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader, - template (present) GnRawPayload p_payload - ) modifies mw_geoNwBroadcastPacketWithNextHeader := { - payload := p_payload - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithArea( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType) - ), - extendedHeader := mw_geoBroadcastHeaderWithArea( - p_sourceLongPosVec, - p_seqNumber, - p_broadcastArea - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @param p_maxHopLimit Maximum number of hops (Default := ?) - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaAndHl( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea, - template (present) UInt8 p_maxHopLimit := ? - ) modifies mw_geoNwBroadcastPacketWithArea := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType), - p_maxHopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet (Default: ?) - * @param p_hopLimit Maximum number of hops (Default: ?) - * @param p_flags Flags in the common header (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithHlAndFlags( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber := ?, - template (present) UInt8 p_hopLimit := ?, - template (present) Bit8 p_flags := ? - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeaderWithHopLimitAndFlags( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderType, - p_hopLimit, - p_flags - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwBroadcastPacketWithArea := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketBroadcastTemplates - - group geoNwPacketLsTemplates { - - /** - * @desc Send template for GeoNetworking LS Request Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of LS Request packet - * @param p_gnAddress Searched GN_Address - */ - template (value) GnNonSecuredPacket m_geoNwLsRequestPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GN_Address p_gnAddress - ) := { - commonHeader := m_commonHeader( - e_any, - m_lsRequestHeaderType, - m_trafficClass, - c_defaultHopLimit - ), - extendedHeader := m_lsRequestHeader( - p_sourceLongPosVec, p_seqNumber, p_gnAddress - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking LS Request Packet - * @param p_seqNumber Sequence number of LS Request packet - * @param p_mid Searched GN_Address MID - */ - template (present) GnNonSecuredPacket mw_geoNwLsRequestPacket( - template (present) UInt16 p_seqNumber := ?, - template (present) GN_Address.mid p_mid := ? - ) := { - commonHeader := mw_commonHeader( - e_any, - m_lsRequestHeaderType - ), - extendedHeader := mw_lsRequestHeader( - p_seqNumber, - p_mid - ), - payload := omit - } - - /** - * @desc Send template for GeoNetworking LS Reply Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of LS Reply packet - */ - template (value) GnNonSecuredPacket m_geoNwLsReplyPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - commonHeader := m_commonHeader( - e_any, - m_lsReplyHeaderType, - m_trafficClass, - c_defaultHopLimit - ), - extendedHeader := m_lsReplyHeader( - p_sourceLongPosVec, p_destinationLongPosVec, p_seqNumber - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking LS Reply Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Short position vector of destination - */ - template (present) GnNonSecuredPacket mw_geoNwLsReplyPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) ShortPosVector p_destinationLongPosVec := ? - ) := { - commonHeader := mw_commonHeader( - e_any, - m_lsReplyHeaderType - ), - extendedHeader := mw_lsReplyHeader( - p_sourceLongPosVec, p_destinationLongPosVec - ), - payload := omit - } - - } // end group geoNwPacketLsTemplates - - group geoNwPacketBeaconTemplates { - - /** - * @desc Send template for GeoNetworking Beacon Packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) GnNonSecuredPacket m_geoNwBeaconPacket( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - commonHeader := m_commonHeader( - e_any, - m_beaconHeaderType, - m_trafficClass, - c_hopLimit1 - ), - extendedHeader := m_beaconHeader( - p_sourceLongPosVec - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking Beacon Packet - * - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_nextHeader Next header (Default: e_any) - */ - template (present) GnNonSecuredPacket mw_geoNwBeaconPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) NextHeader p_nextHeader := e_any - ) := { - commonHeader := mw_commonHeader_noPayload( - p_nextHeader, - m_beaconHeaderType - ), - extendedHeader := mw_beaconHeader(p_sourceLongPosVec), - payload := '00000000000000000000'O ifpresent //(*, '00000000000000000000'O) - } - - } // end group geoNwPacketBeaconTemplates - - group geoNwPacketShbTemplates { - - /** - * @desc Send template for GeoNetworking SHB Packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) GnNonSecuredPacket m_geoNwShbPacket( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_shbHeaderType, - m_trafficClass, - c_defaultHopLimit - )), - extendedHeader := valueof(m_shbHeader( - p_sourceLongPosVec - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking SHB Packet - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_hopLimit Maximum number of hops (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwShbPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - m_shbHeaderType, - p_hopLimit - ), - extendedHeader := mw_shbHeader(p_sourceLongPosVec), - payload := * - } - - } // end group geoNwPacketShbTemplates - - group geoNwPacketTsbTemplates { - - /** - * @desc Send template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit) - */ - template (value) GnNonSecuredPacket m_geoNwTsbPacket( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_tsbHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_tsbHeader( - p_seqNumber, - p_sourceLongPosVec - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacket( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - m_tsbHeaderType - ), - extendedHeader := mw_tsbHeader(p_seqNumber, p_sourceLongPosVec), - payload := * - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_hopLimit The maximum number of hops (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithHl( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_geoNwTsbPacket := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - m_tsbHeaderType, - p_hopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithNextHeader( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ?, - in template (value) NextHeader p_nextHeader - ) modifies mw_geoNwTsbPacket := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketTsbTemplates - - } // end group geoNwPacketTemplates - - group geoNwHeadersTemplates { - - group geoNwBasicHeaderTemplates { - - /** - * @desc Send template for Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (value) BasicHeader m_basicHeader( - in template (value) Lifetime p_lifeTime := m_defaultLifetime, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_commonHeader, - reserved := 0, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } - - /** - * @desc Receive template for Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (present) BasicHeader mw_basicHeader( - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - version := c_geoNwProtocolVersion, - nextHeader := ?, - reserved := ?, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } - - /** - * @desc Send template for Secured Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (value) BasicHeader m_securedBasicHeader( - in template (value) Lifetime p_lifeTime := { - multiplier := c_defaultLifetime, - ltBase := e_100s - }/*FIXME Bug TITAN ? m_defaultLifetime*/, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_securedPacket, - reserved := 0, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } // End of template m_securedBasicHeader - - /** - * @desc Receive template for Secured Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (present) BasicHeader mw_securedBasicHeader( - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_securedPacket, - reserved := ?, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } // End of template mw_securedBasicHeader - - /** - * @desc Default send template for Lifetime field - */ - template (value) Lifetime m_defaultLifetime := { - multiplier := c_defaultLifetime, - ltBase := e_100s - } - - /** - * @desc Send template for Lifetime field (Base = 1s) - */ - template (value) Lifetime m_lifetimeBase1s( - in template (value) UInt6 p_multiplier - ) := { - multiplier := p_multiplier, - ltBase := e_1s - } - - /** - * @desc Receive template for lifetime 0 - */ - template (present) Lifetime mw_lifetime0 := { - multiplier := 0, - ltBase := ? - } - - } //end group geoNwBasicHeaderTemplates - - group geoNwCommonHeaderTemplates { - - /** - * @desc Send template for Common header - * @param p_nextHeader Id of next header - * @param p_trafficClass Packet's traffic class - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @remark plLength field is set to 0 and has to be computed by codec - */ - template (value) CommonHeader m_commonHeader ( - in template (value) NextHeader p_nextHeader, - in template (value) HeaderTST p_headerTypeSubType, - in template (value) TrafficClass p_trafficClass, - in template (value) UInt8 p_hopLimit - ) := { - nextHeader := p_nextHeader, - reserved := c_uInt8Zero, - headerTST := p_headerTypeSubType, - trafficClass := p_trafficClass, - flags := c_8ZeroBits, - plLength := 0, // will be computed by Codec - maxHopLimit := p_hopLimit, - reserved2 := 0 - } - - /** - * @desc Receive template for Common header - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - */ - template (present) CommonHeader mw_commonHeader ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ? - ) := { - nextHeader := p_nextHeader, - reserved := ?, - headerTST := p_headerTypeSubType, - trafficClass := ?, - flags := ?, - plLength := ?, - maxHopLimit := ?, - reserved2 := ? - } - - /** - * @desc Receive template for Common header with no payload - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - */ - template (present) CommonHeader mw_commonHeader_noPayload ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ? - ) modifies mw_commonHeader := { - plLength := 0 - } - - /** - * @desc Receive template for Common header with specific Hop limit - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @see mw_commonHeader - */ - template (present) CommonHeader mw_commonHeaderWithHopLimit ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_commonHeader := { - maxHopLimit := p_hopLimit - } - - /** - * @desc Receive template for Common header with specific Hop limit - * @param p_senderLongPosVec Long position vector of sender - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @param p_flags Flags in the common header - * @see mw_commonHeaderWithHopLimit - */ - template (present) CommonHeader mw_commonHeaderWithHopLimitAndFlags ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) UInt8 p_hopLimit := ?, - template (present) Bit8 p_flags := ? - ) modifies mw_commonHeaderWithHopLimit := { - flags := p_flags - } - - /** - * @desc Receive template for Common header with specific Traffic Class - * @param p_senderLongPosVec Long position vector of sender - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_trafficClass Packet's traffic class - */ - template (present) CommonHeader mw_commonHeaderWithTrafficClass ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) TrafficClass p_trafficClass := ? - ) modifies mw_commonHeader := { - trafficClass := p_trafficClass - } - - /** - * @desc Default send template for traffic class - */ - template (value) TrafficClass m_trafficClass ( in SCF p_scf := e_scfEnabled, in ChannelOffload p_ChOff := e_choffDisabled ) := { - scf := p_scf, - channelOffload := p_ChOff, - tcId := 0 - } - - /** - * @desc Receive template for traffic class - */ - template TrafficClass mw_trafficClass ( in template(present) SCF p_scf := ?, in template(present) ChannelOffload p_ChOff := ? ) := { - scf := p_scf, - channelOffload := p_ChOff, - tcId := ? - } - - /** - * @desc Receive template for any GN_Address - */ - template GN_Address mw_gnAddressAny := { - typeOfAddress := ?, - stationType := ?, - reserved := ?, - mid := ? - } - - /** - * @desc Receive template for GN_Address - * @param p_stationType Station's type - * @param p_reserved Station's country code - */ - template GN_Address mw_gnAddress( - template (present) StationType p_stationType, - template (present) UInt10 p_reserved - ) := { - typeOfAddress := ?, - stationType := p_stationType, - reserved := p_reserved, - mid := ? - } - - /** - * @desc Receive template for long position vector with specific GN_Address - * @param p_gnAddress GN_Address to be contained in the long position vector - */ - template (present) LongPosVector mw_longPosVectorAny( - template (present) GN_Address p_gnAddress := ? - ) := { - gnAddr := p_gnAddress, - timestamp_ := ?, - latitude := ?, - longitude := ?, - pai := ?, - speed := ?, - heading := ? - } - - /** - * @desc Receive template for long position vector with strict position check - * @param p_longPosVector The base long position vector - */ - template (present) LongPosVector mw_longPosVectorPosition( - template (present) LongPosVector p_longPosVector := ? - ) := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := ?, - latitude := f_getDelta32(valueof(p_longPosVector.latitude), PX_POS_DELTA), - longitude := f_getDelta32(valueof(p_longPosVector.longitude), PX_POS_DELTA), - pai := ?, - //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta - speed := f_getDelta15(valueof(p_longPosVector.speed), float2int(int2float(valueof(p_longPosVector.speed)) * 0.03)), - heading := p_longPosVector.heading - } - - /** - * @desc Receive template for short position vector with strict position check - * @param p_shortPosVector The base short position vector - */ - template (present) ShortPosVector mw_shortPosVectorPosition( - template (present) ShortPosVector p_shortPosVector := ? - ) := { - gnAddr := p_shortPosVector.gnAddr, - timestamp_ := ?, - latitude := f_getDelta32(valueof(p_shortPosVector.latitude), PX_POS_DELTA), - longitude := f_getDelta32(valueof(p_shortPosVector.longitude), PX_POS_DELTA) - } - - /** - * @desc Receive template for short position vector without position check - * @param p_shortPosVector The base short position vector - */ - template (present) ShortPosVector mw_shortPosVectorPosition_anyPos( - template (present) ShortPosVector p_shortPosVector := ? - ) modifies mw_shortPosVectorPosition := { - latitude := ?, - longitude := ? - } - - function f_getDelta32(Int32 p_value, integer p_delta) return template (present) Int32 { - if (p_value == c_int32Min) { - return (p_value .. p_value+p_delta); - } - if (p_value == c_int32Max) { - return (p_value-p_delta .. p_value); - } - return (p_value-p_delta .. p_value+p_delta); - } - - function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 { - log(">>> f_getDelta15: ", p_value, ", ", p_delta); - - if (p_value == c_int15Min) { - return (p_value .. p_value+p_delta); - } - if (p_value == c_int15Max) { - return (p_value-p_delta .. p_value); - } - return (p_value-p_delta .. p_value+p_delta); - } - - } // end geoNwCommonHeaderTemplates - - group geoUnicastHeaderTemplates { - - /** - * @desc Send template for GeoUnicast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (value) ExtendedHeader m_geoUnicastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - geoUnicastHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - /** - * @desc Receive template for GeoUnicast header - * @param p_senderLongPosVec Long position vector of sender - * @param p_destinationShortPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (present) ExtendedHeader mw_geoUnicastHeader( - template (present) ShortPosVector p_destinationShortPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoUnicastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := ?, - dstPosVector := p_destinationShortPosVec - } - } - - /** - * @desc Receive template for GeoUnicast header with source long position vector - * @param p_destinationShortPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_srcLongPosVec Long position vector of source - * @see mw_geoUnicastHeader - */ - template (present) ExtendedHeader mw_geoUnicastHeaderWithSourcePv( - template (present) ShortPosVector p_destinationShortPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_srcLongPosVec := ? - ) modifies mw_geoUnicastHeader := { - geoUnicastHeader := { - srcPosVector := p_srcLongPosVec - } - } - - /** - * @desc Send template for GeoUnicast header type - */ - template (value) HeaderTST m_geoUnicastHeaderType := { - geoUnicastHdr := { - headerType := e_geoUnicast, - headerSubType := c_uInt4Zero - } - } - - /** - * @desc Receive template for GeoUnicast header type - */ - template HeaderTST mw_geoUnicastHeaderType := { - geoUnicastHdr := { - headerType := e_geoUnicast, - headerSubType := c_uInt4Zero - } - } - - } // end geoUnicastHeaderTemplates - - group geoBroadcastHeaderTemplates { - - /** - * @desc Send template for GeoBroadcast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (value) ExtendedHeader m_geoBroadcastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoBroadcastArea p_broadcastArea - ) := { - geoBroadcastHeader := { - seqNumber := valueof(p_seqNumber), - reserved := c_uInt8Zero, - srcPosVector := valueof(p_sourceLongPosVec), - geoAreaPosLatitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude), - geoAreaPosLongitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude), - distanceA := valueof(p_broadcastArea.geoBroadcastArea.distanceA), - distanceB := valueof(p_broadcastArea.geoBroadcastArea.distanceB), - angle := valueof(p_broadcastArea.geoBroadcastArea.angle), - reserved2 := c_uInt24Zero - } - } - - /** - * @desc Receive template for GeoBroadcast header for any GeoArea - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoBroadcast packet - */ - template (present) ExtendedHeader mw_geoBroadcastHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoBroadcastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := ?, - geoAreaPosLongitude := ?, - distanceA := ?, - distanceB := ?, - angle := ?, - reserved2 := ? - } - } - - /** - * @desc Receive template for GeoBroadcast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @see mw_geoBroadcastHeader - */ - template (present) ExtendedHeader mw_geoBroadcastHeaderWithArea ( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoBroadcastArea p_broadcastArea := ? - ) modifies mw_geoBroadcastHeader := { - geoBroadcastHeader := { - geoAreaPosLatitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude, - distanceA := p_broadcastArea.geoBroadcastArea.distanceA, - distanceB := p_broadcastArea.geoBroadcastArea.distanceB, - angle := p_broadcastArea.geoBroadcastArea.angle - } - } - - /** - * @desc Send template for GeoBroadcast header type - * @param p_headerSubType Packet's subtype - */ - template (value) HeaderTST m_geoBroadcastHeaderType( - in template (value) HeaderSubTypeGeoBroadcast p_headerSubType - ) := { - geoBroadcastHdr := { - headerType := e_geoBroadcast, - headerSubType := p_headerSubType - } - } - - /** - * @desc Receive template for GeoBroadcast header type - */ - template (present) HeaderTST mw_geoBroadcastHeaderType := { - geoBroadcastHdr := { - headerType := e_geoBroadcast, - headerSubType := ? - } - } - - /** - * @desc Receive template for GeoBroadcast header type with sub-type - * @param p_headerSubType Packet's subtype - * @see mw_geoBroadcastHeaderType - */ - template (present) HeaderTST mw_geoBroadcastHeaderTypeWithSubType( - template (present) HeaderSubTypeGeoBroadcast p_headerSubType := ? - ) modifies mw_geoBroadcastHeaderType := { - geoBroadcastHdr := { - headerSubType := p_headerSubType - } - } - - } // end geoBroadcastHeaderTemplates - - group geoAnycastHeaderTemplates { - - /** - * @desc Send template for GeoAnycast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - */ - template (value) ExtendedHeader m_geoAnycastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoAnycastArea p_anycastArea - ) := { - geoAnycastHeader := { - seqNumber := valueof(p_seqNumber), - reserved := c_uInt8Zero, - srcPosVector := valueof(p_sourceLongPosVec), - geoAreaPosLatitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLatitude), - geoAreaPosLongitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLongitude), - distanceA := valueof(p_anycastArea.geoAnycastArea.distanceA), - distanceB := valueof(p_anycastArea.geoAnycastArea.distanceB), - angle := valueof(p_anycastArea.geoAnycastArea.angle), - reserved2 := c_uInt24Zero - } - } - - /** - * @desc Receive template for GeoAnycast header for any GeoArea - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoAnycast packet - */ - template (present) ExtendedHeader mw_geoAnycastHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoAnycastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := ?, - geoAreaPosLongitude := ?, - distanceA := ?, - distanceB := ?, - angle := ?, - reserved2 := ? - } - } - - /** - * @desc Receive template for GeoAnycast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @see mw_geoAnycastHeader - */ - template (present) ExtendedHeader mw_geoAnycastHeaderWithArea ( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoAnycastArea p_anycastArea := ? - ) modifies mw_geoAnycastHeader := { - geoAnycastHeader := { - geoAreaPosLatitude := p_anycastArea.geoAnycastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_anycastArea.geoAnycastArea.geoAreaPosLongitude, - distanceA := p_anycastArea.geoAnycastArea.distanceA, - distanceB := p_anycastArea.geoAnycastArea.distanceB, - angle := p_anycastArea.geoAnycastArea.angle - } - } - - /** - * @desc Send template for GeoBroadcast header type with sub-type - * @param p_headerSubType Packet's subtype - */ - template (value) HeaderTST m_geoAnycastHeaderType( - in template (value) HeaderSubTypeGeoAnycast p_headerSubType - ) := { - geoAnycastHdr := { - headerType := e_geoAnycast, - headerSubType := p_headerSubType - } - } - - /** - * @desc Receive template for GeoAnycast header type with any sub-type - */ - template (present)HeaderTST mw_geoAnycastHeaderType := { - geoAnycastHdr := { - headerType := e_geoAnycast, - headerSubType := ? - } - } - - /** - * @desc Receive template for GeoAnycast header type with sub-type - * @param p_headerSubType Packet's subtype - * @see mw_geoAnycastHeaderType - */ - template (present) HeaderTST mw_geoAnycastHeaderTypeWithSubType( - template (present) HeaderSubTypeGeoAnycast p_headerSubType := ? - ) modifies mw_geoAnycastHeaderType := { - geoAnycastHdr := { - headerSubType := p_headerSubType - } - } - - } // end geoAnycastHeaderTemplates - - group lsRequestHeaderTemplates { - - /** - * @desc Send template for LS Request header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of LS Request packet - * @param p_gnAddress Searched GN_Address - */ - template (value) ExtendedHeader m_lsRequestHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GN_Address p_gnAddress - ) := { - lsRequestHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - gnAddress := p_gnAddress - } - } - - /** - * @desc Receive template for LS Request header - * @param p_seqNumber Sequence number of LS Request packet - * @param p_mid Searched GN_Address MID - */ - template (present) ExtendedHeader mw_lsRequestHeader( - template (present) UInt16 p_seqNumber := ?, - template (present) GN_Address.mid p_mid := ? - ) := { - lsRequestHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := ?, - gnAddress := mw_gnAddressMid(p_mid) - } - } - - /** - * @desc Send template for LS Request header type - */ - template (value) HeaderTST m_lsRequestHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsRequest - } - } - - /** - * @desc Receive template for LS Request header type - */ - template HeaderTST mw_lsRequestHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsRequest - } - } - - } // end lsRequestHeaderTemplates - - group lsReplyHeaderTemplates { - - /** - * @desc Send template for LS Reply header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of LS Reply packet - */ - template (value) ExtendedHeader m_lsReplyHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - lsReplyHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - /** - * @desc Receive template for any LS Reply header - */ - template (present) ExtendedHeader mw_lsReplyHeaderAny := { - lsReplyHeader := { - seqNumber := ?, - reserved := ?, - srcPosVector := ?, - dstPosVector := ? - } - } - - /** - * @desc Receive template for LS Reply header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Short position vector of destination - * @see mw_lsReplyHeaderAny - */ - template (present) ExtendedHeader mw_lsReplyHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) ShortPosVector p_destinationLongPosVec := ? - ) modifies mw_lsReplyHeaderAny := { - lsReplyHeader := { - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - - /** - * @desc Send template for LS Reply header type - */ - template (value) HeaderTST m_lsReplyHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsReply - } - } - - } // end lsRequestHeaderTemplates - - group beaconHeaderTemplates { - - /** - * @desc Send template for Beacon header - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) ExtendedHeader m_beaconHeader( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - beaconHeader := { - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Receive template for Beacon header - * @param p_sourceLongPosVec Long position vector of source - */ - template (present) ExtendedHeader mw_beaconHeader( - template (present) LongPosVector p_sourceLongPosVec := ? - ) := { - beaconHeader := { - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Send template for Beacon header type - */ - template (value) HeaderTST m_beaconHeaderType := { - beaconHdr := { - headerType := e_beacon, - headerSubType := c_uInt4Zero - } - } - - /** - * @desc Receive template for Beacon header type - */ - template HeaderTST mw_beaconHeaderType := { - beaconHdr := { - headerType := e_beacon, - headerSubType := ? - } - } - - } // end beaconHeaderTemplates - - group shbHeaderTemplates { - - /** - * @desc Send template for SHB header - * @param p_sourceLongPosVec Long position vector of sender - */ - template (value) ExtendedHeader m_shbHeader( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - shbHeader := { - srcPosVector := p_sourceLongPosVec, - reserved := 0 - } - } - - /** - * @desc Receive template for SHB header - * @param p_sourceLongPosVec Long position vector of sender - */ - template (present) ExtendedHeader mw_shbHeader( - template (present) LongPosVector p_sourceLongPosVec - ) := { - shbHeader := { - srcPosVector:= p_sourceLongPosVec, - reserved := ? - } - } - - /** - * @desc Send template for SHB header type - */ - template (value) HeaderTST m_shbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_singleHop - } - } - - } // end shbHeaderTemplates - - group tsbHeaderTemplates { - - /** - * @desc Send template for TSB header - * @param p_seqNumber Sequence number of TSB packet - * @param p_srcPosVector Long position vector of source - */ - template ExtendedHeader m_tsbHeader( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_srcPosVector - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_srcPosVector - } - } - - /** - * @desc Receive template for TSB header - * @param p_seqNumber Sequence number of TSB packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (present) ExtendedHeader mw_tsbHeader( - template (present) UInt16 p_seqNumber, - template (present) LongPosVector p_sourceLongPosVec - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Send template for TSB header type - */ - template (value) HeaderTST m_tsbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_multiHop - } - } - - /** - * @desc Receive template for TSB header type - */ - template (present) HeaderTST mw_tsbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_multiHop - } - } - - } // end tsbHeaderTemplates - - } // end geoNwHeadersTemplates - - group geoMiscTemplates { - - /** - * @desc Receive template for GN_Address. Only M_ID field is discriminent - * @param p_mid Expected GN Address MID - */ - template (present) GN_Address mw_gnAddressMid( - template (present) GN_Address.mid p_mid := ? - ) := { - typeOfAddress := ?, - stationType := ?, - reserved := ?, - mid := p_mid - } - - group geoDummyTemplates { - - /** - * @desc Dummy template for GN_Address - */ - template (value) GN_Address m_dummyGnAddr := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := c_6ZeroBytes - } - - /** - * @desc Dummy template for long position vector - */ - template (value) LongPosVector m_dummyLongPosVector := { - gnAddr := m_dummyGnAddr, - timestamp_ := c_uInt32Zero, - latitude := c_uInt32Zero, - longitude := c_uInt32Zero, - pai := int2bit(1,1), - speed := c_uInt16Zero, - heading := c_uInt16Zero - } - - /** - * @desc Dummy template for Area - */ - template (value) Area m_dummyArea := { - geoAreaPosLatitude := c_uInt32Zero, - geoAreaPosLongitude := c_uInt32Zero, - distanceA := c_uInt16Zero, - distanceB := c_uInt16Zero, - angle := c_uInt16Zero - } - - /** - * @desc Dummy template for GeoBroadcastArea - */ - template (value) GeoBroadcastArea m_dummyGeoBroadcastArea := { - geoBroadcastSubType := e_geoBroadcastRect, - geoBroadcastArea := m_dummyArea - } - - } // end geoDummyTemplates - - } // end geoMiscTemplates - -} // end ItsGeoNetworking_Templates diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn deleted file mode 100644 index 4b46b328..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn $ - * $Id: LibItsGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_Sync all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TypesAndValues all; - - // LibItsSecurity - import from LibItsSecurity_TestSystem all; - - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnPrimitive, AcGn6Primitive, AcGnssPrimitive, AcSecPrimitive; - in - AcGnResponse, AcGn6Response, AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - in - UtGnResults, UtGnEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt2Ports { - - /** - * @desc NT2 GeoNetworking Port (GeoNetworking/G5) - */ - type port GeoNetworkingPort message { - in GeoNetworkingInd; - out GeoNetworkingReq; - } // end GeoNetworkingPort - - } // End of group nt2Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS Main Test Component - */ - type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking { - var ComponentTable vc_componentTable := {}; - } // end ItsMtc - - /** - * @desc ITS System Adapter - */ - type component ItsGeoNetworkingSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // NT2 ports - port GeoNetworkingPort geoNetworkingPort; - - } // end ItsGeoNetworkingSystem - - } // End of group componentDefinitions - - type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // UT indications - var UtGnEventIndList vc_utInds := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_acDefaultActive := true; - var boolean vc_gnDefaultActive := true; - - } - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsGeoNetworking extends ItsBaseGeoNetworking { - - // NT2 ports - port GeoNetworkingPort geoNetworkingPort; - - //variables for Gn - var UInt16 vc_localSeqNumber := 0; - var PositionTable vc_positionTable := {}; - var GeoAreaTable vc_areaTable := {}; - var charstring vc_componentName := ""; - var default vc_neighbourDefault; - var integer vc_multipleMessagesCount := 0; - - } // End of component ItsGeoNetworking - - group networkAndTransportPrimitives { - - group nt2Primitives { - - /** - * @desc NT2 GeoNetworking Indication Primitive - */ - type record GeoNetworkingInd { - GeoNetworkingPdu msgIn, - MacAddress macDestinationAddress, - Bit256 ssp optional, - UInt32 its_aid optional - } with { - //encode "RAW"; - variant "FIELDORDER(msb)" - } - - /** - * @desc NT2 GeoNetworking Request Primitive - */ - type record GeoNetworkingReq { - GeoNetworkingPdu msgOut, - MacAddress macDestinationAddress, - UInt32 its_aid - } with { - //encode "RAW"; - variant "FIELDORDER(msb)" - } - - } // end nt2Primitives - - } // End of group networkAndTransportPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - - group misc { - - type record ComponentEntry { - charstring componentName, - ItsGeoNetworking gnComponent optional - } - - type record of ComponentEntry ComponentTable; - - } // end misc - -} // End of module LibItsGeoNetworking_TestSystem diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn deleted file mode 100644 index 928fce7f..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ /dev/null @@ -1,1182 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn $ - * $Id: LibItsGeoNetworking_TypesAndValues.ttcn,v 1.5 2018/06/26 13:54:21 dte Exp $ - * @desc Module containing types and values for GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - group geoConfigurationValues { - - const charstring c_compIut := "IUT"; - const charstring c_compMTC := "MTC"; - const charstring c_compNodeA := "NodeA"; - const charstring c_compNodeB := "NodeB"; - const charstring c_compNodeC := "NodeC"; - const charstring c_compNodeD := "NodeD"; - const charstring c_compNodeE := "NodeE"; - const charstring c_compNodeF := "NodeF"; - - const charstring c_area1 := "AREA1"; - const charstring c_area2 := "AREA2"; - - const integer c_latitudeFactorNodeA := 10; - const integer c_latitudeFactorNodeB := 2; - const integer c_latitudeFactorNodeC := -6; - const integer c_latitudeFactorNodeD := 1; - const integer c_latitudeFactorNodeE := -1; - const integer c_latitudeFactorNodeF := 2; - const integer c_longitudeFactorNodeA := 0; - const integer c_longitudeFactorNodeB := 0; - const integer c_longitudeFactorNodeC := 0; - const integer c_longitudeFactorNodeD := 0; - const integer c_longitudeFactorNodeE := 0; - const integer c_longitudeFactorNodeF := -3; - } // end geoConfigurationValues - - group geoSyncMessages { - - const charstring c_msgSent := "Message sent"; - - } // end geoSyncMessages - - group geoTestingConstants { - - const UInt6 c_defaultLifetime := 10; // in seconds - const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds - - } // end geoTestingConstants - - group units { - - const float c_squareKm := 1000000.0; - - } // end units - - group geoConfigurationTypes { - - /** - * @desc Entry of position table - * @member key Reference key of the entry - * @member position Position vector stored in the entry - */ - type record PositionEntry { - charstring key, - LongPosVector position - } - - /** - * @desc Table containing node positions - */ - type record of PositionEntry PositionTable; - - /** - * @desc Parameters of a geometric area - * @member geoAreaPosLatitude Latitude of area's center - * @member geoAreaPosLongitude Longitude of area's center - * @member distanceA Distance A - * @member distanceB Distance B - * @member angle Angle - */ - type record Area { - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle - } - - /** - * @desc Compact definition of GeoBroadcastArea - * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) - * @member geoBroadcastArea Parameters of the geometric area - */ - type record GeoBroadcastArea { - HeaderSubTypeGeoBroadcast geoBroadcastSubType, - Area geoBroadcastArea - } - - /** - * @desc Compact definition of GeoAnycastArea - * @member geoAnycastSubType Type of GeoAnycastArea (=shape) - * @member geoAnycastArea Parameters of the geometric area - */ - type record GeoAnycastArea { - HeaderSubTypeGeoAnycast geoAnycastSubType, - Area geoAnycastArea - } - - /** - * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) - * @member shape Shape of the GeoArea - * @member area Parameters of the geometric area - */ - type record GeoArea { - GeoShape shape, - Area area - } - - /** - * @desc Geometric shapes used to define GeoAreas - */ - type enumerated GeoShape { - e_geoCircle(0), - e_geoRect(1), - e_geoElip(2), - e_reserved - } - - /** - * @desc Entry of GeoArea table - * @member key Reference key of the entry - * @member geoArea GeoArea stored in the entry - */ - type record GeoAreaEntry { - charstring key, - GeoArea geoArea - } - - /** - * @desc Table containing geoArea definitions - */ - type record of GeoAreaEntry GeoAreaTable; - - } // end geoConfigurationTypes - - group geoNwValues { - - group geoNwHeaderConstants { - - const UInt4 c_geoNwProtocolVersion := 1; - - const UInt8 c_hopLimit1 := 1; - const UInt8 c_defaultHopLimit := 10; - - } // end geoNwHeaderConstants - - } // end geoNwValues - - group geoNetworkingPdus { - - /** - * @desc GeoNetworking Packet - * - * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 - * - * @member basicHeader - * @member gnPacket - */ - type record GeoNetworkingPdu { - BasicHeader basicHeader, - GeoNetworkingPacket gnPacket - } - - type record GeoNetworkingPacket { - GnNonSecuredPacket packet, - EtsiTs103097Data securedMsg optional - } with { - encode (securedMsg) "LibItsSecurity" - } - - type octetstring GnRawPayload; - - type record GnNonSecuredPacket { - CommonHeader commonHeader, - ExtendedHeader extendedHeader optional, - GnRawPayload payload optional - } - } // end group geoNetworkingPdus - - group geoNetworkingHeader { - - group geoNetworkingBasicHeader { - - /** - * @desc Basic Header - * - *
-       *  0               1               2               3
-       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
-       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.6.1 - * - * @member version - * @member nextHeader - * @member reserved - * @member lifeTime - * @member routerHopLimit - */ - type record BasicHeader { - UInt4 version, - BasicNextHeader nextHeader, - UInt8 reserved, - Lifetime lifeTime, - UInt8 routerHopLimit - } with { - variant "FIELDORDER(msb)" - } - - type enumerated BasicNextHeader { - e_any(0), - e_commonHeader(1), - e_securedPacket(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" - } - - /** - * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. - * @member multiplier - * @member ltBase - */ - type record Lifetime { - UInt6 multiplier, - LtBase ltBase - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The base for the calculation of the lifetime. - */ - type enumerated LtBase { - e_50ms(0), - e_1s(1), - e_10s(2), - e_100s(3) - } with { - variant "FIELDLENGTH(2)" - } - - } // end group geoNetworkingBasicHeader - - group geoNetworkingCommonHeader { - - /** - * @desc Common header for GeoNetworking - * - *
-       *  0               1               2               3
-       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
-       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       * |              PL               |     MHL       |    Reserved   |
-       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.7.2 - * - * @member nextHeader - * @member reserved - * @member headerTST Header type + Header Sub Type - * @member trafficClass - * @member flags - * @member plLength - * @member maxHopLimit - * @member reserved2 - */ - type record CommonHeader { - NextHeader nextHeader, - UInt4 reserved, - HeaderTST headerTST, - TrafficClass trafficClass, - Bit8 flags, - UInt16 plLength, // The Codec shall set the length of the paylaod if present - UInt8 maxHopLimit, - UInt8 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of header immediately following the Common Header (4Bits). - */ - type enumerated NextHeader { - e_any(0), - e_btpA(1), - e_btpB(2), - e_ipv6(3), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc TrafficClass - * - *
-       *  0   1   2   3   4   5   6   7
-       * +---+---+---+---+---+---+---+---+
-       * |SCF|Ch.|         TC ID         |
-       * |   |Off|                       |
-       * +---+---+---+---+---+---+---+---+
-       * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.7.5 - * - * @member scf - * @member channelOffload - * @member tcId - */ - type record TrafficClass { - SCF scf, - ChannelOffload channelOffload, - TcId tcId - } with { - variant "FIELDORDER(msb)" - } - - type enumerated SCF { - e_scfDisabled(0), - e_scfEnabled (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type enumerated ChannelOffload { - e_choffDisabled(0), - e_choffEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type UInt6 TcId; - - } // end group geoNetworkingCommonHeader - - group geoNetworkingExtendedHeaders { - - /** - * @desc GeoNetworking ExtendedHeader - * - * @see ETSI EN 302 636-4-1 chapter 8.3 - * - * @member commonHeader - * @member gnExtHeader - */ - type union ExtendedHeader { - GeoUnicastHeader geoUnicastHeader, - TSBHeader tsbHeader, - SHBHeader shbHeader, - GeoBroadcastHeader geoBroadcastHeader, - GeoAnycastHeader geoAnycastHeader, - BeaconHeader beaconHeader, - LSRequestHeader lsRequestHeader, - LSReplyHeader lsReplyHeader, - AnyHeader anyHeader - } with { - variant "" - } - - /** - * @desc The unspecified ANY header. - * - * @member seqNumber - * @member reserved - */ - type record AnyHeader { - UInt16 seqNumber, - UInt16 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The BEACON packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.6 - * - * @member commonHeader - */ - type record BeaconHeader { - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOANYCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type record GeoAnycastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle, - UInt16 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOBROADCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type GeoAnycastHeader GeoBroadcastHeader; - - /** - * @desc The GEOUNICAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.2 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record GeoUnicastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Reply packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.8 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record LSReplyHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Request packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.7 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member gnAddress - */ - type record LSRequestHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - GN_Address gnAddress - } with { - variant "FIELDORDER(msb)" - } - - /** - * The Single Hop Broadcast (SHB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.4 - * - * @member srcPosVector - * @member reserved - */ - type record SHBHeader { - LongPosVector srcPosVector, - UInt32 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Topologically-Scoped Broadcast (TSB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.3 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - */ - type record TSBHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingHeadersSubtypes { - - /** - * @desc Identifies the header type and the header subtype for ANY. - * @member headerType - * @member reserved - */ - type record AnyHeaderType { - HeaderType headerType(e_any), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for BEACON. - * @member headerType - * @member reserved - */ - type record BeaconHeaderType { - HeaderType headerType(e_beacon), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOANYCAST. - * @member headerType - * @member reserved - */ - type record GeoAnycastHeaderType { - HeaderType headerType(e_geoAnycast), - HeaderSubTypeGeoAnycast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOBROADCAST. - * @member headerType - * @member reserved - */ - type record GeoBroadcastHeaderType { - HeaderType headerType(e_geoBroadcast), - HeaderSubTypeGeoBroadcast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOUNICAST. - * @member headerType - * @member reserved - */ - type record GeoUnicastHeaderType { - HeaderType headerType(e_geoUnicast), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Location Service LS. - * @member headerType - * @member reserved - */ - type record LsHeaderType { - HeaderType headerType(e_locationService), - HeaderSubTypeLs headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. - * @member headerType - * @member headerSubType - */ - type record TsbHeaderType { - HeaderType headerType(e_topologicallyScopedBroadcast), - HeaderSubTypeTSB headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header subtype for GEOANYCAST. - */ - type enumerated HeaderSubTypeGeoAnycast { - e_geoAnycastCircle(0), - e_geoAnycastRect(1), - e_geoAnycastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for GEOBROADCAST. - */ - type enumerated HeaderSubTypeGeoBroadcast { - e_geoBroadcastCircle(0), - e_geoBroadcastRect(1), - e_geoBroadcastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. - */ - type enumerated HeaderSubTypeTSB { - e_singleHop(0), - e_multiHop(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Location Service LS. - */ - type enumerated HeaderSubTypeLs { - e_lsRequest(0), - e_lsReply(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Service Announcement SA. - */ - type enumerated HeaderSubTypeSa { - e_sa(0), - e_saEos(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header type and the header subtype. - * @member anyHdr - * @member beaconHdr - * @member geoUnicastHdr - * @member geoAnycastHdr - * @member geoBroadcastHdr - * @member tsbHdr - * @member lsHdr - * @member saHdr - * @member reserved - */ - type union HeaderTST { - AnyHeaderType anyHdr, - BeaconHeaderType beaconHdr, - GeoUnicastHeaderType geoUnicastHdr, - GeoAnycastHeaderType geoAnycastHdr, - GeoBroadcastHeaderType geoBroadcastHdr, - TsbHeaderType tsbHdr, - LsHeaderType lsHdr, - UInt8 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of the GeoAdhoc header type (4Bits). - */ - type enumerated HeaderType { - e_any(0), - e_beacon(1), - e_geoUnicast(2), - e_geoAnycast(3), - e_geoBroadcast(4), - e_topologicallyScopedBroadcast(5), - e_locationService(6), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Long Position Vector - * - *
-         *  0               1               2               3
-         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                           GN_ADDR                             |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             TST                               |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             Lat                               |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             Long                              |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |P|              S              |               H               |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.5.2 - * - * @member gnAddr - * @member timestamp_ - * @member latitude - * @member longitude - * @member pai Position Accuracy Indicator - * @member speed - * @member heading - */ - type record LongPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude, - Bit1 pai, - Int15 speed, - UInt16 heading - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Short Position Vector - * - *
-         *  0               1               2               3
-         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                           GN_ADDR                             |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             TST                               |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             Lat                               |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * |                             Long                              |
-         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.5.3 - * - * @member gnAddr - * @member timestamp - * @member latitude - * @member longitude - */ - type record ShortPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddress { - /** - * @desc GeoNetworking address - * - *
-           *  0               1               2               3
-           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-           * |M|  S_T    |       S_CC        |             M_ID              |
-           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-           * |                              M_ID                             |
-           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-           * 
- * - * @see ETSI EN 302 636-4-1 chapter 6.2 - * - * @member typeOfAddress - * @member stationType - * @member mid - */ - type record GN_Address { - TypeOfAddress typeOfAddress, - StationType stationType, - UInt10 reserved, - Oct6 mid - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddressSubtypes { - - /** - * @desc Identifies the ITS station (5Bits). - */ - type enumerated StationType { - e_unknown(0), - e_pedestrian(1), - e_cyclist(2), - e_moped(3), - e_motorcycle(4), - e_passengerCar(5), - e_bus(6), - e_lightTruck(7), - e_heavyTruck(8), - e_trailer(9), - e_specialVehicle(10), - e_tram(11), - e_roadSideUnit(15) - } with { - variant "FIELDLENGTH(5)" //variant "5 bit" - } - - /** - * @desc Distinguish between manually configured - * network address and the initial GeoNetwork address (1Bit). - */ - type enumerated TypeOfAddress { - e_manual(1), - e_initial(0) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - - } // end group geoNetworkingAddressSubtypes - - } // end group geoNetworkingAddress - - } // end group geoNetworkingHeadersSubtypes - - } // end group geoNetworkingExtendedHeaders - - } // end group geoNetworkingHeader - - group geoNwPicsTypes { - - /** - * @desc The GeoUnicast forwarding algorithm. - */ - type enumerated NonAreaForwardingAlgorithm { - e_unspecified(0), - e_greedy(1), - e_cbf(2) - } - - /** - * @desc The GeoBroadcast forwarding algorithm. - */ - type enumerated AreaForwardingAlgorithm { - e_unspecified(0), - e_simple(1), - e_cbf(2), - e_advanced(3) - } - - /** - * @desc GN address configuration method. - */ - type enumerated GnAddressConfigurationMethod { - e_auto(0), - e_managed(1), - e_anonymous(2) - } - - } // end geoNwPicsTypes - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtGnInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the GeoNetworking IUT - * @member utGnInitialize - - * @member utGnTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utGnChangePositionResult - - */ - type union UtGnResults { - boolean utGnInitializeResult, - boolean utGnTriggerResult, - boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - boolean utGnChangePositionResult - } with { - variant "" - } // End of type UtGnResults - - /** - * @desc AutoInterop UpperTester trigger - * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). - */ - type union UtAutoInteropTrigger { - boolean utRadioOnOff - } with { - variant "" - } // End of type UtAutoInteropTrigger - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtGnChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitives for GeoNetworking - * @member geoUnicast - - * @member geoBroadcast - - * @member geoAnycast - - * @member shb - - * @member tsb - - * @member changePosition - - * @member checkPacket - - */ - type union UtGnTrigger { - GenerateGeoUnicastMessage geoUnicast, - GenerateGeoBroadcastMessage geoBroadcast, - GenerateGeoAnycastMessage geoAnycast, - GenerateSHBMessage shb, - GenerateTSBMessage tsb - } with { - variant "" - } - - /** - * @desc UT primitive for IUT to send a GeoUnicast packet - * @member gnAddress Destination of the packet - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoUnicastMessage { - GN_Address gnAddress, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a GeoBroadcast packet - * @member shape Shape of the area - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member area Destination GeoArea - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoBroadcastMessage { - GeoShape shape, - UInt16 lifetime, - TrafficClass trafficClass, - UInt24 reserved, - Area area, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a Geoanycast packet - */ - type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateSHBMessage { - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member nbHops Number of Hops - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateTSBMessage { - UInt8 nbHops, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check Upper Layer message transmission on GN IUT - */ - type record UtGnEventInd { - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT - */ - type record of UtGnEventInd UtGnEventIndList; - - } // end utPrimitives - with { - encode "UpperTester"; - variant "" - } - - group acPrimitives { - - /** - * @desc TA primitives for GeoNetworking - * @member startBeaconing - - * @member stopBeaconing - - * @member startPassBeaconing - - * @member stopPassBeaconing - - * @member startBeaconingMultipleNeighbour - - * @member stopBeaconingMultipleNeighbour - - * @member getLongPosVector - - */ - type union AcGnPrimitive { - AcStartBeaconing startBeaconing, - AcStopBeaconing stopBeaconing, - AcStartPassBeaconing startPassBeaconing, - AcStopPassBeaconing stopPassBeaconing, - AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, - AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, - AcGetLongPosVector getLongPosVector - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcGnResponse { - LongPosVector getLongPosVector, - AcGnResponseFailure failure - } - with { - variant "" - encode(getLongPosVector) "LibItsGeoNetworking" - } - - type record AcGnResponseFailure { - boolean failure - } - - /** - * @desc Primitive for TA to start sending beacons for the test component - * @member beaconHeader Beacon template - */ - type record AcStartBeaconing { - GeoNetworkingPdu beaconPacket - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - } - - /** - * @desc Primitive for TA to stop sending beacons for the test component - */ - type record AcStopBeaconing { - } - - /** - * @desc Primitive for TA to start enqueueing received beacons - * @member beaconHeader Filter - */ - type record AcStartPassBeaconing { - BeaconHeader beaconHeader - } - with { - encode(beaconHeader) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop enqueueing received beacons - */ - type record AcStopPassBeaconing { - } - - /** - * @desc Primitive for TA to start sending beacons for multiple neighbours - * @member beaconHeader Beacon template - * @member numberOfNeighbour Number of neighbours to simulate - */ - type record AcStartBeaconingMultipleNeighbour { - GeoNetworkingPdu beaconPacket, - integer numberOfNeighbour - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop sending beacons for multiple neighbours - */ - type record AcStopBeaconingMultipleNeighbour { - } - - /** - * @desc Primitive for retrieving the position vector corresponding to a specific GN address - * @member gnAddress GN address to be searched - */ - type record AcGetLongPosVector { - GN_Address gnAddress - } - with { - encode(gnAddress) "LibItsGeoNetworking" - }; - - } // end acPrimitives - with { - variant "" - encode "AdapterControl" - } -} -with { - variant "" - encode "LibItsGeoNetworking" - } diff --git a/ttcn/GeoNetworking/module.mk b/ttcn/GeoNetworking/module.mk deleted file mode 100644 index 2db9447c..00000000 --- a/ttcn/GeoNetworking/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsGeoNetworking_EncdecDeclarations.ttcn \ - LibItsGeoNetworking_Functions.ttcn \ - LibItsGeoNetworking_Pics.ttcn \ - LibItsGeoNetworking_Pixits.ttcn \ - LibItsGeoNetworking_Templates.ttcn \ - LibItsGeoNetworking_TestSystem.ttcn \ - LibItsGeoNetworking_TypesAndValues.ttcn \ diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 8b2b26d0..c7650134 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -16,8 +16,8 @@ module LibItsHttp_BinaryMessageBodyTypes { */ // TODO Add here your custom binary import // LibIts - import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; - import from Ieee1609Dot2 language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index d988cfad..45c6df15 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -15,8 +15,8 @@ module LibItsHttp_BinaryTemplates { // TODO Add here your custom binary import // LibIts - import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; - import from Ieee1609Dot2 language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index a2a70803..c1abcf32 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -8,6 +8,7 @@ module LibItsHttp_Functions { // LibHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Pics all; + import from LibItsHttp_Pixits all; import from LibItsHttp_TestSystem all; group http_preambles { @@ -71,6 +72,9 @@ module LibItsHttp_Functions { v_i := v_i + 1; } //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; + if (lengthof(PX_ADDITIONAL_HTTP_HEADERS_KEYS) != 0) { + f_set_headers_list(PX_ADDITIONAL_HTTP_HEADERS_KEYS, PX_ADDITIONAL_HTTP_HEADERS_VALUES, p_headers); + } } // End of function f_init_default_headers_list function f_set_headers_list( diff --git a/ttcn/Http/LibItsHttp_Pixits.ttcn b/ttcn/Http/LibItsHttp_Pixits.ttcn new file mode 100644 index 00000000..037caf7e --- /dev/null +++ b/ttcn/Http/LibItsHttp_Pixits.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_Pixits { + + import from LibItsHttp_TypesAndValues all; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_KEYS := { }; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_VALUES := { }; + +} // End of module LibItsHttp_Pixits diff --git a/ttcn/Http/module.mk b/ttcn/Http/module.mk index 9ac4f5b9..0a2300e5 100644 --- a/ttcn/Http/module.mk +++ b/ttcn/Http/module.mk @@ -8,6 +8,7 @@ sources := LibItsHttp_BinaryMessageBodyTypes.ttcn \ LibItsHttp_JsonTemplates.ttcn \ LibItsHttp_MessageBodyTypes.ttcn \ LibItsHttp_Pics.ttcn \ + LibItsHttp_Pixits.ttcn \ LibItsHttp_Templates.ttcn \ LibItsHttp_TestSystem.ttcn \ LibItsHttp_TypesAndValues.ttcn \ diff --git a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn deleted file mode 100644 index 390e262f..00000000 --- a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn +++ /dev/null @@ -1,56 +0,0 @@ -//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention - -module LibItsIvim_ASN1_IVInamedNumbers { - -import from IVI language "ASN.1:1997" all; - - group IVI_constants { - - const Direction Direction_sameDirection_ := 0; - const Direction Direction_oppositeDirection_ := 1; - const Direction Direction_bothDirections_ := 2; - const Direction Direction_valueNotUsed_ := 3; - - const IviStatus IviStatus_new_ := 0; - const IviStatus IviStatus_update_ := 1; - const IviStatus IviStatus_cancellation_ := 2; - const IviStatus IviStatus_negation_ := 3; - - const IviType IviType_immediateDangerWarningMessages_ := 0; - const IviType IviType_regulatoryMessages_ := 1; - const IviType IviType_trafficRelatedInformationMessages_ := 2; - const IviType IviType_pollutionMessages_ := 3; - const IviType IviType_notTrafficRelatedInformationMessages_ := 4; - - const LaneType LaneType_traffic_ := 0; - const LaneType LaneType_through_ := 1; - const LaneType LaneType_reversible_ := 2; - const LaneType LaneType_acceleration_ := 3; - const LaneType LaneType_deceleration_ := 4; - const LaneType LaneType_leftHandTurning_ := 5; - const LaneType LaneType_rightHandTurning_ := 6; - const LaneType LaneType_dedicatedVehicle_ := 7; - const LaneType LaneType_bus_ := 8; - const LaneType LaneType_taxi_ := 9; - const LaneType LaneType_hov_ := 10; - const LaneType LaneType_hot_ := 11; - const LaneType LaneType_pedestrian_ := 12; - const LaneType LaneType_bikeLane_ := 13; - const LaneType LaneType_median_ := 14; - const LaneType LaneType_striping_ := 15; - const LaneType LaneType_trackedVehicle_ := 16; - const LaneType LaneType_parking_ := 17; - const LaneType LaneType_emergency_ := 18; - const LaneType LaneType_verge_ := 19; - - const LaneStatus LaneStatus_open_ := 0; - const LaneStatus LaneStatus_closed_ := 1; - const LaneStatus LaneStatus_mergeR_ := 2; - const LaneStatus LaneStatus_mergeL_ := 3; - const LaneStatus LaneStatus_mergeLR_ := 4; - const LaneStatus LaneStatus_provisionallyOpen_ := 5; - const LaneStatus LaneStatus_diverging_ := 6; - - } // end IVI_constants - -} // End of module LibItsIvim_ASN1_IVInamedNumbers diff --git a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn deleted file mode 100644 index 1f063f87..00000000 --- a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn +++ /dev/null @@ -1,50 +0,0 @@ -module LibItsIvim_EncdecDeclarations { - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsIvim - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_TestSystem all; - - external function fx_enc_IvimReq (IvimReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_IvimReq (inout bitstring b, out IvimReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_IvimInd (inout bitstring b, out IvimInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_IVIM (IVIM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_IVIM (inout bitstring b, out IVIM p) return integer - with {extension "prototype(sliding) decode(PER)"} -/* - external function fx_enc_IVIM (IVIM p) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -*/ - - external function fx_enc_UtIvimInitialize (UtIvimInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - /* external function fx_enc_UtIvimChangePosition (UtIvimChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"}*/ - - external function fx_enc_UtIvimTrigger (UtIvimTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtIvimUpdate (UtIvimUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtIvimTermination (UtIvimTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtIvimResults (inout bitstring b, out UtIvimResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtIvimEventInd (inout bitstring b, out UtIvimEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsIvim_EncdecDeclarations diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn deleted file mode 100644 index 45de2ac8..00000000 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ /dev/null @@ -1,473 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Functions.ttcn $ - * $Id: LibItsIvim_Functions.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ - * @desc Module containing functions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_VerdictControl all; - import from LibCommon_Time all; - - // LibItsCommon - import from LibItsCommon_Templates all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsIvim - import from ITS_Container language "ASN.1:1997" all; - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsIvim - import from LibItsIvim_TestSystem all; - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_Templates all; - import from LibItsIvim_Pics all; - import from LibItsIvim_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtIvimInitialize p_init) runs on ItsIvim { - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtIvimTrigger p_event - ) runs on ItsIvim return IviIdentificationNumber { - var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimResults v_result; - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimTriggerResult := ? }) -> value v_result { - tc_wait.stop; - v_iviIdentificationNumber := v_result.utIvimTriggerResult.iviIdentificationNumber; - if ( not v_result.utIvimTriggerResult.result ) { - f_selfOrClientSyncAndVerdict("IVIM Trigger failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - - return v_iviIdentificationNumber; - } - - /** - * @desc Updates an event at the application layer - * @param p_event The event to update. - */ - function f_utUpdateEvent( - in template (value) UtIvimUpdate p_event - ) runs on ItsIvim return IviIdentificationNumber { - var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimResults v_result; - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimUpdateResult := ? }) -> value v_result { - tc_wait.stop; - v_iviIdentificationNumber := v_result.utIvimUpdateResult.iviIdentificationNumber; - if ( not v_result.utIvimUpdateResult.result ) { - f_selfOrClientSyncAndVerdict("IVIM Update failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate ivimPort default alts - vc_ivimDefaultActive := true; - - return v_iviIdentificationNumber; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtIvimTermination p_event) runs on ItsIvim { - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimTerminationResult := ? }) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsIvim { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsIvim { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsIvim return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group ivimConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsIvim system ItsIvimSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:ivimPort, system:ivimPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsIvim system ItsIvimSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:ivimPort, system:ivimPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } // End of group ivimConfigurationFunctions - - group altsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsIvim { - [vc_ivimDefaultActive] ivimPort.receive( - mw_ivimInd( - mw_ivimPdu( - mw_ivimStructure - ))) { - log("*** " & testcasename() & ": INFO: IVIM received in default ***"); - vc_ivimReceived := true; - repeat; - } - [vc_ivimDefaultActive] ivimPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsIvim { - var UtIvimEventInd v_event; - [] utPort.receive(UtIvimEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsIvim { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ -// function f_prInitialState(Scenario p_scenario := e_staticPosition) runs on ItsIvim return FncRetCode { -// var FncRetCode v_ret := e_success; -// -// f_utInitializeIut(m_ivimStructureInitialize); -// -// f_prDefault(); -// -// return v_ret; -// } - function f_prInitialState(Scenario p_scenario := e_staticPosition, // TODO: To be removed, not used in IVIM (RSU) - in charstring p_certificate_id := "" - ) runs on ItsIvim return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_IVI_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_ivimStructureInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_ivimStructureInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsIvim { - // Nothing to do - } - - /** - * @desc Postamble including cancellation of an event. - * @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets) - * or at the application layer of the IUT(e_iut). - * @param p_actionId The action ID of the event to be cancelled - */ - function f_poCancelEvent( - in template (value) Trigger p_trigger, - in template (value) IviIdentificationNumber p_iviIdentificationNumber - ) runs on ItsIvim { - var FncRetCode v_ret := e_success; - - if (valueof(p_trigger) == e_ets) { - f_sendIviMessage(valueof(m_ivimStructureCancellation(p_iviIdentificationNumber))); - f_sleep(PX_TNOAC); - } - else { - f_utTerminateEvent(m_utEventCancellation(p_iviIdentificationNumber)); - } - - f_poDefault(); - } - - } // End of group postambles - - group sendFunctions { - - /** - * @desc Sends a IVI message - * @param p_sendMsg The IVI message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendIviMessage( - in template (value) IviStructure p_ivim - ) runs on ItsIvim { - ivimPort.send( - m_ivimReq( - m_ivimStructurePdu( - p_ivim - ) - ) - ); - } - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a IVI message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitIviMessage( - in template (present) IvimInd p_rcvMsg, - out IvimInd p_rcvdMsg - ) runs on ItsIvim { - - tc_ac.start; - alt { - [] ivimPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the IviIdentification number and handles the special case where the - * IviIdentification number reaches the limit of 32768 and will be reset to 0. - * @param p_iviIdentificationNumber The IviIdentification number to increase. - * @return The increased IviIdentification number. - */ - function f_increaseIviIdentificationNumber( - in IviIdentificationNumber p_iviIdentificationNumber - ) return IviIdentificationNumber { - // if maximum number of 32768 reached, reset it to 0 - return ((p_iviIdentificationNumber + 1) mod 32768); - } - - } // End of group miscellaneousFunctions - -} // End of module LibItsIvim_Functions diff --git a/ttcn/IVIM/LibItsIvim_Pics.ttcn b/ttcn/IVIM/LibItsIvim_Pics.ttcn deleted file mode 100644 index 9508c5fc..00000000 --- a/ttcn/IVIM/LibItsIvim_Pics.ttcn +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pics.ttcn $ - * $Id: LibItsIvim_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc IVIM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Pics { - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for IVIM generation - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_GENERATION := true; - - /** - * @desc Support for IVIM update - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_UPDATE := true; - - /** - * @desc Support for IVIM cancellation - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_CANCELLATION := true; - - /** - * @desc Support for IVIM NEGATION - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_NEGATION := true; - - /** - * @desc Support for IVIM RECEPTION - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_RECEPTION := true; - - /** - * @desc Minimum time interval between IVIM generations (in seconds). - * Default value, as per base standard: 4s - * @see ETSI TS 103 191-1 Table A.4 - */ - modulepar float PICS_T_GENIVIMMIN := 4.0; - - /** - * @desc Maximum time interval between IVIM generations (in seconds). - * Default value, as per base standard: 10.0s - * @see ETSI TS 103 191-1 Table A.4 - */ - modulepar float PICS_T_GENIVIMMAX := 10.000; - - /** - * @desc Support for IVIM fragmentation - * @see TODO - */ - modulepar boolean PICS_IVIM_FRAGMENTATION := false; - - /** - * @desc Support for IVIM general container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_GENERAL_CONTAINER := false; - - /** - * @desc Support for IVIM has layout container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_LAYOUT_CONTAINER := false; - - /** - * @desc Support for IVIM has road cfg container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_ROAD_CFG_CONTAINER := false; - - /** - * @desc Support for IVIM has text container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_TEXT_CONTAINER := false; - - /** - * @desc Support for IVIM rscode viennaconv - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_VIENNACONV := false; - - /** - * @desc Support for IVIM rscode ISO14823 - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_ISO14823 := false; - - /** - * @desc Support for IVIM rscode saej2540 - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_SAEJ2540 := false; - - /** - * @desc Support for IVIM rscode anz catalogue - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_ANY_CATALOGUE := false; - -} // End of module LibItsIvim_Pics \ No newline at end of file diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn deleted file mode 100644 index 3f592dd4..00000000 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pixits.ttcn $ - * $Id: LibItsIvim_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ - * @desc IVIM PIXITS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Pixits { - - // LibIts - import from EfcDsrcGeneric language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - /** - * @desc IUT Provider identifier - * Provider description used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Provider PX_PROVIDER := { - countryCode := '0000000000'B, - providerIdentifier := 0 - } - - /** - * @desc IUT IVI identifier - * IVI identification number - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_IVI_ID := 2; - - /** - * @desc IUT ZoneId 1 identifier - * ZoneId 1 used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_ZONEID_1 := 1; - - /** - * @desc IUT ZoneId 2 identifier - * ZoneId 2 used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_ZONEID_2 := 2; - - /** - * @desc IUT LaneId identifier - * LaneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar LanePosition PX_LANE := 1; //innermostDrivingLane(1) - - /** - * @desc IUT RelavanceZoneId identifier - * RelavanceZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_RELAVANCE_ZONEID := 1; - - /** - * @desc IUT DetectionZoneId identifier - * DetectionZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_DETECTION_ZONEID := 1; - - /** - * @desc IUT DriverAwarenesZoneId identifier - * DriverAwarenesZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_DRIVER_AWARENES_ZONEID := 1; - - /** - * @desc IUT LayoutId identifier - * LayoutId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_LAYOUTID := 1; - - /** - * @desc IUT RScode integer variant - * see TpFunction to set the correct value - * used in f_IS_IVI_RCV_SSP_BO_03 and f_IS_IVI_RCV_SSP_BO_04 - * //add others if needed - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_RSCODE_VA := 1; - -} // End of module LibItsIvim_Pixits diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn deleted file mode 100644 index fcc8bb0e..00000000 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ /dev/null @@ -1,1056 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Templates.ttcn $ - * $Id: LibItsIvim_Templates.ttcn 1316 2017-01-03 09:03:43Z garciay $ - * @desc Module containing base template definitions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from AVIAEINumberingAndDataStructures language "ASN.1:1997" all; - import from CITSapplMgmtIDs language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsIvim - import from LibItsIvim_TestSystem all; - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_Pixits all; - import from LibItsIvim_ASN1_IVInamedNumbers all; - - group asn1Constants { - } // End of group asn1Constants - - group primitivesTemplates { - - /** - * @desc Send template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The IVI Message to be sent - */ - template (value) IvimReq m_ivimReq( - in template (value) IVIM p_iviMsg - ) := { - msgOut := p_iviMsg - } // End of template m_ivimReq - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - */ - template (present) IvimInd mw_ivimInd( - template (present) IVIM p_iviMsg := ? - ) := { - msgIn := p_iviMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } // End of template mw_ivimInd - - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template IvimInd mw_ivimIndWithGnParameters( - template (present) IVIM p_iviMsg := ?, - template UInt8 p_gnNextHeader := *, - template UInt8 p_gnHeaderType := *, - template UInt8 p_gnHeaderSubtype := *, - template UInt32 p_gnLifetime := *, - template UInt8 p_gnTrafficClass := * - ) modifies mw_ivimInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } // End of template mw_ivimIndWithGnParameters - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template IvimInd mw_ivimIndWithBtpParameters( - template (present) IVIM p_iviMsg := ?, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_ivimInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - } // End of template mw_ivimIndWithBtpParameters - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template IvimInd mw_ivimIndWithSecurityParameters( - template (present) IVIM p_iviMsg := ?, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := * - ) modifies mw_ivimInd := { - ssp := p_ssp, - its_aid := p_its_aid - } // End of template mw_ivimIndWithSecurityParameters - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - */ - template (value) UtIvimInitialize m_ivimStructureInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } // End of template m_ivimStructureInitialize - - /** - * @desc Send template for Upper Tester Trigger event - * @param p_repetitionInterval Repetition interval (Default: 4 seconds) - * @param p_validFrom Valid From value (Default: omit) - * @param p_validTo Valid To value (Default: omit) - * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) - * @param p_optional_ Optional field (Default: omit) - */ - template (value) UtIvimTrigger m_utTriggerEvent( - template (omit) TimestampIts p_repetitionInterval := c_duration_4sec * 1000, // TimeStampIts in millseconds - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) ZidList p_zoneIds := omit, - template (omit) LanePosition p_laneNumber := omit, - template (omit) RelavanceZidList p_relavanceZoneIds := omit, - template (omit) DetectionZidList p_detectionZoneIds := omit, - template (omit) DriverAwarenesZidList p_driverAwarenesZoneIds := omit, - template (omit) VarLengthNumber p_itsRrid := omit, - template (omit) Direction p_directionGic := omit, - template (omit) integer p_layoutId := omit - ) := { - validFrom := p_validFrom, - validTo := p_validTo, - repetitionInterval := p_repetitionInterval, - zoneIds := p_zoneIds, - laneNumber := p_laneNumber, - relavanceZoneIds := p_relavanceZoneIds, - detectionZoneIds := p_detectionZoneIds, - driverAwarenesZoneIds := p_driverAwarenesZoneIds, - itsRrid := p_itsRrid, - directionGic := p_directionGic, - layoutId := p_layoutId - } // End of template m_utTriggerEvent - - /** - * @desc Send template for Upper Tester event update - * @param p_iviIdentificationNumber The p_iviIVI identification number - * @param p_timeStamp Time stamp value (Default: 2 seconds) - * @param p_validFrom Valid From value (Default: omit) - * @param p_validTo Valid To value (Default: omit) - * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) - */ - template (omit) UtIvimUpdate m_utIvimUpdateEvent( - template (value) IviIdentificationNumber p_iviIdentificationNumber, - template (omit) TimestampIts p_timeStamp := c_duration_2sec * 1000, // TimeStampIts in millseconds - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit - ) := { - iviIdentificationNumber := p_iviIdentificationNumber, - validFrom := p_validFrom, - validTo := p_validTo, - timeStamp := p_timeStamp, - connectedIviStructures := p_connectedIviStructures - } // End of template m_utIvimUpdateEvent - - /** - * @desc Send template for Upper Tester event cancellation - * @param p_actionId The action id - */ - template (value) UtIvimTermination m_utEventCancellation( - template (value) IviIdentificationNumber p_iviIdentificationNumber - ) := { - iviIdentificationNumber := p_iviIdentificationNumber - } // End of template m_utEventCancellation - - } // End of group utPrimitives - - } // End of group primitivesTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current IVI protocol version) - * @param p_messageID The message Id (Default: IVI message id) - */ - template (value) ItsPduHeader m_itsPduHeader( - template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } // End of template m_itsPduHeader - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current IVI protocol version) - * @param p_messageID The expected message id (Default: IVI message id) - */ - template (present) ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } // End of template mw_itsPduHeader - - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group ivimPduTemplates { - - /** - * @desc Send template for IVIM PDU - * @param p_ivim The IVI Message - */ - template (value) IVIM m_ivimStructurePdu( - template (value) IviStructure p_ivim - ) := { - header := m_itsPduHeader, - ivi := p_ivim - } // End of template m_ivimStructurePdu - - /** - * @desc Default receive template for IVIM PDU - * @param p_itsPduHeader The expected ITS PDU header (Default: any) - * @param p_ivim The expected IVI Message (Default: any) - */ - template (present) IVIM mw_anyIvimPdu( - template (present) ItsPduHeader p_itsPduHeader := ?, - template (present) IviStructure p_ivim := ? - ) := { - header := p_itsPduHeader, - ivi := p_ivim - } // End of template mw_anyIvimPdu - - /** - * @desc Receive template for IVIM PDU - * @param p_ivim The expected IVI Message - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current IVI protocol version) - * @param p_messageID The expected message id (Default: IVI message id) - */ - template (present) IVIM mw_ivimPdu( - template (present) IviStructure p_ivim := ?, - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), - ivi := p_ivim - } // End of template mw_ivimPdu - - } // End of group ivimPduTemplates - - group iviStructureTemplates { - - /** - * @desc Send template for IVI Message - * @param p_mandatory The Management Container - * @param p_optional_ A list of IVI Container (Default: omit) - */ - template (omit) IviStructure m_ivimStructure( - in template (value) IVIManagementContainer p_mandatory, - in template (omit) IviStructure.optional_ p_optional_ := omit - ) := { - mandatory := p_mandatory, - optional_ := p_optional_ - } // End of template m_ivimStructure - - /** - * @desc Receive template for IVI Message - * @param p_mandatory The Management Container - * @param p_optional_ A list of IVI Container (Default: omit) - */ - template (present) IviStructure mw_ivimStructure( - template (present) IVIManagementContainer p_mandatory := ?, - template IviStructure.optional_ p_optional_ := * - ) := { - mandatory := p_mandatory, - optional_ := p_optional_ - } // End of template mw_ivimStructure - - /** - * @desc Send template for DEN Message for event termination. - * @param p_iviIdentificationNumber The IVIM identification number - */ - template (value) IviStructure m_ivimStructureCancellation( - in template (value) IviIdentificationNumber p_iviIdentificationNumber - ) := { - mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), IviStatus_cancellation_)), - optional_ := omit - } // End of template m_ivimStructureCancellation - - } // End of group iviStructureTemplates - - group iviManagementContainerGroup { - - /** - * @desc Send template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - */ - template (omit) IVIManagementContainer m_iviManagementContainer( - in template (value) Provider p_serviceProviderId, - in template (value) IviIdentificationNumber p_iviIdentificationNumber, - in template (value) IviStatus p_iviStatus, - in template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, - in template (omit) IVIManagementContainer.timeStamp p_timeStamp := f_getCurrentTime() - ) := { - serviceProviderId := p_serviceProviderId, - iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := p_timeStamp, - validFrom := omit, - validTo := omit, - connectedIviStructures := p_connectedIviStructures, - iviStatus := p_iviStatus - } // End of template m_iviManagementContainer - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - */ - template (present) IVIManagementContainer mw_iviManagementContainer( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ? - ) := { - serviceProviderId := p_serviceProviderId, - iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := *, - validFrom := *, - validTo := *, - connectedIviStructures := *, - iviStatus := p_iviStatus - } // End of template mw_iviManagementContainer - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_timeStamp Time stamp value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_timestamp( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_timeStamp := ? - ) modifies mw_iviManagementContainer := { - timeStamp := p_timeStamp - } // End of template mw_iviManagementContainer_timestamp - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_validTo Valid To value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_validTo( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_validTo := ? - ) modifies mw_iviManagementContainer := { - validTo := p_validTo - } // End of template mw_iviManagementContainer_validTo - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_validFrom Valid From value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_validFrom( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_validFrom := ? - ) modifies mw_iviManagementContainer := { - validFrom := p_validFrom - } // End of template mw_iviManagementContainer_validFrom - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_connectedIviStructures The IVIM connectedIviStructures - */ - template (present) IVIManagementContainer mw_iviManagementContainer_connectedIviStructures( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := ? - ) modifies mw_iviManagementContainer := { - connectedIviStructures := p_connectedIviStructures - } // End of template mw_iviManagementContainer - - /** - * @desc Receive template for Porvide identifier - * @param p_countryCode Country code value - * @param p_providerIdentifier Provider Identifier value - */ - template (present) Provider mw_provider( - template (present) CountryCode p_countryCode := ?, - template (present) AVIAEIIssuerIdentifier p_providerIdentifier := ? - ) := { - countryCode := p_countryCode, - providerIdentifier := p_providerIdentifier - } // End of template mw_provider - - } // End of group iviManagementContainerGroup - - group connectedIviStructuresGroup { - - } // End of group connectedIviStructuresGroup - - group iviContainerGroup { - - template (value) IviContainer m_iviContainer_geographicLocationContainer( - in template (value) GeographicLocationContainer p_glc - ) := { - glc := p_glc - } // End of template m_iviContainer_geographicLocationContainer - - template (present) IviContainer mw_iviContainer_geographicLocationContainer( - template (present) GeographicLocationContainer p_glc := ? - ) := { - glc := p_glc - } // End of template mw_iviContainer_geographicLocationContainer - - template (value) IviContainer m_iviContainer_generalIviContainer( - in template (value) GeneralIviContainer p_giv - ) := { - giv := p_giv - } // End of template m_iviContainer_generalIviContainer - - template (present) IviContainer mw_iviContainer_generalIviContainer( - template (present) GeneralIviContainer p_giv := ? - ) := { - giv := p_giv - } // End of template mw_iviContainer_generalIviContainer - - template (value) IviContainer m_iviContainer_roadConfigurationContainer( - in template (value) RoadConfigurationContainer p_rcc - ) := { - rcc := p_rcc - } // End of template m_iviContainer_roadConfigurationContainer - - template (present) IviContainer mw_iviContainer_roadConfigurationContainer( - template (present) RoadConfigurationContainer p_rcc := ? - ) := { - rcc := p_rcc - } // End of template mw_iviContainer_roadConfigurationContainer - - template (value) IviContainer m_iviContainer_textContainer( - in template (value) TextContainer p_tc - ) := { - tc := p_tc - } // End of template m_iviContainer_textContainer - - template (present) IviContainer mw_iviContainer_textContainer( - template (present) TextContainer p_tc := ? - ) := { - tc := p_tc - } // End of template mw_iviContainer_textContainer - - template (value) IviContainer m_iviContainer_layoutContainer( - in template (value) LayoutContainer p_lac - ) := { - lac := p_lac - } // End of template m_iviContainer_layoutContainer - - template (present) IviContainer mw_iviContainer_layoutContainer( - template (present) LayoutContainer p_lac := ? - ) := { - lac := p_lac - } // End of template mw_iviContainer_layoutContainer - - } // End of group iviContainerGroup - - group geographicLocationContainerGroup { - - template (value) GeographicLocationContainer m_geographicLocationContainer( - in template (value) ReferencePosition p_referencePosition, - in template (value) GeographicLocationContainer.parts p_parts - ) := { - referencePosition := p_referencePosition, - referencePositionTime := omit, - referencePositionHeading := omit, - referencePositionSpeed := omit, - parts := p_parts - } // End of template m_geographicLocationContainer - - template (present) GeographicLocationContainer mw_geographicLocationContainer( - template (present) ReferencePosition p_referencePosition := ?, - template (present) GeographicLocationContainer.parts p_parts := ? - ) := { - referencePosition := p_referencePosition, - referencePositionTime := *, - referencePositionHeading := *, - referencePositionSpeed := *, - parts := p_parts - } // End of template mw_geographicLocationContainer - - template (omit) GlcPart m_glcPart( - in template (value) Zid p_zoneId, - in template (omit) LanePosition p_laneNumber := omit, - in template (omit) GlcPart.zoneExtension p_zoneExtension := omit, - in template (omit) HeadingValue p_zoneHeading := omit, - in template (omit) Zone p_zone := omit - ) := { - zoneId := p_zoneId, - laneNumber := p_laneNumber, - zoneExtension := p_zoneExtension, - zoneHeading := p_zoneHeading, - zone := p_zone - } // End of template m_glcPart - - template GlcPart mw_glcPart( - template (present) Zid p_zoneId := ?, - template LanePosition p_laneNumber := *, - template GlcPart.zoneExtension p_zoneExtension := *, - template HeadingValue p_zoneHeading := *, - template Zone p_zone := * - ) := { - zoneId := p_zoneId, - laneNumber := p_laneNumber, - zoneExtension := p_zoneExtension, - zoneHeading := p_zoneHeading, - zone := p_zone - } // End of template mw_glcPart - - template (value) ReferencePosition m_referencePosition( - in template (value) Latitude p_latitude := 10000, - in template (value) Longitude p_longitude := 10000, - in template (value) PosConfidenceEllipse p_position, - in template (value) Altitude p_altitude - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := p_position, - altitude := p_altitude - } // End of template m_referencePosition - - template (value) ReferencePosition m_referencePosition_sample( - in template (value) Latitude p_latitude := 10000, - in template (value) Longitude p_longitude := 10000 - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := - { - semiMajorConfidence := 1000, - semiMinorConfidence := 1000, - semiMajorOrientation := 1000 - }, - altitude := - { - altitudeValue := 10000, - altitudeConfidence := alt_000_01//unavailable - } - } // End of template m_referencePosition - - template Zone m_zone_segment( - template (value) Segment p_segment := m_segment - ) := { - segment := p_segment - } // End of template m_zone_segment - - template Zone m_zone_polygonalLine( - template (value) PolygonalLine p_area := m_polygonalLine_deltaPositions - ) := { - area := p_area - } // End of template m_zone_polygonalLine - - template Segment m_segment( - template (value) PolygonalLine p_line := m_polygonalLine_deltaPositions, - template (omit) IVILaneWidth p_laneWidth := omit - ) := { - line := p_line, - laneWidth := p_laneWidth - } // End of template m_segment - - template PolygonalLine m_polygonalLine_deltaPositions( - template (value) PolygonalLine.deltaPositions p_deltaPositions := {m_deltaPosition} - ) := { - deltaPositions := p_deltaPositions - } // End of template m_segment - - template DeltaPosition m_deltaPosition( - template (value) DeltaLatitude p_deltaLatitude := 9997, - template (value) DeltaLongitude p_deltaLongitude := 9998 - ) := { - deltaLatitude := p_deltaLatitude, - deltaLongitude := p_deltaLongitude - } // End of template m_segment - - - - } // End of group geographicLocationContainerGroup - - group generalIviContainerGroup { - - template (value) GicPart m_gicPart_basic( - in template (value) IviType p_iviType, - in template (value) GicPart.roadSignCodes p_roadSignCodes - ) := { - detectionZoneIds := omit, - its_Rrid := omit, - relevanceZoneIds := omit, - direction := omit, - driverAwarenessZoneIds := omit, - minimumAwarenessTime := omit, - applicableLanes := omit, - iviType := p_iviType, - iviPurpose := omit, - laneStatus := omit, - vehicleCharacteristics := omit, - driverCharacteristics := omit, - layoutId := omit, - preStoredlayoutId := omit, - roadSignCodes := p_roadSignCodes, - extraText := omit - } // End of template m_gicPart_basic - - template (value) GicPart m_gicPart_relavanceZoneId( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID} - ) modifies m_gicPart_basic:= { - relevanceZoneIds := p_relevanceZoneIds, - iviType := p_iviType, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId - - template (value) GicPart m_gicPart_relavanceZoneId_detectionZoneId_direction( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID}, - in template (value) GicPart.detectionZoneIds p_detectionZoneIds := {PX_DETECTION_ZONEID}, - in template (value) GicPart.direction p_direction := Direction_sameDirection_ - ) modifies m_gicPart_basic:= { - detectionZoneIds := p_detectionZoneIds, - relevanceZoneIds := p_relevanceZoneIds, - direction := p_direction, - iviType := p_iviType, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId_detectionZoneId_direction - - template (value) GicPart m_gicPart_laneStatus( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.laneStatus p_laneStatus := LaneStatus_open_ - ) modifies m_gicPart_basic:= { - iviType := p_iviType, - laneStatus := p_laneStatus, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId - - template (present) GicPart mw_gicPart_basic( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ? - ) := { - detectionZoneIds := *, - its_Rrid := *, - relevanceZoneIds := *, - direction := *, - driverAwarenessZoneIds := *, - minimumAwarenessTime := *, - applicableLanes := *, - iviType := p_iviType, - iviPurpose := *, - laneStatus := *, - vehicleCharacteristics := *, - driverCharacteristics := *, - layoutId := *, - preStoredlayoutId := *, - roadSignCodes := p_roadSignCodes, - extraText := * - } // End of template mw_gicPart - - template (present) GicPart mw_gicPart_layoutId( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ?, - template (present) integer p_layoutId := ? - ) modifies mw_gicPart_basic := { - layoutId := p_layoutId - } // End of template mw_gicPart_layoutId - - template (present) GicPart mw_gicPart_allZoneIdsAndItsRridAndDirection( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ?, - template GicPart.detectionZoneIds p_detectionZoneIds := *, - template VarLengthNumber p_varLengthNumber := *, - template GicPart.relevanceZoneIds p_relevanceZoneIds := *, - template Direction p_direction := *, - template GicPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := * - ) modifies mw_gicPart_basic := { - detectionZoneIds := p_detectionZoneIds, - its_Rrid := p_varLengthNumber, - relevanceZoneIds := p_relevanceZoneIds, - direction := p_direction, - driverAwarenessZoneIds := p_driverAwarenessZoneIds - } // End of template mw_gicPart - - template (present) RSCode mw_rSCode( - template RSCode.layoutComponentId p_layoutComponentId := *, - template (present) RSCode.code p_code := ? - ) := { - layoutComponentId := p_layoutComponentId, - code := p_code - } // End of template mw_rSCode - - template (present) RSCode mw_rSCode_viennaConvention( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - viennaConvention := ? - } - } // End of template mw_rSCode_viennaConvention - - template (present) RSCode mw_rSCode_iso14823( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - iso14823 := ? - } - } // End of template mw_rSCode_iso14823 - - template (present) RSCode mw_rSCode_itisCodes( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - itisCodes := ? - } - } // End of template mw_rSCode_itisCodes - - template (present) RSCode mw_rSCode_anyCatalogue( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - anyCatalogue := ? - } - } // End of template mw_rSCode_anyCatalogue - - template (value) RSCode m_rSCode_itisCodes := { - layoutComponentId := omit, - code := { - itisCodes := 100 - } - } // End of template m_rSCode_itisCodes - - template (value) RSCode m_rSCode_viennaConvention := { - layoutComponentId := omit, - code := { - viennaConvention := - { - roadSignClass := 1, // classB (1), - roadSignCode := 2, //INTEGER (1..64), - vcOption := 1, //a(1), - validity := omit, - value_ := omit, - unit := omit - } - } - } // End of template m_rSCode_viennaConvention - - template (value) RSCode m_rSCode_iso14823_trafficSignPictogram ( - template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.trafficSignPictogram p_trafficSignPictogram := dangerWarning - ):= { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - trafficSignPictogram := p_trafficSignPictogram - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_trafficSignPictogram - - template (value) RSCode m_rSCode_iso14823_publicFacilitiesPictogram := { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - publicFacilitiesPictogram := publicFacilities - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_publicFacilitiesPictogram - - template (value) RSCode m_rSCode_iso14823_ambientOrRoadConditionPictogram ( - template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.ambientOrRoadConditionPictogram p_ambientOrRoadConditionPictogram := ambientCondition - ):= { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - ambientOrRoadConditionPictogram := p_ambientOrRoadConditionPictogram - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_ambientOrRoadConditionPictogram - - } // End of group generalIviContainerGroup - - group layoutContainerGroup { - - template (value) LayoutContainer m_layoutContainer( - in template (value) LayoutContainer.layoutComponents p_layoutComponents := {m_layoutComponent} - ) := { - layoutId := 1, - height := omit, - width := omit, - layoutComponents := p_layoutComponents - } // End of template m_tcPart_basic - - template (present) LayoutContainer mw_layoutContainer( - template (present) LayoutContainer.layoutComponents p_layoutComponents := ? - ) := { - layoutId := ?, - height := *, - width := *, - layoutComponents := p_layoutComponents - } // End of template mw_tcPart_basic - - template (value) LayoutComponent m_layoutComponent := { - layoutComponentId := 1, - height := 10, - width := 11, - x := 12, - y := 13, - textScripting := 1 - } // End of template m_layoutComponent - - } //end group layoutContainerGroup - - group roadConfigurationContainerGroup { - - template (value) RccPart m_rccPart( - in template (value) RccPart.zoneIds p_zoneIds, - in template (value) RoadType p_roadType, - in template (value) RccPart.laneConfiguration p_laneConfiguration - ) := { - zoneIds := p_zoneIds, - roadType := p_roadType, - laneConfiguration := p_laneConfiguration - } // End of template m_rccPart - - template (present) RccPart mw_rccPart( - template (present) RccPart.zoneIds p_zoneIds := ?, - template (present) RoadType p_roadType := ?, - template (present) RccPart.laneConfiguration p_laneConfiguration := ? - ) := { - zoneIds := p_zoneIds, - roadType := p_roadType, - laneConfiguration := p_laneConfiguration - } // End of template mw_rccPart - - template (present) LaneInformation mw_laneInformation( - template (present) LanePosition p_lanePosition := ?, - template (present) Direction p_direction := ?, - template (present) LaneType p_laneType := ?, - template (present) LaneStatus p_laneStatus := ? - ) := { - laneNumber := p_lanePosition, - direction := p_direction, - validity := *, //DTM - laneType := p_laneType, - laneTypeQualifier := *, //CompleteVehicleCharacteristics - laneStatus := p_laneStatus, - laneWidth := * //IVILaneWidth - } - - template (value) LaneInformation m_laneInformation( - template (value) LanePosition p_lanePosition := LanePosition_innerHardShoulder_, - template (value) Direction p_direction := Direction_sameDirection_, - template (value) LaneType p_laneType := LaneType_traffic_, - template (value) LaneStatus p_laneStatus := LaneStatus_open_ - ) := { - laneNumber := p_lanePosition, - direction := p_direction, - validity := omit, //DTM - laneType := p_laneType, - laneTypeQualifier := omit, //CompleteVehicleCharacteristics - laneStatus := p_laneStatus, - laneWidth := omit //IVILaneWidth - } - - } // End of group roadConfigurationContainerGroup - - group textContainerGroup { - - template (value) TcPart m_tcPart_basic( - in template (value) TcPart.relevanceZoneIds p_relevanceZoneIds, - in template (value) TcPart.data p_data - ) := { - detectionZoneIds := omit, - relevanceZoneIds := p_relevanceZoneIds, - direction := omit, - driverAwarenessZoneIds := omit, - minimumAwarenessTime := omit, - applicableLanes := omit, - layoutId := omit, - preStoredlayoutId := omit, - text := omit, - data := p_data - } // End of template m_tcPart_basic - - template (present) TcPart mw_tcPart_basic( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ? - ) := { - detectionZoneIds := *, - relevanceZoneIds := p_relevanceZoneIds, - direction := *, - driverAwarenessZoneIds := *, - minimumAwarenessTime := *, - applicableLanes := *, - layoutId := *, - preStoredlayoutId := *, - text := *, - data := p_data - } // End of template mw_tcPart_basic - - template (present) TcPart mw_tcPart_allZoneIds( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.detectionZoneIds p_detectionZoneIds := ?, - template (present) TcPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := ? - ) modifies mw_tcPart_basic := { - detectionZoneIds := p_detectionZoneIds, - driverAwarenessZoneIds := p_driverAwarenessZoneIds - } // End of template mw_tcPart_allZoneIds - - template (present) TcPart mw_tcPart_direction( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.direction p_direction := ? - ) modifies mw_tcPart_basic := { - relevanceZoneIds := p_relevanceZoneIds - } // End of template mw_tcPart_direction - - template (present) TcPart mw_tcPart_text( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.text p_text := ? - ) modifies mw_tcPart_basic := { - text := p_text - } // End of template mw_tcPart_text - - template (present) TcPart mw_tcPart_layoutId( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.layoutId p_layoutId := ? - ) modifies mw_tcPart_basic := { - layoutId := p_layoutId - } // End of template mw_tcPart_layoutId - - template (present) Text mw_text := { - layoutComponentId := *, - language_ := ?, - textContent := ? - } - - } // End of group textContainerGroup - - group itsFunction { - - /** - * @desc Gets the Provifr of test system - * @return Test system's Provider value - * @see PX_PROVIDER - */ - function f_getProvider() - return Provider { - - return PX_PROVIDER; - - } // End of function f_getProvider - - } // End of group itsFunction - -} // End of module LibItsIvimTemplates diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn deleted file mode 100644 index 1808ecf9..00000000 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TestSystem.ttcn $ - * $Id: LibItsIvim_TestSystem.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ - * @desc Test System module for ITS IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsIvim - import from LibItsIvim_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtIvimInitialize, UtIvimTrigger, UtIvimUpdate, UtIvimTermination; - in - UtIvimResults, UtIvimEventInd; - } // end UpperTesterPort - - } // end portDefinitions - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) - */ - type port IvimPort message { - in IvimInd; - out IvimReq; - } // End of port IvimPort - - } // End of group fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsIvimSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port IvimPort ivimPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsIvim extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - - // FA1 ports - port IvimPort ivimPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - var SequenceNumber vc_sequenceNo := 0; - var boolean vc_ivimReceived := false; - - var UtIvimEventIndList vc_utEvents := {}; - - var boolean vc_ivimDefaultActive := true; - } // End of component ItsIvim - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 IVIM Indication Primitive - * - * @member ivimMsg - */ - type record IvimInd { - IVIM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 IVIM Request Primitive - * - * @member ivimMsg - */ - type record IvimReq { - IVIM msgOut - } - with { - encode (msgOut) "PER" - } - - } // End of group fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsIvim_TestSystem - - diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn deleted file mode 100644 index cb16e7f9..00000000 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ /dev/null @@ -1,203 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn $ - * $Id: LibItsIvim_TypesAndValues.ttcn,v 1.4 2019/01/02 14:14:11 dte Exp $ - * @desc Module containing type and value definitions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_TypesAndValues { - - // LibCommon - import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - import from CITSapplMgmtIDs language "ASN.1:1997" all; - - group actionTypes { - - /** - * @desc Indication of whether event cancellation has to be raised by the test system or iut - */ - type enumerated Trigger { - e_ets(0), - e_iut(1) - } - - } // End ofgroup actionTypes - - group ivimConstants { - - const TimestampIts c_repetition_interval_deactivated := 0; - const TimestampIts c_duration_2sec := 2; // FIXME Change them into milliseconds and remove *1000 factor in Tp & Template (default values) - const TimestampIts c_duration_4sec := 4; - const TimestampIts c_duration_6sec := 6; - - type record of float Times; - } // End ofgroup ivimConstants - - group otherTypes { - - /** - * @desc List of UtIvimTriggers used in behaviours - */ - type record of UtIvimTrigger UtIvimTriggerList; - - /** - * @desc List of IviIdentificationNumbers used in behaviours - */ - type record of IviIdentificationNumber IviIdentificationNumberList; - - /** - * @desc List of ZoneIds - */ - type record of Zid ZidList; - - /** - * @desc List of RelavanceZoneIds - */ - type record of Zid RelavanceZidList; - - /** - * @desc List of DetectionZoneIds - */ - type record of Zid DetectionZidList; - - /** - * @desc List of DriverAwarenesZoneIds - */ - type record of Zid DriverAwarenesZidList; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtIvimInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the IVIM IUT - * @member utIvimInitialize - - * @member utIvimTriggerResult - - * @member utIvimUpdateResult, - - * @member utIvimTerminationResult - - */ - type union UtIvimResults { - boolean utIvimInitializeResult, - UtIvimTriggerResult utIvimTriggerResult, - UtIvimUpdateResult utIvimUpdateResult, - boolean utIvimTerminationResult - } with { - variant "" - } // End of type UtIvimResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtIvimTrigger { - TimestampIts validFrom optional, - TimestampIts validTo optional, - TimestampIts repetitionInterval optional, - ZidList zoneIds optional, - LanePosition laneNumber optional, - RelavanceZidList relavanceZoneIds optional, - DetectionZidList detectionZoneIds optional, - DriverAwarenesZidList driverAwarenesZoneIds optional, - VarLengthNumber itsRrid optional, - Direction directionGic optional, - integer layoutId optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtIvimTriggerResult { - boolean result, - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to update an event at IUT - */ - type record UtIvimUpdate { - IviIdentificationNumber iviIdentificationNumber, - TimestampIts validFrom optional, - TimestampIts validTo optional, - TimestampIts timeStamp optional, // FIXME Rename timeStamp into repetitionInterval as described in ETSI TR 103 099 Clause C.9.2 UpdateIvimEvent - IVIManagementContainer.connectedIviStructures connectedIviStructures optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of an update request of an event on Ivim IUT - */ - type record UtIvimUpdateResult { - boolean result, - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request the termination of an event at IUT - */ - type record UtIvimTermination { - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of termination of an event on Ivim IUT - */ - //type boolean UtIvimTerminationResult; - - /** - * @desc Upper Tester message to check event/status on Ivim IUT - */ - type record UtIvimEventInd { - IVIM iviMsg - } with { - encode (iviMsg) "LibItsIvim_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on Ivim IUT - */ - type record of UtIvimEventInd UtIvimEventIndList; - - /** - * @desc List of ActionID received in response to the Upper Tester triggered messages - */ - type record of ActionID UtIvimActionIDList; - - } - with { - encode "UpperTester" - variant "" - } -} -with { - encode "LibItsIvim" -} - - diff --git a/ttcn/IVIM/module.mk b/ttcn/IVIM/module.mk deleted file mode 100644 index 72982712..00000000 --- a/ttcn/IVIM/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := LibItsIvim_ASN1_IVInamedNumbers.ttcn \ - LibItsIvim_EncdecDeclarations.ttcn \ - LibItsIvim_Functions.ttcn \ - LibItsIvim_Pics.ttcn \ - LibItsIvim_Pixits.ttcn \ - LibItsIvim_Templates.ttcn \ - LibItsIvim_TestSystem.ttcn \ - LibItsIvim_TypesAndValues.ttcn diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn deleted file mode 100644 index 0ccedc01..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn +++ /dev/null @@ -1,11 +0,0 @@ -module LibItsIpv6OverGeoNetworking_EncdecDeclarations { - - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - - external function fx_enc_Ipv6Packet (Ipv6Packet p) return bitstring - with {extension "prototype(convert) encode(LibItsIpv6OverGeoNetworking)"} - - external function fx_dec_Ipv6Packet (inout bitstring b, out Ipv6Packet p) return integer - with {extension "prototype(sliding) decode(LibItsIpv6OverGeoNetworking)"} - -} // End of module LibItsIpv6OverGeoNetworking_EncdecDeclarations diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn deleted file mode 100644 index 5a52ae09..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ /dev/null @@ -1,761 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing functions for Ipv6OverGeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_TextStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_Functions all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsIpv6OverGeoNetworking_Templates all; - import from LibItsIpv6OverGeoNetworking_Pixits all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group ipv6OverGeoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - three GVLs - */ - function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { - - // Variables - var float v_distance; - - // Map - map(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); - - f_cf01Up(); - v_distance := f_distance(f_getPosition(c_compNodeB), f_getPosition(c_compIut)); - - // Compute IPv6 addresses - f_addAddresses(vc_addressTable, c_compIut); - f_addAddresses(vc_addressTable, c_compNodeA); - f_addAddresses(vc_addressTable, c_compNodeB); - - // Create additional areas - f_addArea(vc_areaTable, c_gvlArea1, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.1 * v_distance))); - f_addArea(vc_areaTable, c_gvlArea2, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.2 * v_distance))); - f_addArea(vc_areaTable, c_gvlArea3, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.3 * v_distance))); - - // Create GVLs - f_addGvl(c_gvl1_name, f_getPrefix(1), f_getPrefixLength(1), c_gvlArea1, ""); - f_addGvl(c_gvl2_name, f_getPrefix(2), f_getPrefixLength(2), c_gvlArea2, ""); - f_addGvl(c_gvl3_name, f_getPrefix(3), f_getPrefixLength(3), c_gvlArea3, ""); - - - } // end f_cf01Up - - /** - * @desc Deletes configuration cf01Gn6 - */ - function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { - - // Map - unmap(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); - - f_cf01Down(); - - } // end f_cf01Down - - } // end group ipv6OverGeoConfigurationFunctions - - group ipv6OverGeoNwAltsteps { - - /** - * @desc IPv6 default. - */ - altstep a_ipv6Default() runs on ItsIpv6OverGeoNetworking { - var GeoNetworkingInd v_geoNwInd; - - [] geoNetworkingPort.receive ( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - ?, - ?, - e_ipv6, - ?// FIXME Check that we have an IPv6Payload mw_octetstringPayload - ) - ) - ) - ) { - log("*** " & testcasename() & ": INFO: Ignoring unsupported IPv6 packet ***"); - repeat; - } - [] geoNetworkingPort.receive ( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - ?, - ?, - e_ipv6, - ? - ) - ) - ) - ) -> value v_geoNwInd { - if (match( - v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.geoBroadcastHeader.srcPosVector, - ( - mw_longPosVectorPosition(f_getPosition(c_compNodeA)), - mw_longPosVectorPosition(f_getPosition(c_compNodeB)) - ) - )) { - log("*** " & testcasename() & ": INFO: Ignoring rebroadcasted IPv6 packet ***"); - repeat; - } - else { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - [] ipv6OverGeoNetworkingPort.receive( - mw_ipv6OverGeoNwInd( - ?, - ?, - c_macBroadcastAddr, - ? // Refine rtAdv - ) - ) { - log("*** " & testcasename() & ": INFO: Ignoring Router Advertisement ***"); - repeat; - } - - } // end a_ipv6Default - - } // end ipv6OverGeoNwAltsteps - - group preambles { - - /** - * @desc Preamble for IPv6 neighbour nodes - */ - function f_prIpv6Neighbour() runs on ItsIpv6OverGeoNetworking { - f_prNeighbour(); - activate(a_ipv6Default()); - } - - /** - * @desc Preamble to configure the GVLs, either manual or via RA - * @param p_gvls The GVLs to configure - * @param p_validLifetimes The specific invalidation timer for the GVLs - */ - function f_prConfigureGVL( - in GvlIdxList p_gvls, - in template (omit) UInt32List p_validLifetimes := omit - ) runs on ItsIpv6OverGeoNetworking - return FncRetCode { - var integer i; - var charstring v_str := ""; - var UInt32 v_validLifetime := c_validLifetime30s; - - if (lengthof(vc_gvlTable)=(i+1)) { - v_validLifetime := valueof(p_validLifetimes[i]); - } - f_sendGeoBroadcastWithRtAdv(vc_gvlTable[i], c_compNodeA, v_validLifetime); - } - f_sleep(PX_T_BUILD_CONFIG); - } - f_acUpdateInterfaces(); - - return e_success; - } - - } // end preambles - - group postambles { - - /** - * @desc Postamble for neighbour nodes - */ - function f_poIpv6Neighbour() runs on ItsIpv6OverGeoNetworking { - f_poNeighbour(); - } - } // end postambles - - group testAdapter { - - /** - * @desc Retrieve IUT's interface names and associate them with predefined GVLs - */ - function f_acUpdateInterfaces() runs on ItsIpv6OverGeoNetworking { - - var AcGn6Response v_response; - var AcGn6InterfaceInfoList v_interfaceInfoList; - var integer i, j, k; - - acPort.send(m_acGetInterfaceInfos); - tc_ac.start; - alt { - [] acPort.receive(mw_acInterfaceInfos) -> value v_response { - tc_ac.stop; - - v_interfaceInfoList := valueof(v_response.interfaceInfoList); - // Go through interfaceInfos - for(i:=0; i < sizeof(v_interfaceInfoList); i:=i+1) { - // Go through IPv6 addresses configured for this interface - for(j:=0; j < sizeof(v_interfaceInfoList[i].ipv6AddressList); j:=j+1) { - // Compare IPv6 address to recorded GVL prefixes - for(k:=0; k < sizeof(vc_gvlTable); k:=k+1) { - if(f_isIpv6AddressCorrespondingToPrefix( - v_interfaceInfoList[i].ipv6AddressList[j], - vc_gvlTable[k].prefix, - vc_gvlTable[k].prefixLength)) { - // interface i is associated to GVL k - vc_gvlTable[k].interface := v_interfaceInfoList[i].interfaceName; - break; - } - } - if(k >= sizeof(vc_gvlTable)) { - // GVL already found - break; - } - } - } - } - [] acPort.receive { - tc_ac.stop; - log("*** " & testcasename() & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // end group testAdapter - - group sendFunctions { - - /** - * @desc Send a GeoBroadcast containing an IPv6 Router Advertisement - * @param p_gvl Name of the GVL for which the RA is sent - * @param p_compName Name of the component sending this packet - */ - function f_sendGeoBroadcastWithRtAdv( - in template (value) GvlTableEntry p_gvl, - in charstring p_compName, - in UInt32 p_validLifetime := c_validLifetime30s - ) runs on ItsIpv6OverGeoNetworking { - var bitstring v_ipv6Payload; - var AddressTableEntry v_nodeAddresses := f_getAddresses(p_compName); - var LongPosVector v_nodeLongPosVector := f_getPosition(p_compName); - - v_ipv6Payload := encvalue( - m_ipv6Packet( - v_nodeAddresses.lla, - c_allNodesMca, - c_icmpHdr, - m_rtAdvWithOptions( - m_rtAdvOpt_prefixOpt( - p_gvl.prefixLength, - c_lFlag1, - c_aFlag1, - p_validLifetime, - c_preferredLifetime30s, - valueof(p_gvl.prefix) - ) - ) - ) - ); - - f_sendGeoNetMessageWithPayload( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwBroadcastPacket( - v_nodeLongPosVector, - vc_localSeqNumber, - f_getGeoBroadcastArea(valueof(p_gvl.area)) - ) - ) - ), - bit2oct(v_ipv6Payload) - ); - } - - } //end group sendFunctions - - group miscellaneous { - - /** - * @desc Add GVL information in the GVL table - * @param p_gvlKey Name of the GVL - * @param p_prefix IPv6 prefix associated with the GVL - * @param p_prefixLength Prefix length - * @param p_area Name of the GeoArea associated with the GVL - * @param p_interface Name of IUT's virtual interface associated with the GVL - */ - function f_addGvl( - in charstring p_gvlKey, - in Oct16 p_prefix, - in UInt8 p_prefixLength, - in charstring p_area, - in charstring p_interface - ) runs on ItsIpv6OverGeoNetworking { - vc_gvlTable[lengthof(vc_gvlTable)] := { - key := p_gvlKey, - prefix := p_prefix, - prefixLength := p_prefixLength, - area := p_area, - interface := p_interface - }; - } // end f_addGvl - - /** - * @desc Gets the Geographical Virtual link entry associated to an area - * @param p_gvlName Name of the GVL - */ - function f_getGvl(in charstring p_gvlName) runs on ItsIpv6OverGeoNetworking return GvlTableEntry { - var GvlTableEntry v_return; - var integer i := 0; - - for (i:=0; i 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen (max 64 bits) ***"); - return int2oct(0, 8); - } - - //Fill v_prefixReady with existing Prefix - for (i:=0; i 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen ***"); - return '00000000000000000000000000000000'O; - } - - // compute interface ID - v_interfaceIdReady := f_createUniqueInterfaceId(f_getAddresses(p_compName).macAddress); - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & v_interfaceIdReady; - - } // end f_computeGlobalAddress - - /** - * @desc Compute Home Agent anycast address for a prefix - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix - * @return Home Agent anycast address - */ - function f_computeHomeAgentAnycastAddress( - in Oct16 p_prefix, - in UInt8 p_prefixLen - ) return Ipv6Address { - var Oct8 v_haAnycast := 'FDFFFFFFFFFFFFFE'O; - - if (p_prefixLen != 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen ***"); - return '00000000000000000000000000000000'O; - } - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & v_haAnycast; - } // end f_computeHomeAgentAnycastAddress - - /** - * @desc Computes global-scoped unicast-prefix-based multicast Ipv6 address - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix in bits (max 64) - * @param p_groupId Group ID - * @return Global-scoped unicast-prefix-based multicast Ipv6 address - */ - function f_computeGlobalScopedUnicastPrefixBasedMulticastIpv6Address( - in Oct16 p_prefix, - in UInt8 p_prefixLen, - in UInt32 p_groupId - ) return Ipv6Address { - var Oct3 v_leftPart := 'FF3E00'O; - - if (p_prefixLen>64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen, max 64 bits allowed ***"); - return int2oct(0, 16); - } - - return v_leftPart & int2oct(p_prefixLen, 1) & f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & int2oct(p_groupId, 4); - } - - /** - * @desc Computes geographic anycast Ipv6 address - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix in bits (max 64) - * @return Geographic anycast Ipv6 address - */ - function f_computeGeographicAnycastIpv6Address( - in Oct16 p_prefix, - in UInt8 p_prefixLen - ) return Ipv6Address { - var Bit64 v_interfaceIdentifierField := '11111101'B & int2bit(1, 49) & c_itsGn6aslGeoAnycastID; - - if (p_prefixLen>64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen, max 64 bits allowed ***"); - return int2oct(0, 16); - } - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & bit2oct(v_interfaceIdentifierField); - } - - /** - * @desc Gets a predefined prefix - * @param p_index Index of the predefined prefix - * @return IPv6 prefix - * @see PX_GN6_PREFIX_1 - * @see PX_GN6_PREFIX_2 - * @see PX_GN6_PREFIX_3 - */ - function f_getPrefix(in integer p_index) return Oct16 { - - select (p_index) { - case (1) { - return PX_GN6_PREFIX_1; - } - case (2) { - return PX_GN6_PREFIX_2; - } - case (3) { - return PX_GN6_PREFIX_3; - } - } - - return int2oct(0, 16); - - } // end f_getPrefix - - /** - * @desc Gets the length of a predefined prefix - * @param p_index Index of the predefined prefix - * @return length of a prefix - * @see PX_GN6_PREFIX_LENGTH_1 - * @see PX_GN6_PREFIX_LENGTH_2 - * @see PX_GN6_PREFIX_LENGTH_3 - */ - function f_getPrefixLength(in integer p_index) return UInt8 { - - select (p_index) { - case (1) { - return PX_GN6_PREFIX_LENGTH_1; - } - case (2) { - return PX_GN6_PREFIX_LENGTH_2; - } - case (3) { - return PX_GN6_PREFIX_LENGTH_3; - } - } - - return 64; - - } // end f_getPrefixLength - - /** - * @desc Checks whether an IPv6 address belongs to an IPv6 prefix - * @param p_ipv6Address IPv6 address to be checked - * @param p_prefix Prefix - * @param p_prefixLength Length of the prefix - * @return Boolean - True if IPv6 address belongs to prefix, False otherwise - */ - function f_isIpv6AddressCorrespondingToPrefix(Ipv6Address p_ipv6Address, Ipv6Address p_prefix, UInt8 p_prefixLength) - return boolean { - - var bitstring v_ipv6Address := oct2bit(p_ipv6Address); - var bitstring v_prefix := oct2bit(p_prefix); - var integer i; - - for(i:=0; i < p_prefixLength; i:=i+1) { - if(v_ipv6Address[i] != v_prefix[i]) { - return false; - } - } - - return true; - } // end f_isIpv6AddressCorrespondingToPrefix - - /** - * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3 - * @param p_sourceAddress Source address, - * @param p_destinationAddress Destination address - * @param p_payloadLength Upper-Layer Packet Length - * @param p_payload Upper-Layer payload - * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6) - */ - function f_computeIPv6CheckSum( - in template (value) Ipv6Address p_sourceAddress, - in template (value) Ipv6Address p_destinationAddress, - in template (value) integer p_payloadLength, - in template (value) GnRawPayload p_payload, - in template (value) UInt8 p_nextHdr - ) return Oct2 { - var Oct2 v_checksum := 'FFFF'O; - - log("*** " & testcasename() & ": INFO: calling fx_computeIPv6CheckSum() ***"); - v_checksum := fx_computeIPv6CheckSum(valueof(p_sourceAddress), valueof(p_destinationAddress), valueof(p_payloadLength), valueof(p_payload), valueof(p_nextHdr)); - - return v_checksum; - } - - } // end group miscellaneous - - group externalFunctions { - - /** - * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3 - * @param p_sourceAddress Source address, - * @param p_destinationAddress Destination address - * @param p_payloadLength Upper-Layer Packet Length - * @param p_payload Upper-Layer payload - * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6) - * @return The checksum value - *
-         * Pseudo header is defined by RFC 2460 - Clause 8.1
-         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         *  |                                                               |
-         *  +                                                               +
-         *  |                                                               |
-         *  +                         Source Address                        +
-         *  |                                                               |
-         *  +                                                               +
-         *  |                                                               |
-         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         *  |                                                               |
-         *  +                                                               +
-         *  |                                                               |
-         *  +                      Destination Address                      +
-         *  |                                                               |
-         *  +                                                               +
-         *  |                                                               |
-         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         *  |                   Upper-Layer Packet Length                   |
-         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         *  |                      zero                     |  Next Header  |
-         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         * 
- */ - external function fx_computeIPv6CheckSum( - in template (value) Ipv6Address p_sourceAddress, - in template (value) Ipv6Address p_destinationAddress, - in template (value) integer p_payloadLength, - in template (value) GnRawPayload p_payload, - in template (value) UInt8 p_nextHdr - ) return Oct2; - - } // End of group externalFunctions - -} // end LibItsIpv6OverGeoNetworking_Functions \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn deleted file mode 100644 index 5d5efdc3..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc IPv6 Over GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - - group ipv6OverGeoNwPics { - - /** - * @desc Indicates whether the GN6ASL shall resolve the destination link-layer-address - * from the IPv6 address. - * FALSE, perform address resolution, otherwise do not. - * @see ETSI TS 102 859-1 A.10/10 - */ - modulepar boolean PICS_GN6_ASL_VI_RESOL_ADDR := true; - - - } // end ipv6OverGeoNwPics - -} // end LibItsIpv6OverGeoNetworking_Pics \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn deleted file mode 100644 index 68e016f6..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author ETSI / STF405 /STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module parameters for IPv6 over GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - /** - * @desc GVL will be configured manually? - */ - modulepar boolean PX_CONFIG_MANUAL_GVL := false; - - /** - * @desc Time for building the configuration and virtual interfaces dynamically. - */ - modulepar float PX_T_BUILD_CONFIG := 5.0; - - /** - * @desc IPv6 prefix 1 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_1 := '3FFE0000000000010000000000000000'O; - - /** - * @desc IPv6 prefix 2 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_2 := '3FFE0000000000020000000000000000'O; - - /** - * @desc IPv6 prefix 3 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_3 := '3FFE0000000000030000000000000000'O; - - /** - * @desc Length of IPv6 prefix 1 - * @see PX_GN6_PREFIX_1 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_1 := 64; - - /** - * @desc Length of IPv6 prefix 2 - * @see PX_GN6_PREFIX_2 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_2 := 64; - - /** - * @desc Length of IPv6 prefix 3 - * @see PX_GN6_PREFIX_3 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_3 := 64; - - /** - * @desc Name of IUT's virtual interface associated with TVL - */ - modulepar charstring PX_GN6_TVL_INTERFACE_NAME := "tvl0"; - -} \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn deleted file mode 100644 index 70fae63a..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn +++ /dev/null @@ -1,292 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc IPv6 over GeoNetworking Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Templates { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - //LibIts - import from LibItsIpv6OverGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group ipv6OverGeoNwPrimitivesTemplates { - - /** - * @desc Send template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface Which virtual interface to use for sending the packet - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet IPv6 packet to be sent - */ - template (value) IPv6OverGeoNetworkingReq m_ipv6OverGeoNwReq( - template (value) charstring p_interface, - template (value) MacAddress p_srcMacAddr, - template (value) MacAddress p_dstMacAddr, - template (value) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - /** - * @desc Receive template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface On which virtual interface the packet is expected - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet Expected IPv6 packet - */ - template IPv6OverGeoNetworkingInd mw_ipv6OverGeoNwInd( - template (present) charstring p_interface, - template (present) MacAddress p_srcMacAddr, - template (present) MacAddress p_dstMacAddr, - template (present) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - } // ipv6OverGeoNwPrimitivesTemplates - - group ipv6 { - - /** - * @desc Send template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template (value) Ipv6Packet m_ipv6Packet( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr, - in template (omit) Ipv6Payload p_payload - ) := { - ipv6Hdr := m_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Reception template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template Ipv6Packet mw_ipv6Packet( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr, - in template Ipv6Payload p_payload - ) := { - ipv6Hdr := mw_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Send template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template (value) Ipv6Header m_ipv6Header( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := 0, - flowLabel := 0, - payloadLength := 0, //indicates that the adaptation will fill the correct value - nextHeader := p_nextHdr, - hopLimit := 255, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Receive template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template Ipv6Header mw_ipv6Header( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := ?, - flowLabel := ?, - payloadLength := ?, - nextHeader := p_nextHdr, - hopLimit := ?, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_rtAdvWithOptions( - in template (omit) RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := c_2ZeroBytes, //indicates that the adaptation will fill the correct value - curHopLimit := 255, - managedConfigFlag := 0, - otherConfigFlag := 0, - homeAgentFlag := 0, - reserved := 0, - routerLifetime := c_uInt16Max, - reachableTime := c_uInt32Max, - retransTimer := 0, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_rtAdvWithOptions( - in template RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := ?, - curHopLimit := ?, - managedConfigFlag := ?, - otherConfigFlag := ?, - homeAgentFlag := ?, - reserved := ?, - routerLifetime := ?, - reachableTime := ?, - retransTimer := ?, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_octetstringPayload( - in template (value) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_octetstringPayload( - in template (present) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Send template for IPv6 Prefix option - * @param p_prefixLength Length of the prefix. - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preffered life time duration. - * @param p_prefix Address prefix to be used - */ - template RtAdvOptions m_rtAdvOpt_prefixOpt ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):={ - srcLinkLayerAddr := omit, - prefixInfoList := { - m_prefixInfo( - p_prefixLength, - p_lFlag, - p_aFlag, - p_validLifetime, - p_preferredLifetime, - p_prefix - ) - }, - otherOption := omit - } - - /** - * @desc Send template for IPv6 Prefix info - * @param p_prefixLength The length of the prefix - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preferred life time duration. - * @param p_prefix Address prefix to be used - */ - template PrefixInfo m_prefixInfo ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):= { - icmpType:= c_prefixInfo, - optionLength:= c_prefixInfoLen, - prefixLength:= p_prefixLength, - linkFlag:=p_lFlag, - autoConfigFlag:=p_aFlag, - rtAddrFlag := c_rtAddrFlag0, - reserved1:=0, - validLifetime:=p_validLifetime, - preferredLifetime:=p_preferredLifetime, - reserved2:=0, - prefix:= p_prefix - } - - } // end group ipv6 - - group gn6AcPrimitives { - - /** - * @desc TA primitive for querying link-layer interfaces information - */ - template (value) AcGn6Primitive m_acGetInterfaceInfos := { - getInterfaceInfos := 3 - } - - /** - * @desc TA primitive for retrieving link-layer interfaces information - */ - template AcGn6Response mw_acInterfaceInfos := { - interfaceInfoList := ? - } - } // end gn6AcPrimitives - -} // end LibItsIpv6OverGeoNetworking_TypesAndValues \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn deleted file mode 100644 index 88b6998b..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS Ipv6OverGeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; - - // LibIts - import from LibItsGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsIpv6OverGeoNetworkingSystem extends ItsGeoNetworkingSystem { - - // NT2 ports - port IPv6OverGeoNetworkingPort ipv6OverGeoNetworkingPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt2Ports { - - /** - * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/G5) - */ - type port IPv6OverGeoNetworkingPort message { - in IPv6OverGeoNetworkingInd; - out IPv6OverGeoNetworkingReq; - } // end IPv6OverGeoNetworkingPort - - } // End of group nt2Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsIpv6OverGeoNetworking extends ItsGeoNetworking { - - // NT2 ports - port IPv6OverGeoNetworkingPort ipv6OverGeoNetworkingPort; - - // timers - - //variables for Gn6 - var GvlTable vc_gvlTable := {}; - var AddressTable vc_addressTable := {}; - - - } // End of component Ipv6OverGeoNetworking - - group networkAndTransportPrimitives { - - group nt2Primitives { - - /** - * @desc NT2 IPv6 over GeoNetworking Indication Primitive - */ - type record IPv6OverGeoNetworkingInd { - charstring interface, - MacAddress macSourceAddress, - MacAddress macDestinationAddress, - Ipv6Packet ipv6Packet - } - - /** - * @desc NT2 IPv6 over GeoNetworking Request Primitive - */ - type record IPv6OverGeoNetworkingReq { - charstring interface, - MacAddress macSourceAddress, - MacAddress macDestinationAddress, - Ipv6Packet ipv6Packet - } - - } // end nt2Primitives - - } // End of group networkAndTransportPrimitives - with { - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsIpv6OverGeoNetworking_TestSystem diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn deleted file mode 100644 index 1d22a895..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Types and values for IPv6 over GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_TypesAndValues { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - //LibIts - import from LibItsExternal_TypesAndValues all; - - group ipv6OverGeoConfigurationTypes { - - /** - * @desc Entry of GVL table - * @member key Reference key of the entry - * @member prefix Prefix associated with the GVL - * @member prefixLength Prefix length - * @member area GeoArea associated with th e GVL - * @member interface IUT's interface associated with the GVL - */ - type record GvlTableEntry { - charstring key, - Oct16 prefix, - UInt8 prefixLength, - charstring area, - charstring interface - } - - /** - * @desc Table containing GVL information - */ - type record of GvlTableEntry GvlTable; - - /** - * @desc Entry of Address table - * @member key Reference key of the entry - * @member macAddress Link-layer address - * @member macSolNodeMca Link-layer solicited node multicast address - * @member lla IPv6 link-local address - * @member solNodeMca IPv6 solicited node multicast address - */ - type record AddressTableEntry { - charstring key, - MacAddress macAddress, - MacAddress macSolNodeMca, - Ipv6Address lla, - Ipv6Address solNodeMca - } - - /** - * @desc Table containing Address information - */ - type record of AddressTableEntry AddressTable; - - } // end ipv6OverGeoConfigurationTypes - - group ipv6OverGeoConfigurationValues { - - type record of integer GvlIdxList; - - type record of UInt32 UInt32List; - - const integer c_gvl1 := 0; - const integer c_gvl2 := 1; - const integer c_gvl3 := 2; - - const charstring c_gvl1_name := "GVL1"; - const charstring c_gvl2_name := "GVL2"; - const charstring c_gvl3_name := "GVL3"; - - const charstring c_gvlArea1 := "GVL_AREA1"; - const charstring c_gvlArea2 := "GVL_AREA2"; - const charstring c_gvlArea3 := "GVL_AREA3"; - - } // end ipv6OverGeoConfigurationValues - - group ethernet { - - const MacAddress c_macBroadcastAddr := '333300000001'O; - - } // end ethernet - - group ipv6 { - - /** - * @desc PDU type derived from RFC2460 - */ - type record Ipv6Packet { - Ipv6Header ipv6Hdr, - ExtensionHeaderList extHdrList optional, - Ipv6Payload ipv6Payload optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Derived from RFC 2460 Section 3 - * @url http://www.ietf.org/rfc/rfc2460.txt - */ - type record Ipv6Header { - UInt4 version, - UInt8 trafficClass, - UInt20 flowLabel, - UInt16 payloadLength, - UInt8 nextHeader, - UInt8 hopLimit, - Ipv6Address sourceAddress, - Ipv6Address destinationAddress - } - - group gn6ExtensionHeaderIds { - const UInt8 c_hopHdr := 0; - const UInt8 c_tcpHdr := 6; - const UInt8 c_udpHdr := 17; - const UInt8 c_tunneledIpHdr := 41; - const UInt8 c_routeHdr := 43; - const UInt8 c_fragHdr := 44; - const UInt8 c_espHdr := 50; - const UInt8 c_authHdr := 51; - const UInt8 c_icmpHdr := 58; - const UInt8 c_noNextHdr := 59; - const UInt8 c_dstHdr := 60; - const UInt8 c_mobileHdr := 135; - } - - /** - * @desc IPv6 extension header list - */ - type octetstring ExtensionHeaderList; - - /** - * @desc IPv6 payload - */ - type union Ipv6Payload { - RouterAdvertisementMsg routerAdvMsg, - octetstring octetstringMsg - } - - /** - * @desc IPv6 Address - */ - type Oct16 Ipv6Address with {encode "length(16)"}; - - group rfc2461MessageTypes { - const UInt8 c_prefixInfo := 3 ; - const UInt8 c_rtAdvMsg := 134; - } // end group rfc2461MessageTypes - - group ipv6Address { - //Prefix - const Oct2 c_llaMcaPrefix := 'FF02'O ; - const Oct2 c_llaPrefix := 'FE80'O ; - //Postfix - const Oct2 c_allNodesMcaPostfix := '0001'O ; - const Oct2 c_allRoutersMcaPostfix := '0002'O ; - const Oct2 c_anycastPostfix := 'FFFF'O ; - const Oct1 c_haAnycastPostfix := '7E'O ; - //Wellknown Multicast Address - const Ipv6Address c_allNodesMca := c_llaMcaPrefix & c_12ZeroBytes & c_allNodesMcaPostfix ; - const Ipv6Address c_allRoutersMca := c_llaMcaPrefix & c_12ZeroBytes & c_allRoutersMcaPostfix ; - //Unspecified - const Ipv6Address c_unspecified := '00000000000000000000000000000000'O; - - //geographic - const Bit7 c_itsGn6aslGeoAnycastID := '1111101'B; // TDB by IANA - }//end group ipv6Address - - /** - * @desc PDU type derived from RFC2461 clause 4.2 - */ - type record RouterAdvertisementMsg { - UInt8 icmpType(c_rtAdvMsg), - UInt8 icmpCode, - Oct2 checksum, - UInt8 curHopLimit, - UInt1 managedConfigFlag, - UInt1 otherConfigFlag, - UInt1 homeAgentFlag, - UInt5 reserved, - UInt16 routerLifetime, - UInt32 reachableTime, - UInt32 retransTimer, - RtAdvOptions rtAdvOptions optional - } // FIXME CHECK while TITAN refuse it: with { variant (checksum) "MarkForIPv6ChecksumCalculation" } - - /** - * @desc RouterAdvertisement option list - * - * @remark Any RtAdvOptions value should at least have - * one of the first three options present! - */ - type set RtAdvOptions { - SrcLinkLayerAddress srcLinkLayerAddr optional, -// MtuOption mtuOption optional, - PrefixInfoList prefixInfoList optional, -// AdvertisementInterval advertisementInterval optional, -// HomeAgentInfo homeAgentInfo optional, - octetstring otherOption optional - } - - /** - * @desc Derived from RFC2461 clause4.6.1 + MIPv6 - * @url http://www.ietf.org/rfc/rfc2461.txt - */ - type record SrcLinkLayerAddress { - UInt8 icmpType(c_srcLinkLayerAddress), - UInt8 optionLength, - Oct6to15 linkLayerAddr - } - - type set length (1..c_maxNrPrefixInfo) of PrefixInfo PrefixInfoList; - - /** - * @desc Derived from RFC 2461 clause 4.6.2 - */ - type record PrefixInfo { - UInt8 icmpType(c_prefixInfo), - UInt8 optionLength, - UInt8 prefixLength, - UInt1 linkFlag, - UInt1 autoConfigFlag, - UInt1 rtAddrFlag, - UInt5 reserved1, - UInt32 validLifetime, - UInt32 preferredLifetime, - UInt32 reserved2, - Prefix prefix - } - - type Ipv6Address Prefix ; - - group neighbourDiscoveryConstants { - const UInt8 c_maxNrPrefixInfo := 10; - const UInt1 c_rtAddrFlag0 := 0; - - const UInt1 c_aFlag0 := 0; - const UInt1 c_aFlag1 := 1; - const UInt1 c_rFlag0 := 0; - const UInt1 c_rFlag1 := 1; - const UInt1 c_sFlag0 := 0; - const UInt1 c_sFlag1 := 1; - const UInt1 c_oFlag0 := 0; - const UInt1 c_oFlag1 := 1; - const UInt1 c_mFlag0 := 0; - const UInt1 c_mFlag1 := 1; - const UInt1 c_lFlag0 := 0; - const UInt1 c_lFlag1 := 1; - - const UInt16 c_zeroLifetime := 0 ; - const UInt32 c_validLifetime20s := 20; - const UInt32 c_validLifetime30s := 30; - const UInt32 c_preferredLifetime30s := 30; - - } // end group neighbourDiscoveryConstants - - const UInt8 c_srcLinkLayerAddress := 1; - const UInt8 c_prefixInfoLen := 4; - - } // end group ipv6 - - group acPrimitives { - - /** - * @desc GN6 TA primitives - * @member getInterfaceInfos Primitive for querying IUT's interface information - */ - type union AcGn6Primitive { - integer getInterfaceInfos - } - - /** - * @desc GN6 TA responses - * @member interfaceInfoList Primitive for retrieving IUT's interface information - */ - type union AcGn6Response { - AcGn6InterfaceInfoList interfaceInfoList - } - - /** - * @desc List of interface informations - */ - type record of AcGn6InterfaceInfo AcGn6InterfaceInfoList; - - /** - * @desc Interface informations - * @member interfaceName Interface name - * @member ipv6AddressList Configured IPv6 addresses for this interface - */ - type record AcGn6InterfaceInfo { - charstring interfaceName, - Ipv6AddressList ipv6AddressList - } - - /** - * @desc List of IPv6 addresses - */ - type record of Ipv6Address Ipv6AddressList; - - } // end acPrimitives - -} -with { - variant "" - encode "LibItsIpv6OverGeoNetworking" -} \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/module.mk b/ttcn/Ipv6OverGeoNetworking/module.mk deleted file mode 100644 index bc70007d..00000000 --- a/ttcn/Ipv6OverGeoNetworking/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ -LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn \ -LibItsIpv6OverGeoNetworking_Functions.ttcn \ -LibItsIpv6OverGeoNetworking_Pics.ttcn \ -LibItsIpv6OverGeoNetworking_Pixits.ttcn \ -LibItsIpv6OverGeoNetworking_Templates.ttcn \ -LibItsIpv6OverGeoNetworking_TestSystem.ttcn \ -LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn deleted file mode 100644 index 6177edd0..00000000 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,19 +0,0 @@ -module LibItsMapemSpatem_EncdecDeclarations { - - // LibIts - import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; - import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; - - external function fx_enc_MAPEM (MAPEM pdu) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_MAPEM (inout bitstring b, out MAPEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SPATEM (SPATEM pdu) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SPATEM (inout bitstring b, out SPATEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - -} // End of module LibItsMapemSpatem_EncdecDeclarations diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn deleted file mode 100644 index 1f31709f..00000000 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ /dev/null @@ -1,461 +0,0 @@ -/** - * @author ETSI / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn $ - * $Id: LibItsMapemSpatem_Functions.ttcn,v 1.2 2018/05/31 15:57:09 dte Exp $ - * @desc Module containing common functions for ITS MAPEM SPATEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsMapemSpatem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsMapemSpatem - import from LibItsMapemSpatem_TestSystem all; - import from LibItsMapemSpatem_TypesAndValues all; - import from LibItsMapemSpatem_Templates all; - import from LibItsMapemSpatem_Pics all; - import from LibItsMapemSpatem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtMapemSpatemInitialize p_init) runs on ItsMapemSpatem { - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtMapemSpatemResults: { utMapemSpatemInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtMapemSpatemTrigger p_event - ) runs on ItsMapemSpatem { - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("MapSpat Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := true; - - return; - } - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsMapemSpatem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsMapemSpatem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsMapemSpatem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsMapemSpatem { - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_mapemInd(mw_mapemPdu(mw_defaultMapem))) { - log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); - vc_mapemReceived := true; - repeat; - } - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_spatemInd(mw_spatemPdu(mw_defaultSpatem))) { - log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); - vc_spatemReceived := true; - repeat; - } - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsMapemSpatem { - var UtMapemEventInd v_mapemevent; - var UtSpatemEventInd v_spatemevent; - [] utPort.receive(UtMapemEventInd:?) -> value v_mapemevent { - //store every upper tester indication received - log("*** " & testcasename() & ": INFO: Store UtMapemEventInd messge ***"); - vc_utMapemEvents[lengthof(vc_utMapemEvents)] := v_mapemevent; - repeat; - } - [] utPort.receive(UtSpatemEventInd:?) -> value v_spatemevent { - //store every upper tester indication received - log("*** " & testcasename() & ": INFO: Store UtSpatemEventInd messge ***"); - vc_utSpatemEvents[lengthof(vc_utSpatemEvents)] := v_spatemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group mapSpatConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem system ItsMapemSpatemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:mapemSpatemPort, system:mapemSpatemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:mapemSpatemPort, system:mapemSpatemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cf02Up(in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { - - // Variables - var integer i; - - // Select components - vc_componentTable := {{c_compMap, omit}, {c_compSpat, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].msComponent := ItsMapemSpatem.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].msComponent:acPort, system:acPort); - map(vc_componentTable[i].msComponent:utPort, system:utPort); - map(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); - connect(vc_componentTable[i].msComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of f_cf02Up - - /** - * @desc Deletes default configuration - */ - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].msComponent:utPort, system:utPort); - unmap(vc_componentTable[i].msComponent:acPort, system:acPort); - unmap(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); - disconnect(vc_componentTable[i].msComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - - } // End of f_cf02Down - - } // End of of mapSpatConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsMapemSpatem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsMapemSpatem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_mapemSpatemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_mapemSpatemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsMapemSpatem { - //empty - } - - } // End of group postambles - - group receiveFunctions { - - /** - * @desc Awaits a SPATE message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitSpateMessage(in template (present) SpatemInd p_rcvMsg, out SpatemInd p_rcvdMsg) runs on ItsMapemSpatem { - - tc_ac.start; - alt { - [] mapemSpatemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - /** - * @desc Awaits a MAPE message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitMapeMessage(in template (present) MapemInd p_rcvMsg, out MapemInd p_rcvdMsg) runs on ItsMapemSpatem { - - tc_ac.start; - alt { - [] mapemSpatemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsMapemSpatem { - - var ItsMapemSpatem v_return := null; - var integer i := 0; - - for (i:=0; i>> f_initializeState: vc_hashedId8ToBeUsed= ", vc_hashedId8ToBeUsed); - v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - log("f_initializeState: v_hashedId8ToBeUsed= ", v_hashedId8ToBeUsed); - - f_utInitializeIut(UtPkiInitialize: { v_hashedId8ToBeUsed } ); - - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - // f_acLoadScenario(p_scenario); - // f_acStartScenario(); - } - - } // End of pkiConfigurationFunctions - - group ut_port { - - function f_utInitializeIut(template (value) UtPkiInitialize p_init) runs on ItsPkiItss { - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } // End of function f_utInitializeIut - - function f_sendUtTriggerEnrolmentRequestPrimitive( - in octetstring p_canonical_id := ''O, - in Oct1 p_enc_algorithm := '00'O, - in octetstring p_private_key := ''O, - in octetstring p_public_key_compressed := ''O, - in integer p_compressed_mode := 0 - ) runs on ItsPkiItss { - var TriggerEnrolmentRequest v_ut_trigger_enrolment_request; - var octetstring v_compressed_public_key; - - if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? - v_compressed_public_key := '02'O & p_public_key_compressed; - } else { - v_compressed_public_key := '03'O & p_public_key_compressed; - } - - v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; - utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); - tc_ac.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { - tc_ac.stop; - } - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { - tc_ac.stop; - log("*** f_sendUtTriggerEnrolmentRequestPrimitive: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_sendUtTriggerEnrolmentRequestPrimitive - - function f_sendUtTriggerAuthorizationRequestPrimitive( - in octetstring p_canonical_id := ''O, - in Oct1 p_enc_algorithm := '00'O, - in octetstring p_private_key := ''O, - in octetstring p_public_key_compressed := ''O, - in integer p_compressed_mode := 0 - ) runs on ItsPkiItss { - var TriggerAuthorizationRequest v_ut_trigger_enrolment_request; - var octetstring v_compressed_public_key; - - if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? - v_compressed_public_key := '02'O & p_public_key_compressed; - } else { - v_compressed_public_key := '03'O & p_public_key_compressed; - } - - v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; - utPort.send(UtPkiTrigger: { triggerAuthorizationRequest := v_ut_trigger_enrolment_request }); - tc_ac.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { - tc_ac.stop; - } - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { - tc_ac.stop; - log("*** f_sendUtTriggerAuthorizationRequestPrimitive: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_sendUtTriggerAuthorizationRequestPrimitive - - } // End of group ut_port - - group helpers { - - function f_generate_key_pair( - out octetstring p_private_key, - out octetstring p_public_key_x, - out octetstring p_public_key_y, - out octetstring p_public_key_compressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair: PX_VE_ALG=", PX_VE_ALG); - - if (PX_VE_ALG == e_nist_p256) { - f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - f_generate_key_pair_brainpoolp384r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else { - // error - return false; - } - - log("<<< f_generate_key_pair: p_compressed_mode=", p_compressed_mode); - return true; - } - - function f_generate_key_pair_for_encryption( - in SecurityAlg p_algorithm, - out octetstring p_private_key, - out octetstring p_public_key_x, - out octetstring p_public_key_y, - out octetstring p_public_key_compressed, - out integer p_compressed_mode - ) return boolean { - if (p_algorithm == e_nist_p256) { - f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (p_algorithm == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else { - // error - return false; - } - - return true; - } - - function f_signWithEcdsa( - in octetstring p_toBeSignedSecuredMessage, - in octetstring p_certificateIssuer, - in octetstring p_privateKey - ) return octetstring { - log(">>> f_verifyEcdsa: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); - log(">>> f_verifyEcdsa: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyEcdsa: p_privateKey= ", p_privateKey); - log(">>> f_verifyEcdsa: PX_VE_ALG= ", PX_VE_ALG); - - if (PX_VE_ALG == e_nist_p256) { - return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - return f_signWithEcdsaBrainpoolp256r1WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_certificateIssuer == int2oct(0, 32)) { - return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); - } else { - return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } - } - - return ''O; - } // End of function f_signWithEcdsa - - function f_verifyEcdsa( - in octetstring p_tbs, - in octetstring p_issuer, - in Signature p_signature_, - in PublicVerificationKey p_verification_key - ) return boolean { - var boolean v_ret := false; - - log(">>> f_verifyEcdsa: p_tbs= ", p_tbs); - log(">>> f_verifyEcdsa: p_issuer= ", p_issuer); - log(">>> f_verifyEcdsa: p_signature_= ", p_signature_); - log(">>> f_verifyEcdsa: p_verification_key= ", p_verification_key); - - if (ischosen(p_verification_key.ecdsaNistP256)) { - if (ischosen(p_verification_key.ecdsaNistP256.compressed_y_0)) { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, - p_verification_key.ecdsaNistP256.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, - p_verification_key.ecdsaNistP256.compressed_y_1, - 1); - } - } else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) { - if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP256r1.compressed_y_1, - 1); - } - } else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) { - if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP384r1.compressed_y_1, - 1); - } - } - - return v_ret; - } // End of function f_verifyEcdsa - - function f_http_send( - in Headers p_headers, - in template (value) HttpMessage p_http_message - ) runs on ItsPkiHttp { - log(">>> f_http_send: ", p_http_message); - - if (not(PICS_MULTIPLE_END_POINT)) { - httpPort.send(p_http_message); - } else { - var charstring_list v_content_text; - - f_get_header(p_headers, c_header_content_text, v_content_text); - - if (not(isvalue(v_content_text))) { - log("f_http_send: Failed to send message: header not found: ", c_header_content_text); - return; - } - if (v_content_text == { "inner_ec_request" }) { - log("f_http_send: Send on EC end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_EC }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpEcPort.send(p_http_message); - } else if (v_content_text == { "inner_atv_request" }) { - log("f_http_send: Send on ATV end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_ATV }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtVPort.send(p_http_message); - } else if (v_content_text == { "inner_at_request" }) { - log("f_http_send: Send on AT end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_AT }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtPort.send(p_http_message); - } else if (v_content_text == { "ca_request" }) { - log("f_http_send: Send on CA end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_CA }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpCaPort.send(p_http_message); - } else if (v_content_text == { "tlm_request" }) { - log("f_http_send: Send on TLM end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_TLM }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpTlmPort.send(p_http_message); - } else { - log("f_http_send: Invalid header value: ", v_content_text); - } - } - } // End of function f_http_send - - function f_generate_key_tag( - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out octetstring p_encoded_tag - ) return boolean { - // Local variables - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - - log(">>> f_generate_key_tag: p_public_key_compressed=", p_public_key_compressed); - log(">>> f_generate_key_tag: p_public_compressed_enc_key=", p_public_compressed_enc_key); - - - if (PX_VE_ALG == e_nist_p256) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; - } - } else { - log("f_generate_key_tag: Failed to generate HMAC tag"); - return false; - } - log("f_generate_key_tag: v_verification_tag= ", v_verification_tag); - p_encoded_tag := bit2oct(encvalue(v_verification_tag)); - if (PX_INCLUDE_ENCRYPTION_KEYS) { - v_encryption_tag.supportedSymmAlg := aes128Ccm; - if (PX_EC_ALG_FOR_EC_SIGN == e_nist_p256) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; - } - } else if (PX_EC_ALG_FOR_EC_SIGN == e_brainpool_p256_r1) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; - } - } else { - log("f_generate_key_tag: Failed to generate HMAC tag (enc)"); - return false; - } - log("f_generate_key_tag: v_encryption_tag= ", v_encryption_tag); - p_encoded_tag := p_encoded_tag & bit2oct(encvalue(v_encryption_tag)); - } - - return true; - } // End of function f_generate_key_tag - - } // End of group helpers - - group http { // TODO Split into EnnerEc, Authorization & AuthorizationValidation - - function f_http_build_inner_ec_request( // TODO Cleanup parameters - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_result; - - log(">>> f_http_build_inner_ec_request"); - if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_inner_ec_request: ==> EC verification private key: ", p_private_key); - log ("f_http_build_inner_ec_request: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_inner_ec_request: ==> EC verification public compressed mode: ", p_compressed_mode); - // TODO Store enrolment keys for re-enrolment - vc_ec_private_keys[vc_ec_keys_counter] := p_private_key; - vc_ec_public_compressed_key[vc_ec_keys_counter] := p_public_key_compressed; - vc_ec_compressed_modes[vc_ec_keys_counter] := p_compressed_mode; - vc_ec_keys_counter := vc_ec_keys_counter + 1; - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if ((PICS_SECPKI_REENROLMENT == false) or (vc_ec_keys_counter == 1)) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request: v_ec_private_key: ", vc_ec_private_keys[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_public_compressed_key: ", vc_ec_public_compressed_key[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_compressed_modes: ", vc_ec_compressed_modes[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(vc_ec_private_keys[vc_ec_keys_counter - 1], valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_result == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } else { - log("f_http_build_inner_ec_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_inner_ec_request: p_request_hash= ", p_request_hash); - } - } // End of function f_http_build_inner_ec_request - - function f_http_build_inner_ec_request_with_wrong_parameters( // TODO Cleanup parameters - in SequenceOfPsidSsp p_appPermissions, - in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, - in Time32 p_start, - in Duration p_duration, - in boolean p_alter_private_key := false, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_result; - - log(">>> f_http_build_inner_ec_request_with_wrong_parameters"); - if (f_generate_inner_ec_request_with_wrong_parameters(p_appPermissions, p_canonical_id, p_start, p_duration, p_alter_private_key, p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification private key: ", p_private_key); - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed mode: ", p_compressed_mode); - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request_with_wrong_parameters: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); - log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_private_key: ", PX_EC_PRIVATE_KEY); - log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_result == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } else { - log("f_http_build_inner_ec_request_with_wrong_parameters: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_inner_ec_request_with_wrong_parameters: p_request_hash= ", p_request_hash); - } - } // End of function f_http_build_inner_ec_request_with_wrong_parameters - - function f_http_build_invalid_enrolment_request( - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_ret_code; - - if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_invalid_enrolment_request: EC verification private key: ", p_private_key); - log ("f_http_build_invalid_enrolment_request: EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_invalid_enrolment_request: EC verification public compressed mode: ", p_compressed_mode); - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - // Modify signature to get an error - if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature)) { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1])); - } else if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1])); - } else { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1])); - } - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_invalid_enrolment_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); - log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_ret_code == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); - } // End of function f_http_build_invalid_enrolment_request - - function f_http_build_inner_ec_response( - in template (omit) InnerEcRequest p_inner_ec_request := omit, - in EnrolmentResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out InnerEcResponse p_inner_ec_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_ec_certificate; - var boolean p_result := false; - - log(">>> f_http_build_inner_ec_response: p_inner_ec_request= ", p_inner_ec_request); - log(">>> f_http_build_inner_ec_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_inner_ec_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_inner_ec_response: p_private_key= ", p_private_key); - log(">>> f_http_build_inner_ec_response: p_digest= ", p_digest); - log(">>> f_http_build_inner_ec_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - // Generate the certificate - if (f_generate_ec_certificate_for_inner_ec_response(valueof(p_inner_ec_request), p_private_key, p_digest, v_ec_certificate) == false) { - log("f_http_build_inner_ec_response: Failed to generate the certificate"); - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - incompleterequest - ) - ); - } else { - p_inner_ec_response := valueof( - m_innerEcResponse_ok( - p_request_hash, - v_ec_certificate - ) - ); - } - } - - // Secure the response - log("f_http_build_inner_ec_response: p_inner_ec_response= ", p_inner_ec_response); - v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_ec_response(p_inner_ec_response))); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_inner_ec_response: Failed to generate the certificate"); - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - deniedrequest - ) - ); - } else { - p_result := true; - } - - return p_result; - } // End of function f_http_build_inner_ec_response - - function f_http_build_authorization_request( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - - // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request: ERROR: Non canonical AA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request - - function f_http_build_authorization_request_with_wrong_private_key( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - - // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request_with_wrong_private_key: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - /*** - Use the wrong private key - ***/ - if (f_extract_enc_key(vc_eaCertificate/*Insted of vc_aaCertificate/*/, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_private_key: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_private_key - - function f_http_build_authorization_request_with_wrong_parameters( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - in boolean p_alter_pop_signature := false, - in boolean p_alter_hmac := false, - in boolean p_alter_signer_digest := false, - in boolean p_alter_pks_recipient := false, - in boolean p_alter_enc_key := false, - in boolean p_alter_ea_id := false, - in template (omit) Time32 p_start := omit, - in template (omit) Duration p_duration := omit, - in template (omit) Time64 p_generation_time := omit, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - var boolean v_ret_code; - - // Generate the InnerAtRequest - if (p_alter_ea_id == true) { - var HashedId8 v_ea_hashed_id8 := vc_eaHashedId8; - v_ea_hashed_id8[0] := 'bb'O; - v_ea_hashed_id8[1] := 'cc'O; - log("f_http_build_authorization_request_with_wrong_parameters: Altered eaId= ", v_ea_hashed_id8); - v_ret_code := f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); - } else { - v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_generation_time, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); - } - if (v_ret_code == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request_with_wrong_parameters: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Non canonical AA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request_with_wrong_parameters: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_alter_pop_signature, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_parameters: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - if (p_alter_enc_key == true) { - /*** - Alter encryption key to prevent decryption - ***/ - if (ischosen(p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256)) { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[1] := 'aa'O; - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[2] := 'bb'O; - } else { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[1] := 'aa'O; - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[2] := 'bb'O; - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered enc key= ", p_ieee1609dot2_signed_and_encrypted_data); - } - if (p_alter_pks_recipient == true) { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].pskRecipInfo := int2oct(314259265, 8); // NOT equal to the HashedId8 of the certificate CERT_AA - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered pskRecipInfo= ", p_ieee1609dot2_signed_and_encrypted_data); - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_parameters - - function f_http_build_authorization_response( - in template (omit) InnerAtRequest p_inner_at_request := omit, - in AuthorizationResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out InnerAtResponse p_inner_at_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_at_certificate; - var boolean p_result := false; - - log(">>> f_http_build_authorization_response: p_inner_at_request= ", p_inner_at_request); - log(">>> f_http_build_authorization_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_authorization_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_authorization_response: p_private_key= ", p_private_key); - log(">>> f_http_build_authorization_response: p_digest= ", p_digest); - log(">>> f_http_build_authorization_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - // Generate the certificate - if (f_generate_at_certificate_for_inner_at_response(valueof(p_inner_at_request), p_private_key, p_digest, v_at_certificate) == false) { - log("f_http_build_authorization_response: Failed to generate the certificate"); - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - its_aa_incompleterequest - ) - ); - } else { - p_inner_at_response := valueof( - m_innerAtResponse_ok( - p_request_hash, - v_at_certificate - ) - ); - } - } - - // Secure the response - log("f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); - v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_at_response(p_inner_at_response))); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_authorization_response: Failed to generate the certificate"); - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - its_aa_deniedpermissions - ) - ); - } else { - p_result := true; - } - - log("<<< f_http_build_authorization_response: p_result= ", p_result); - log("<<< f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); - return p_result; - } // End of function f_http_build_authorization_response - - function f_http_build_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var AuthorizationValidationRequest v_authorization_validation_request; - var bitstring v_authorization_validation_request_msg; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - - log(">>> f_http_build_authorization_validation_request"); - - // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage - v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; - // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop - v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; - // Secure the InnerAtRequest message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("f_http_build_authorization_validation_request: Non canonical EA certificate"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("f_http_build_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); - log("f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_authorization_validation_request: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_validation_request - - function f_http_build_invalid_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var AuthorizationValidationRequest v_authorization_validation_request; - var bitstring v_authorization_validation_request_msg; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - - log(">>> f_http_build_invalid_authorization_validation_request"); - - // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage - v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; - // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop - v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; - // Secure the InnerAtRequest message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("f_http_build_invalid_authorization_validation_request: Non canonical EA certificate"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("f_http_build_invalid_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); - log("f_http_build_invalid_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, true, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("f_http_build_invalid_authorization_validation_request: Failed to generate Authorization Request"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_invalid_authorization_validation_request: p_request_hash= ", p_request_hash); - } // End of function f_http_build_invalid_authorization_validation_request - - function f_http_build_authorization_validation_response( - in SharedAtRequest p_shared_at_request, - in AuthorizationValidationResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out AuthorizationValidationResponse p_authorization_validation_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_at_certificate; - var boolean p_result := false; - - log(">>> f_http_build_authorization_validation_response: p_shared_at_request= ", p_shared_at_request); - log(">>> f_http_build_authorization_validation_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_authorization_validation_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_authorization_validation_response: p_private_key= ", p_private_key); - log(">>> f_http_build_authorization_validation_response: p_digest= ", p_digest); - log(">>> f_http_build_authorization_validation_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_authorization_validation_response := valueof( - m_authorizationValidationResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - p_authorization_validation_response := valueof(m_authorizationValidationResponse_ok( - p_request_hash, - p_shared_at_request.requestedSubjectAttributes - ) - ); - } - - // Secure the response - log("f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); - v_msg := bit2oct(encvalue(p_authorization_validation_response)); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_authorization_validation_response: Failed to generate the certificate"); - p_authorization_validation_response := valueof( - m_authorizationValidationResponse_ko( - p_request_hash, - deniedpermissions - ) - ); - } else { - p_result := true; - } - - log("<<< f_http_build_authorization_validation_response: p_result= ", p_result); - log("<<< f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); - return p_result; - } // End of function f_http_build_authorization_validation_response - - function f_http_build_dc_request( // TODO Cleanup parameters - in charstring p_ea_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_rca_certificate_id, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - } // End of function - } // End of group http - - group generate_certificates { - - function f_generate_ec_certificate( - out octetstring p_private_key, - out Certificate p_ec_certificate - ) return boolean { - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring p_public_key_compressed; - var integer p_compressed_mode; - var EccP256CurvePoint v_ecc_p256_curve_point; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(37, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM })) - }; - var template (value) EtsiTs103097Certificate v_cert; - var bitstring v_tbs; - var Oct32 v_sig; - var bitstring v_enc_msg; - var PublicVerificationKey v_public_verification_key; - - log(">>> f_generate_ec_certificate"); - log("f_generate_ec_certificate: PX_EC_ALG_FOR_EC=", PX_EC_ALG_FOR_EC); - log("f_generate_ec_certificate: PX_VE_ALG=", PX_VE_ALG); - - // Generate verification keys for the certificate - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log("f_generate_ec_certificate: Failed to generate verification key"); - return false; - } - if (p_compressed_mode == 0) { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - - if (PX_EC_ALG_FOR_EC == e_nist_p256) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaNistP256( - v_ecc_p256_curve_point - )); - } else if (PX_EC_ALG_FOR_EC == e_brainpool_p256_r1) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaBrainpoolP256r1( - v_ecc_p256_curve_point - )); - } else { - log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG_FOR_xx"); - return false; - } - v_cert := m_etsiTs103097Certificate( - m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(f_hashWithSha256('616263'O))), - m_toBeSignedCertificate_at( - v_appPermissions, - m_verificationKeyIndicator_verificationKey( - v_public_verification_key - ), - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ); - } - log("f_generate_ec_certificate: v_cert= ", v_cert); - - p_ec_certificate := valueof(v_cert); - return true; - } // End of function f_generate_ec_certificate - - function f_generate_ec_certificate_for_inner_ec_response( - in InnerEcRequest p_inner_ec_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_ec_certificate - ) return boolean { - var CertificateId v_certificate_id; - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_inner_ec_request: ", p_inner_ec_request); - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_digest: ", p_digest); - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - if (not(ispresent(p_inner_ec_request.requestedSubjectAttributes.id))) { - v_certificate_id := { none_ := NULL }; - } else { - v_certificate_id := p_inner_ec_request.requestedSubjectAttributes.id; - } - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_ec( - v_certificate_id, - p_inner_ec_request.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_ec_request.publicKeys.verificationKey - ), - p_inner_ec_request.requestedSubjectAttributes.validityPeriod, - p_inner_ec_request.requestedSubjectAttributes.region, - p_inner_ec_request.requestedSubjectAttributes.assuranceLevel, - p_inner_ec_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_ec_certificate := valueof(v_cert); - log("f_generate_ec_certificate_for_inner_ec_response: p_ec_certificate= ", p_ec_certificate); - - return true; - } // End of function f_generate_ec_certificate_for_inner_ec_response - - function f_generate_at_certificate_for_inner_at_response( - in InnerAtRequest p_inner_at_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_at_certificate - ) return boolean { - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_at( - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_at_request.publicKeys.verificationKey - ), - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, - p_inner_at_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - log("f_generate_at_certificate_for_inner_at_response: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_at_certificate := valueof(v_cert); - log("f_generate_at_certificate_for_inner_at_response: p_ec_certificate= ", p_at_certificate); - - return true; - } // End of function f_generate_at_certificate_for_inner_at_response - - function f_generate_at_certificate_for_authorization_response( - in InnerAtRequest p_inner_at_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_at_certificate - ) return boolean { - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - log(">>> f_generate_at_certificate_for_authorization_response"); - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_ec( - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.id, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_at_request.publicKeys.verificationKey - ), - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, - p_inner_at_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_at_certificate := valueof(v_cert); - log("f_generate_at_certificate_for_authorization_response: p_at_certificate= ", p_at_certificate); - - return true; - } // End of function f_generate_at_certificate_for_authorization_response - - } // End of group generate_certificates - - group inner_ec_xxx { - - function f_generate_inner_ec_request( - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out InnerEcRequest p_inner_ec_request - ) return boolean { - // Local variables - var Oct32 v_public_key_x; - var Oct32 v_public_key_y; - var PublicVerificationKey v_public_verification_key; - - log (">>> f_generate_inner_ec_request"); - log("f_generate_inner_ec_request: PX_VE_ALG=", PX_VE_ALG); - - // Generate keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log ("f_generate_inner_ec_request: failed to generate keys"); - return false; - } - // Build the Proof of Possession InnerEcRequest - if (PX_VE_ALG == e_nist_p256) { - var EccP256CurvePoint v_eccP256_curve_point; - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - var EccP256CurvePoint v_eccP256_curve_point; - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PICS_EC_SUBJECT_ATTRIBUT_ID) { - p_inner_ec_request := valueof( - m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID) & int2str(f_getCurrentTime()), // ETSI TS 103 097 Clause 7.2.2 Enrolment credential - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - } else { - p_inner_ec_request := valueof( - m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_omit( // ETSI TS 103 097 Clause 7.2.2 Enrolment credential - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - } - if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential - log("f_generate_inner_ec_request: This is a re-enrolment"); - p_inner_ec_request.itsId := PX_EC_HASHED_ID8; - } - log("<<< f_generate_inner_ec_request: ", p_inner_ec_request); - - return true; - } // End of function f_generate_inner_ec_request - - function f_generate_inner_ec_request_with_wrong_parameters( - in SequenceOfPsidSsp p_appPermissions, - in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, - in Time32 p_start, - in Duration p_duration, - in boolean p_alter_private_key := false, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out InnerEcRequest p_inner_ec_request - ) return boolean { - // Local variables - var Oct32 v_public_key_x; - var Oct32 v_public_key_y; - var octetstring v_private_key; - var octetstring v_public_key_compressed; - var integer v_compressed_mode; - var PublicVerificationKey v_public_verification_key; - - log (">>> f_generate_inner_ec_request_with_wrong_parameters"); - // Generate keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); - return false; - } - if (p_alter_private_key == false) { - v_private_key := p_private_key; - v_public_key_compressed := p_public_key_compressed; - v_compressed_mode := p_compressed_mode; - } else { - log ("f_generate_inner_ec_request_with_wrong_parameters: Alter verify private key"); - if (f_generate_key_pair(v_private_key, v_public_key_x, v_public_key_y, v_public_key_compressed, v_compressed_mode) == false) { - log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); - return false; - } - } - // Build the Proof of Possession InnerEcRequest - log("f_generate_inner_ec_request_with_wrong_parameters: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - var EccP256CurvePoint v_eccP256_curve_point; - if (v_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - var EccP256CurvePoint v_eccP256_curve_point; - if (v_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (v_compressed_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - p_inner_ec_request := valueof( - m_innerEcRequest( - p_canonical_id, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID), - p_appPermissions, // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - m_validityPeriod( - p_start, - p_duration - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential - log("f_generate_inner_ec_request_with_wrong_parameters: This is a re-enrolment"); - p_inner_ec_request.itsId := PX_EC_HASHED_ID8; - } - log("f_generate_inner_ec_request_with_wrong_parameters: ", p_inner_ec_request); - - return true; - } // End of function f_generate_inner_ec_request_with_wrong_parameters - - function f_generate_inner_ec_request_signed_for_pop( - in octetstring p_private_key, - in InnerEcRequest p_inner_ec_request, - out Ieee1609Dot2Data p_inner_ec_request_signed_for_pop - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var octetstring v_encoded_inner_ec_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Signature v_signature; - - // Encode it - log("f_generate_inner_ec_request_signed_for_pop: encode ", p_inner_ec_request); - v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); - // Signed the encoded InnerEcRequestSignedForPop - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured( - v_encoded_inner_ec_request - ) - ), - m_headerInfo_inner_pki_request( - -, - (f_getCurrentTime() * 1000) //us - ) - ); - // Signed the encoded InnerEcRequestSignedForPop - log("f_generate_inner_ec_request_signed_for_pop: tbs= ", v_tbs); - log("f_generate_inner_ec_request_signed_for_pop: tbs= ", bit2oct(encvalue(v_tbs))); - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - // Finalyse signed InnerEcRequestSignedForPop - if (PX_VE_ALG == e_nist_p256) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } - log("f_generate_inner_ec_request_signed_for_pop: v_signature= ", v_signature); - p_inner_ec_request_signed_for_pop := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - m_signerIdentifier_self, - v_signature - ) - ) - ); - - log("<<< f_generate_inner_ec_request_signed_for_pop: p_inner_ec_request_signed_for_pop= ", p_inner_ec_request_signed_for_pop); - return true; - } // End of function f_generate_inner_ec_request_signed_for_pop - - function f_verify_inner_ec_request_signed_for_pop( - in EtsiTs102941Data p_etsi_ts_102941_data, - out InnerEcRequest p_inner_ec_request - ) return boolean { - var bitstring v_msg_bit; - - log(">>> f_verify_inner_ec_request_signed_for_pop: ", p_etsi_ts_102941_data); - - // 1. Decode content - v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_inner_ec_request) != 0) { - log("f_verify_inner_ec_request_signed_for_pop: Failed to decode InnerEcRequest"); - return false; - } else { - log("f_verify_inner_ec_request_signed_for_pop: v_inner_ec_request= ", p_inner_ec_request); - - // 2. Verify the InnerEcRequestSignedForPop signature - // TODO - } - - return true; - } // End of function f_verify_inner_ec_request_signed_for_pop - - function f_generate_inner_ec_response( - in octetstring p_inner_ec_request_hash, - in EtsiTs103097Certificate p_certificate, - out InnerEcResponse p_inner_ec_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerEcResponse - p_inner_ec_response := valueof( - m_innerEcResponse_ok( - substr(p_inner_ec_request_hash, 0, 16), - p_certificate - ) - ); - - return true; - } // End of function f_generate_inner_ec_response - - } // End of group inner_ec_xxx - - group inner_at_xxx { - - function f_generate_inner_at_request( - in Certificate p_aa_certificate, - in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_EC_SIGN, - in Oct8 p_aa_hashed_id8, - in Certificate p_ea_certificate, - in octetstring p_salt, - in Oct8 p_ea_hashed_id8, - in Certificate p_ec_certificate, - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out InnerAtRequest p_inner_at_request - ) return boolean { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var bitstring v_enc_value; - var octetstring v_ec_hash; - var PublicVerificationKey v_public_verification_key; - var BasePublicEncryptionKey v_public_encryption_key; - var Oct8 v_ec_hashed_id8; - var octetstring public_enc_key_x; - var octetstring public_enc_key_y; - var Oct32 v_hmac_key; - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - var octetstring v_encoded_tag; - var Oct16 v_key_tag; - var octetstring v_hash_shared_at_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Ieee1609Dot2Data v_signed_at_signature; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashAlgorithm v_hashId; - var Signature v_signature; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) - }; - - log(">>> f_generate_inner_at_request: p_enc_algo=", p_enc_algo); - - // Generate verification keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { - log("f_generate_inner_at_request: Failed to generate verification key"); - return false; - } - log ("f_generate_inner_at_request: AT verification private key: ", p_private_key); - log ("f_generate_inner_at_request: AT verification public compressed key: ", p_public_key_compressed); - log ("f_generate_inner_at_request: AT verification public compressed mode: ", p_compressed_key_mode); - // Generate encryption keys for the certificate to be requested - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { - log("f_generate_inner_at_request: Failed to generate encryption key"); - return false; - } else { - log ("f_generate_inner_at_request: AT encryption private key: ", p_private_enc_key); - log ("f_generate_inner_at_request: AT encryption public compressed key: ", p_public_compressed_enc_key); - log ("f_generate_inner_at_request: AT encryption public compressed mode: ", p_compressed_enc_key_mode); - } - } else { - p_private_enc_key := ''O; - v_public_enc_key_x := ''O; - v_public_enc_key_y := ''O; - p_public_compressed_enc_key := ''O; - p_compressed_enc_key_mode := -1; - } - - // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); - log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); - - // Generate tag based on the concatenation of verification keys & encryption keys - if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { - log("f_generate_inner_at_request: Failed to generate Key tag"); - return false; - } - log("f_generate_inner_at_request: v_encoded_tag= ", v_encoded_tag); - v_key_tag := substr( - fx_hmac_sha256( // TODO Rename and use a wrapper function - v_hmac_key, - v_encoded_tag - ), - 0, - 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously - log("f_generate_inner_at_request: v_key_tag= ", v_key_tag); - - // Build the SharedAtRequest - p_inner_at_request.sharedAtRequest := valueof( - m_shared_at_request( - p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity - v_key_tag, // Calculated keyTag - valueof( - m_certificate_subject_attributes( // FIXME Review subjectPermissions - v_appPermissions, - p_ec_certificate.toBeSigned.certRequestPermissions, - -,//{ none_ := NULL },//p_ec_certificate.toBeSigned.id, - p_ec_certificate.toBeSigned.validityPeriod, - p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel - ))) // Desired attributes - ); - - // Calculate the hash of the SharedAtRequest - v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("f_generate_inner_at_request: v_hash_shared_at_request= ", v_hash_shared_at_request); - - // Build the ETsiTs103097Data-SignedExternalPayload - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - (f_getCurrentTime()) * 1000) //us - ); - log("f_generate_inner_at_request: v_tbs= ", v_tbs); - - // Calculate the whole certificate SHA - v_enc_value := encvalue(p_ec_certificate); - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); - } else { - v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); - } - log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); - - // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } else { - v_hashId := sha256; - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else { - // Error - log("f_generate_inner_at_request: Failed to process signature"); - return false; - } - } - v_signed_at_signature := valueof( - m_etsiTs103097Data_signed( - m_signedData( - v_hashId, - v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request - v_signature - ) - ) - ); - log("f_generate_inner_at_request: v_signed_at_signature= ", v_signed_at_signature); - log("f_generate_inner_at_request: p_ea_certificate= ", p_ea_certificate); - - if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure - var octetstring v_public_enc_key; - var integer v_compressed_mode; - var Oct12 v_nonce; - var Oct16 v_authentication_vector; - var Oct16 v_aes_sym_key; - var Oct16 v_encrypted_sym_key; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_enc_signed_ec_signature; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - - // Use EA certificate for the encryption - if (p_enc_algo == e_nist_p256) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else if (p_enc_algo == e_brainpool_p256_r1) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else { - log("f_generate_inner_at_request: Wrong encryption variant"); - return false; - } - log("f_generate_inner_at_request: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); - v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("f_generate_inner_at_request: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_inner_at_request.ecSignature := valueof( - m_ec_signature( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - - v_encrypted_data_encryption_key )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - v_nonce, - v_enc_signed_ec_signature - ) - ) - ) - ) - ) - ); - } else { // Skip the encryption, alowed to be re-identified by the AA - p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); - } - // Build the InnerAtRequest, EcSignature field is already set - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_key_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PX_INCLUDE_ENCRYPTION_KEYS) { - var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; - - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); - } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); - } - if (p_enc_algo == e_nist_p256) { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); - } else { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); - } - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key, - m_encryptionKey( // FIXME Encryption keys could be optional - -, - v_public_encryption_key - ) - ) - ); - } else { - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key - ) - ); - } - p_inner_at_request.hmacKey := v_hmac_key; - log("f_generate_inner_at_request: p_inner_at_request= ", p_inner_at_request); - - return true; - } // End of function f_generate_inner_at_request - - function f_generate_inner_at_request_with_wrong_parameters( - in Certificate p_aa_certificate, - in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_AT, - in Oct8 p_aa_hashed_id8, - in Certificate p_ea_certificate, - in octetstring p_salt, - in Oct8 p_ea_hashed_id8, - in Certificate p_ec_certificate, - in octetstring p_ec_private_key, - in boolean p_alter_hmac := false, - in boolean p_alter_signer_digest := false, - in template (omit) Time32 p_start := omit, - in template (omit) Duration p_duration := omit, - in template (omit) Time64 p_generation_time := omit, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out InnerAtRequest p_inner_at_request - ) return boolean { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var bitstring v_enc_value; - var octetstring v_ec_hash; - var PublicVerificationKey v_public_verification_key; - var BasePublicEncryptionKey v_public_encryption_key; - var Oct8 v_ec_hashed_id8; - var octetstring public_enc_key_x; - var octetstring public_enc_key_y; - var Oct32 v_hmac_key; - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - var octetstring v_encoded_tag; - var Oct16 v_key_tag; - var octetstring v_hash_shared_at_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Ieee1609Dot2Data v_signed_at_signature; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; - var HashAlgorithm v_hashId; - var Signature v_signature; - var Time32 v_start; - var Duration v_duration; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) - }; - - log("f_generate_inner_at_request_with_wrong_parameters: p_enc_algo=", p_enc_algo); - - // Generate verification keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate verification key"); - return false; - } - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification private key: ", p_private_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed key: ", p_public_key_compressed); - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed mode: ", p_compressed_key_mode); - // Generate encryption keys for the certificate to be requested - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate encryption key"); - return false; - } else { - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption private key: ", p_private_enc_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed key: ", p_public_compressed_enc_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed mode: ", p_compressed_enc_key_mode); - } - } else { - p_private_enc_key := ''O; - v_public_enc_key_x := ''O; - v_public_enc_key_y := ''O; - p_public_compressed_enc_key := ''O; - p_compressed_enc_key_mode := -1; - } - - // Calculate the whole certificate SHA - v_enc_value := encvalue(p_ec_certificate); - if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { - v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); - } else { - v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); - } - log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hash= ", v_ec_hash); - log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hashed_id8= ", v_ec_hashed_id8); - if (p_alter_signer_digest == true) { - v_ec_hashed_id8 := int2oct((f_getCurrentTimeUtc() * 1000), 8); - log("f_generate_inner_at_request_with_wrong_parameters: Altered v_ec_hashed_id8= ", v_ec_hashed_id8); - } - - // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); - log("f_generate_inner_at_request_with_wrong_parameters: v_hmac_key= ", v_hmac_key); - - // Generate tag based on the concatenation of verification keys & encryption keys - if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate Key tag"); - return false; - } - log("f_generate_inner_at_request_with_wrong_parameters: v_encoded_tag= ", v_encoded_tag); - // Generate hmac key - v_key_tag := substr( - fx_hmac_sha256( // TODO Rename and use a wrapper function - v_hmac_key, - v_encoded_tag - ), - 0, - 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously - log("f_generate_inner_at_request_with_wrong_parameters: v_key_tag= ", v_key_tag); - if (p_alter_hmac == true) { - v_hmac_key[0] := 'aa'O; - v_hmac_key[1] := 'bb'O; - log("f_generate_inner_at_request_with_wrong_parameters: Altered key_tag= ", v_hmac_key); - } - - // Build the SharedAtRequest - if (not(ispresent(p_start))) { - v_start := p_ec_certificate.toBeSigned.validityPeriod.start_; - } else { - v_start := valueof(p_start); - log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.start= ", v_start); - } - if (not(ispresent(p_duration))) { - v_duration := p_ec_certificate.toBeSigned.validityPeriod.duration; - } else { - v_duration := valueof(p_duration); - log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.duration= ", v_duration); - } - p_inner_at_request.sharedAtRequest := valueof( - m_shared_at_request( - p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity - v_key_tag, // Calculated keyTag - valueof( - m_certificate_subject_attributes( - v_appPermissions, - p_ec_certificate.toBeSigned.certRequestPermissions, - { none_ := NULL },//p_ec_certificate.toBeSigned.id, - m_validityPeriod(v_start, v_duration), - p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel - ))) // Desired attributes - ); - - // Calculate the hash of the SharedAtRequest - v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("f_generate_inner_at_request_with_wrong_parameters: v_hash_shared_at_request= ", v_hash_shared_at_request); - - // Build the ETsiTs103097Data-SignedExternalPayload - if (ispresent(p_generation_time)) { - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - valueof(p_generation_time) * 1000) //us - ); - log("f_generate_inner_at_request_with_wrong_parameters: Altered generation time: v_tbs= ", v_tbs); - } else { - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - f_getCurrentTime() * 1000) //us - ); - log("f_generate_inner_at_request_with_wrong_parameters: v_tbs= ", v_tbs); - } - // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - // TODO Simplify with f_signWithEcdsa - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } else { - v_hashId := sha256; - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else { - // Error - log("f_generate_inner_at_request_with_wrong_parameters: Failed to process signature"); - return false; - } - } - v_signed_at_signature := valueof( - m_etsiTs103097Data_signed( - m_signedData( - v_hashId, - v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request - v_signature - ) - ) - ); - log("f_generate_inner_at_request_with_wrong_parameters: v_signed_at_signature= ", v_signed_at_signature); - - if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure - var octetstring v_public_enc_key; - var integer v_compressed_mode; - var Oct12 v_nonce; - var Oct16 v_authentication_vector; - var Oct16 v_aes_sym_key; - var Oct16 v_encrypted_sym_key; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_enc_signed_ec_signature; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - - // Use EA certificate for the encryption - if (p_enc_algo == e_nist_p256) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong NistP256 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else if (p_enc_algo == e_brainpool_p256_r1) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong encryption variant"); - return false; - } - log("f_generate_inner_at_request_with_wrong_parameters: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); - v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("f_generate_inner_at_request_with_wrong_parameters: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_inner_at_request.ecSignature := valueof( - m_ec_signature( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - - v_encrypted_data_encryption_key )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - v_nonce, - v_enc_signed_ec_signature - ) - ) - ) - ) - ) - ); - } else { // Skip the encryption, alowed to be re-identified by the AA - p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); - } - // Build the InnerAtRequest, EcSignature field is already set - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_key_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); - } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); - } - if (p_enc_algo == e_nist_p256) { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); - } else { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); - } - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key, - m_encryptionKey( // FIXME Encryption keys could be optional - -, - v_public_encryption_key - ) - ) - ); - } else { - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key - ) - ); - } - p_inner_at_request.hmacKey := v_hmac_key; - log("f_generate_inner_at_request_with_wrong_parameters: p_inner_at_request= ", p_inner_at_request); - - return true; - } // End of function f_generate_inner_at_request_with_wrong_parameters - - function f_verify_inner_at_request_signed_for_pop( - in EtsiTs102941Data p_etsi_ts_102941_data, - in EtsiTs103097Certificate p_ec_certificate, - out InnerAtRequest p_inner_at_request - ) return boolean { - var bitstring v_msg_bit; - - log(">>> f_verify_inner_at_request_signed_for_pop: p_etsi_ts_102941_data=", p_etsi_ts_102941_data); - log(">>> f_verify_inner_at_request_signed_for_pop: p_ec_certificate=", p_ec_certificate); - - // 1. Extract content - p_inner_at_request := p_etsi_ts_102941_data.content.authorizationRequest; - - // 2. Verify the InnerEcRequestSignedForPop signature - // TODO - - log("<<< f_verify_inner_at_request_signed_for_pop: ", p_inner_at_request); - return true; - } // End of function f_verify_inner_at_request_signed_for_pop - - function f_generate_inner_at_response( - in octetstring p_authorization_request_hash, - in EtsiTs103097Certificate p_certificate, - out InnerAtResponse p_authorization_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerEcResponse - p_authorization_response := valueof( - m_innerAtResponse_ok( - substr(p_authorization_request_hash, 0, 16), - p_certificate - ) - ); - - return true; - } // End of function f_generate_inner_at_response - - } // End of group inner_at_xxx - - group authorization_validation_xxx { - - } // End of group authorization_validation_xxx - - group dc { - - function f_build_dc_ctl( - in charstring p_ea_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_rca_certificate_id, - out ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) { - // Local variables - var EtsiTs103097Certificate v_ea_certificate; - var EtsiTs103097Certificate v_aa_certificate; - var EtsiTs103097Certificate v_rca_certificate; - var CtlCommands v_ctl_commands; - var ToBeSignedRcaCtl v_to_be_signed_rca_ctl; - - log(">>> f_build_dc_ctl"); - - // Load certificates - f_readCertificate(p_ea_certificate_id, v_ea_certificate); - f_readCertificate(p_aa_certificate_id, v_aa_certificate); - f_readCertificate(p_rca_certificate_id, v_rca_certificate); - // Create ctrlCommnand list - v_ctl_commands := { - { add := { rca := valueof(m_root_ca_entry(v_rca_certificate)) } }, - { add := { aa := valueof(m_aa_entry(v_aa_certificate, "http://www.etsi.org")) } }, - { add := { ea := valueof(m_ea_entry(v_ea_certificate, "http://www.etsi.org")) } } - }; - log("f_build_dc_ctl: v_ctl_commands= ", v_ctl_commands); - // Build the main data structure - p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(1000, 1, v_ctl_commands)); - - log("<<< f_build_dc_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - } // End of function f_build_dc_ctl - - function f_sign_dc_ctl( - in charstring p_issuer_certificate_id, - in ToBeSignedRcaCtl p_to_be_signed_rca_ctl, - out Ieee1609Dot2Data p_ieee_1609Dot2_signed_data - ) { - // Local variables - var EtsiTs103097Certificate v_certificate; - var EtsiTs102941Data v_etsi_ts_102941_data; - var octetstring v_pki_message; - var ToBeSignedData v_tbs; - var octetstring v_private_key; - var octetstring v_issuer; - var bitstring v_tbs_encoded; - var octetstring v_sig; - var Signature v_signature; - - log(">>> f_sign_dc_ctl"); - - f_readSigningKey(p_issuer_certificate_id, v_private_key); - f_getCertificateHash(p_issuer_certificate_id, v_issuer); - - // Encode the main data structure - v_etsi_ts_102941_data := valueof(m_etsiTs102941Data_to_be_signed_rca_ctl(p_to_be_signed_rca_ctl)); - v_pki_message := bit2oct(encvalue(v_etsi_ts_102941_data)); - // Signed the encoded PKI message - v_tbs := valueof( - m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(v_pki_message) - ), - m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) - ) - ); - v_tbs_encoded := encvalue(v_tbs); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs_encoded), v_issuer, v_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - )); - p_ieee_1609Dot2_signed_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - m_signerIdentifier_digest(v_issuer), - v_signature - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - )); - p_ieee_1609Dot2_signed_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha384, - v_tbs, - m_signerIdentifier_digest(v_issuer), - v_signature - ) - ) - ); - } - log("<<< f_sign_dc_ctl: p_ieee_1609Dot2_signed_data= ", p_ieee_1609Dot2_signed_data); - } // End of function f_sign_dc_ctl - - } // End of group dc - - group rca { - - function f_verify_rca_ctl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var charstring v_certificate_id; - var octetstring v_issuer; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_rca_ctl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_rca_ctl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_rca_ctl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_rca_ctl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: RcaCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl) == false) { - log("f_verify_rca_ctl_response_message: Failed to decode certificateTrustListRca"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_rca_ctl := v_etsi_ts_102941_data.content.certificateTrustListRca; - log("f_verify_rca_ctl_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - if (p_to_be_signed_rca_ctl.nextUpdate <= v_time) { - log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", v_time); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - function f_verify_rca_crl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedCrl p_to_be_signed_crl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var charstring v_certificate_id; - var octetstring v_issuer; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_rca_crl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_rca_crl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_rca_crl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_rca_crl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: CertificateRevocationList matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl) == false) { - log("f_verify_rca_crl_response_message: Failed to decode certificateRevocationList"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_crl := v_etsi_ts_102941_data.content.certificateRevocationList; - log("f_verify_rca_crl_response_message: p_to_be_signed_crl= ", p_to_be_signed_crl); - if (p_to_be_signed_crl.thisUpdate >= v_time) { - log("f_verify_rca_crl_response_message: Invalid thisUpdate value"); - return false; - } - if (p_to_be_signed_crl.nextUpdate <= v_time) { - log("f_verify_rca_crl_response_message: Invalid nextUpdate value"); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - function f_verify_full_ctl( - in ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) return boolean { - log(">>> f_verify_full_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - - // 1. Check mandatory fields - log("f_verify_full_ctl matching= ", match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl)); - if (match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl) == false) { - return false; - } - - log("f_verify_full_ctl: ctlCommands length: ", lengthof(p_to_be_signed_rca_ctl.ctlCommands)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_rca_ctl.ctlCommands); v_i := v_i + 1) { - var CtlCommand v_ctl_command := p_to_be_signed_rca_ctl.ctlCommands[v_i]; - - if (ischosen(v_ctl_command.delete)) { - log("f_verify_full_ctl: ctlCommands shall not contains 'delete' variant"); - return false; - } else { - if (f_verify_ctl_entry(v_ctl_command.add) == false) { - log("f_verify_full_ctl: ctlCommands contains invalid entries"); - return false; - } - } - } // End of 'for' statements - - return true; - } - - function f_verify_full_crl( - in ToBeSignedCrl p_to_be_signed_crl - ) return boolean { - log(">>> f_verify_full_crl: p_to_be_signed_crl= ", p_to_be_signed_crl); - - // 1. Check mandatory fields - log("f_verify_full_crl matching= ", match(p_to_be_signed_crl, mw_to_be_signed_crl)); - if (match(p_to_be_signed_crl, mw_to_be_signed_crl) == false) { - return false; - } - - log("f_verify_full_crl: entries length: ", lengthof(p_to_be_signed_crl.entries)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_crl.entries); v_i := v_i + 1) { - var CrlEntry v_crl_entry := p_to_be_signed_crl.entries[v_i]; - - log("f_verify_full_crl: crlEntry: v_crl_entry"); - } // End of 'for' statements - - return true; - } - - function f_verify_full_ectl( - in ToBeSignedRcaCtl p_to_be_signed_tlm_ectl - ) return boolean { - log(">>> f_verify_full_ectl: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); - - // 1. Check mandatory fields - log("f_verify_full_ectl matching= ", match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl)); - if (match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl) == false) { - return false; - } - - log("f_verify_full_ectl: ctlCommands length: ", lengthof(p_to_be_signed_tlm_ectl.ctlCommands)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_tlm_ectl.ctlCommands); v_i := v_i + 1) { - var CtlCommand v_ectl_command := p_to_be_signed_tlm_ectl.ctlCommands[v_i]; - - if (ischosen(v_ectl_command.delete)) { - log("f_verify_full_ectl: ctlCommands shall not contains 'delete' variant"); - return false; - } else { - if (f_verify_ectl_entry(v_ectl_command.add) == false) { - log("f_verify_full_ectl: ctlCommands contains invalid entries"); - return false; - } - } - } // End of 'for' statements - - return true; - } - - function f_verify_ctl_entry( - in CtlEntry p_ctl_entry - ) return boolean { - log(">>> f_verify_ctl_entry: p_ctl_entry=", p_ctl_entry); - - if (ischosen(p_ctl_entry.rca)) { - if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.ea)) { - if (match(p_ctl_entry.ea, mw_ea_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.aa)) { - if (match(p_ctl_entry.aa, mw_aa_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.dc)) { - if (match(p_ctl_entry.dc, mw_dc_entry) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else { - return false; - } - - return true; - } - - function f_verify_ectl_entry( - in CtlEntry p_ctl_entry - ) return boolean { - log(">>> f_verify_ectl_entry: p_ctl_entry=", p_ctl_entry); - - if (ischosen(p_ctl_entry.tlm)) { - if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.dc)) { - if (match(p_ctl_entry.dc, mw_dc_entry) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.rca)) { - if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else { - return false; - } - - return true; - } - - /** - * @desc this function is used to retrieve the root certificate from SubCA entity - * @param p_certificate The root certificate - * @return 0 on success, -1 otherwise - */ - external function fx_get_root_ca_certificate( - in charstring p_iut_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_CA", - in boolean p_explicit_type := false, - out octetstring p_certificate - ) return integer; - - function f_get_root_ca_certificate( - in charstring p_iut_certificate := "CERT_IUT_A_CA", - in boolean p_explicit_type := false, - out Certificate p_certificate - ) return integer { - var octetstring v_os; - var bitstring v_msg_bit; - - log(">>> f_get_root_ca_certificate"); - - // Get root certificate - if (fx_get_root_ca_certificate(p_iut_certificate, p_explicit_type, v_os) != 0) { - log("f_get_root_ca_certificate: fail to get certificate"); - return -1; - } - log("f_get_root_ca_certificate: v_os=", v_os); - // Decode it - v_msg_bit := oct2bit(v_os); - if (decvalue(v_msg_bit, p_certificate) != 0) { - log("f_get_root_ca_certificate: fail to decode certificate"); - return -1; - } - log("<<< f_get_root_ca_certificate: ", p_certificate); - return 0; - } - - function f_verify_rca_certificate( - in charstring p_authorized_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_RCA", - in Certificate p_certificate, - in boolean p_check_implicit := false, - in boolean p_check_reconstruction_value := false, - in boolean p_check_no_signature := false, - in boolean p_check_region_restriction := false, - in boolean p_check_signature_content := false, - in boolean p_check_app_permissions := false - ) return boolean { - var CertificateType v_type_ := explicit; - var template Signature v_signature_ := ?; - var template IssuerIdentifier v_issuer := ?; - var template PublicVerificationKey v_public_verification_key := ?; - - log(">>> f_verify_rca_certificate: p_authorized_certificate= ", p_authorized_certificate); - log(">>> f_verify_rca_certificate: p_certificate= ", p_certificate); - - if (p_check_implicit == true) { - v_type_ := implicit; - } - if (p_check_no_signature == true) { - v_signature_ := omit; - } - if (match(p_certificate, mw_etsiTs103097Certificate(-, -, v_signature_, v_type_)) == false) { - log("f_verify_rca_certificate: version/explicit mismatch"); - return false; - } - if (p_check_reconstruction_value == false) { - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_verificationKey - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: verificationKey mismatch"); - return false; - } - if (p_check_signature_content) { - var template PublicVerificationKey v_publicVerificationKey; - - if (PICS_SEC_SHA256) { - v_signature_ := mw_signature_ecdsaNistP256; - v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaNistP256; - } else if (PICS_SEC_BRAINPOOL_P256R1) { - v_signature_ := mw_signature_ecdsaBrainpoolP256r1; - v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP256r1; - } else if (PICS_SEC_BRAINPOOL_P384R1) { - v_signature_ := mw_signature_ecdsaBrainpoolP384r1; - v_issuer := (mw_issuerIdentifier_self(sha384), mw_issuerIdentifier_sha384AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP384r1; - } - if (match(p_certificate, mw_etsiTs103097Certificate( - v_issuer, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_verificationKey(v_public_verification_key), - -, -, -, -, - -//mw_encryptionKey - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: signature mismatch"); - return false; - } - // Verify Signature - if (ischosen(p_certificate.issuer.self_)) { - v_publicVerificationKey := p_certificate.toBeSigned.verifyKeyIndicator.verificationKey; - } else { - var HashedId8 v_digest; - var Certificate v_authorized_certificate; - var charstring v_cert; - - if (ischosen(p_certificate.issuer.sha256AndDigest)) { - v_digest := p_certificate.issuer.sha256AndDigest; - } else if (ischosen(p_certificate.issuer.sha384AndDigest)) { - v_digest := p_certificate.issuer.sha384AndDigest; - } else { - log("f_verify_rca_certificate: Invalid certificate issuer ", p_certificate.issuer); - return false; - } - if (f_getCertificateFromDigest(v_digest, v_authorized_certificate, v_cert) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - v_publicVerificationKey := v_authorized_certificate.toBeSigned.verifyKeyIndicator.verificationKey - } - log("f_verify_rca_certificate: v_publicVerificationKey= ", v_publicVerificationKey); - if (f_verifyCertificateSignatureWithPublicKey(p_certificate, v_publicVerificationKey) == false) { - log("f_verify_rca_certificate: signature not verified"); - return false; - } - } - } else { - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_reconstructionValue - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: verificationKey mismatch"); - return false; - } - // TODO Verify Signature - } - - if (p_check_region_restriction == true) { - var Certificate v_authorized_certificate; - var template GeographicRegion v_geographic_region := ?; - - if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); - - if (PICS_SEC_CIRCULAR_REGION == true) { - v_geographic_region := mw_geographicRegion_circle; - } else if (PICS_SEC_RECTANGULAR_REGION == true) { - v_geographic_region := mw_geographicRegion_rectangular; - } else if (PICS_SEC_POLYGONAL_REGION == true) { - v_geographic_region := mw_geographicRegion_polygonal; - } else if (PICS_SEC_IDENTIFIED_REGION == true) { - v_geographic_region := mw_geographicRegion_identified( - { - (mw_identifiedRegion_country_only, mw_identifiedRegion_country_and_region) - } - ); - } - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - -, - -, - -, - -, - -, - -, - v_geographic_region - ) - )) == false) { - log("f_verify_rca_certificate: Geographical region mismatch"); - return false; - } - // Check interception of area - if (f_checkRegionValidityRestiction(v_authorized_certificate, p_certificate) == false) { - log("f_verify_rca_certificate: Geographical region intersection mismatch"); - return false; - } - } - // Check appPermissions - if (p_check_app_permissions == true) { - var integer v_idx, v_jdx; - var charstring v_psid := ""; // 'psid' currently processed - var charstring v_psidsFound := ";"; // Used to build the list of the 'psid' already processed - var template charstring m_found_pattern; // Used in regex to verify that 'psid' was not found before - var Certificate v_authorized_certificate; - - if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); - if (match(v_authorized_certificate.toBeSigned.certIssuePermissions, { mw_psidGroupPermissions }) == false) { - log("f_verify_rca_certificate: eeType mismatch"); - return false; - } - - for (v_idx := 0; v_idx < lengthof(p_certificate.toBeSigned.appPermissions); v_idx := v_idx + 1) { - log("f_verify_rca_certificate: Processing ", p_certificate.toBeSigned.appPermissions[v_idx]); - if (match(p_certificate.toBeSigned.appPermissions[v_idx], mw_appPermissions) == false) { - log("f_verify_rca_certificate: PsidSsp mismatch"); - return false; - } - // Check uniqueness of PSIDs - v_psid := int2str(p_certificate.toBeSigned.appPermissions[v_idx].psid); - m_found_pattern := pattern "*({v_psid})*"; - if (regexp(v_psidsFound, m_found_pattern, 0) == v_psid) { - log("f_verify_rca_certificate: Psid uniqueness is not verified"); - return false; // v_psid exist at least 2 times, uniqueness is not verified - } - // v_psid non found, add it into the built list - v_psidsFound := v_psidsFound & v_psid & ";"; - // Check that 'psid' is in the certIssuePermissions component in the issuing certificate - if (match(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions, mw_subjectPermissions_explicit) == false) { - for (v_jdx := 0; v_jdx < lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit); v_jdx := v_jdx + 1) { - if (int2str(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid) == v_psid) { - break; - } - } // End of 'for'statement - if (v_jdx == lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit)) { - log("f_verify_rca_certificate: Psid is not in the list of the issuing certificate"); - return false; - } - } - } // End of 'for'statement - } - - return true; - } - - } // End of group rca - - group tlm { - - function f_verify_tlm_ectl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedTlmCtl p_to_be_signed_tlm_ectl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var boolean v_result; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signer.certificate)) { - v_certificate := p_etsi_ts_103097_signed_data.content.signedData.signer.certificate[0]; - } else { - var charstring v_certificate_id; - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_tlm_ectl_response_message: Failed to retrieve certificate from digest ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - } - if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 48), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); - } else { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 32), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); - } - if (v_result == false) { - log("f_verify_tlm_ectl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_tlm_ectl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_tlm_ectl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: TlmCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl) == false) { - log("f_verify_tlm_ectl_response_message: Failed to decode certificateTrustListTlm"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_tlm_ectl := v_etsi_ts_102941_data.content.certificateTrustListTlm; - log("f_verify_tlm_ectl_response_message: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); - if (p_to_be_signed_tlm_ectl.nextUpdate <= v_time) { - log("f_verify_tlm_ectl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_tlm_ectl.nextUpdate, "/", v_time); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - } // End of group tlm - - group awaiting_messages { - - function f_await_http_inner_ec_request_response( - out Oct32 p_private_key, - out Oct32 p_compressed_public_key, - out integer p_compressed_mode, - out InnerEcResponse p_inner_ec_response, - in boolean p_strict_checks := true - ) runs on ItsPkiHttp return boolean { - var Headers v_headers; - var Oct32 v_request_hash; - var Oct16 v_encrypted_sym_key; - var Oct16 v_aes_sym_key; - var HashedId8 v_aes_sym_key_hashed_id8; - var Oct16 v_authentication_vector; - var Oct12 v_nonce; - var octetstring v_salt; - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var EtsiTs102941Data v_etsi_ts_102941_data; - var HttpMessage v_response; - - log(">>> f_await_http_inner_ec_request_response: p_strict_checks=", p_strict_checks); - - f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); - v_aes_sym_key_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256('80'O & v_aes_sym_key)); // Used to macth the response - f_init_default_headers_list(-, "inner_ec_request", v_headers); - f_http_send( - v_headers, - m_http_request( - m_http_request_post( - PICS_HTTP_POST_URI_EC, - v_headers, - m_http_message_body_binary( - m_binary_body_ieee1609dot2_data( - v_ieee1609dot2_signed_and_encrypted_data - ))))); - tc_ac.start; - alt { - [] a_await_ec_http_request_from_iut( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentResponseMessage( - mw_encryptedData( - { *, mw_recipientInfo_pskRecipInfo(v_aes_sym_key_hashed_id8), * }, - mw_SymmetricCiphertext_aes128ccm - )))))), - v_response - ) { - tc_ac.stop; - - if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, p_strict_checks, -, v_etsi_ts_102941_data) == false) { - log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); - if (p_strict_checks) { - return false; - } - } - log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); - // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(?/*FIXME YANN Blackberry substr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { - log("f_await_http_inner_ec_request_response: Unexpected message received ***"); - if (p_strict_checks) { - return false; - } - } - if (ischosen(v_etsi_ts_102941_data.content.enrolmentResponse) and ispresent(v_etsi_ts_102941_data.content.enrolmentResponse.certificate)) { - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, vc_eaHashedId8, p_compressed_public_key, p_compressed_mode) == false) { - log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); - if (p_strict_checks) { - return false; - } - } - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; - log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); - log("p_inner_ec_response= ", p_inner_ec_response); - } else { - log("f_await_http_inner_ec_request_response: Invalid message received ***"); - return false; - } - } - [] tc_ac.timeout { - log("f_await_http_inner_ec_request_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return true; - } // End of function f_await_http_inner_ec_request_response - - function f_await_ec_request_send_response( - out InnerEcResponse p_inner_ec_response - ) runs on ItsPkiHttp return boolean { - var HttpMessage v_request; - var boolean v_result := false; - - log(">>> f_await_ec_request_send_response"); - - tc_ac.start; - alt { - [] a_await_ec_http_request_from_iut( - mw_http_request( - mw_http_request_post( - PICS_HTTP_POST_URI_EC, - -, - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentRequestMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - )))))), - v_request - ) { - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var EtsiTs102941Data v_etsi_ts_102941_data; - var Oct16 v_request_hash; - var Oct16 v_aes_enc_key; - var InnerEcRequest v_inner_ec_request; - var template (value) HttpMessage v_response; - var Headers v_headers; - - tc_ac.stop; - - f_init_default_headers_list(-, "inner_ec_response", v_headers); - - if (f_verify_pki_request_message(vc_eaPrivateEncKey, vc_eaWholeHash/*salt*/, ''O, v_request.request.body.binary_body.ieee1609dot2_data, false, v_request_hash, v_etsi_ts_102941_data, v_aes_enc_key) == false) { // Cannot decrypt the message - log("f_await_ec_request_send_response: Failed to verify PKI message ***"); - // Send error message - v_response := m_http_response(m_http_response_ko(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers, 400, "Bad request")); // Initialize v_reponse with an error message - } else { - log("f_await_ec_request_send_response: Receive ", v_etsi_ts_102941_data, " ***"); - if (f_verify_inner_ec_request_signed_for_pop(v_etsi_ts_102941_data, v_inner_ec_request) == false) { - log("f_await_ec_request_send_response: Failed to verify PKI message ***"); - // Send error message - f_http_build_inner_ec_response(v_inner_ec_request/*Not required*/, cantparse, v_request_hash, -, -, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - } else { - f_http_build_inner_ec_response(v_inner_ec_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - v_result := true; - } - f_http_send(v_headers, v_response); - } - } - [] tc_ac.timeout { - log("f_await_ec_request_send_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return v_result; - } // End of function f_await_ec_request_send_response - - function f_await_dc_request_send_response( - in charstring p_rca_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_ea_certificate_id, - out ToBeSignedRcaCtl p_ctl - ) runs on ItsPkiHttp return boolean { - var HttpMessage v_request; - var boolean v_result := false; - - log(">>> f_await_dc_request_send_response"); - - tc_ac.start; - alt { - [] a_await_dc_http_request_from_iut( - mw_http_request( - mw_http_request_post( - PICS_HTTP_POST_URI_DC - )), - v_request - ) { - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var ToBeSignedRcaCtl p_to_be_signed_rca_ctl; - var EtsiTs102941Data v_etsi_ts_102941_data; - var Oct16 v_request_hash; - var Oct16 v_aes_enc_key; - var template (value) HttpMessage v_response; - var Headers v_headers; - tc_ac.stop; - - f_init_default_headers_list(-, "inner_dc_response", v_headers); - - // Send message - f_build_dc_ctl( - p_rca_certificate_id, - p_aa_certificate_id, - p_ea_certificate_id, - p_to_be_signed_rca_ctl - ); - f_sign_dc_ctl(p_rca_certificate_id, p_to_be_signed_rca_ctl, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - f_http_send(v_headers, v_response); - v_result := true; - } - [] tc_ac.timeout { - log("f_await_dc_request_send_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return v_result; - } // End of function f_await_dc_request_send_response - - } // End of group awaiting_messages - - group pki_functions { - - /** - * @desc Build a signed and encrypted PKI request message - * @param p_private_key Private key for signature - * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_request_message_signed_with_pop( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, // TODO Use RCA to check encryption alg - in boolean p_alter_signature := false, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Signature v_signature; - var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var octetstring v_encoded_request; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_private_key= ", p_private_key); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_signer_identifier= ", p_signer_identifier); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_public_key_compressed= ", p_public_key_compressed); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_compressed_mode= ", p_compressed_mode); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_enc_algorithm= ", p_enc_algorithm); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_alter_signature= ", p_alter_signature); - - // Signed the encoded PKI message - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(p_pki_message) - ), - m_headerInfo_inner_pki_request(-, (f_getCurrentTime() * 1000)/*us*/) - ); - log("f_build_pki_secured_request_message_signed_with_pop: v_tbs: ", v_tbs); - if (ischosen(p_signer_identifier.self_)) { - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - } else { - var charstring v_certificate_id; - var octetstring v_hash; - // FIXME Huge issue, certificate is BP256 and PX_VE_ALG is e_brainpool_p384_r1, so v_hash & p_private_key are 32 bytes length not 48 - // ==> Need to sign with v_certificate_id capabilities not with PX_VE_ALG :( - fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); - } - log("f_build_pki_secured_request_message_signed_with_pop: lengthof(v_tbs_signed)= ", lengthof(v_tbs_signed)); - log("f_build_pki_secured_request_message_signed_with_pop: v_tbs_signed= ", v_tbs_signed); - if (p_alter_signature == true) { - v_tbs_signed[0] := '0A'O; - v_tbs_signed[1] := '0A'O; - log("f_build_pki_secured_request_message_signed_with_pop: Altered signature= ", v_tbs_signed); - } - // Add the signature and create EtsiTs103097Data-Signed data structure - log("f_build_pki_secured_request_message_signed_with_pop: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } - log("f_build_pki_secured_request_message_signed_with_pop: v_signature= ", v_signature); - v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - p_signer_identifier, - v_signature - ) - ); - // Encode EtsiTs103097Data-Signed data structure - v_encoded_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - log("f_build_pki_secured_request_message_signed_with_pop: v_encoded_request= ", v_encoded_request); - // Encrypt encode EtsiTs103097Data-Signed data structure - - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message_signed_with_pop: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message_signed_with_pop: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message_signed_with_pop: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message_signed_with_pop: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message_signed_with_pop: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message_signed_with_pop: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else { - log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); - return false; - } - - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_pki_message); - return true; - } // End of function f_build_pki_secured_request_message_signed_with_pop - - /** - * @desc Build a signed and encrypted PKI request message without POP with signature - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_request_message( - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message"); - - // Encrypt encode EtsiTs103097Data-Signed data structure - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_request_message - - function f_build_pki_secured_request_message_for_authorization( - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var Ieee1609Dot2Data v_unsecured_data; - var octetstring v_pki_message; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message_for_authorization"); - - // Add Ieee1609Dot2Data layer - v_unsecured_data := valueof(m_etsiTs103097Data_unsecured(p_pki_message)); - v_pki_message := bit2oct(encvalue(v_unsecured_data)); - - // Encrypt encode EtsiTs103097Data-Signed data structure - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message_for_authorization: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message_for_authorization: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message_for_authorization: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message_for_authorization: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message_for_authorization: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message_for_authorization: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message_for_authorization: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message_for_authorization: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message_for_authorization: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_request_message_for_authorization - - /** - * @desc Build a signed and encrypted PKI response message - * @param p_private_key Private key for signature - * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_response_message( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in octetstring p_pki_message, - in Oct16 p_aes_sym_key, - in Oct12 p_nonce, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var octetstring v_encoded_inner_ec_response; - var HashedId8 v_recipientId; - var octetstring v_encrypted_inner_ec_response; - - // Signed the encoded PKI message - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(p_pki_message) - ), - m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) - ); - if (ischosen(p_signer_identifier.self_)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - } else { - var charstring v_certificate_id; - var Oct32 v_hash; - fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); - } - // Add the signature and create EtsiTs103097Data-Signed data structure - v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - p_signer_identifier, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ) - ); - // Encode EtsiTs103097Data-Signed data structure - v_encoded_inner_ec_response := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - v_encrypted_inner_ec_response := fx_encrypt_aes_128_ccm_test(p_aes_sym_key, p_nonce, v_encoded_inner_ec_response); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_aes_sym_key)); - log("v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_pskRecipInfo( - v_recipientId - ) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_inner_ec_response - ) - ) - ) - ) - ); - - log("<<< f_build_pki_secured_response_message: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_response_message - - /** - * @desc Verify the protocol element of the Pki message. - * If p_check_security is set to false, only decryption and decoding of the outer message are verified. - * @param p_private_enc_key Private key for decryption - * @param p_salt - * @param p_p_ieee1609dot2_encrypted_and_signed_data - * @param p_check_security Set to true to verify PKI protocol element such as signatures... - * @param p_request_hash The request hash for to be used to build the response - * @param p_etsi_ts_102941_data The EtsiTs102941Data message - * @param p_aes_enc_key The AES 128 encrytion key to be used to encrypt the response - * @return true on success, false otherwise - */ - function f_verify_pki_request_message( - in Oct32 p_private_enc_key, - in Oct32 p_salt, - in octetstring p_issuer, - in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_security := true, - out Oct16 p_request_hash, - out EtsiTs102941Data p_etsi_ts_102941_data, - out Oct16 p_aes_enc_key - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var Certificate v_certificate; - var charstring v_certificate_id; - - log(">>> f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_request_message: p_salt= ", p_salt); - log(">>> f_verify_pki_request_message: p_issuer= ", p_issuer); - log(">>> f_verify_pki_request_message: p_ieee1609dot2_encrypted_and_signed_data= ", p_ieee1609dot2_encrypted_and_signed_data); - - // 1. Calculate the request Hash - v_msg := bit2oct(encvalue(p_ieee1609dot2_encrypted_and_signed_data)); - log("f_verify_pki_request_message: Encoded request: ", v_msg); - p_request_hash := substr(f_hashWithSha256(v_msg), 0, 16); - log("f_verify_pki_request_message: p_request_hash= ", p_request_hash); - - // 2. Decrypt the InnerEcRequest - log("f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); - if (f_decrypt(p_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, p_salt, v_ieee1609dot2_signed_data, p_aes_enc_key) == false) { - log("f_verify_pki_request_message: Failed to decrypt message"); - return false; - } - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); - log("f_verify_pki_request_message: p_aes_enc_key= ", p_aes_enc_key); - - // 3. Check basics security - log( - match( - v_ieee1609dot2_signed_data, - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload, - mw_ieee1609Dot2_headerInfo(c_its_aid_SCR) - ) - ) - ))); - if (match(v_ieee1609dot2_signed_data, mw_etsiTs103097Data_signed(mw_signedData(-, mw_toBeSignedData(mw_signedDataPayload)))) == false) { - log("f_verify_pki_request_message: Failed to check basic security"); - if (p_check_security == true) { - return false; - } - } - - // 4. Verifiy signature - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); - v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); - log("f_verify_pki_request_message: v_msg= ", v_msg); - if (p_issuer == ''O) { // self - log("f_verify_pki_request_message: Issuer is self, check outer signature using IUT public key (PICS_ITS_S_SIGN_xxx_PUBLIC_KEY)"); - var PublicVerificationKey v_verification_key; - - log("f_verify_pki_request_message: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); - } else { - v_verification_key.ecdsaNistP256.compressed_y_1 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaBrainpoolP256r1.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); - } else { - v_verification_key.ecdsaBrainpoolP256r1.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaBrainpoolP384r1.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); - } else { - v_verification_key.ecdsaBrainpoolP384r1.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); - } - } - log("f_verify_pki_request_message: v_verification_key=", v_verification_key); - if (f_verifyEcdsa(v_msg, int2oct(0, 32), v_ieee1609dot2_signed_data.content.signedData.signature_, v_verification_key) == false) { - if (p_check_security == true) { - return false; - } - } - //return false; - } else { - if (f_getCertificateFromDigest(f_hashedId8FromSha256(p_issuer), v_certificate, v_certificate_id) == false) { - if (p_check_security == true) { - return false; - } - } - log("f_verify_pki_request_message: v_certificate= ", v_certificate); - if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - if (p_check_security == true) { - return false; - } - } - } - - // 4. Return the PKI message - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - v_msg_bit := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_etsi_ts_102941_data) != 0) { - if (p_check_security == true) { - return false; - } - } - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - if (p_check_security == true) { - return false; - } - } - - log("<<< f_verify_pki_request_message: true"); - return true; - } // End of function f_verify_pki_request_message - - /** - * @desc Verify the protocol element of the Pki message. - * If p_check_security is set to false, only decryption and decoding of the outer message are verified. - * @param p_private_key Private key for decryption - * @param p_publicEphemeralCompressedKey - * @param p_publicEphemeralCompressedKeyMode - * @param p_issuer Issuer - * @param p_certificate Certificate to use for verification key - * @param p_ieee1609dot2_encrypted_and_signed_data The received encrypted and signed data - * @param p_check_security Set to true to verify PKI protocol element such as signatures... - * @param p_response_type Response type (0: InnerEcResponse, 1: InnerAtResponse...). Default: 0 - * @param p_etsi_ts_102941_data The EtsiTs102941Data message - * @return true on success, false otherwise - */ - function f_verify_pki_response_message( - in octetstring p_private_enc_key, - in Oct16 p_aes_sym_key, - in Oct16 p_authentication_vector, // TODO Tobe removed - in octetstring p_issuer, - in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_security := true, - in integer p_response_type := 0, - out EtsiTs102941Data p_etsi_ts_102941_data - ) return boolean { - // Local variables - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var octetstring v_plain_message; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var Certificate v_certificate; - var charstring v_certificate_id; - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var boolean v_ret; - - log(">>> f_verify_pki_response_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_response_message: p_aes_sym_key= ", p_aes_sym_key); - log(">>> f_verify_pki_response_message: p_authentication_vector= ", p_authentication_vector); - log(">>> f_verify_pki_response_message: p_issuer= ", p_issuer); - log(">>> f_verify_pki_response_message: p_check_security= ", p_check_security); - log(">>> f_verify_pki_response_message: p_response_type= ", p_response_type); - - // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo - - // 1. Decrypt the data - v_plain_message := fx_decrypt_aes_128_ccm_test(p_aes_sym_key, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.nonce, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.ccmCiphertext); - if (isbound(v_plain_message) == false) { - return false; - } - log("f_verify_pki_response_message: v_plain_message= ", v_plain_message); - - // 2. Decode it - v_tbs := oct2bit(v_plain_message); - if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { - return false; - } - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); - - // 3. Check the signature - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); - v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - if (p_check_security == true) { - return false; - } - } - if (f_verifyEcdsa(bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - if (p_check_security == true) { - return false; - } - } - - // 4. Verify EtsiTs103097Data-Signed HeaderInfo - // TODO Parameter p_response_type seems to be useless - if ((p_response_type == 0) or (p_response_type == 1)) { // InnerEcResponse & InnerAtResponse - log("f_verify_pki_response_message: headerInfo matching= ", match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response)); - if (match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response) == false) { - if (p_check_security == true) { - return false; - } - } - } // else, no check - - // 5. Return the PKI message - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { - return false; - } - - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - return false; - } - - return true; - } // End of function f_verify_pki_response_message - - /** - * @desc Verify the EC certificate generated by the EA entity - * @param p_ec_certificate The new EC certificate - * @param p_ea_certificate The certificate issuer - * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerEcRequest - * @param p_compressed_mode The public compressed key mode - * @return true on success, false otherwise - */ - function f_verify_ec_certificate( - in Certificate p_ec_certificate, - in Certificate p_ea_certificate, - in HashedId8 p_ea_hashed_id8, - in octetstring p_public_key_compressed, - in integer p_compressed_mode - ) return boolean { - var bitstring v_encoded_cert; - var Oct32 v_ec_cert_hash; - var HashedId8 v_ec_cert_hashed_id8; - - // Calculate the HashedId8 of the whole certificate - v_encoded_cert := encvalue(p_ec_certificate); - v_ec_cert_hash := f_hashWithSha256(bit2oct(v_encoded_cert)); - log("f_verify_ec_certificate: ==> EC certificate Hash: ", v_ec_cert_hash); - v_ec_cert_hashed_id8 := f_hashedId8FromSha256(v_ec_cert_hash); - log("f_verify_ec_certificate: ==> EC certificate HashedId8: ", v_ec_cert_hashed_id8); - - // Check the signer - log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8))); - log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8))); - if ( - (match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8)) == false) and - (match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8)) == false) - ) { - log("f_verify_ec_certificate: Wrong issuer"); - return false; - } - - // Check EC certificate signature - if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ea_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_ec_certificate: Signature not verified"); - return false; - } - - // TODO Check that requested information are present - - if (f_verifySspPermissions(p_ec_certificate.toBeSigned.appPermissions, p_ea_certificate.toBeSigned.appPermissions) == false) { - log("f_verify_ec_certificate: Ssp permissions not verified"); - return false; - } - - return true; - } // End of function f_verify_ec_certificate - - /** - * @desc Verify the generated AT certificate - * @param p_at_certificate The new AT certificate - * @param p_ea_certificate The certificate issuer - * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerAtRequest - * @param p_compressed_mode The public compressed key mode - * @return true on success, false otherwise - */ - function f_verify_at_certificate( - in Certificate p_at_certificate, - in Certificate p_aa_certificate, - in octetstring p_public_key_compressed, - in integer p_compressed_mode - ) return boolean { - var bitstring v_encoded_cert; - var HashedId8 v_at_cert_hashed_id8; - - // Calculate the HashedId8 of the whole certificate - v_encoded_cert := encvalue(p_at_certificate); - v_at_cert_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); - log("f_verify_at_certificate: EC certificate HashedId8: ", v_at_cert_hashed_id8); - - // Check the signer - log("f_verify_at_certificate: ", match(p_at_certificate.issuer, mw_issuerIdentifier_self())); - if (match(p_at_certificate.issuer, mw_issuerIdentifier_self)) { - return false; - } - - // Check EC certificate signature - if (f_verifyCertificateSignatureWithPublicKey(p_at_certificate, p_aa_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_at_certificate: Signature not verified"); - return false; - } - - // TODO Check that requested information are present - - if (f_verifySspPermissions(p_aa_certificate.toBeSigned.appPermissions, p_at_certificate.toBeSigned.appPermissions) == false) { - log("f_verify_ec_certificate: Ssp permissions not verified"); - return false; - } - - return true; - } // End of function f_verify_at_certificate - - } // End of group inner_ec_xxx - - group security_function { // TODO To be moved in LibItsSecurity_Function module - - function f_extract_enc_key( - in Certificate p_certificate, - out octetstring p_public_enc_key, - out integer p_compressed_enc_key_mode - ) return boolean { - log(">>> f_extract_enc_key: ", p_certificate); - - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256)) { - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - p_compressed_enc_key_mode := 0; - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - p_compressed_enc_key_mode := 1; - } else { - log("f_extract_enc_key: Non canonical certificate: ", p_certificate); - return false; - } - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1)) { - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - p_compressed_enc_key_mode := 0; - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - p_compressed_enc_key_mode := 0; - } else { - log("f_extract_enc_key: Non canonical certificate: ", p_certificate); - return false; - } - } else { - log("f_extract_enc_key: Invalid certificate: ", p_certificate); - return false; - } - - return true; - } // End of function f_extract_enc_key - - } // End of group security_function - - group altsteps { - - altstep a_default_pki_http() runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http - - altstep a_default_pki_http_ec() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpEcPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_ec - - altstep a_default_pki_http_atv() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_atv - - altstep a_default_pki_http_at() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpAtPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_at - - altstep a_default_pki_http_ca() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpCaPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_ca - - altstep a_default_pki_http_tlm() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_tlm - - altstep a_await_ec_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_request_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_ec_http_request_from_iut - - altstep a_await_ec_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_response_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_ec_http_response_from_iut - - altstep a_await_at_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_at_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(p_http_message) -> value p_response { - log("a_await_at_http_response_from_iut: Received message on httpAtPort"); - } - } // End of altstep a_await_at_http_response_from_iut - - altstep a_await_atv_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_request - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { - log("a_await_atv_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_request { - log("a_await_avt_http_request_from_iut: Received message on httpAtVPort"); - } - } // End of altstep a_await_atv_http_request_from_iut - - altstep a_await_atv_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_atv_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_response { - log("a_await_avt_http_response_from_iut: Received message on httpAtVPort"); - } - } // End of altstep a_await_atv_http_response_from_iut - - altstep a_await_dc_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_dc_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_dc_http_request_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_dc_http_request_from_iut - - } // End of group altsteps - -} // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn deleted file mode 100644 index c03ef560..00000000 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ /dev/null @@ -1,259 +0,0 @@ -module LibItsPki_Pics { - - /** - * @desc Does the IUT act as ITS-S device? - */ - modulepar boolean PICS_IUT_ITS_S_ROLE := false; - - /** - * @desc Does the IUT act as EA device? - */ - modulepar boolean PICS_IUT_EA_ROLE := true; - - /** - * @desc Does the IUT act as AA device? - */ - modulepar boolean PICS_IUT_AA_ROLE := true; - - /** - * @desc Does the IUT act as CA device? - */ - modulepar boolean PICS_IUT_CA_ROLE := true; - - /** - * @desc Does the IUT act as TLM device? - */ - modulepar boolean PICS_IUT_TLM_ROLE := true; - - /** - * @desc Does the IUT support enrolment? - */ - modulepar boolean PICS_SECPKI_ENROLMENT := true; - - /** - * @desc Does the IUT support autorization? - */ - modulepar boolean PICS_SECPKI_AUTHORIZATION := true; - - /** - * @desc Is a re-enrolment request? - */ - modulepar boolean PICS_SECPKI_REENROLMENT := false; - - /** - * @desc ? - */ - modulepar boolean PICS_SECPKI_CRL := false; - - /** - * @desc Do the Authorization Request use SignedWithPop mechanism? - */ - modulepar boolean PICS_PKI_AUTH_POP := true; - - /** - * @desc Certificate used by the IUT acting as ITS-S - */ - modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_AT"; - - /** - * @desc Certificate used by the IUT acting as EA - */ - modulepar charstring PICS_IUT_EA_CERTIFICATE_ID := "CERT_IUT_A_EA"; - - /** - * @desc Certificate used by the IUT acting as AA - */ - modulepar charstring PICS_IUT_AA_CERTIFICATE_ID := "CERT_IUT_A_AA"; - - /** - * @desc Certificate used by the IUT acting as AA - */ - modulepar charstring PICS_IUT_CA_CERTIFICATE_ID := "CERT_IUT_A_RCA"; - - /** - * @desc Certificate used by the Test System acting as ITS-S - */ - modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_AT"; - - /** - * @desc Certificate used by the Test System acting as EA - */ - modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_TS_A_EA"; - - /** - * @desc Certificate used by the Test System acting as AA - */ - modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_TS_A_AA"; - - /** - * @desc Certificate used by the Test System acting as EA - */ - modulepar charstring PICS_TS_CA_CERTIFICATE_ID := "CERT_TS_RCA_A"; - - /** - * @desc Set to true if different end points are used for EC and AT - */ - modulepar boolean PICS_MULTIPLE_END_POINT := false; - - /** - * @desc End point for the enrolment - */ - modulepar charstring PICS_HEADER_HOST_EC := "www.its.ec.org"; - - /** - * @desc End point for the authorization validation - */ - modulepar charstring PICS_HEADER_HOST_ATV := "www.its.atv.org"; - - /** - * @desc End point for the authorization - */ - modulepar charstring PICS_HEADER_HOST_AT := "www.its.at.org"; - - /** - * @desc End point for the CA - */ - modulepar charstring PICS_HEADER_HOST_CA := "www.its.ca.org"; - - /** - * @desc End point for the TLM - */ - modulepar charstring PICS_HEADER_HOST_TLM := "www.its.tlm.org"; - - /** - * @desc - */ - modulepar charstring PICS_HTTP_POST_URI_DC := "www.its.ec.org"; - - /** - * @desc Certificate used by the Test System - */ - modulepar charstring PICS_HTTP_POST_URI := "/its/inner_ec_request"; - - /** - * @desc ITS-S with privacy - */ - modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; - - /** - * @desc Set to true if the PKI configuration authorize to configure an external EA entity - */ - - modulepar boolean PICS_SIMULATE_EA_ENTITY := false; - - /** - * @desc Set to true if the PKI configuration authorize to configure an external AA entity - */ - modulepar boolean PICS_SIMULATE_AA_ENTITY := false; - - /** - * @desc HTTP POST URI for InnerECRequest - */ - modulepar charstring PICS_HTTP_POST_URI_EC := "/enrolment"; - - /** - * @desc HTTP POST URI for InnerATRequest - */ - modulepar charstring PICS_HTTP_POST_URI_AT := "/authorize"; - - /** - * @desc HTTP POST URI for authorization validation - */ - modulepar charstring PICS_HTTP_POST_URI_ATV := "/authorize_validate"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CA := "/dc/getctl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_ECTL := "/tlm/getectl"; - - /** - * @desc Factory private key for verification Nist P256 - */ - modulepar octetstring PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY := '5C25F97607DFC62972A147FAD8B7A7C939569F0F95ECD4C641724A68B51836E5'O; - - /** - * @desc Factory compressed public key for verification Nist P256 - */ - modulepar octetstring PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY := '020144E5174B0AFDA86BDB8B643B68D40030F5BDB9A9F090C64852CC3C20C9D5AD'O; - - /** - * @desc Factory private key for encryption Nist P256 - */ - modulepar octetstring PICS_ITS_S_ENC_NITSP256_PRIVATE_KEY := 'EDEBEADCAA9514CD4B30256126FB7DF958B911C6EB58CCF702983C3DCD3DECBD'O; - - /** - * @desc Factory compressed public key for encryption Nist P256 - */ - modulepar octetstring PICS_ITS_S_ENC_NISTP256_PUBLIC_KEY := '023A4ADDCDD5EE66DAB2116B0C3AB47CCEDAE92CD9ACE98A84B10EB63A9DCA798C'O; - - /** - * @desc Factory private key for encryption Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PRIVATE_KEY := '9F155D40B6C920BA45D8027093C8ADADAF3AA6F9F71F0CC0F8279FF0146A8A48'O; - - /** - * @desc Factory compressed public key for encryption Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PUBLIC_KEY := '038602F468BD334EA4D2BA416295E204D58BD1F42C85FB9BE57237C74544F6A69A'O; - - /** - * @desc Factory private key for verification Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY := '2CCBC88C6AD0FBB78AE50DA63366E64445F069369CED4605485442F524A0791E'O; - - /** - * @desc Factory compressed public key for verification Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY := '02A7A21F8FEE8DF454B7AF80A7C78CBC506C16F491C72BDC54F0CE98F20C15C59B'O; - - /** - * @desc Factory private key for encryption Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PRIVATE_KEY := '6B4B4392511B252C904801466F5DA0A7F28E038E6656800CBB0CDCB3D32F862CA4D59CBDC1A19E98E9191582AF1DB3D7'O; - - /** - * @desc Factory private key for verification Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY := '0F94E957F915B39E545FE845A8B4681D52F9D144353FFE36879F3DC9AFDE4001EDE55D5234EB977425E44D95BD6D3328'O; - - /** - * @desc Factory compressed public key for verification Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY := '0210E2B13DCC736F22A1E9C6E156177BD0CB106D34897EF8D596CF3A7AC4034003AD2BB3FA4F65C723F665BEF089858C4F'O; - - /** - * @desc Canonical ITSS-S identifier - */ - modulepar octetstring PICS_ITS_S_CANONICAL_ID := '455453492D4954532D303031'O; - - /** - * @desc Invalid Canonical ITSS-S identifier - */ - modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := '455453492D4954532D30303145454545'O; - - /** - * @desc Set to true if the IUT support CertificateId shall be set to the choice name - * @see ETSI TS 103 097 Clause 7.2.2 Enrolment credential - */ - modulepar boolean PICS_EC_SUBJECT_ATTRIBUT_ID := false; - - modulepar boolean PICS_SEC_IMPLICIT_CERTIFICATES := false; - - modulepar boolean PICS_SEC_EXPLICIT_CERTIFICATES := true; - -} // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn deleted file mode 100644 index 8db552eb..00000000 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ /dev/null @@ -1,79 +0,0 @@ -module LibItsPki_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - /** - * @desc Do the encryption keys be included in Authorization Request? - */ - modulepar boolean PX_INCLUDE_ENCRYPTION_KEYS := true; - - /** - * @desc Contains the private key for the EC certificate, used in case of re-enrolment - */ - modulepar Oct32 PX_EC_PRIVATE_KEY := int2oct(0, 32); - - /** - * @desc Contains the hashed id8 of the EC certificate, used in case of re-enrolment - */ - modulepar HashedId8 PX_EC_HASHED_ID8 := int2oct(0, 8); - - /** - * @desc Contains the hash of the EC certificate, used in case of re-enrolment - */ - modulepar Oct32 PX_EC_HASH := int2oct(0, 32); - - /** - * @desc Indicate which encryption algorithem to be used for Enrolment Credencial - */ - modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm? - /** - * @desc Indicate which encryption algorithem to be used for Authorization Request (AA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256; - /** - * @desc Indicate which encryption algorithem to be used for Authorization Validation Request (EA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256; - /** - * @desc Indicate which encryption algorithem to be used for EcSignature (EA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_EC_SIGN := e_nist_p256; - - /** - * @desc Indicate which verification algorithem to be used - */ - modulepar SecurityAlg PX_VE_ALG := e_nist_p256; - - modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; - - modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR := '01C0'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR := '01FF'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_VERSION := '00C0'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_SSP_BIT := '0180'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM := '830001'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM := '830001'O; - - modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM := '01FFFC'O; - - modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM := '01FFFFFF'O; - -} // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn deleted file mode 100644 index e8f3cb63..00000000 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ /dev/null @@ -1,671 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for IT PKI Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsPki_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesCa language "ASN.1:1997" all; - import from EtsiTs102941TrustLists language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop( - in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop - ) := { - version := PkiProtocolVersion, - content := { - enrolmentRequest := p_inner_ec_request_signed_for_pop - } - } // End of template m_etsiTs102941Data_inner_ec_request_signed_for_pop - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response( - in template (value) InnerEcResponse p_inner_ec_response - ) := { - version := PkiProtocolVersion, - content := { - enrolmentResponse := p_inner_ec_response - } - } // End of template m_etsiTs102941Data_inner_ec_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response( - in template (value) InnerAtResponse p_inner_at_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationResponse := p_inner_at_response - } - } // End of template m_etsiTs102941Data_inner_at_response - - template (present) EtsiTs102941Data mw_etsiTs102941Data_inner_ec_response( - template (present) InnerEcResponse p_inner_ec_response := ? - ) := { - version := PkiProtocolVersion, - content := { - enrolmentResponse := p_inner_ec_response - } - } // End of template mw_etsiTs102941Data_inner_ec_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_request( - in template (value) InnerAtRequest p_inner_at_request - ) := { - version := PkiProtocolVersion, - content := { - authorizationRequest := p_inner_at_request - } - } // End of template m_etsiTs102941Data_authorization_request - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_response( - in template (value) InnerAtResponse p_inner_at_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationResponse := p_inner_at_response - } - } // End of template m_etsiTs102941Data_authorization_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( - in template (value) AuthorizationValidationRequest p_authorization_validation_request - ) := { - version := PkiProtocolVersion, - content := { - authorizationValidationRequest := p_authorization_validation_request - } - } // End of template m_etsiTs102941Data_authorization_validation_request - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( - in template (value) AuthorizationValidationResponse p_authorization_validation_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationValidationResponse := p_authorization_validation_response - } - } // End of template m_etsiTs102941Data_authorization_validation_response - - template (present) EtsiTs103097Data/*EnrolmentRequestMessage*/mw_enrolmentRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentRequestMessage - - template (present) EtsiTs103097Data/*EnrolmentResponseMessage*/mw_enrolmentResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentResponseMessage - - template (value) EtsiTs103097Data m_authorizationValidationRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationValidationRequestMessage - - template (present) EtsiTs103097Data mw_authorizationValidationResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationValidationResponseMessage - - template (value) EtsiTs103097Data/*AuthorizationRequestMessage*/ m_authorizationRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationRequestMessage - - template (present) EtsiTs103097Data/*AuthorizationRequestMessage*/ mw_authorizationRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationRequestMessage - - template (value) EtsiTs103097Data/*AuthorizationResponseMessage*/ m_authorizationResponseMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationResponseMessage - - template (present) EtsiTs103097Data/*AuthorizationResponseMessage*/ mw_authorizationResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationResponseMessage - - template (value) EtsiTs102941Data m_etsiTs102941Data_to_be_signed_rca_ctl( - in template (value) ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListRca := p_to_be_signed_rca_ctl - } - } // End of template m_etsiTs102941Data_to_be_signed_rca_ctl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_rca_ctl( - template (present) ToBeSignedRcaCtl p_to_be_signed_rca_ctl := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListRca := p_to_be_signed_rca_ctl - } - } // End of template mw_etsiTs102941Data_to_be_signed_rca_ctl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_crl( - template (present) ToBeSignedCrl p_to_be_signed_crl := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateRevocationList := p_to_be_signed_crl - } - } // End of template mw_etsiTs102941Data_to_be_signed_crl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_tlm_ctl( - template (present) ToBeSignedTlmCtl p_to_be_signed_tlm := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListTlm := p_to_be_signed_tlm - } - } // End of template mw_etsiTs102941Data_to_be_signed_crl - - template (value) EtsiTs102941DataContent m_enrolmentRequest( - in template (value) InnerEcRequestSignedForPop p_enrolmentRequest - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template m_enrolmentRequest - - template (present) EtsiTs102941DataContent mw_enrolmentRequest( - template (present) InnerEcRequestSignedForPop p_enrolmentRequest := ? - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template mw_enrolmentRequest - - template (present) InnerEcRequestSignedForPop mw_innerEcRequestSignedForPop( - template (present) SignedData p_signedData := ? - ) modifies mw_etsiTs103097Data_signed := { - } // End of template mw_innerEcRequestSignedForPop - - template (present) EtsiTs102941DataContent mw_enrolmentResponse( - template (present) InnerEcResponse p_enrolmentResponse := ? - ) := { - enrolmentResponse := p_enrolmentResponse - } // End of template mw_enrolmentResponse - - template (value) EtsiTs102941DataContent m_authorizationRequest( - in template (value) InnerAtRequest p_authorizationRequest - ) := { - authorizationRequest := p_authorizationRequest - } // End of template m_authorizationRequest - - template (present) EtsiTs102941DataContent mw_authorizationRequest( - in template (present) InnerAtRequest p_authorizationRequest := ? - ) := { - authorizationRequest := p_authorizationRequest - } // End of template mw_authorizationRequest - - template (present) EtsiTs102941DataContent mw_authorizationResponse( - template (present) InnerAtResponse p_authorizationResponse := ? - ) := { - authorizationResponse := p_authorizationResponse - } // End of template mw_authorizationResponse - - template (present) EtsiTs102941DataContent mw_authorizationValidationRequest( - template (present) AuthorizationValidationRequest p_authorization_validation_request := ? - ) := { - authorizationValidationRequest := p_authorization_validation_request - } // End of template mw_authorizationValidationRequest - - template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( - template (present) AuthorizationValidationResponse p_authorization_validation_response := ? - ) := { - authorizationValidationResponse := p_authorization_validation_response - } // End of template mw_authorizationValidationResponse - - template (value) InnerEcRequest m_innerEcRequest( - in template (value) octetstring p_itsId, - in template (value) PublicKeys p_publicKeys, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_innerEcRequest - - template (present) InnerEcRequest mw_innerEcRequest( - template (present) octetstring p_itsId := ?, - template (present) PublicKeys p_publicKeys := ?, - template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template mw_innerEcRequest - - template (value) InnerAtRequest m_innerAtRequest( - in template (value) PublicKeys p_publicKeys, - in template (value) Oct32 p_hmacKey, - in template (value) SharedAtRequest p_sharedAtRequest, - in template (value) EcSignature p_ecSignature - ) := { - publicKeys := p_publicKeys, - hmacKey := p_hmacKey, - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template m_innerAtRequest - - template (present) InnerAtRequest mw_innerAtRequest( - template (present) PublicKeys p_publicKeys := ?, - template (present) Oct32 p_hmacKey := ?, - template (present) SharedAtRequest p_sharedAtRequest := ?, - template (present) EcSignature p_ecSignature := ? - ) := { - publicKeys := p_publicKeys, - hmacKey := p_hmacKey, - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template mw_innerAtRequest - - template (omit) PublicKeys m_publicKeys( - in template (value) PublicVerificationKey p_verificationKey, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template m_publicKeys - - template PublicKeys mw_publicKeys( - template (present) PublicVerificationKey p_verificationKey := ?, - template PublicEncryptionKey p_encryptionKey := * - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template mw_publicKeys - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { none_ := NULL }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes_id_none - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_omit( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) modifies m_certificateSubjectAttributes_id_none := { - id := omit - } // End of template m_certificateSubjectAttributes_id_omit - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name( - in template (value) Hostname p_name, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { name := p_name }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes_id_name - - template (value) InnerEcResponse m_innerEcResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerEcResponse_ok - - template (present) InnerEcResponse mw_innerEcResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template mw_innerEcResponse_ok - - template (value) InnerEcResponse m_innerEcResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) EnrolmentResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerEcResponse_ko - - template (present) InnerEcResponse mw_innerEcResponse_ko( - template (present) Oct16 p_requestHash := ?, - template (present) EnrolmentResponseCode p_responseCode := complement(ok) - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template mw_innerEcResponse_ko - - template (value) InnerAtResponse m_innerAtResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerAtResponse_ok - - template (present) InnerAtResponse mw_innerAtResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template mw_innerAtResponse_ok - - template (value) InnerAtResponse m_innerAtResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) AuthorizationResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerAtResponse_ko - - template (present) InnerAtResponse mw_innerAtResponse_ko( - template (present) Oct16 p_requestHash := ?, - template (present) AuthorizationResponseCode p_responseCode := complement(ok) - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template mw_innerAtResponse_ko - - template (value) AuthorizationValidationRequest m_authorization_validation_request( - in template (value) SharedAtRequest p_sharedAtRequest, - in template (value) EcSignature p_ecSignature - ) := { - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template m_authorization_validation_request - - template (present) AuthorizationValidationRequest mw_authorization_validation_request( - template (present) SharedAtRequest p_sharedAtRequest := ?, - template (present) EcSignature p_ecSignature := ? - ) := { - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template mw_authorization_validation_request - - template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ok( - template (value) Oct16 p_requestHash, - template (value) CertificateSubjectAttributes p_confirmedSubjectAttributes - ) := { - requestHash := p_requestHash, - responseCode := ok, - confirmedSubjectAttributes := p_confirmedSubjectAttributes - } // End of template m_authorizationValidationResponse_ok - - template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - confirmedSubjectAttributes := p_confirmedSubjectAttributes - } // End of template mw_authorizationValidationResponse_ok - - template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) AuthorizationValidationResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - confirmedSubjectAttributes := omit - } // End of template m_authorizationValidationResponse_ko - - template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko( - template (present) Oct16 p_requestHash := ? - ) := { - requestHash := p_requestHash, - responseCode := complement(ok), - confirmedSubjectAttributes := omit - } // End of template mw_authorizationValidationResponse_ko - - template (value) SharedAtRequest m_shared_at_request( - in template (value) HashedId8 p_eaId, - in template (value) Oct16 p_keyTag, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes - ) := { - eaId := p_eaId, - keyTag := p_keyTag, - certificateFormat := 1, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_shared_at_request - - template (present) SharedAtRequest mw_shared_at_request( - template (present) HashedId8 p_eaId := ?, - template (present) Oct16 p_keyTag := ?, - template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? - ) := { - eaId := p_eaId, - keyTag := p_keyTag, - certificateFormat := 1, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template mw_shared_at_request - - template (value) EcSignature m_ec_signature( - in template (value) EtsiTs103097Data p_encryptedEcSignature - ) := { - encryptedEcSignature := p_encryptedEcSignature - } // End of template m_ec_signature - - template (present) EcSignature mw_ec_signature( - template (present) EtsiTs103097Data p_encryptedEcSignature := ? - ) := { - encryptedEcSignature := p_encryptedEcSignature - } // End of template mw_ec_signature - - template (value) EcSignature m_ec_signature_ext_payload( - in template (value) EtsiTs103097Data p_ecSignature - ) := { - ecSignature := p_ecSignature - } // End of template m_ec_signature_ext_payload - - template (present) EcSignature mw_ec_signature_ext_payload( - template (present) EtsiTs103097Data p_ecSignature := ? - ) := { - ecSignature := p_ecSignature - } // End of template mw_ec_signature_ext_payload - - template (omit) CertificateSubjectAttributes m_certificate_subject_attributes( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (omit) CertificateId p_id := omit, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := p_id, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template m_certificate_subject_attributes - - template CertificateSubjectAttributes mw_certificate_subject_attributes( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template CertificateId p_id := *, - template (present) ValidityPeriod p_validityPeriod := ?, - template SubjectAssurance p_assuranceLevel := *, - template GeographicRegion p_region := *, - template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit - ) := { - id := p_id ifpresent, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template mw_certificate_subject_attributes - - template CertificateSubjectAttributes mw_certificate_subject_attributes_optional_assuranceLevel( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) CertificateId p_id := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template SubjectAssurance p_assuranceLevel := *, - template GeographicRegion p_region := *, - template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit - ) := { - id := p_id, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template mw_certificate_subject_attributes - - template (value) ToBeSignedRcaCtl m_to_be_signed_rca_full_ctl( - in Time32 p_next_update, - in UInt8 p_ctl_sequence, - in CtlCommands p_ctl_commands -) := { - version := 1, - nextUpdate := p_next_update, - isFullCtl := true, - ctlSequence := p_ctl_sequence, - ctlCommands := p_ctl_commands - } // End of template m_to_be_signed_rca_ful_ctl - - template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_full_ctl := { - version := 1, - nextUpdate := ?, - isFullCtl := true, - ctlSequence := ?, - ctlCommands := ? - } // End of template mw_to_be_signed_rca_ful_ctl - - template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_delta_ctl := { - version := 1, - nextUpdate := ?, - isFullCtl := false, - ctlSequence := ?, - ctlCommands := ? - } // End of template mw_to_be_signed_rca_delta_ctl - - template (value) ToBeSignedCrl m_to_be_signed_crl( - in Time32 p_this_update, - in Time32 p_next_update, - in CrlEntries p_entries - ) := { - version := 1, - thisUpdate := p_this_update, - nextUpdate := p_next_update, - entries := p_entries - } // End of template m_to_be_signed_crl - - template (present) ToBeSignedCrl mw_to_be_signed_crl := { - version := 1, - thisUpdate := ?, - nextUpdate := ?, - entries := ? - } // End of template mw_to_be_signed_crl - - template (present) TlmEntry mw_tlm_entry( - template (present) EtsiTs103097Certificate p_selfSignedTLMCertificate := ?, - template (present) Url p_accessPoint := ? - ) := { - selfSignedTLMCertificate := p_selfSignedTLMCertificate, - linkTLMCertificate := *, - accessPoint := p_accessPoint - } // End of template mw_tlm_entry - - template (value) RootCaEntry m_root_ca_entry( - in template (value) EtsiTs103097Certificate p_selfsignedRootCa - ) := { - selfsignedRootCa := p_selfsignedRootCa, - linkRootCaCertificate := omit - } // End of template m_root_ca_entry - - template (present) RootCaEntry mw_root_ca_entry( - template (present) EtsiTs103097Certificate p_selfsignedRootCa := ? - ) := { - selfsignedRootCa := p_selfsignedRootCa, - linkRootCaCertificate := * - } // End of template mw_root_ca_entry - - template (value) EaEntry m_ea_entry( - in template (value) EtsiTs103097Certificate p_eaCertificate, - in template (value) Url p_aaAccessPoint - ) := { - eaCertificate := p_eaCertificate, - aaAccessPoint := p_aaAccessPoint, - itsAccessPoint := omit - } // End of template m_ea_entry - - template (present) EaEntry mw_ea_entry( - template (present) EtsiTs103097Certificate p_eaCertificate := ?, - template (present) Url p_aaAccessPoint := ? - ) := { - eaCertificate := p_eaCertificate, - aaAccessPoint := p_aaAccessPoint, - itsAccessPoint := * - } // End of template mw_ea_entry - - template (value) AaEntry m_aa_entry( - in template (value) EtsiTs103097Certificate p_aaCertificate, - in template (value) Url p_accessPoint - ) := { - aaCertificate := p_aaCertificate, - accessPoint := p_accessPoint - } // End of template m_aa_entry - - template (present) AaEntry mw_aa_entry( - template (present) EtsiTs103097Certificate p_aaCertificate := ?, - template (present) Url p_accessPoint := ? - ) := { - aaCertificate := p_aaCertificate, - accessPoint := p_accessPoint - } // End of template mw_aa_entry - - template (present) DcEntry mw_dc_entry( - template (present) Url p_url := ?, - template (present) HashedId8s p_cert := ? - ) := { - url := p_url, - cert := p_cert - } // End of template mw_dc_entry - -} // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn deleted file mode 100644 index f6a7f354..00000000 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Test System module for ITS PKI - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsPki_TestSystem { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesCa language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; - - // LibItsSecurity - import from LibItsSecurity_TestSystem all; - - // LibItsHttp - import from LibItsHttp_TestSystem all; - - group portDefinitions { - - /** - * @desc Upper Tester port - */ - type port UpperTesterPkiPort message { - out UtPkiInitialize, UtPkiTrigger; - in UtPkiResults; - } // End of UpperTesterPort - - type port InfoPort message { - inout InfoPortData - } with { - extension "internal" - } // End of InfoPort - - } // End of group portDefinitions - - group componentDefinitions { - - /** - * @desc System component - */ - type component ItsPkiHttpSystem extends HttpTestAdapter{ - /** Use httPort when EC and AT are served by the same end point */ - port HttpPort httpEcPort; /** Enrolment end point */ - port HttpPort httpAtVPort; /** Authorization Validation end point */ - port HttpPort httpAtPort; /** Authorization end point */ - port HttpPort httpCaPort; /** CA CTL/CRL end point */ - port HttpPort httpTlmPort; /** TLM ECTL end point */ - } // End of component ItsPkiHttpSystem - - type component ItsPkiItssSystem extends ItsPkiHttpSystem { - port UpperTesterPkiPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItssSystem - - /** - * @desc Test component for PKI entities execpt ITS-S - */ - type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { - /** Use httPort when EC and AT are served by the same end point */ - port HttpPort httpEcPort; /** Enrolment end point */ - port HttpPort httpAtVPort; /** Authorization Validation end point */ - port HttpPort httpAtPort; /** Authorization end point */ - port HttpPort httpCaPort; /** CA CTL/CRL end point */ - port HttpPort httpTlmPort; /** TLM ECTL end point */ - - port InfoPort infoPort; - - var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ - var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ - var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ - var octetstring vc_eaWholeHash; /** Test Adapter EA whole-hash for signature check */ - var octetstring vc_eaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ - var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ - var octetstring vc_aaPrivateKey; /** Test Adapter AA private key for signature */ - var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ - var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ - var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ - var octetstring vc_aaWholeHash256; /** Test Adapter AA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ - - var PrivateEcKeys vc_ec_private_keys; - var PublicCompressedEcKeys vc_ec_public_compressed_key; - var EcCompressedModes vc_ec_compressed_modes; - var EcHashedId8 vc_ec_hashed_id8; - var EcCertificates vc_ec_certificates; - var integer vc_ec_keys_counter; - } // End of component ItsPkiHttp - - /** - * @desc Test component for ITS-S entity - */ - type component ItsPkiItss extends ItsPkiHttp { - port UpperTesterPkiPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItss - - } // End of group componentDefinitions - -} // End of module LibItsPki_TestSystem diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn deleted file mode 100644 index 0d602c05..00000000 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for IT PKI Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsPki_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - import from EtsiTs102941TrustLists language "ASN.1:1997" all; - - group constants { - - const integer PkiProtocolVersion := 1; - - } // End of group constants - - type enumerated SecurityAlg { - e_nist_p256 (0), - e_brainpool_p256_r1 (1), - e_brainpool_p384_r1 (2) - } // End of type SecurityAlg - - type set of PublicVerificationKey ListOfPublicVerificationKey; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize ITS-S IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtPkiInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the PKI ITS-S IUT - */ - type union UtPkiResults { - boolean utPkiInitializeResult, - boolean utPkiTriggerResult - } with { - variant "" - } // End of type UtPkiResults - - /** - * @desc UT primitives for PKI ITS-S IUT - * @member triggerEnrolmentRequest Request to trigger an EnrolmentRequest - */ - type union UtPkiTrigger { - TriggerEnrolmentRequest triggerEnrolmentRequest, - TriggerAuthorizationRequest triggerAuthorizationRequest - } with { - variant "" - } // End of type UtPkiTrigger - - /** - * @desc Request to trigger an EnrolmentRequest - * @member cannonicalId The canonical identifier of the ITS-S - * @member encAlgorithm The encrypion algorithm to be used (Nist P256 or Brainpool P256) - * @member privateKey The private key to be used for signature of the requested EA certificate - * @member compressedPublickey The compressed public key to be used for signature of the requested EA certificate (format: [02|03] - */ - type record TriggerEnrolmentRequest { - octetstring cannonicalId, - Oct1 encAlgorithm, - octetstring privateKey, - octetstring compressedPublickey - } with { - variant "FIELDORDER(msb)" - } // End of type TriggerEnrolmentRequest - - type record TriggerAuthorizationRequest { - octetstring cannonicalId, - Oct1 encAlgorithm, - octetstring privateKey, - octetstring compressedPublickey - } with { - variant "FIELDORDER(msb)" - } // End of type TriggerAuthorizationRequest - - } with { - encode "UpperTester" - variant "" - } // End of group utPrimitives - - group acPrimitives { - - /** - * @desc TA primitives for Pki - */ - type union AcPkiPrimitive { - AcSetSecurityData acSetSecurityData - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - */ - type union AcPkiResponse { - boolean result - } with { - variant "" - } - - type record AcSetSecurityData { - charstring certificateId, - charstring peer_certificateId, - octetstring private_key, - octetstring public_key_compressed, - integer public_key_compressed_mode - } with { - variant "" - encode "LibItsPki" - } // AcSetSecurityData - - } with { - variant "" - encode "AdapterControl" - } // End of group acPrimitives - - type record InfoPortData { - octetstring hashed_id8, - EtsiTs103097Certificate at_certificate - } // End of type InfoPortData - - type record of CrlEntry CrlEntries; - - type record of CtlCommand CtlCommands; - - type record of octetstring PrivateEcKeys; - type record of octetstring PublicCompressedEcKeys; - type record of integer EcCompressedModes; - type record of HashedId8 EcHashedId8; - type record of EtsiTs103097Certificate EcCertificates; -} -with { - variant "" - encode "LibItsPki" -} // End of module LibItsPki_TypesAndValues diff --git a/ttcn/Pki/module.mk b/ttcn/Pki/module.mk deleted file mode 100644 index 24fe315b..00000000 --- a/ttcn/Pki/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsPki_EncdecDeclarations.ttcn \ - LibItsPki_Functions.ttcn \ - LibItsPki_Pics.ttcn \ - LibItsPki_Pixits.ttcn \ - LibItsPki_Templates.ttcn \ - LibItsPki_TestSystem.ttcn \ - LibItsPki_TypesAndValues.ttcn diff --git a/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn b/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn deleted file mode 100644 index 3573ca22..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,43 +0,0 @@ -module LibItsRtcmem_EncdecDeclarations { - - // LibIts - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsRtcmem - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_TestSystem all; - - external function fx_enc_RtcmemReq (RtcmemReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_RtcmemReq (inout bitstring b, out RtcmemReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_RtcmemInd (inout bitstring b, out RtcmemInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_RTCMEM (RTCMEM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_RTCMEM (inout bitstring b, out RTCMEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtRtcmemInitialize (UtRtcmemInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemTrigger (UtRtcmemTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemUpdate (UtRtcmemUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemTermination (UtRtcmemTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtRtcmemResults (inout bitstring b, out UtRtcmemResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtRtcmemEventInd (inout bitstring b, out UtRtcmemEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsRtcmem_EncdecDeclarations diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn deleted file mode 100644 index d24c6271..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ /dev/null @@ -1,394 +0,0 @@ -module LibItsRtcmem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsRtcmem - import from LibItsRtcmem_TestSystem all; - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_Templates all; - import from LibItsRtcmem_Pics all; - import from LibItsRtcmem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtRtcmemInitialize p_init) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtRtcmemResults: { utRtcmemInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtRtcmemTrigger p_event - ) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utUpdateEvent( - in template (value) UtRtcmemUpdate p_event - ) runs on ItsRtcmem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Update failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - - return; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtRtcmemTermination p_event) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := true}) { - tc_wait.stop; - } - [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := false}) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Termination failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - - } - - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsRtcmem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsRtcmem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsRtcmem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsRtcmem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsRtcmem { - [vc_rtcmemDefaultActive] rtcmemPort.receive(mw_rtcmemInd(mw_rtcmemPdu(mw_defaultRtcmem))) { - log("*** " & testcasename() & ": INFO: RTCMEM received in default ***"); - vc_rtcmemReceived := true; - repeat; - } - [vc_rtcmemDefaultActive] rtcmemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsRtcmem { - var UtRtcmemEventInd v_rtcmemevent; - - [] utPort.receive(UtRtcmemEventInd:?) -> value v_rtcmemevent { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_rtcmemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group rtcmemConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsRtcmem system ItsRtcmemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:rtcmemPort, system:rtcmemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - //Initialze the IUT - f_prInitialState(); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsRtcmem system ItsRtcmemSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:rtcmemPort, system:rtcmemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - } // End of of rtcmemConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsRtcmem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsRtcmem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_rtcmemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_rtcmemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsRtcmem { - //empty - } - - } // End of group postambles - - group sendFunctions { - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a RTCMEM and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitRtcmeMessage( - in template (present) RtcmemInd p_rcvMsg, - out RtcmemInd p_rcvdMsg - ) runs on ItsRtcmem { - - tc_ac.start; - alt { - [] rtcmemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - -} // End of module LibItsRtcmem_Functions diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn deleted file mode 100644 index 448f32b2..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn +++ /dev/null @@ -1,30 +0,0 @@ -module LibItsRtcmem_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for RTCMEM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_RTCMEM_GENERATION := true; - - /** - * @desc Support for RTCMEM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_RTCMEM_RECEPTION := true; - - /** - * @desc Does IUT support GeoNetworking short range? - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SHORT_RANGE := true; - -} // End of module LibItsRtcmem_Pics diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn deleted file mode 100644 index f4018e8a..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn +++ /dev/null @@ -1,3 +0,0 @@ -module LibItsRtcmem_Pixits { - -} // End of module LibItsRtcmem_Pixits diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn deleted file mode 100644 index 49f30843..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ /dev/null @@ -1,277 +0,0 @@ -module LibItsRtcmem_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsRtcmem - import from LibItsRtcmem_TestSystem all; - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_Pixits all; - - group primitivesTemplates { - - /** - * @desc Send template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The RTCMEM Message to be sent - */ - template (value) RtcmemReq m_rtcmemReq( - in template (value) RTCMEM p_rtcmemMsg - ) := { - msgOut := p_rtcmemMsg - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - */ - template (present) RtcmemInd mw_rtcmemInd( - template (present) RTCMEM p_rtcmemMsg - ) := { - msgIn := p_rtcmemMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) RtcmemInd mw_rtcmemIndWithGnParameters( - template (present) RTCMEM p_rtcmemMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_rtcmemInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg Expected RTCMEM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template (present) RtcmemInd mw_rtcmemIndWithBtpParameters( - template (present) RTCMEM p_rtcmemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_rtcmemInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) RtcmemInd mw_rtcmemIndWithSecurityParameters( - template (present) RTCMEM p_rtcmemMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_rtcmemInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - } - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - template (value) UtRtcmemInitialize m_rtcmemInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (omit) UtRtcmemTrigger m_utTriggerEvent( - in MsgCount p_msgCnt, - in RTCM_Revision p_rev := rtcmRev3, - in RTCMmessageList p_msgs, - in template (omit) MinuteOfTheYear p_timeStamp := omit, - in template (omit) FullPositionVector p_anchorPoint := omit, - in template (omit) RTCMheader p_rtcmHeader := omit - ) := { - msgCnt := p_msgCnt, - rev := p_rev, - msgs := p_msgs, - timeStamp := p_timeStamp, - anchorPoint := p_anchorPoint, - rtcmHeader := p_rtcmHeader - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (omit) UtRtcmemTermination m_utTriggerTermination( - in MsgCount p_msgCnt - ) := { - msgCnt := p_msgCnt - } - - } - - group rtcmemPduTemplates { - - /** - * @desc Send template for RTCMEM PDU - * @param p_map The RTCMEM Message - */ - template (value) RTCMEM m_rtcmemPdu( - in template (value) RTCMcorrections p_rtcmc - ) := { - header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_), - rtcmc := p_rtcmc - } - - /** - * @desc Receive template for RTCMEM PDU - * @param p_rtcmc The RTCMEM Message - */ - template (present) RTCMEM mw_rtcmemPdu( - template (present) RTCMcorrections p_rtcmc := ? - ) := { - header := mw_itsPduHeaderRtcmem, - rtcmc := p_rtcmc - } - - } // End of group rtcmemPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The message Id (Default: RTCMEM id) - */ - template (value) ItsPduHeader m_itsPduHeader( - in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - in template (value) ItsPduHeader.messageID p_messageID - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The expected message id (Default: RTCMEM message id) - */ - template ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ? - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The expected message id (Default: SREM id) - */ - template ItsPduHeader mw_itsPduHeaderRtcmem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group rtcmemTemplatesSend { - - /** - * @desc Receive template for RTCMEM Message - */ - template (value) RTCMcorrections m_defaultRtcmem( - in MsgCount p_msgCnt, - in RTCM_Revision p_rev := rtcmRev3, - in RTCMmessageList p_msgs, - in template (omit) MinuteOfTheYear p_timeStamp := omit, - in template (omit) FullPositionVector p_anchorPoint := omit, - in template (omit) RTCMheader p_rtcmHeader := omit - ) := { - msgCnt := p_msgCnt, - rev := p_rev, - timeStamp := p_timeStamp, - anchorPoint := p_anchorPoint, - rtcmHeader := p_rtcmHeader, - msgs := p_msgs, - regional := omit - } // End of template m_defaultRtcmem - - } // End of group rtcmemTemplatesSend - - group rtcmemTemplatesRecv { - - /** - * @desc Receive template for RTCMEM Message - */ - template (present) RTCMcorrections mw_defaultRtcmem := { - msgCnt := ?, - rev := ?, - timeStamp := *, - anchorPoint := *, - rtcmHeader := *, - msgs := ?, - regional := * - } - - } // End of group rtcmemTemplatesRecv - -} // End of module LibItsRtcmem_Templates diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn deleted file mode 100644 index 674d3de0..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn +++ /dev/null @@ -1,127 +0,0 @@ -module LibItsRtcmem_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_Time all; - import from LibCommon_Sync all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsRtcmem - import from LibItsRtcmem_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtRtcmemInitialize, UtRtcmemTrigger, UtRtcmemUpdate, UtRtcmemTermination; - in - UtRtcmemResults, UtRtcmemEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - /** - * @desc Application MapSpat Port - */ - type port RtcmemPort message { - in RtcmemInd; - out RtcmemReq - } - - } // End of group interfacePorts - - /** - * @desc ITS System Adapter - */ - type component ItsRtcmemSystem { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port RtcmemPort rtcmemPort; - - } // End of component ITS System Adapter - - /** - * @desc Test component for ITS SREM-SSEM application layer - */ - type component ItsRtcmem extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port RtcmemPort rtcmemPort; - //timers - - //component variables - var RtcmemInd vc_mapMsg; - var UtRtcmemEventIndList vc_utEvents := {}; - - //default - var default vc_default := null; - - //global variables - var boolean vc_rtcmemReceived := false; - - var boolean vc_rtcmemDefaultActive := true; - } // End of component ItsRtcmem - - group ApplPrimitives { - - type record RtcmemInd { - RTCMEM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - type record of RtcmemInd RtcmemInds; - - /** - * @desc Appl SREM and SSEM Request Primitive - */ - type record RtcmemReq { - RTCMEM msgOut - } - with { - encode (msgOut) "PER" - } - - } with { - variant "" - encode "LibIts_Interface" - } // End of group ApplPrimitives - -} // End of module LibItsRtcmem_TestSystem diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn deleted file mode 100644 index 6ccfed04..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn +++ /dev/null @@ -1,99 +0,0 @@ -module LibItsRtcmem_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtRtcmemInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Rtcmem/Ssem IUT - * @member utRtcmemInitialize - - * @member utRtcmemTriggerResult - - * @member utRtcmemUpdateResult - - * @member utRtcmemTerminationResult - - */ - type union UtRtcmemResults { - boolean utRtcmemInitializeResult, - boolean utRtcmemTriggerResult, - boolean utRtcmemUpdateResult, - boolean utRtcmemTerminationResult - } with { - variant "" - } // End of type UtRtcmemResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtRtcmemTrigger { - MsgCount msgCnt, - RTCM_Revision rev, - RTCMmessageList msgs, - MinuteOfTheYear timeStamp optional, - FullPositionVector anchorPoint optional, - RTCMheader rtcmHeader optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request updating of an event at IUT - */ - type record UtRtcmemUpdate { - RTCMmessageList msgs, - MinuteOfTheYear timeStamp optional, - FullPositionVector anchorPoint optional, - RTCMheader rtcmHeader optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request termination of an event at IUT - */ - type record UtRtcmemTermination { - MsgCount msgCnt - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtRtcmemEventInd { - RTCMEM rtcmemMsg - } with { - encode (rtcmemMsg) "PER" - } - - /** - * @desc List of Upper Tester messages to check event/status on RTCMEM IUT - */ - type record of UtRtcmemEventInd UtRtcmemEventIndList; - - } with { - encode "UpperTester" - variant "" - } - -} with { - encode "LibItsRtcmem" -} // End of module LibItsRtcmem_TypesAndValues diff --git a/ttcn/Rtcmem/module.mk b/ttcn/Rtcmem/module.mk deleted file mode 100644 index 1afd06be..00000000 --- a/ttcn/Rtcmem/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ -LibItsRtcmem_EncdecDeclarations.ttcn \ -LibItsRtcmem_Functions.ttcn \ -LibItsRtcmem_Pics.ttcn \ -LibItsRtcmem_Pixits.ttcn \ -LibItsRtcmem_Templates.ttcn \ -LibItsRtcmem_TestSystem.ttcn \ -LibItsRtcmem_TypesAndValues.ttcn diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn deleted file mode 100644 index d48e56d0..00000000 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ /dev/null @@ -1,58 +0,0 @@ -module LibItsSecurity_EncdecDeclarations { - - // LibIts - //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - //import from EtsiTs103097Module language "ASN.1:1997" all; - - import from LibItsSecurity_TypesAndValues all; - - /** - * @desc Encoding function for EtsiTs103097Certificate certificate - * @param p The certificate to encode - * @return The encode message in OER format - */ - external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer - with {extension "prototype(sliding) decode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate - * @param p The ToBeSign part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.Ieee1609Dot2Data - * @param p The Ieee1609Dot2Data part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_Ieee1609Dot2ToBeSignedData(in IEEE1609dot2.ToBeSignedData p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out IEEE1609dot2.ToBeSignedData p_toBeSignedData) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspCAM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspCAM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - - external function fx_enc_SspDENM (LibItsSecurity_TypesAndValues.SspDENM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspDENM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspDENM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - -} // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn deleted file mode 100644 index 2865ca82..00000000 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ /dev/null @@ -1,3557 +0,0 @@ -/** - * @Author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing functions for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Functions all; - //import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - import from LibItsSecurity_Pixits all; - import from LibItsSecurity_Pics all; - import from LibItsSecurity_TestSystem all; - - group helpersFunctions { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha256( - in octetstring p_toBeHashedData - ) return Oct32 { - return fx_hashWithSha256(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha384( - in octetstring p_toBeHashedData - ) return Oct48 { - return fx_hashWithSha384(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaNistp256WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - log(">>> f_signWithEcdsaNistp256WithSha256: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaNistp256WithSha256: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_signWithEcdsaNistp256WithSha256: p_privateKey= ", p_privateKey); - - return fx_signWithEcdsaNistp256WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp256r1WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - return fx_signWithEcdsaBrainpoolp256r1WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp384r1WithSha384( - in octetstring p_toBeSignedSecuredMessage, - in Oct48 p_certificateIssuer, - in Oct48 p_privateKey - ) return octetstring { - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_certificateIssuer); - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_privateKey); - return fx_signWithEcdsaBrainpoolp384r1WithSha384( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp384r1WithSha384 - - function f_decrypt( - in octetstring p_encryptPrivateKey, - in EtsiTs103097Data p_encrypedSecuredMessage, - in octetstring p_salt, - out EtsiTs103097Data p_decrypedSecuredMessage, - out octetstring p_aes_sym_enc_key - ) return boolean { - if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { - var PKRecipientInfo v_pKRecipientInfo; - var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; - var octetstring v_decryptedSecuredMessage; - - log(">>> f_decrypt: p_encryptPrivateKey=", p_encryptPrivateKey); - log(">>> f_decrypt: p_encrypedSecuredMessage=", p_encrypedSecuredMessage); - log(">>> f_decrypt: p_salt=", p_salt); - - // Check the private encryption key - if (not(isbound(p_encryptPrivateKey))) { - log("*** " & testcasename() & ":ERROR: Failed to load encryption private key ***"); - return false; - } - - if (ischosen(v_recipientInfo.certRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; - // Read the certificate based on the recipientId - } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; - // Read the certificate based on the recipientId - } else { - log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); - return false; - } - - log("f_decrypt: v_pKRecipientInfo=", v_pKRecipientInfo); - if (isbound(v_pKRecipientInfo)) { - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - - log("f_decrypt: v_ciphertext=", v_ciphertext); - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - // TODO else, other variants shall be processed here if - } else { - log("*** " & testcasename() & ":ERROR: Invalid recipient info ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else { - log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); - } - - return false; - } // End of function f_decrypt - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - * @return The encrypted message - */ - function f_encryptWithEciesNistp256WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce - ) return octetstring { - return fx_encryptWithEciesNistp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); - } // End of function f_encryptWithEciesNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesNistp256WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesNistp256WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_encryptWithEciesBrainpoolp256r1WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce - ) return octetstring { - return fx_encryptWithEciesBrainpoolp256r1WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); - } // End of function f_encryptWithEciesBrainpoolp256r1WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesBrainpoolp256r1WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesBrainpoolp256r1WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha256( - in Oct32 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha384( - in Oct48 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha384 - - /** - * @desc Compute the HashedId3 value from the HashedId8 value - * @param p_hashp_hashedId8 The HashedId8 value - * @return The HashedId3 value - * @verdict Unchanged - */ - function f_hashedId3FromHashedId8( - in HashedId8 p_hashedId8 - ) return HashedId3 { - return substr(p_hashedId8, lengthof(p_hashedId8) - 3, 3); - } // End of function f_hashedId3FromHashedId8 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); - return fx_verifyWithEcdsaNistp256WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaNistp256WithSha256 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyX, - in Oct32 p_ecdsaNistp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); - return fx_verifyWithEcdsaNistp256WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyX, - p_ecdsaNistp256PublicKeyY); - } // End of function f_verifyWithEcdsaNistp256WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256r1WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyX, - in Oct32 p_ecdsaBrainpoolp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyX, - p_ecdsaBrainpoolp256PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384r1WithSha384( - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyX, - in Oct48 p_ecdsaBrainpoolp384PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyX, - p_ecdsaBrainpoolp384PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1 - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_nistp256( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_nistp256"); - return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp256r1( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_brainpoolp256r1"); - return fx_generateKeyPair_brainpoolp256r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp384r1( - out Oct48 p_privateKey, - out Oct48 p_publicKeyX, - out Oct48 p_publicKeyY, - out Oct48 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - return fx_generateKeyPair_brainpoolp384r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestFromCertificate( - in Certificate p_cert - ) return HashedId8 { - var octetstring v_hash; - - if (PICS_SEC_SHA256) { - v_hash := f_calculateDigestSha256FromCertificate(p_cert); - } if (PICS_SEC_SHA384) { - v_hash := f_calculateDigestSha384FromCertificate(p_cert); - } - - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestFromCertificate - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestSha256FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha256(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha256FromCertificate - - function f_calculateDigestSha384FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha384(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha384FromCertificate - - function f_duration2time( - in Duration p_duration - ) return UInt16 { - if (ischosen(p_duration.seconds)) { - return p_duration.seconds; - } else if (ischosen(p_duration.minutes)) { - return p_duration.minutes; - } else if (ischosen(p_duration.hours)) { - return p_duration.hours; - } else if (ischosen(p_duration.sixtyHours)) { - return p_duration.sixtyHours; - } else if (ischosen(p_duration.years)) { - return p_duration.years; - } - - return 0; // Unrechable code - } // End of function f_duration2time - - group hostSignatureHelpers { - - /** - * @desc Initialize [out] certificates according to the specified certificate name - * @param p_certificateName The certificate name to be used - * @param p_aaCertificate The AA certificate [out] - * @param p_atCertificate The AT certificate [out] - * @return true on succes, false otherwise - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_prepareCertificates( - in template (omit) charstring p_certificateName, - out EtsiTs103097Certificate p_aaCertificate, - out EtsiTs103097Certificate p_atCertificate - ) runs on ItsSecurityBaseComponent return boolean { - //log(">>> f_prepareCertificates: ", p_certificateName); - - // Load certificates if required - if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { - var HashedId8 v_digest; - var charstring v_cert; - - if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ - log("f_prepareCertificates: Failed to read certificate ", p_certificateName); - return false; - } - if (ischosen(p_atCertificate.issuer.sha256AndDigest)) { - v_digest := p_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(p_atCertificate.issuer.sha384AndDigest)) { - v_digest := p_atCertificate.issuer.sha384AndDigest; - } else { - log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); - return false; - } - if (f_getCertificateFromDigest(v_digest, p_aaCertificate, v_cert) == false) { - log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); - return false; - } - } else { - p_atCertificate := vc_atCertificate; - p_aaCertificate := vc_aaCertificate; - } - // Store the certificate to build this message - vc_lastAtCertificateUsed := p_atCertificate; - - return true; - } // End of function f_prepareCertificates - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage( - inout EtsiTs103097Data p_securedMessage, - in charstring p_certificateName, - in ToBeSignedData p_payloadField - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var ToBeSignedData v_toBeSignedData; - var octetstring v_certificateIssuer; - var octetstring v_privateKey; - - log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - log(">>> f_buildGnSecuredMessage: p_payloadField=", p_payloadField); - - // Prepare payload to be signed - v_toBeSignedData := valueof(p_payloadField); - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_buildGnSecuredMessage: v_secPayload=", v_secPayload); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } -// log("f_buildGnSecuredMessage: v_privateKey=", v_privateKey); - f_getCertificateHash(p_certificateName, v_certificateIssuer); - - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(substr(v_signature, 0, 48)), - substr(v_signature, 48, 48) - ) - )); - } // TODO To be continued - -// log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - return true; - } // End of function f_buildGnSecuredMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_certificateName The certificate name - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in template (value) charstring p_certificateName, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in template (value) ToBeSignedData p_payloadField, - in template (value) HeaderInfo p_mandatoryHeaders, - in template (omit) HeaderInfo p_headerInfo := omit - ) return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var template (value) ToBeSignedData v_toBeSignedData; - var integer i, j, k, n; - var HeaderInfo v_headerFields; - var Ieee1609Dot2Content v_toBeSignedPayload; - var Oct32 v_privateKey; - var UInt8 v_trailerSize; - - // Prepare headers - if (not(ispresent(p_headerInfo))) { - v_headerFields := valueof(p_mandatoryHeaders); - } else {/* FIXME To be reviewed - // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - - i := 0; // index for p_headerInfo - j := 0; // index for v_mandatoryHeaders - k := 0; // index for v_headerFields - - // Special processing for signer_info - if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - i := i + 1; - } - - for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { - // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { - if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { - // mandatory header already in p_HeaderFields - break; - } - } // End of 'for' statement - if (n >= lengthof(p_headerInfo)) { - if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerInfo having lower number than mandatory header - for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerInfo[n]); - k := k + 1; - i := i + 1; - } - } - // Add mandatory header - v_headerFields[k] := valueof(p_mandatoryHeaders[j]); - k := k + 1; - } - } // End of 'for' statement - - // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { - // Add headers from p_headerInfo having lower number than mandatory header - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - } // End of 'for' statement - */} - - // Prepare payload to be signed - /* FIXME To be reviewed v_toBeSignedPayload := valueof(p_payloadField); -// log("p_trailerStatus=", p_trailerStatus); - if (p_trailerStatus == 0) { - v_trailerSize := 0; - } else if (p_trailerStatus == 1) { - v_trailerSize := 67; - } else if (p_trailerStatus == 2) { - v_trailerSize := 2 * 67; - } else { - v_trailerSize := 67; - } - v_toBeSignedData := m_toBeSignedSecuredMessage_wrong_protocol( - v_headerFields, - v_toBeSignedPayload, - e_signature, - p_protocolVersion, - v_trailerSize - );*/ -// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedData); - - /* FIXME To be reviewedv_secPayload := bit2oct(encvalue(v_toBeSignedData)); -// log("v_secPayload=", v_secPayload); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_privateKey - );*/ -// log("v_signature=", v_signature); - -// log("p_trailerStatus=", p_trailerStatus); - /* FIXME To be reviewed if (p_trailerStatus == 0) { // No signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { } - ); - v_trailerSize := 0; - } else if (p_trailerStatus == 2) { // Duplicate signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ), - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - } else if (p_trailerStatus == 3) { // Signature with reserved algorthm - p_securedMessage := m_ieee1609Dot2Data_wrong_protocol( - p_protocolVersion, - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_unknownSignature( - v_signature - ) - ) - } - ); - } else { // Invalid signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig)); - }*/ - - return false;/* FIXME To be reviewed true;*/ - } // End of function f_buildGnSecuredMessage_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := "" - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - - log(">>> f_buildGnSecuredCam: p_securedMessage= ", p_securedMessage); - log(">>> f_buildGnSecuredCam: p_payloadField= ", p_payloadField); - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - //log("f_buildGnSecuredCam: v_atCertificate = ", v_atCertificate); - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - - } // End of function f_buildGnSecuredCam - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_alterIssuerIdentifier Set to true to alter IssuerIdentifier - * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature - * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam_Bo( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in charstring p_certificateName, - in UInt8 p_protocolVersion, - in boolean p_alter_psid, - in boolean p_add_generation_location, - in boolean p_add_expiry_time, - in boolean p_add_p2pcd_learning_request, - in boolean p_add_missing_crl_identifier, - in boolean p_add_encryption_key, - in boolean p_alter_signature_algorithm, - in boolean p_alter_signer_identifier, - in boolean p_alter_signature - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredCam_Bo: p_securedMessage = ", p_securedMessage); - - // Alter protocolVersion - p_securedMessage.protocolVersion := p_protocolVersion; - // Alter psid - if (p_alter_psid == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; - } - // Add generationLocation - if (p_add_generation_location == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := valueof(m_threeDLocation(PX_WGSLATITUDE, PX_WGSLONGITUDE, 0)); - } - if (p_add_expiry_time == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; - } - if (p_add_p2pcd_learning_request == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; - } - if (p_add_missing_crl_identifier == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { - cracaId := 'CAFEDE'O, - crlSeries := 0 - }; - } - if (p_add_encryption_key == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( - m_encryptionKey_public( - m_encryptionKey( - -, - m_publicEncryptionKey_eciesNistP256( - m_eccP256CurvePoint_x_only(int2oct(5096, 32)) - )))); - } - if (p_alter_signature_algorithm == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - // Change it in to Brainpool P256r1 - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - // Change it in to NistP256 - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig - )); - } else { - var EccP256CurvePoint r_sig; - // Change it in to Brainpool P256r1 - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { - r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); - } else { - // TODO - log("f_buildGnSecuredCam_Bo: Unsupported signature variant"); - } - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - r_sig, - str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) - )); - } - } - if (p_alter_signer_identifier == true) { - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); - } - if (p_alter_signature == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); - } else { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); - } - } - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); - /*if (p_alterATCertificateSignature == true) { - v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); - } - if (p_alterAACertificateSignature == true) { - v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); - }*/ - - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - f_calculateDigestFromCertificate(v_atCertificate) - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_its_aid(c_its_aid_CAM)) - } - } - - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo);*/ - - } // End of function f_buildGnSecuredCam_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := "" - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - - log(">>> f_buildGnSecuredDenm: p_securedMessage= ", p_securedMessage); - log(">>> f_buildGnSecuredDenm: p_payloadField= ", p_payloadField); - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - //log("f_buildGnSecuredDenm: v_atCertificate = ", v_atCertificate); - - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - log("f_buildGnSecuredDenm: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredDenm: p_securedMessage = ", p_securedMessage); - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredDenm - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm_Bo( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in charstring p_certificateName, - in UInt8 p_protocolVersion, - in boolean p_alter_psid, - in boolean p_remove_generation_location := true, // Shall be present for DENM - in boolean p_add_expiry_time, - in boolean p_add_p2pcd_learning_request, - in boolean p_add_missing_crl_identifier, - in boolean p_add_encryption_key, - in boolean p_alter_signature_algorithm, - in boolean p_alter_signer_identifier, - in boolean p_alter_signature - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredDenm_Bo: p_securedMessage = ", p_securedMessage); - - // Alter protocolVersion - p_securedMessage.protocolVersion := p_protocolVersion; - // Alter psid - if (p_alter_psid == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; - } - // Remove generationLocation - if (p_remove_generation_location == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := omit; - } - if (p_add_expiry_time == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; - } - if (p_add_p2pcd_learning_request == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; - } - if (p_add_missing_crl_identifier == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { - cracaId := 'CAFEDE'O, - crlSeries := 0 - }; - } - if (p_add_encryption_key == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( - m_encryptionKey_public( - m_encryptionKey( - -, - m_publicEncryptionKey_eciesNistP256( - m_eccP256CurvePoint_x_only(int2oct(5096, 32)) - )))); - } - if (p_alter_signature_algorithm == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - // Change it in to Brainpool P256r1 - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - // Change it in to NistP256 - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig - )); - } else { - var EccP256CurvePoint r_sig; - // Change it in to Brainpool P256r1 - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { - r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); - } else { - // TODO - log("f_buildGnSecuredDenm_Bo: Unsupported signature variant"); - } - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - r_sig, - str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) - )); - } - } - if (p_alter_signer_identifier == true) { - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); - } - if (p_alter_signature == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); - } else { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); - } - } - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); - } // End of function f_buildGnSecuredDenm_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage( - inout EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // FIXME To be done - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage_Bo - - } // End of group hostSignatureHelpers - - group deviceSignatureHelpers { - - /** - * @desc Retrieve the HashedId8 to be sent to the IUT, based on the provided certificate identifier - * @param p_certificateName The certificate the IUT shall use - * @return The HashedId8 to be sent to the IUT in the UtInitialize command - * @verdict Unchanged - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_setupIutCertificate( - in charstring p_certificateName - ) runs on ItsSecurityBaseComponent return HashedId8 { - // Local variables - var HashedId8 v_hashedId8 := '0000000000000000'O; - - // Sanity check - if (lengthof(p_certificateName) == 0) { - return v_hashedId8; - } - - // Load certificates - if(f_getCertificateDigest(p_certificateName, v_hashedId8) == false) { - v_hashedId8 := '0000000000000000'O; - } - - return v_hashedId8; - } // End of function f_setupIutCertificate - - /** - * @desc Verify the signature of the provided certificate - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_publicKey Public key to verify the certificate signature - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithPublicKey( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) PublicVerificationKey p_publicVerificationKey - ) return boolean { - var ToBeSignedCertificate v_toBeSignedCertificate; - var octetstring v_enc_msg; - var octetstring v_signature; - var octetstring v_issuer; - - log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); - log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); - - // Create ToBeSignedCertificate payload to be signed - v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); - log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); - - v_enc_msg := bit2oct(encvalue(v_toBeSignedCertificate)); - log("f_verifyCertificateSignatureWithPublicKey: v_enc_msg=", v_enc_msg); - - // Verify payload - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 48); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { - return f_verifyWithEcdsaNistp256WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } - - return false; - } // End of finction f_verifyCertificateSignatureWithPublicKey - - /** - * @desc Verify the signature of the provided secured message - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_issuingCertificate Issuing certificate - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithIssuingCertificate( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) EtsiTs103097Certificate p_issuingCertificate - ) return boolean { - - // Sanity checks - if (not(ischosen(p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey))) { - return false; - } - return f_verifyCertificateSignatureWithPublicKey( - p_certificateToBeVerified, - p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey - ); - } // End of function f_verifyCertificateSignatureWithIssuingCertificate - - /** - * @desc Verify the signature of the provided secured message for ECDSA Nist-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaNistP256( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); - - // Verify payload - - // TODO Check in standard if x-only only - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaNistp256WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaNistP256 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P384 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct48 p_certificateIssuer, - in template (value) EccP384CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP384)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP384.x), - valueof(p_publicKey.uncompressedP384.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1 - - /** - * @desc Verify the signature of the provided secured message - * @param p_securedMessage - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict - */ - function f_verifyGnSecuredMessageSignatureWithCertificate( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) charstring p_certificate_id, - in template (value) EtsiTs103097Certificate p_certificate - - ) return boolean { - var octetstring v_issuer; - var EtsiTs103097Certificate v_certificate; - - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_securedMessage=", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate_id=", p_certificate_id); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); - - if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); - return false; - } - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); - } - - return false; - } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate - - } // End of group deviceSignatureHelpers - - group sspPermissions { - - function f_verifySspPermissions( - in SequenceOfPsidSsp p_issuer_ssp_permissions, - in SequenceOfPsidSsp p_subordinate_ssp_permissions, - in boolean p_strict_checks := false - ) return boolean { - // Local variables - var integer v_idx := 0; - - log(">>> f_verifySspPermissions: p_issuer_ssp_permissions:", p_issuer_ssp_permissions); - log(">>> f_verifySspPermissions: p_subordinate_ssp_permissions: ", p_subordinate_ssp_permissions); - - for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { - var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; - var PsidSsp v_subordinatePsidSsp; - var boolean v_found := false; - var integer v_jdx := 0; - log("f_verifySspPermissions: v_issuerPsidSsp: ", v_issuerPsidSsp); - // 1. Check permission from issuer is present - for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { - log("f_verifySspPermissions: match=", match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp))); - // 1. Check the version - if (p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0] != '01'O) { - log("f_verifySspPermissions: Wrong SSP version control (1 is expected): ", p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0]); - return false; - } - // 2. Check the version - if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { - v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; - v_found := true; - break; - } - } // End of 'for' statement - if (v_found == false) { - log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } else { - return true; - } - } - // 2. Validate bits mask - if (ispresent(v_issuerPsidSsp.ssp)) { - if (ispresent(v_subordinatePsidSsp.ssp) == false) { - log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { - log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp, " / ", v_subordinatePsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { - log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); - if (p_strict_checks == true) { - return false; - } - } else { - var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); - var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); - - for (var integer i := 0; i < lengthof(v_issuerSsp); i := i + 1) { - if (v_issuerSsp[i] == "1") { // TODO How to check Permission using SspBitmask/SspValue - if (v_subordinateSsp[i] != "1") { - log("f_verifySspPermissions: Ssp bitmask mismatch at index: ", i); - return false; - } - } // else, no restriction, subordinate certificate can have any value. - } // End of 'for' statement - } - } - } // End of 'for' statement - - return true; - } // End of function f_verifySspPermissions - - } // End of group sspPermissions - - group messageGetters { - - /** - * @desc return Ieee1609Dot2Data header field of given type or null if none - * @param p_msg the Ieee1609Dot2Data - * @param p_type header field type - * @return HeaderInfo of given type if any or null - */ - function f_getMsgHeaderInfo( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out HeaderInfo p_return - ) return boolean { - var integer v_length; - var Ieee1609Dot2Data v_securedMessage; - - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - v_securedMessage := valueof(p_securedMessage); - if (ischosen(v_securedMessage.content.signedData)) { - p_return := v_securedMessage.content.signedData.tbsData.headerInfo; - return true; - } - - log("f_getMsgHeaderField: return false"); - return false; - } - - /** - * @desc return SignerIdentifier Ieee1609Dot2Data field - */ - function f_getMsgSignerIdentifier ( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out SignerIdentifier p_signerIdentifier - ) return boolean { - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - - if (ischosen(p_securedMessage.content.signedData)) { - p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); - return true; - } - - log("f_getMsgSignerIdentifier: return false"); - return false; - } - - } // End of group messageGetters - - group certificateGetters { - - /** - * @desc Set the generation location as defined in Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profile for DENMs - * @param p_latitude The latitude value of the ITS-S position - * @param p_longitude The longitude value of the ITS-S position - * @param p_elevation The elevation value of the ITS-S position - * @verdict Unchanged - */ - function f_setGenerationLocation( - in SecLatitude p_latitude, - in SecLongitude p_longitude, - in SecElevation p_elevation := 0 - ) runs on ItsSecurityBaseComponent { - vc_location := { - p_latitude, - p_longitude, - p_elevation - } - } // End of function f_setGenerationLocation - - /** - * @desc Load in memory cache the certificates available - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - function f_loadCertificates( - in charstring p_configId - ) runs on ItsSecurityBaseComponent return boolean { - var charstring v_certificate_id; - - // Setup certificates memory cache - if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { - // Setup security component variables - if (f_readCertificate(PX_CERT_FOR_TS, vc_atCertificate) == true) { - var HashedId8 v_issuer; -// log("Issuer: ", vc_atCertificate.issuer); - if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(vc_atCertificate.issuer.sha384AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha384AndDigest; - } else { - log("AT certificate cannot be issued by CA"); - return false; - } - log("Selected issuer: ", v_issuer); - if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate, v_certificate_id)) { - if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { - f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); - return true; - } - log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); - } else { - log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); - } - return false; - } // End of function f_loadCertificates - - /** - * @desc Unload from memory cache the certificates available - * @return true on success, false otherwise - */ - function f_unloadCertificates() runs on ItsSecurityBaseComponent return boolean { - // Reset security component variables - vc_signingPrivateKey := ''O; - vc_encryptPrivateKey := ''O; - // Clear certificates memory cache - return fx_unloadCertificates(); - } // End of function f_unloadCertificates - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - function f_readCertificate( - in charstring p_certificate_id, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var octetstring v_certificate; - - if (fx_readCertificate(p_certificate_id, v_certificate) == true) { - var bitstring v_oct2bit; - var integer v_result; - - v_oct2bit := oct2bit(v_certificate); - v_result := decvalue(v_oct2bit, p_certificate); - if (v_result == 0) { - return true; - } - } - - log("f_readCertificate: Failed to retrieve ", p_certificate_id); - return false; - } // End of function f_readCertificate - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_digest the digest of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateDigest( - in charstring p_certificate_id, - out HashedId8 p_digest - ) return boolean { - if (not fx_readCertificateDigest(p_certificate_id, p_digest)){ - log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateDigest - - /** - * @desc Read the whole-hash of the certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateHash( - in charstring p_certificate_id, - out octetstring p_hash - ) return boolean { - log(">>> f_getCertificateHash: ", p_certificate_id); - - if (not fx_readCertificateHash(p_certificate_id, p_hash)){ - log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash - - /** - * @desc Read the whole-hash of the certificate SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate using SHA 256 - * @return true on success, false otherwise - */ - function f_getCertificateHash256( - in charstring p_certificate_id, - out Oct32 p_hash - ) return boolean { - if (not fx_readCertificateHash256(p_certificate_id, p_hash)){ - log("f_getCertificateHash256: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash256 - - function f_getCertificateFromDigest( - in HashedId8 p_digest, - out EtsiTs103097Certificate p_certificate, - out charstring p_certificate_id - ) return boolean { - if (not(fx_readCertificateFromDigest(p_digest, p_certificate_id))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(p_certificate_id, p_certificate))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromDigest - - function f_getCertificateFromHashedId3( - in HashedId3 p_digest, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var charstring v_certificate_id; - if (not(fx_readCertificateFromHashedId3(p_digest, v_certificate_id))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(v_certificate_id, p_certificate))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", v_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromHashedId3 - - function f_getCertificateIssuer( - in IssuerIdentifier p_issuer - ) return HashedId8 { - if (ischosen(p_issuer.sha256AndDigest)) { - return p_issuer.sha256AndDigest; - } else if (ischosen(p_issuer.sha256AndDigest)) { - return p_issuer.sha256AndDigest; - } - return int2oct(0, 8); - } - - function f_getHashAlgorithm( - in IssuerIdentifier p_issuer - ) return HashAlgorithm { - if (ischosen(p_issuer.sha256AndDigest)) { - return sha256; - } else if (ischosen(p_issuer.sha256AndDigest)) { - return sha384; - } - return p_issuer.self_; - } - - /** - * @desc Read the signing private key for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - function f_readSigningKey( - in charstring p_keysId, - out Oct32 p_signingPrivateKey - ) return boolean { - return fx_readSigningKey(p_keysId, p_signingPrivateKey); - } // End of function f_readSigningKey - - /** - * @desc Read the encrypting private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - function f_readEncryptingKey( - in charstring p_keysId, - out Oct32 p_encryptPrivateKey - ) return boolean { - return fx_readEncryptingKey(p_keysId, p_encryptPrivateKey); - } // End of function f_readEncryptingKey - - function f_getCertificateValidityRestriction( - in template (value) EtsiTs103097Certificate p_cert, - out template (value) ValidityPeriod p_validityPeriod, - out template (omit) GeographicRegion p_geographicRegion - ) return boolean { - p_validityPeriod := valueof(p_cert.toBeSigned.validityPeriod); - if (ispresent(p_cert.toBeSigned.region)) { - p_geographicRegion := valueof(p_cert.toBeSigned.region); - } else { - p_geographicRegion := omit; - } - return true; - } // End of function f_getCertificateValidityRestriction - - }// End of group certificateGetters - - group certificatesCaching { - - function f_createCertificatesCaching( - in SequenceOfCertificate p_certificates, - out CertificatesCaching p_certificatesCaching - ) return boolean { - p_certificatesCaching := { }; - for (var integer v_counter := 0; v_counter < lengthof(p_certificates); v_counter := v_counter + 1) { - var CertificatesCachingItem v_item; - v_item.certificate := p_certificates[v_counter]; - v_item.hashedId8 := f_calculateDigestSha256FromCertificate(v_item.certificate); - p_certificatesCaching[v_counter] := v_item; - } // End of 'for' statement - - return true; - } - - function f_getCertificateFromCaching( - in CertificatesCaching p_certificatesCaching, - in HashedId8 p_hashedId8, - out EtsiTs103097Certificate p_certificate - ) return boolean { - for (var integer v_counter := 0; v_counter < lengthof(p_certificatesCaching); v_counter := v_counter + 1) { - if (match(p_certificatesCaching[v_counter].hashedId8, p_hashedId8) == true) { - p_certificate := p_certificatesCaching[v_counter].certificate; - return true; - } - } // End of 'for' statement - - return false; - } - - function f_getCertificatesCachingItem( - in CertificatesCaching p_certificatesCaching, - in UInt8 p_index, - out EtsiTs103097Certificate p_certificate - ) return boolean { - if (lengthof(p_certificatesCaching) < p_index) { - p_certificate := p_certificatesCaching[p_index].certificate; - return true; - } - - return false; - } - - function f_getCertificatesCachingItemSize( - in CertificatesCaching p_certificatesCaching - ) return UInt8 { - return lengthof(p_certificatesCaching); - } - - }// End of group certificatesCaching - - - } // End of group helpersFunctions - - group externalFunctions { - - group signing { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key - * @return The signature value - */ - external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp256r1(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp384r1(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - external function fx_get_uncompressed_key_nistp256(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; - external function fx_get_uncompressed_key_brainpoolp256r1(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; - external function fx_get_uncompressed_key_brainpoolp384r1(in Oct48 p_privateKey, in Oct48 p_publicKeyCompressed, in integer p_compressed_mode, out Oct48 p_publicKeyY) return boolean; - - } // End of group signing - - group encryption { - - external function fx_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; - - /** - * @desc This function validates AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc TThis function validates AES128 CCM encryption based on AES-GCM-256 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc This function validates AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The cyphered payload - * @return The raw payload - */ - external function fx_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - external function fx_test_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - } // End of group encryption - - group certificatesLoader { - - /** - * @desc Load in memory cache the certificates available in the specified directory - * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hash_256, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; - - /** - * @desc Unload from memory cache the certificates - * @return true on success, false otherwise - */ - external function fx_unloadCertificates() return boolean; - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificate(in charstring p_certificate_id, out octetstring p_certificate) return boolean; - - /** - * @desc Read the specified certificate digest - * @param p_certificate_id the certificate identifier - * @param p_digest the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateDigest(in charstring p_certificate_id, out HashedId8 p_digest) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate using SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash256(in charstring p_certificate_id, out Oct32 p_hash) return boolean; - - external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; - - external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - - external function fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - - external function fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean; - - } // End of group certificatesLoader - - group geodesic { - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean; - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean; - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideRectangularRegion(in SequenceOfRectangularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean; - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areRectanglesInside(in SequenceOfRectangularRegion p_rectanglar_region_1, in SequenceOfRectangularRegion p_rectanglar_region_2) return boolean; - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - external function fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean; - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - external function fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float; - - } // End of group geodesic - - } // End of group externalFunctions - - group geometryFunctions { - - function f_checkRegionValidityRestiction( - in EtsiTs103097Certificate p_cert, - in EtsiTs103097Certificate p_cert_issuer - ) return boolean { - var GeographicRegion v_cert_region, v_cert_issuer_region; - var boolean v_cert_issuer_region_result; - - // FIXME To be reviewed - - // Sanity checks - if (ispresent(p_cert.toBeSigned.region) == false) { - log("f_checkRegionValidityRestiction: GeographicRegion missig into certificate"); - return false; - } - if (ispresent(p_cert_issuer.toBeSigned.region) == false) { - // No greographical constraints - return true; - } - v_cert_region := p_cert.toBeSigned.region; - v_cert_issuer_region := p_cert_issuer.toBeSigned.region; - if (ispresent(v_cert_region.circularRegion) and ispresent(v_cert_issuer_region.circularRegion)) { - // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' - if (f_areCirclesInside(valueof(v_cert_region.circularRegion), valueof(v_cert_issuer_region.circularRegion)) == false) { - log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates circle area does not match"); - return false; - } - } else if (ispresent(v_cert_region.rectangularRegion) and ispresent(v_cert_issuer_region.rectangularRegion)) { - // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' - if (f_isRectangularRegionsIntersected(v_cert_region.rectangularRegion, v_cert_issuer_region.rectangularRegion) == false) { - log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates rectangle area does not match"); - return false; - } - } else if (ispresent(v_cert_region.polygonalRegion) and ispresent(v_cert_issuer_region.polygonalRegion)) { - // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' - log("f_checkRegionValidityRestiction: FAIL: Not implemented"); - // TODO - return false; - } else if (ispresent(v_cert_region.identifiedRegion) and ispresent(v_cert_issuer_region.identifiedRegion)) { - log("f_checkRegionValidityRestiction: FAIL: Not implemented"); - // Check id_region - // TODO - } - /*if (v_cert_region.validity.region.region_type == e_polygon) { - if (v_cert_issuer_region.validity.region.region_type == e_polygon) { - // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' - if (f_arePolygonsInside(v_cert_region.validity.region.region.polygonal_region, v_cert_issuer_region.validity.region.region.polygonal_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates polygon area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_id) { - // Check id_region - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_iso3166_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to ISO 3166-1 ***"); - return false; - } - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_un_stats_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to United Nations Statistics Division ***"); - return false; - } - // Check region_dictionary - if (not match (v_cert_region.validity.region.region.id_region.region_dictionary, v_cert_issuer_region.validity.region.region.id_region.region_dictionary)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_dictionary' field does not match ***"); - return false; - } - // Check region_identifier - if (not match (v_cert_region.validity.region.region.id_region.region_identifier, v_cert_issuer_region.validity.region.region.id_region.region_identifier)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_identifier' field does not match ***"); - return false; - } - // Check local_region - if ( - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, v_cert_region.validity.region.region.id_region.local_region)) or - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, 0)) - ) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'local_region' field does not match ***"); - return false; - } - } - }*/ - - return true; - } // End of function f_checkRegionValidityRestiction - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - function f_areCirclesInside( - in CircularRegion p_circular_region_1, - in CircularRegion p_circular_region_2 - ) return boolean { - return fx_areCirclesInside(p_circular_region_1, p_circular_region_2); - } - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - function f_areRectanglesInside( - in SequenceOfRectangularRegion p_rectanglar_region_1, - in SequenceOfRectangularRegion p_rectanglar_region_2 - ) return boolean { - return fx_areRectanglesInside(p_rectanglar_region_1, p_rectanglar_region_2); - } - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - function f_arePolygonsInside( - in PolygonalRegion p_polygonal_region_1, - in PolygonalRegion p_polygonal_region_2 - ) return boolean { - return fx_arePolygonsInside(p_polygonal_region_1, p_polygonal_region_2); - } - - /** - * @desc Check that given location is valid - * @param p_location location to be checked - * @return true on success, false otherwise - */ - function f_isValidTwoDLocation( - in template (value) TwoDLocation p_location - ) return boolean { - return -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// (valueof(p_location).longitude != c_maxLongitude + 1) and -// (valueof(p_location).latitude != c_maxLatitude + 1); - (valueof(p_location.longitude) != c_maxLongitude + 1) and - (valueof(p_location.latitude) != c_maxLatitude + 1); - } // End of function f_isValidTwoDLocation - - /** - * @desc Check that two given rectanlular regions are intersected - * Note: Regions must be normalized(northWest.latitude >= southEast.latitude) - * @param p_r1 Region 1 - * @param p_r2 Region 2 - * - * @return true on success, false otherwise - */ - function f_isRectangularRegionsIntersected( - in template (value) SequenceOfRectangularRegion p_r1, - in template (value) SequenceOfRectangularRegion p_r2 - ) return boolean { - var integer v_min := f_min(lengthof(p_r1), lengthof(p_r2)); - - for (var integer i := 0; i < v_min; i := i + 1) { - if (not ( - valueof(p_r2[i].northWest.longitude) > valueof(p_r1[i].southEast.longitude) or - valueof(p_r2[i].southEast.longitude) < valueof(p_r1[i].northWest.longitude) or - valueof(p_r2[i].southEast.latitude) > valueof(p_r1[i].northWest.latitude) or - valueof(p_r2[i].northWest.latitude) < valueof(p_r1[i].southEast.latitude) - )) { - return false; - } - } // End of 'for' statement - - return true; - } // End of function f_isRectangularRegionsIntersected - - function f_isContinuousRectangularRegions( - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - var boolean v_found; - - for (v_i := 0; v_i < lengthof(p_region); v_i := v_i + 1) { - var PolygonalRegion v_region_base; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_i]), v_region_base); - v_found := false; - for (v_j := 0; v_j < lengthof(p_region); v_j := v_j + 1) { - if (v_j != v_i) { - var PolygonalRegion v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_base) == true) { - v_found := true; - } - } - } // End of 'for' statement - if (v_found == false) { - return false; - } - } // End of 'for' statement - - return true; - } // End of function f_isContinuousRectangularRegions - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isRectangularRegionsInside( - in template (value) SequenceOfRectangularRegion p_parent, - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - - for (v_i := 0; v_i < lengthof(p_parent); v_i := v_i + 1) { - var PolygonalRegion v_region_parent, v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_parent[v_i]), v_region_parent); - for (v_j := 0; v_j < lengthof(p_parent); v_j := v_j + 1) { - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_parent) == true) { - return true; - } - } // End of 'for' statement - } // End of 'for' statement - - return false; - } // End of function f_isRectangularRegionsInside - - /** - * @desc Convert a rectangular region into a polygonal region - * @param p_region The rectangular regions to convert - * @return - * @verdict - */ - function f_convertRectangularRegionIntoPolygonalRegion( - in template (value) RectangularRegion p_rectangular_region, - out PolygonalRegion p_region - ) return boolean { - - // Convert rectangular regions to polygons and check polygons - p_region[0] := valueof(p_rectangular_region.northWest); - p_region[1] := { - valueof(p_rectangular_region.northWest.latitude) + valueof(p_rectangular_region.southEast.latitude), - valueof(p_rectangular_region.northWest.longitude) - }; - p_region[2] := valueof(p_rectangular_region.southEast); - p_region[3] := { - valueof(p_rectangular_region.northWest.latitude), - valueof(p_rectangular_region.northWest.longitude) + valueof(p_rectangular_region.southEast.longitude) - }; - log("f_convertRectangularRegionIntoPolygonalRegion: DEBUG: Northwest location is invalid in rect ", p_region); - - return true; - } // End of function - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isValidPolygonalRegion( - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_region) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isValidPolygonalRegion(valueof(p_region)); - } // End of function f_isValidPolygonalRegion - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isPolygonalRegionInside( - in template (value) PolygonalRegion p_parent, - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_parent) or not isbound(p_region) or (lengthof(p_parent) == 0) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isPolygonalRegionInside(valueof(p_parent), valueof(p_region)); - } // End of function f_isPolygonalRegionInside - - /** - * @desc - */ - function f_isIdentifiedRegionInside( - in template (value) UInt16 p_parent, - in template (value) UInt16 p_region - ) return boolean { - return valueof(p_parent) == valueof(p_region); - } // End of function f_isIdentifiedRegionInside - - /** - * @desc Check that the location is inside a region - * @param p_region The region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRegion( - in template (value) GeographicRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - var boolean v_ret := false; - - if (ischosen(p_region.circularRegion)) { - v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); - } else if (ischosen(p_region.rectangularRegion)) { - v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.rectangularRegion), p_location); - } else if (ischosen(p_region.polygonalRegion)) { - v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.polygonalRegion), p_location); - } else if (ischosen(p_region.identifiedRegion)) { - for (var integer v_i := 0; v_i < lengthof(p_region.identifiedRegion); v_i := v_i + 1) { - if (f_isLocationInsideIdentifiedRegion(valueof(p_region.identifiedRegion[v_i]), p_location) == true) { - v_ret := true; - break; - } - } // End of 'for' statement - } - - return v_ret; - } // End of function f_isLocationInsideRegion - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideCircularRegion( - in template (value) CircularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideCircularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideCircularRegion - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRectangularRegion( - in template (value) SequenceOfRectangularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsideRectangularRegion: p_polygonalArea: ", p_region); -// log("f_isLocationInsideRectangularRegion: p_location: ", p_location); - - return fx_isLocationInsideRectangularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideRectangularRegion - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsidePolygonalRegion( - in template (value) PolygonalRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsidePolygonalRegion: p_polygonalArea: ", p_region, " - ", valueof(p_region)); -// log("f_isLocationInsidePolygonalRegion: p_location: ", p_location, " - ", valueof(p_location)); - - return fx_isLocationInsidePolygonalRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsidePolygonalRegion - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideIdentifiedRegion( - in template (value) IdentifiedRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideIdentifiedRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideIdentifiedRegion - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideOtherRegion( - in template (value) octetstring p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (valueof(p_region) == ''O) { - return false; - } - - return fx_isLocationInsideOtherRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideOtherRegion - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - function f_dms2dd( - in integer p_degrees, - in integer p_minutes, - in float p_seconds, - in charstring p_latlon - ) return float { - var Oct1 v_latlon; - - // Sanity checks - if (lengthof(p_latlon) != 1) { - return 0.0; - } else if ((p_latlon != "N") and (p_latlon != "S") and (p_latlon != "E") and (p_latlon != "W")) { - return 0.0; - } - v_latlon := char2oct(p_latlon); - - return fx_dms2dd(p_degrees, p_minutes, p_seconds, v_latlon); - } // End of function f_dms2dd - - /** - * @desc Convert the latitude from float to int - * @param p_latitude The latitude to be converted. Significand length shall be 7 digits length - * @return The converted latitude - * @verdict Unchanged - */ - function f_ddlat2int( - in float p_latitude - ) return SecLatitude { - return float2int(p_latitude * 10000000.0); // Significand length shall be 7 digits length - } - - /** - * @desc Convert the longitude from float to int - * @param p_longitude The longitude to be converted. Significand length shall be 6 digits length - * @return The converted longitude - * @verdict Unchanged - */ - function f_ddlon2int( - in float p_longitude - ) return SecLongitude { - return float2int(p_longitude * 1000000.0); // Significand length shall be 6 digits length - } - - } // End of group geometryFunctions - -} // End of module LibItsSecurity_Functions - diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn deleted file mode 100644 index 4265a9fc..00000000 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pics.ttcn3 $ - * $Id: LibItsSecurity_Pics.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pics for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pics { - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - - /** - * Does the IUT support SHA-256 digest - */ - modulepar boolean PICS_SEC_SHA256 := true; - - /** - * Does the IUT support SHA-384 digest - */ - modulepar boolean PICS_SEC_SHA384 := false; - - /** - * Does the IUT support NIST P256 algorithm - */ - modulepar boolean PICS_SEC_NIST_P256 := true; - - /** - * Does the IUT support Brainpool P256r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := false; - - /** - * Does the IUT support Brainpool P384r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P384R1 := false; - - /** - * Is the IUT able to distribute AT certificates - */ - modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := true; - - /** - * Is the IUT able to distribute AA certificates - */ - modulepar boolean PICS_SEC_P2P_AA_DISTRIBUTION := true; - - /** - * Is the IUT support certificates pushing - */ - modulepar boolean PICS_SEC_CERTIFICATE_SELECTION := true; - - /** - * Is the IUT support circular region geographical restriction - */ - modulepar boolean PICS_SEC_CIRCULAR_REGION := true; - - /** - * Does the IUT support rectangular region geographical restriction - */ - modulepar boolean PICS_SEC_RECTANGULAR_REGION := true; - - /** - * Does the IUT support polygonal region geographical restriction - */ - modulepar boolean PICS_SEC_POLYGONAL_REGION := true; - - /** - * Is the IUT support identified region geographical restriction - */ - modulepar boolean PICS_SEC_IDENTIFIED_REGION := true; - - /** - * Does the IUT support identified region/UN geographical restriction - */ - //TODO Remove modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; - - /** - * Does the IUT support identified region/ISO31661 geographical restriction - */ - //TODO Remove modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; - - /** - * Does the IUT support ITS-AID for Generic profile? - */ - modulepar boolean PICS_SEC_ITS_AID_OTHER := true; - -} // End of module LibItsSecurity_Pics diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn deleted file mode 100644 index c25a11e1..00000000 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pixits.ttcn3 $ - * $Id: LibItsSecurity_Pixits.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Root path to access certificate stored in files, identified by certficate ID - */ - modulepar charstring PX_CERTIFICATE_POOL_PATH := "data/v3/certificates"; - - /** - * @desc Configuration sub-directory to access certificate stored in files - */ - modulepar charstring PX_IUT_SEC_CONFIG_NAME := ""; - - /** - * @desc The certficate the IUT should use. Default: CERT_IUT_A_AT - * @remark If the IUT cannot use the test certificates, set this PIXIT to CERT_NONE - */ - modulepar charstring PX_IUT_DEFAULT_CERTIFICATE := "CERT_IUT_A_AT"; - - /** - * @desc The certficate the IUT should use. Default: CERT_TS_B_AT - * @remark Possible values: CERT_TS_C_AT, CERT_TS_D_AT, or CERT_TS_E_AT - */ - modulepar charstring PX_AT_CERTIFICATE := "CERT_TS_B_AT"; - - /** - * @desc ITS-AID value for other profile. Default: 38 - */ - modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 - - /** - * @desc Invalid protocol version. Default: 3 - */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 4; - - /** - * @desc Invalid WGS longitude - */ - modulepar SecLongitude PX_WGSLONGITUDE := 0; - - /** - * @desc Invalid WGS latitude. Default: 1 - */ - modulepar SecLatitude PX_WGSLATITUDE := 0; - -} // End of module LibItsSecurity_Pixits diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn deleted file mode 100644 index 32ef18a5..00000000 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ /dev/null @@ -1,2101 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TypesAndValues all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - /** - * @desc Constants declaration - */ - group constants { - - /** - * @desc Protocol version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 Ieee1609Dot2Data - */ - const UInt8 c_protocol_version := 3; - - /** - * @desc Certificate version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - const UInt8 c_certificate_version := 3; - - /** - * @desc Its AID for Other - * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs - */ - template Psid c_its_aid_Other := PX_OTHER_ITS_AID; - - /** - * @desc Minimal value of Longitude - */ - const SecLongitude c_minLongitude := -1799999999; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Longitude - */ - const SecLongitude c_maxLongitude := 1800000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Minimal value of Latitude - */ - const SecLatitude c_minLatitude := -900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Latitude - */ - const SecLatitude c_maxLatitude := 900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc List of ISO-3166 country codes - */ - const SequenceOfUint16 c_iso3166Codes := { - 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, - 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, - 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, - 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, - 246, 248, 250, 254, 258, 260, 262, 266, 268, 270, 275, 276, 288, 292, 296, 300, 304, 308, - 312, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, - 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, - 440, 442, 446, 450, 454, 458, 462, 466, 470, 474, 478, 480, 484, 492, 496, 498, 499, 500, - 504, 508, 512, 516, 520, 524, 528, 531, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, - 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, - 630, 634, 638, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, - 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, - 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 810, - 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894 - }; - - /** - * @desc List of United Nations Statistics Division country codes - */ - const SequenceOfUint16 c_unStatsAdditionalCodes := { - 1, 2, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, - 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 199, 419, 432, 680, 722, 830 - }; - - } // End of group constants - - /** - * @desc Dummy send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group dummyBasicFormatElements { - - /** - * @desc Dummy receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group dummyBasicFormatElementsRecv { - - /** - * @desc Dummy receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation_dummy := { - latitude := ?, - longitude := ? - } // End of template mw_twoDLocation_dummy - - /** - * @desc Dummy send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation_dummy := { - latitude := ?, - longitude := ?, - elevation := ? - } // End of template mw_threeDLocation_dummy - - } // End of group dummyBasicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group basicFormatElements { - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsSend { - - /** - * @desc Send templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Send template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (value) Signature m_signature( - in template (value) EcdsaP256Signature p_ecdsaSignature - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template m_signature_ecdsa - - /** - * @desc Send template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (value) EcdsaP256Signature m_ecdsaSignature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) octetstring p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaSignature - - } // End of group signatures - - group signerInfos { - - /** - * @desc Send template for self signed message - */ - template (value) SignerIdentifier m_signerIdentifier_self := { - self_ := NULL - } // End of template m_signerIdentifier_self - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificate( - in template (value) Certificate p_certificate // TODO Use SingleEtsiTs103097Certificate - ) := { - certificate := { p_certificate } // Only one - } // End of template m_signerIdentifier_certificate - - /** - * @desc Send template for digest signed message - */ - template (value) SignerIdentifier m_signerIdentifier_digest( - in template (value) HashedId8 p_digest := '0000000000000000'O - ) := { - digest := p_digest - } // End of template m_signerIdentifier_digest - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificates( - in template (value) SequenceOfCertificate p_certificates := {} - ) := { - certificate := p_certificates - } // End of template m_signerIdentifier_certificates - - } // End of group signerInfos - - /** - * @desc Send template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (value) TwoDLocation m_twoDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template m_twoDLocation - - /** - * @desc Send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (value) ThreeDLocation m_threeDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude, - in template (value) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template m_threeDLocation - - /** - * @desc Send template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_circle( - in template (value) TwoDLocation p_center, - in template (value) UInt16 p_radius - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template m_geographicRegion_circle - - /** - * @desc Send template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_rectangular( - in template (value) TwoDLocation p_northwest, - in template (value) TwoDLocation p_southeast - ) := { - rectangularRegion := { - { - northWest := p_northwest, - southEast := p_southeast - } - } - } // End of template m_geographicRegion_rectangular - - /** - * @desc Send template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_polygonial( - in template (value) PolygonalRegion p_polygonal_region - ) := { - polygonalRegion := p_polygonal_region - } // End of template m_geographicRegion_polygonial - - /** - * @desc Send template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_identifiedRegion( - in template (value) SequenceOfIdentifiedRegion p_identifiedRegions - ) := { - identifiedRegion := p_identifiedRegions - } // End of template m_geographicRegion_identifiedRegion - - template (value) IdentifiedRegion m_identifiedRegion_country_only( - in template (value) CountryOnly p_countryOnly - ) := { - countryOnly := p_countryOnly - } // End of template m_identifiedRegion_country_only - - template (value) IdentifiedRegion m_identifiedRegion_country_and_region( - in template (value) CountryOnly p_countryOnly, - in template (value) SequenceOfUint8 p_regions - ) := { - countryAndRegions := { - countryOnly := p_countryOnly, - regions := p_regions - } - } // End of template m_identifiedRegion_country_and_region - - } // End of group basicFormatElementsSend - - /** - * @desc Receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsRecv { - - group signerIdentifiers { - - /** - * @desc Recv template for message signed with digest - */ - template (present) SignerIdentifier mw_signerIdentifier_digest( - template (present) HashedId8 p_digest := ? - ) := { - digest := p_digest - } // End of template mw_signerIdentifier_digest - - template (present) SignerIdentifier mw_signerIdentifier_certificate( - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - certificate := { p_certificate } - } // End of template m_signerIdentifier_certificate - - template (present) SignerIdentifier mw_signerIdentifier_certificates( - template (present) SequenceOfCertificate p_certificates := ? - ) := { - certificate := p_certificates - } // End of template mw_signerIdentifier_certificates - - } // End of group signerIdentifiers - - /** - * @desc Receive templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Receive template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (present) Signature mw_signature( - template (present) EcdsaP256Signature p_ecdsaSignature := ? - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template mw_signature - - /** - * @desc Receive template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (present) EcdsaP256Signature mw_ecdsaSignature( - template (present) EccP256CurvePoint p_rSig := ?, - template (present) octetstring p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaSignature - - } // End of group signatures - - /** - * @desc Receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation( - template (present) SecLatitude p_latitude, - template (present) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template mw_twoDLocation - - /** - * @desc Receive template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation( - template (present) SecLatitude p_latitude, - template (present) SecLongitude p_longitude, - template (present) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template mw_threeDLocation - - /** - * @desc Receive template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_circle( - template (present) TwoDLocation p_center := ?, - template (present) UInt16 p_radius := ? - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template mw_geographicRegion_circle - - /** - * @desc Basic receive template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_rectangular := { - rectangularRegion := ? - } // End of template mw_geographicRegion_rectangular - - /** - * @desc Receive template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_polygonal( - template (present) PolygonalRegion p_polygonal_region := ? - ) := { - polygonalRegion := p_polygonal_region - } // End of template mw_geographicRegion_polygonial - - /** - * @desc Receive template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_identified( - template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? - ) := { - identifiedRegion := p_identifiedRegion - } // End of template mw_geographicRegion_identifiedRegion - - template (present) IdentifiedRegion mw_identifiedRegion_country_only - := { - countryOnly := ?// FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)) - } - - template (present) IdentifiedRegion mw_identifiedRegion_country_and_region := { - countryAndRegions := { - countryOnly := ?, // FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), - regions := ? - } - } - - } // End of group basicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 EtsiTs103097Data - */ - group etsiTs103097Data { - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data - - /** - * @desc Generic receive template for EtsiTs103097Data message - */ - template (present) EtsiTs103097Data mw_etsiTs103097Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_etsiTs103097Data - - template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - protocolVersion := c_protocol_version, - content := { unsecuredData := p_unsecuredData } - } // End of template m_secured_data_unsecured - - template (value) EtsiTs103097Data m_etsiTs103097Data_signed( - in template (value) SignedData p_signedData - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template m_secured_data_signed - - template (present) EtsiTs103097Data mw_etsiTs103097Data_signed( - template (present) SignedData p_signedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template mw_secured_data_signed - - template (value) EtsiTs103097Data m_etsiTs103097Data_encrypted( - in template (value) EncryptedData p_encryptedData - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template m_etsiTs103097Data_encrypted - - template (present) EtsiTs103097Data mw_etsiTs103097Data_encrypted( - template (present) EncryptedData p_encryptedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template mw_etsiTs103097Data_encrypted - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data_wrong_protocol( - in template (value) UInt8 p_protocol_version, - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data_wrong_protocol - - } // End of group etsiTs103097Data - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 SignedData - */ - group signedData { - - template (value) SignedData m_signedData( - in template (value) HashAlgorithm p_hashId, - in template (value) ToBeSignedData p_tbsData, - in template (value) SignerIdentifier p_signer, - in template (value) Signature p_signature_ - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template m_signedData - - template (present) SignedData mw_signedData( - template (present) HashAlgorithm p_hashId := ?, - template (present) ToBeSignedData p_tbsData := ?, - template (present) SignerIdentifier p_signer := ?, - template (present) Signature p_signature_ := ? - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template mw_signedData - - template (value) ToBeSignedData m_toBeSignedData( - in template (value) SignedDataPayload p_payload, - in template (value) HeaderInfo p_headerInfo - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template m_toBeSignedData - - template (present) ToBeSignedData mw_toBeSignedData( - template (present) SignedDataPayload p_payload := ?, - template (present) HeaderInfo p_headerInfo := ? - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template mw_toBeSignedData - - template (value) SignedDataPayload m_signedDataPayload( - in template (value) Ieee1609Dot2Data p_data - ) := { - data := p_data, - extDataHash := omit - } // End of template m_signedDataPayload - - template (present) SignedDataPayload mw_signedDataPayload( - template (present) Ieee1609Dot2Data p_data := ? - ) := { - data := p_data, - extDataHash := * - } // End of template mw_signedDataPayload - - template (value) SignedDataPayload m_signedDataPayload_ext( - in template (value) Oct32 p_extDataHash - ) := { - data := omit, - extDataHash := { sha256HashedData := p_extDataHash } - } // End of template m_signedDataPayload_ext - - } // End of group signedData - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData - */ - group encryptedData { - - template (value) EncryptedData m_encryptedData( - in template (value) SequenceOfRecipientInfo p_recipients, - in template (value) SymmetricCiphertext p_ciphertex - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template m_encryptedData - - template (present) EncryptedData mw_encryptedData( - template (present) SequenceOfRecipientInfo p_recipients := ?, - template (present) SymmetricCiphertext p_ciphertex := ? - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template mw_encryptedData - - template (value) RecipientInfo m_recipientInfo_pskRecipInfo( - in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template m_recipientInfo_pskRecipInfo - - template (present) RecipientInfo mw_recipientInfo_pskRecipInfo( - template (present) PreSharedKeyRecipientInfo p_pskRecipInfo := ? - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template mw_recipientInfo_pskRecipInfo - - template (value) RecipientInfo m_recipientInfo_symmRecipInfo( - in template (value) SymmRecipientInfo p_symmRecipInfo - ) := { - symmRecipInfo := p_symmRecipInfo - } // End of template m_recipientInfo_symmRecipInfo - - template (value) RecipientInfo m_recipientInfo_certRecipInfo( - in template (value) PKRecipientInfo p_certRecipInfo - ) := { - certRecipInfo := p_certRecipInfo - } // End of template m_recipientInfo_certRecipInfo - - template (present) RecipientInfo mw_recipientInfo_certRecipInfo( - template (present) PKRecipientInfo p_certRecipInfo := ? - ) := { - certRecipInfo := p_certRecipInfo - } // End of template mw_recipientInfo_certRecipInfo - - template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo( - in template (value) PKRecipientInfo p_signedDataRecipInfo - ) := { - signedDataRecipInfo := p_signedDataRecipInfo - } // End of template m_recipientInfo_signedDataRecipInfo - - template (value) RecipientInfo m_recipientInfo_rekRecipInfo( - in template (value) PKRecipientInfo p_rekRecipInfo - ) := { - rekRecipInfo := p_rekRecipInfo - } // End of template m_recipientInfo_rekRecipInfo - - template (value) PKRecipientInfo m_pKRecipientInfo( - in template (value) HashedId8 p_recipientId, - in template (value) EncryptedDataEncryptionKey p_encKey - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template m_pKRecipientInfo - - template (present) PKRecipientInfo mw_pKRecipientInfo( - template (present) HashedId8 p_recipientId := ?, - template (present) EncryptedDataEncryptionKey p_encKey := ? - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template mw_pKRecipientInfo - - template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey( - in template (value) EccP256CurvePoint p_v, - in template (value) Oct16 p_c, - in template (value) Oct16 p_t - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template m_evciesP256EncryptedKey - - template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey( - template (present) EccP256CurvePoint p_v := ?, - template (present) Oct16 p_c := ?, - template (present) Oct16 p_t := ? - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template mw_evciesP256EncryptedKey - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256( - in template (value) EciesP256EncryptedKey p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_encryptedDataEncryptionKey_eciesNistP256 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256( - template (present) EciesP256EncryptedKey p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_encryptedDataEncryptionKey_eciesNistP256 - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm( - in template (value) AesCcmCiphertext p_aes128ccm - ) := { - aes128ccm := p_aes128ccm - } // End of template m_SymmetricCiphertext_aes128ccm - - template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm( - template (present) AesCcmCiphertext p_aes128ccm := ? - ) := { - aes128ccm := p_aes128ccm - } // End of template mw_SymmetricCiphertext_aes128ccm - - template (value) AesCcmCiphertext m_aesCcmCiphertext( - in template (value) Oct12 p_nonce, - in template (value) Opaque p_ccmCiphertext - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template m_aesCcmCiphertext - - template (present) AesCcmCiphertext mw_aesCcmCiphertext( - template (present) Oct12 p_nonce := ?, - template (present) Opaque p_ccmCiphertext := ? - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template mw_aesCcmCiphertext - - } // End of group encryptedData - - /** - * @desc Send/Receive templates for Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - group ieee1609Dot2Data { - - /** - * @desc Send template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_ieee1609Dot2Data - - /** - * @desc Receive template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_ieee1609Dot2Data - - /** - * @desc Send template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - unsecuredData := p_unsecuredData - } // End of template m_ieee1609Dot2Data_unsecured - - /** - * @desc Receive template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_unsecured( - template (present) Opaque p_unsecuredData := ? - ) := { - unsecuredData := p_unsecuredData - } // End of template mw_ieee1609Dot2Data_unsecured - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_signed( - in template (value) SignedData p_signedData - ) := { - signedData := p_signedData - } // End of template m_ieee1609Dot2Data_signed - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_signed( - template (present) SignedData p_signedData := ? - ) := { - signedData := p_signedData - } // End of template mw_ieee1609Dot2Data_signed - - } // End of group ieee1609Dot2Data - - /** - * @desc Send/Receive templates for HeaderInfo - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.4 HeaderInfo - */ - group headerFields { - - /** - * @desc Basic send HeaderInfo template with ETSI ITS restrction - */ - template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( - in template (value) Psid p_psid - ) := { - psid := p_psid, - generationTime := omit, - expiryTime := omit, - generationLocation := omit, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template m_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo( - template (present) Psid p_psid := ? - ) := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate( - template (present) Psid p_psid := ?, - template (present) Certificate p_requestedCertificate := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := p_requestedCertificate - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc CAM specific send HeaderInfo template with ETSI ITS restrction - * - * @see Clause 7.1.1 Security profile for CAMs - */ - template (omit) HeaderInfo m_headerInfo_cam( - in template (value) Psid p_psid := c_its_aid_CAM, - in template (value) Time64 p_generationTime, - in template (omit) Time64 p_expiryTime := omit, - in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest - } // End of template m_headerInfo_cam - - /** - * @desc CAM specific receive HeaderInfo template with ETSI ITS restrction - * - * Clause 7.1.1 Security profile for CAMs - */ - template (present) HeaderInfo mw_headerInfo_cam( - template (present) Psid p_psid := c_its_aid_CAM, - template (present) Time64 p_generationTime := ?, - template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, - template Certificate p_requestedCertificate := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := c_its_aid_CAM, - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest, - requestedCertificate := p_requestedCertificate - } // End of template mw_headerInfo_cam - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (omit) HeaderInfo m_headerInfo_denm( - in template (value) Psid p_psid := c_its_aid_DENM, - in template (value) Time64 p_generationTime, - in template (value) ThreeDLocation p_generationLocation, - in template (omit) Time64 p_expiryTime := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template m_headerInfo_denm - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (present) HeaderInfo mw_headerInfo_denm( - template (present) Psid p_psid := c_its_aid_DENM, - template (present) Time64 p_generationTime := ?, - template (present) ThreeDLocation p_generationLocation := ?, - template Time64 p_expiryTime := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template mw_headerInfo_denm - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (omit) HeaderInfo m_headerInfo_gn( - in template (value) Psid p_psid := c_its_aid_GN, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - } // End of template m_headerInfo_gn - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (present) HeaderInfo mw_headerInfo_gn( - template (present) Psid p_psid := c_its_aid_GN, - template (present) Time64 p_generationTime := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := *, - generationLocation := *, - encryptionKey := *, - inlineP2pcdRequest := *, - requestedCertificate := * - } // End of template mw_headerInfo_gn - - template (omit) HeaderInfo m_headerInfo_inner_pki_request( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (omit) HeaderInfo m_headerInfo_inner_pki_response( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (present) HeaderInfo mw_headerInfo_inner_pki_request( - template (present) Psid p_psid := c_its_aid_SCR, - template (present) Time64 p_generationTime := ? - ) modifies mw_headerInfo_gn := {}; - - template HeaderInfo mw_headerInfo_inner_pki_response( - template (present) Psid p_psid := c_its_aid_SCR, - template Time64 p_generationTime := * - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit - } - - } // End of group headerFields - - group signatures { - - template (value) Signature m_signature_ecdsaNistP256( - in template (value) EcdsaP256Signature p_ecdsaNistP256Signature - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template m_signature_ecdsaNistP256 - - template (present) Signature mw_signature_ecdsaNistP256( - template (present) EcdsaP256Signature p_ecdsaNistP256Signature := ? - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template mw_signature_ecdsaNistP256 - - template (value) Signature m_signature_ecdsaBrainpoolP256r1( - in template (value) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP256r1( - template (present) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature := ? - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (value) Signature m_signature_ecdsaBrainpoolP384r1( - in template (value) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template m_signature_ecdsaBrainpoolP384r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP384r1( - template (present) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature := ? - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template mw_signature_ecdsaBrainpoolP384r1 - - template (value) EcdsaP256Signature m_ecdsaP256Signature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) Oct32 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP256Signature - - template (present) EcdsaP256Signature mw_ecdsaP256Signature( - template (present) EccP256CurvePoint p_rSig := ?, - template (present) Oct32 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP256Signature - - template (value) EcdsaP384Signature m_ecdsaP384Signature( - in template (value) EccP384CurvePoint p_rSig, - in template (value) Oct48 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP384Signature - - template (present) EcdsaP384Signature mw_ecdsaP384Signature( - template (present) EccP384CurvePoint p_rSig := ?, - template (present) Oct48 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP384Signature - - template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( - in template (value) Oct32 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP256CurvePoint_x_only - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_x_only( - template (present) Oct32 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP256CurvePoint_x_only - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_0( - in template (value) Oct32 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP256CurvePoint_compressed_y_0 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_0( - template (present) Oct32 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP256CurvePoint_compressed_y_0 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_1( - in template (value) Oct32 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP256CurvePoint_compressed_y_1 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_1( - template (present) Oct32 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP256CurvePoint_compressed_y_1 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_uncompressed( - in template (value) Oct32 p_x, - in template (value) Oct32 p_y - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template m_eccP256CurvePoint_uncompressed - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_uncompressed( - template (present) Oct32 p_x := ?, - template (present) Oct32 p_y := ? - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP256CurvePoint_uncompressed - - template (value) EccP384CurvePoint m_eccP384CurvePoint_x_only( - in template (value) Oct48 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP384CurvePoint_x_only - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_x_only( - template (present) Oct48 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP384CurvePoint_x_only - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_0( - in template (value) Oct48 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP384CurvePoint_compressed_y_0 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_0( - template (present) Oct48 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP384CurvePoint_compressed_y_0 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_1( - in template (value) Oct48 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP384CurvePoint_compressed_y_1 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_1( - template (present) Oct48 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP384CurvePoint_compressed_y_1 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_uncompressed( - in template (value) Oct48 p_x, - in template (value) Oct48 p_y - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template m_eccP384CurvePoint_uncompressed - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_uncompressed( - template (present) Oct48 p_x := ?, - template (present) Oct48 p_y := ? - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP384CurvePoint_uncompressed - - } // End of group signatures - - /** - * @desc Dummy send/receive templates for certificates - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6 Specification of certificate format - */ - group certificates { - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( - in template (value) IssuerIdentifier p_issuer, - in template (value) ToBeSignedCertificate p_toBeSigned, - in template (omit) Signature p_signature_ := omit, - in template (value) CertificateType p_type_ := explicit - ) := { - version := c_certificate_version, - type_ := p_type_, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template m_etsiTs103097Certificate - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( - template (present) IssuerIdentifier p_issuer := ?, - template (present) ToBeSignedCertificate p_toBeSigned := ?, - template Signature p_signature_ := ?, - template (present) CertificateType p_type_ := explicit - ) := { - version := c_certificate_version, - type_ := p_type_, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template mw_etsiTs103097Certificate - - } // End of group certificates - - group issuerIdentifier { - - template (value) IssuerIdentifier m_issuerIdentifier_self( - in template (value) HashAlgorithm p_self := sha256 - ) := { - self_ := p_self - } // End of template m_issuerIdentifier_self - - template (present) IssuerIdentifier mw_issuerIdentifier_self( - template (present) HashAlgorithm p_self := ? - ) := { - self_ := p_self - } // End of template mw_issuerIdentifier_self - - template (value) IssuerIdentifier m_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - in template (value) HashedId8 p_sha256AndDigest - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template m_issuerIdentifier_sha256AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - template (present) HashedId8 p_sha256AndDigest := ? - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template mw_issuerIdentifier_sha256AndDigest - - template (value) IssuerIdentifier m_issuerIdentifier_sha384AndDigest( - in template (value) HashedId8 p_sha384AndDigest - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template m_issuerIdentifier_sha384AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha384AndDigest( - template (present) HashedId8 p_sha384AndDigest := ? - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template mw_issuerIdentifier_sha384AndDigest - - } // End of group issuerIdentifier - - group toBeSignedCertificate { - - /** - * @desc Send template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ca( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4 - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ca - - /** - * @desc Receive template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ca( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, - crlSeries := 0, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := ?, - certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := p_certRequestPermissions, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ca - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ea - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ea( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ea - - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ec( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ec( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_aa( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_aa - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_aa( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_aa - - template (present) CertificateId mw_certificateId_name( - template (present) charstring p_name := ? - ) := { - name := p_name - } // End of template mw_certificateId_name - - template CertificateId mw_certificateId_none := { - none_ := NULL - } // End of template mw_certificateId_none - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_at - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_at( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_at - - } // End of group toBeSignedCertificate - - group verificationKeys { - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( - in template (value) PublicVerificationKey p_verificationKey - ) := { - verificationKey := p_verificationKey - } // End of template m_verificationKeyIndicator_verificationKey - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_verificationKey( - template (present) PublicVerificationKey p_verificationKey := ? - ) := { - verificationKey := p_verificationKey - } // End of template mw_verificationKeyIndicator_verificationKey - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_reconstructionValue( - in template (value) EccP256CurvePoint p_reconstructionValue - ) := { - reconstructionValue := p_reconstructionValue - } // End of template m_verificationKeyIndicator_reconstructionValue - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_reconstructionValue( - template (present) EccP256CurvePoint p_reconstructionValue := ? - ) := { - reconstructionValue := p_reconstructionValue - } // End of template mw_verificationKeyIndicator_reconstructionValue - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaNistP256( - in template (value) EccP256CurvePoint p_ecdsaNistP256 - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template m_publicVerificationKey_ecdsaNistP256 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaNistP256( - template (present) EccP256CurvePoint p_ecdsaNistP256 := ? - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template mw_publicVerificationKey_ecdsaNistP256 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256r1( - in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256r1( - template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384r1( - in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP384r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384r1( - template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384r1 - - } // End of group verificationKeys - - group encryptionKey { - - template (value) EncryptionKey m_encryptionKey_public( - in template (value) PublicEncryptionKey p_encryptionKey - ) := { - public_ := p_encryptionKey - } - - template (present) EncryptionKey mw_encryptionKey_public( - template (present) PublicEncryptionKey p_encryptionKey := ? - ) := { - public_ := p_encryptionKey - } - - template (value) PublicEncryptionKey m_encryptionKey( - in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - in template (value) BasePublicEncryptionKey p_publicKey - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template m_encryptionKey - - template (present) PublicEncryptionKey mw_encryptionKey( - template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - template (present) BasePublicEncryptionKey p_publicKey := ? - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template mw_encryptionKey - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesNistP256( - in template (value) EccP256CurvePoint p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_publicEncryptionKey_eciesNistP256 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesNistP256( - template (present) EccP256CurvePoint p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_publicEncryptionKey_eciesNistP256 - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( - in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1( - template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1 - - } // End of group encryptionKey - - group appPermissions { - - template (omit) PsidSsp m_appPermissions( - in template (value) Psid p_psid, - in template (omit) ServiceSpecificPermissions p_ssp := omit - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template m_appPermissions - - template PsidSsp mw_appPermissions( - template (present) Psid p_psid := ?, - template ServiceSpecificPermissions p_ssp := * - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template mw_appPermissions - - template (value) PsidSspRange m_psidSspRange( - in Psid p_psid, - in template (value) SspRange p_sspRange := m_SspRange_all - ) := { - psid := p_psid, - sspRange := p_sspRange - } // End of template m_psidSspRange - - template (value) SspRange m_SspRange_all := { - all_ := NULL - } // End of template m_SspRange_all - - template (value) SspRange m_SspRange_opaque( - in template (value) SequenceOfOctetString p_opaque - ) := { - opaque := p_opaque - } // End of template m_SspRange_opaque - - template (value) SspRange m_SspRange_bitmapSspRange( - in template (value) BitmapSspRange p_bitmapSspRange - ) := { - bitmapSspRange := p_bitmapSspRange - } // End of template m_SspRange_bitmapSspRange - - template (value) PsidGroupPermissions m_psidGroupPermissions( - in template (value) SubjectPermissions p_subjectPermissions, - in integer p_minChainLength := 1, - in integer p_chainLengthRange := 0, - in EndEntityType p_eeType := oct2bit('00'O) - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template m_psidGroupPermissions - - template (present) PsidGroupPermissions mw_psidGroupPermissions( - template (present) SubjectPermissions p_subjectPermissions := ?, - integer p_minChainLength := 1, - integer p_chainLengthRange := 0, - template (present) EndEntityType p_eeType := ? - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template mw_psidGroupPermissions - - template (value) SubjectPermissions m_subjectPermissions_explicit( - in template (value) SequenceOfPsidSspRange p_certIssuePermissions - ) := { - explicit := p_certIssuePermissions - } // End of template m_subjectPermissions_explicit - - template (present) SubjectPermissions mw_subjectPermissions_explicit( - template (present) SequenceOfPsidSspRange p_certIssuePermissions := ? - ) := { - explicit := p_certIssuePermissions - } // End of template mw_subjectPermissions_explicit - - template (value) SubjectPermissions m_subjectPermissions_all := { - all_ := NULL - } // End of template m_subjectPermissions_all - - } // End of group appPermissions - - - group validityRestriction { - - template (value) ValidityPeriod m_validityPeriod( - in template (value) Time32 p_start_, - in template (value) Duration p_duration - ) := { - start_ := p_start_, - duration := p_duration - } // End of template m_validityPeriod - - template (present) ValidityPeriod mw_validityPeriod( - template (present) Time32 p_start_ := ?, - template (present) Duration p_duration := ? - ) := { - start_ := p_start_, - duration := p_duration - } // End of template mw_validityPeriod - - /** - * @desc Send template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_seconds( - in template (value) Int16 p_duration - ) := { - seconds := p_duration - } // End of template m_duration_in_seconds - - /** - * @desc Send template for Duration (in hours) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_hours( - in template (value) Int16 p_duration - ) := { - hours := p_duration - } // End of template m_duration_in_hours - - /** - * @desc Receive template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (present) Duration mw_duration_in_seconds( - template (present) Int16 p_duration := ? - ) := { - seconds := p_duration - } // End of template mw_duration_in_seconds - - template (value) Duration m_duration_years( - in template (value) Uint16 p_years - ) := { - years := p_years - } // End of template m_duration_years - - template (present) Duration mw_duration_years( - template (present) Uint16 p_years := ? - ) := { - years := p_years - } // End of template mw_duration_years - - } // End of group validityRestriction - - group ssp { - - group sspCam { - - group sspCamSend { - - template (value) SspCAM m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '1'B, - publicTransport := '1'B, - specialTransport := '1'B, - dangerousGoods := '1'B, - roadwork := '1'B, - rescue := '1'B, - emergency := '1'B, - safetyCar := '1'B, - closedLanes := '1'B, - requestForRightOfWay := '1'B, - requestForFreeCrossingAtATrafficLight := '1'B, - noPassing := '1'B, - noPassingForTrucks := '1'B, - speedLimit := '1'B, - reserved := '000000000000000000'B - } // End of template m_sspCAMContainer_sign_all - - template (value) SspCAM m_sspCAMContainer_vehicle - modifies m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '0'B, - closedLanes := '0'B, - noPassing := '0'B, - noPassingForTrucks := '0'B, - speedLimit := '0'B - } // End of template m_sspCAMContainer_vehicle - - template (value) ServiceSpecificPermissions m_sspCAM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspCAM - - } // End of group sspCamSend - - group sspCamRecv { - - template (present) SspCAM mw_sspCAMContainer_dummy := { - cenDsrcTollingZone := ?, - publicTransport := ?, - specialTransport := ?, - dangerousGoods := ?, - roadwork := ?, - rescue := ?, - emergency := ?, - safetyCar := ?, - closedLanes := ?, - requestForRightOfWay := ?, - requestForFreeCrossingAtATrafficLight := ?, - noPassing := ?, - noPassingForTrucks := ?, - speedLimit := ?, - reserved := '000000000000000000'B - } // End of template mw_sspCAMContainer_dummy - - template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { - bitmapSsp := ? - } // End of template mw_sspCAM_dummy - - } // End of group sspCamRecv - - } // End of group sspCam - - group sspDenm { - - group sspDenmSend { - - template (value) SspDENM m_sspDENMContainer_sign_all := { - trafficCondition := '1'B, - accident := '1'B, - roadworks := '1'B, - adverseWeatherCondition_Adhesion := '1'B, - hazardousLocation_SurfaceCondition := '1'B, - hazardousLocation_ObstacleOnTheRoad := '1'B, - hazardousLocation_AnimalOnTheRoad := '1'B, - humanPresenceOnTheRoad := '1'B, - wrongWayDriving := '1'B, - rescueAndRecoveryWorkInProgress := '1'B, - adverseWeatherCondition_ExtremeWeatherCondition := '1'B, - adverseWeatherCondition_Visibility := '1'B, - adverseWeatherCondition_Precipitation := '1'B, - slowVehicle := '1'B, - dangerousEndOfQueue := '1'B, - vehicleBreakdown := '1'B, - postCrash := '1'B, - humanProblem := '1'B, - stationaryVehicle := '1'B, - emergencyVehicleApproaching := '1'B, - hazardousLocation_DangerousCurve := '1'B, - collisionRisk := '1'B, - signalViolation := '1'B, - dangerousSituation := '1'B, - reserved := '00000000'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_vehicle - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_roadSideUnit - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - template (value) ServiceSpecificPermissions m_sspDENM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspDENM - - } // End of group sspDenmSend - - group sspDenmRecv { - - template (present) SspDENM mw_sspDENMContainer_dummy := { - trafficCondition := ?, - accident := ?, - roadworks := ?, - adverseWeatherCondition_Adhesion := ?, - hazardousLocation_SurfaceCondition := ?, - hazardousLocation_ObstacleOnTheRoad := ?, - hazardousLocation_AnimalOnTheRoad := ?, - humanPresenceOnTheRoad := ?, - wrongWayDriving := ?, - rescueAndRecoveryWorkInProgress := ?, - adverseWeatherCondition_ExtremeWeatherCondition := ?, - adverseWeatherCondition_Visibility := ?, - adverseWeatherCondition_Precipitation := ?, - slowVehicle := ?, - dangerousEndOfQueue := ?, - vehicleBreakdown := ?, - postCrash := ?, - humanProblem := ?, - stationaryVehicle := ?, - emergencyVehicleApproaching := ?, - hazardousLocation_DangerousCurve := ?, - collisionRisk := ?, - signalViolation := ?, - dangerousSituation := ?, - reserved := '00000000'B - } // End of template mw_sspDENMContainer_dummy - - template (present) SspDENM mw_sspDENMContainer_vehicle - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template mw_sspDENMContainer_vehicle - - template (present) SspDENM mw_sspDENMContainer_roadSideUnit - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - } // End of group sspDenmRecv - - } // End of group sspDenm - - } // End of group ssp - - group utPrimitives { - - template (value) UtGnInitialize m_secGnInitialize( - in Oct8 p_hashedId8 - ) := { - hashedId8 := p_hashedId8 - } // End of template m_secGnInitialize - - } // End of group utPrimitives - -} // End of module LibItsSecurity_Templates diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn deleted file mode 100644 index 3f6b75cb..00000000 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TestSystem.ttcn3 $ - * $Id: LibItsSecurity_TestSystem.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_TestSystem { - - // LibCommon - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - group componentDefinitions { - - /** - * @desc ITS Security Component - */ - type component ItsSecurityBaseComponent { - - // Certificates - var Certificate vc_aaCertificate; /** Test Adapter AA certificate */ - var Certificate vc_atCertificate; /** Test Adapter AT certificate */ - var Certificate vc_lastAtCertificateUsed; /** Last Test Adapter certificate used in 'f_buildGnSecuredXXX' functions */ - var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ - - // Private keys - var octetstring vc_signingPrivateKey; - var octetstring vc_encryptPrivateKey; - - // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs - var ThreeDLocation vc_location; - - } // End of ItsSecurityBaseComponent - - } // End of group componentDefinitions - -} // End of module LibItsSecurity_TestSystem \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn deleted file mode 100644 index fb2bcefb..00000000 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ /dev/null @@ -1,314 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn3 $ - * $Id: LibItsSecurity_TypesAndValues.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for Security Protocol - * @see Draft ETSI TS 103 097 V1.1.14 - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsSecurity_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_Pixits all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Sequence of HashedId8 - */ - type record of HashedId8 HashedId8s; - // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; - const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; - const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; - const charstring cc_taCert_A_B := "CERT_TS_A_B_AT"; - const charstring cc_taCert_A_B3 := "CERT_TS_A_B3_AT"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ - const charstring cc_taCert_F3 := "CERT_TS_F3_AT"; /** Certificate that can be used as an unknown certificate for IUT with BrainpoolP384 curve. */ - const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ - const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ - // Test Adapter certificates & private keys - Inoportune behavior - const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ - const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ - const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ - const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ - const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ - const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ - const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ - const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ - const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ - const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ - const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ - const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ - const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ - const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ - const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ - const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ - const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ - const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ - const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ - const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ - const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ - const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ - const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ - const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ - const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ - const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ - const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ - const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ - const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ - const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ - const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ - const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ - const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ - const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ - const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ - const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ - const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ - const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ - const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ - const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ - const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ - const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ - const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ - const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ - const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ - const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ - const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ - const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ - const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ - - // IUT certificates & private keys - const charstring cc_iutCert_C1 := "CERT_IUT_C1_AT"; - const charstring cc_iutCert_CA1 := "CERT_IUT_CA1_AT"; - const charstring cc_iutCert_CA2 := "CERT_IUT_CA2_AT"; - const charstring cc_iutCert_C3 := "CERT_IUT_C3_AA"; - const charstring cc_iutCert_CA3 := "CERT_IUT_CA3_AT"; - const charstring cc_iutCert_CA_AA := "CERT_IUT_CA_AA"; - const charstring cc_iutCert_CC_AA := "CERT_IUT_CC_AA"; - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_A1 := "CERT_IUT_A1_AT"; - const charstring cc_iutCert_A2 := "CERT_IUT_A2_AT"; - const charstring cc_iutCert_A3 := "CERT_IUT_A3_AT"; - const charstring cc_iutCert_A4 := "CERT_IUT_A4_AT"; - const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ - const charstring cc_iutCert_A_N := "CERT_IUT_A_N_AT"; - const charstring cc_iutCert_A_B_N := "CERT_IUT_A_B_N_AT"; - const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ - const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ - const charstring cc_iutCert_A_B3_N := "CERT_IUT_A_B3_N_AT"; - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - - /** - * @desc Specification of basic format elements - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 - */ - group basicFormatElements { - - /** - * @desc Service specific permissions definition for CAM - * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspCAM { - Bit1 cenDsrcTollingZone, - Bit1 publicTransport, - Bit1 specialTransport, - Bit1 dangerousGoods, - Bit1 roadwork, - Bit1 rescue, - Bit1 emergency, - Bit1 safetyCar, - Bit1 closedLanes, - Bit1 requestForRightOfWay, - Bit1 requestForFreeCrossingAtATrafficLight, - Bit1 noPassing, - Bit1 noPassingForTrucks, - Bit1 speedLimit, - Bit18 reserved - } // End of type SspCAM - - /** - * @desc Service specific permissions definition for DENM - * @member trafficCondition - * @member accident - * @member roadworks - * @member adverseWeatherCondition_Adhesion - * @member hazardousLocation_SurfaceCondition - * @member hazardousLocation_ObstacleOnTheRoad - * @member hazardousLocation_AnimalOnTheRoad - * @member humanPresenceOnTheRoad - * @member wrongWayDriving - * @member rescueAndRecoveryWorkInProgress - * @member adverseWeatherCondition_ExtremeWeatherCondition - * @member adverseWeatherCondition_Visibility - * @member adverseWeatherCondition_Precipitation - * @member slowVehicle - * @member dangerousEndOfQueue - * @member vehicleBreakdown - * @member postCrash - * @member humanProblem - * @member stationaryVehicle - * @member emergencyVehicleApproaching - * @member hazardousLocation_DangerousCurve - * @member collisionRisk - * @member signalViolation - * @member dangerousSituation - * @member reserved Reserved for Future Usage - * @see Draft ETSI EN 302 637-3 V1.2.10 Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspDENM { - Bit1 trafficCondition, - Bit1 accident, - Bit1 roadworks, - Bit1 adverseWeatherCondition_Adhesion, - Bit1 hazardousLocation_SurfaceCondition, - Bit1 hazardousLocation_ObstacleOnTheRoad, - Bit1 hazardousLocation_AnimalOnTheRoad, - Bit1 humanPresenceOnTheRoad, - Bit1 wrongWayDriving, - Bit1 rescueAndRecoveryWorkInProgress, - Bit1 adverseWeatherCondition_ExtremeWeatherCondition, - Bit1 adverseWeatherCondition_Visibility, - Bit1 adverseWeatherCondition_Precipitation, - Bit1 slowVehicle, - Bit1 dangerousEndOfQueue, - Bit1 vehicleBreakdown, - Bit1 postCrash, - Bit1 humanProblem, - Bit1 stationaryVehicle, - Bit1 emergencyVehicleApproaching, - Bit1 hazardousLocation_DangerousCurve, - Bit1 collisionRisk, - Bit1 signalViolation, - Bit1 dangerousSituation, - Bit8 reserved - } // End of type SspDENM - - } // End of group certificateSpecification - - /** - * @desc Send/receive templates for profiles for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - group profileCertificates { - - type record CertificatesCachingItem { - HashedId8 hashedId8, - EtsiTs103097Certificate certificate - } - type record of CertificatesCachingItem CertificatesCaching; - - } // End of group profileCertificates - - type enumerated SignAlgorithm { - e_nistp_256, - e_brainpool_256, - e_brainpool_384 - } - - group taConfiguration { - - /** - * @desc Describes the Test Adapter security configuration - * @member signingPrivateKey Signing private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member encryptPrivateKey Encryption private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member caCertificate Certificates Authorization certificate generated by the PKI Infrastructire tool - * @member aaCertificate Enrolment Credential certificate generated by the PKI Infrastructire tool - * @member atCertificate Authorization Tickate certificate generated by the PKI Infrastructire tool - * @member location 3D location associated to each configuration - */ - /*type record TaConfig { - Oct32 signingPrivateKey, - Oct32 encryptPrivateKey, - EtsiTs103097Certificate caCertificate, - EtsiTs103097Certificate aaCertificate, - EtsiTs103097Certificate atCertificate, - ThreeDLocation location - }*/ // End of type TaConfig - - /** - * @desc Describes the Test Adapter security configurations - */ - //type set of TaConfig TaConfigs; - - } // End of group taConfiguration - - group utPrimitives { - - } - with { - encode "UpperTester" - } // End of group utPrimitives - -} with { - encode "LibItsSecurity" -} // End of module LibItsSecurity_TypesAndValues diff --git a/ttcn/Security/module.mk b/ttcn/Security/module.mk deleted file mode 100644 index 12e4cc43..00000000 --- a/ttcn/Security/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsSecurity_EncdecDeclarations.ttcn \ - LibItsSecurity_Functions.ttcn \ - LibItsSecurity_Pics.ttcn \ - LibItsSecurity_Pixits.ttcn \ - LibItsSecurity_Templates.ttcn \ - LibItsSecurity_TestSystem.ttcn \ - LibItsSecurity_TypesAndValues.ttcn \ diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn deleted file mode 100644 index d8699dda..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,59 +0,0 @@ -module LibItsSremSsem_EncdecDeclarations { - - // LibItsSremSsem - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_TestSystem all; - - external function fx_enc_SremReq (SremReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SremReq (inout bitstring b, out SremReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SremInd (SremInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SremInd (inout bitstring b, out SremInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SsemReq (SsemReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SsemReq (inout bitstring b, out SsemReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SsemInd (SsemInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SsemInd (inout bitstring b, out SsemInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SREM (SREM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SREM (inout bitstring b, out SREM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SSEM (SSEM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SSEM (inout bitstring b, out SSEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - /*external function fx_enc_SRM (SignalRequestMessage p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SRM (inout bitstring b, out SignalRequestMessage p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SSM (SignalStatusMessage p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SSM (inout bitstring b, out SignalStatusMessage p) return integer - with {extension "prototype(sliding) decode(PER)"}*/ -} diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn deleted file mode 100644 index 7f5302a3..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ /dev/null @@ -1,518 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn $ - * $Id: LibItsSremSsem_Functions.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ - * @desc Module containing common functions for ITS SREMM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsSremSsem - import from LibItsSremSsem_TestSystem all; - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_Templates all; - import from LibItsSremSsem_Pics all; - import from LibItsSremSsem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtSremInitialize p_init) runs on ItsSremSsem { - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtSremResults: { utSremInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtSremTrigger p_event - ) runs on ItsSremSsem { - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utUpdateEvent( - in template (value) UtSremUpdate p_event - ) runs on ItsSremSsem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremUpdateResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremUpdateResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utCancelationEvent( - in template (value) UtSremCancelation p_event - ) runs on ItsSremSsem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremCancelationResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremCancelationResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM cancelation failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - - return; - } - - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsSremSsem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsSremSsem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsSremSsem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsSremSsem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsSremSsem { - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_sremInd(mw_sremPdu)) { - log("*** " & testcasename() & ": INFO: SREMM received in default ***"); - vc_sremReceived := true; - repeat; - } - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu)) { - log("*** " & testcasename() & ": INFO: SREMM received in default ***"); - vc_ssemReceived := true; - repeat; - } - [vc_sremSsemDefaultActive] sremSsemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsSremSsem { - var UtSremEventInd v_sremevent; - var UtSsemEventInd v_ssemevent; - [] utPort.receive(UtSremEventInd:?) -> value v_sremevent { - //store every upper tester indication received - vc_utSremEvents[lengthof(vc_utSremEvents)] := v_sremevent; - repeat; - } - [] utPort.receive(UtSsemEventInd:?) -> value v_ssemevent { - //store every upper tester indication received - vc_utSsemEvents[lengthof(vc_utSsemEvents)] := v_ssemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group sremSsemConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS, - in charstring p_iutCertificateId := "" - ) runs on ItsSremSsem system ItsSremSsemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:sremSsemPort, system:sremSsemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - //Initialze the IUT - f_prInitialState(p_iutCertificateId); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsSremSsem system ItsSremSsemSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:sremSsemPort, system:sremSsemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - } // End of of sremSsemConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsSremSsem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsSremSsem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_sremSsemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_sremSsemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsSremSsem { - //empty - } - - } // End of group postambles - - group sendFunctions { - - /** - * @desc Sends a SREM message for cancellation - */ - function f_sendSreMessageForCancellation() runs on ItsSremSsem { - // Send SREM cancellation - sremSsemPort.send( - m_sremReq( - m_sremPdu( - m_srem( - m_requestorDescription( - m_vehicleID( - f_getIutStationId() - ), - m_requestorType( - basicVehicle - ) - ), - { - m_signalRequestPackage( - m_signalRequest( - m_intersectionReferenceID, - 17, - priorityCancellation, - { lane := 2 } - ) - ) - })))); - tc_noac.start; - alt { - [] sremSsemPort.receive(mw_ssemInd) { - tc_noac.stop; - log("*** " & testcasename() & ": INCONC: Received SSEM PDU after cancellation. ***"); - } - [] tc_noac.timeout { - log("*** " & testcasename() & ": PASS: No more SSEM PDU received after cancellation. ***"); - } - } - } - - /** - * @desc Sends a SSEM message - * @param p_sendMsg The IVI message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendSseMessage( - in template (value) SignalRequestMessage p_signalRequestMessage - ) runs on ItsSremSsem { - sremSsemPort.send( - m_ssemReq( - m_ssemPdu( - m_ssem( - valueof(p_signalRequestMessage) - )))); - } - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a SREM and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitSreMessage( - in template (present) SremInd p_rcvMsg, - out SremInd p_rcvdMsg - ) runs on ItsSremSsem { - - tc_ac.start; - alt { - [] sremSsemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - /** - * @desc Awaits a SREM and returns it - * @param p_rcvMsg The expected message to be received. - */ - function f_awaitSreMessageCancellation( - template (present) RequestID p_requestID := ? - ) runs on ItsSremSsem { - tc_ac.start; - alt { - [] sremSsemPort.receive( - mw_sremInd( - mw_sremPdu( - mw_sremWellFormatted( - mw_requestorDescription, - { - mw_signalRequestPackage( - mw_signalRequest( - ?, - p_requestID, - priorityCancellation - )) - }, - ? - )))) { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the RequestID number and handles the special case where the - * SremIdentification number reaches the limit of 32768 and will be reset to 0. - * @param p_requestID The RequestID number to increase. - * @return The increased RequestID number. - */ - function f_increaseRequestID( - in RequestID p_requestID - ) return RequestID { - // if maximum number of 256 reached, reset it to 0 - return ((p_requestID + 1) mod 256); - } - - } // End of group miscellaneousFunctions - -} // End of module LibItsSremSsem_Functions diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn deleted file mode 100644 index f6d2b0cc..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn $ - * $Id: LibItsSremSsem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc SREM SSEM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for SREM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_GENERATION := true; - - /** - * @desc Support for SREM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_TRANSMISSION_RATE := true; - - /** - * @desc Support for SREM cancelation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_CANCELATION := true; - - /** - * @desc Support for SREM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_RECEPTION := true; - - /** - * @desc Support for SSEM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SSEM_GENERATION := true; - - /** - * @desc Support for SSEM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SSEM_RECEPTION := true; - - /** - * @desc Support for Short Range communication - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SHORT_RANGE := true; - - modulepar float PICS_T_GENSREMMIN := 0.5; - - /** - * @desc Support for public transport vehicle - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_PUBLIC_TRANSPORT := true; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SREM_HAS_TIMING := true; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SSEM_TRATEMENT_DELAY := true; - - modulepar float PICS_T_DELAY_GENSSEMMIN := 0.1; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SSEM_TRANSMISSION_RATE := true; - - modulepar float PICS_T_RATE_GENSSEMMIN := 0.1; - - modulepar float PICS_T_RATE_GENSSEMMAX := 2.0; - -} // end LibItsSremSsem_Pics diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn deleted file mode 100644 index 4a9e7a9a..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn $ - * $Id: LibItsSremSsem_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ - * @desc MAPEM SPATEM PIXIT - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Pixits { - - // LibCommon - import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - - // LibItsSremSsem - import from LibItsSremSsem_TypesAndValues all; - - /** - * @desc MsgCount for SREM sending - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar BasicVehicleRole PX_BASICVEHICLEROLE := basicVehicle; - - /** - * @desc Used by tester in SREM trigger request - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar RequestImportanceLevel PX_REQUESTIMPORTANCELEVEL := requestImportanceLevel3; - - modulepar IntersectionID PX_INTERSECTION_ID := 123; - - /** - * @desc Used by tester in SREM trigger request - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar DSecond PX_SECOND := 0; - - modulepar MsgCount PX_SEQUENCE_NUMBER := 10; - - modulepar RequestID PX_REQUEST_ID := 5; - - /** - * @desc Used in SREM and SSEM sent by tester - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar IntersectionReferenceID PX_STATUS := { - region := omit, - id := 0 - }; - - modulepar charstring PX_SREM_CERTIFICATE_X := "CERT_IUT_SREM_SSP_01"; - - modulepar octetstring PX_SREM_CERTIFICATE_X_SSP := '024000'O; - - modulepar BasicVehicleRole PX_SREM_CERTIFICATE_X_ROLE := publicTransport; - -} // end LibItsSremSsem_Pixits diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn deleted file mode 100644 index cafb5ee6..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ /dev/null @@ -1,738 +0,0 @@ -/** - * @author ETSI STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn $ - * $Id: LibItsSremSsem_Templates.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc Module containing base template definitions for SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsSremSsem - import from LibItsSremSsem_TestSystem all; - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_Pixits all; - - group primitivesTemplates { - - /** - * @desc Send template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The SREM Message to be sent - */ - template (value) SremReq m_sremReq( - in template (value) SREM p_sremMsg - ) := { - msgOut := p_sremMsg - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - */ - template (present) SremInd mw_sremInd( - template (present) SREM p_sremMsg - ) := { - msgIn := p_sremMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) SremInd mw_sremIndWithGnParameters( - template (present) SREM p_sremMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_sremInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg Expected SREM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template (present) SremInd mw_sremIndWithBtpParameters( - template (present) SREM p_sremMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_sremInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) SremInd mw_sremIndWithSecurityParameters( - template (present) SREM p_sremMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_sremInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - /** - * @desc Send template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The SSEM Message to be sent - */ - template (value) SsemReq m_ssemReq( - in template (value) SSEM p_ssemMsg - ) := { - msgOut := p_ssemMsg - } - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - */ - template (present) SsemInd mw_ssemInd( - template (present) SSEM p_ssemMsg := ? - ) := { - msgIn := p_ssemMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - }; - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) SsemInd mw_ssemIndWithGnParameters( - template (present) SSEM p_ssemMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_ssemInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg Expected SREM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template(present) SsemInd mw_ssemIndWithBtpParameters( - template (present) SSEM p_ssemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_ssemInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) SsemInd mw_ssemIndWithSecurityParameters( - template (present) SSEM p_ssemMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_ssemInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - } - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - template (value) UtSremInitialize m_sremSsemInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (value) UtSremTrigger m_utTriggerEvent( - in template (value) BasicVehicleRole p_basicVehicleRole, - in template (value) RequestImportanceLevel p_requestImportanceLevel, - in template (value) IntersectionID p_intersectionId - ) := { - basicVehicleRole := p_basicVehicleRole, - requestImportanceLevel := p_requestImportanceLevel, - intersectionId := p_intersectionId - } - - template (value) UtSremUpdate m_utUpdateEvent( - in template (value) RequestID p_requestID, - in template (value) BasicVehicleRole p_basicVehicleRole, - in template (value) RequestImportanceLevel p_requestImportanceLevel - ) := { - requestID := p_requestID, - basicVehicleRole := p_basicVehicleRole, - requestImportanceLevel := p_requestImportanceLevel - } - - template (value) UtSremCancelation m_UtSremCancelationEvent( - in template (value) RequestID p_requestID - ) := { - requestID := p_requestID - } - - } - - group sremSsemPduTemplates { - - /** - * @desc Send template for SREM PDU - * @param p_map The SREM Message - */ - template (value) SREM m_sremPdu( - in template (value) SignalRequestMessage p_srm - ) := { - header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ ), - srm := p_srm - } - - /** - * @desc Receive template for SREM PDU - * @param p_map The SREM Message - */ - template (present) SREM mw_sremPdu( - template (present) SignalRequestMessage p_srm := ? - ) := { - header := mw_itsPduHeaderSrem, - srm := p_srm - } - - /** - * @desc Send template for SSEM PDU - * @param p_spat The SSEM Message - */ - template (value) SSEM m_ssemPdu( - in template (value) SignalStatusMessage p_ssm - ) := { - header := m_itsPduHeader( - , - , LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_), - ssm := p_ssm - } - - /** - * @desc Receive template for SSEM PDU - * @param p_spat The SSEM Message - */ - template (present) SSEM mw_ssemPdu( - template (present) SignalStatusMessage p_ssm := ? - ) := { - header := mw_itsPduHeaderSsem, - ssm := p_ssm - } - - } // End of group sremSsemPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The message Id (Default: SREM SSEM id) - */ - template (value) ItsPduHeader m_itsPduHeader( - in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - in template (value) ItsPduHeader.messageID p_messageID - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SREM SSEM message id) - */ - template ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ? - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SREM id) - */ - template ItsPduHeader mw_itsPduHeaderSrem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SSEM id) - */ - template (present) ItsPduHeader mw_itsPduHeaderSsem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group sremSsemTemplates { - - template (omit) IntersectionReferenceID m_intersectionReferenceID( - in template (value) IntersectionID p_intersectionID := 0, - in template (omit) RoadRegulatorID p_roadRegulatorID := omit - ) := { - region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs - id := p_intersectionID // a unique mapping to the intersection in question within the above region of use - } - - template IntersectionReferenceID mw_intersectionReferenceID( - template (present) IntersectionID p_intersectionID := ?, - template RoadRegulatorID p_roadRegulatorID := * - ) := { - region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs - id := p_intersectionID // a unique mapping to the intersection in question within the above region of use - } - - group sremTemplates { - - group sremTemplatesSend { - - /** - * @desc Send template for SREM Message - */ - template (value) SignalRequestMessage m_defaultSrem := { - timeStamp := omit, - second := PX_SECOND, - sequenceNumber := PX_SEQUENCE_NUMBER, - requests := { - valueof( - m_signalRequestPackage( - valueof( - m_signalRequest( - m_intersectionReferenceID, - PX_REQUEST_ID, - priorityRequestTypeReserved, - { lane := 1 } - )))) }, - requestor := valueof(m_requestorDescription(m_vehicleID(f_getIutStationId()))), - regional := omit - } - - /** - * @desc Send template for SREM Message - */ - template (omit) SignalRequestMessage m_srem( - in template (value) RequestorDescription p_requestorDescription, - in template (omit) SignalRequestList p_requests := omit - ) modifies m_defaultSrem := { - requests := p_requests, - requestor := p_requestorDescription - } - - template (value) SignalRequestPackage m_signalRequestPackage( - in template (value) SignalRequest p_request - ) := { - request := p_request, - minute := omit, - second := omit, - duration := omit, - regional := omit - } - - template (omit) SignalRequest m_signalRequest( - in template (value) IntersectionReferenceID p_id, - in template (value) RequestID p_requestID, - in template (value) PriorityRequestType p_requestType, - in template (value) IntersectionAccessPoint p_inBoundLane, - in template (omit) IntersectionAccessPoint p_outBoundLane := omit - ) := { - id := p_id, - requestID := p_requestID, - requestType := p_requestType, - inBoundLane := p_inBoundLane, - outBoundLane := p_outBoundLane, - regional := omit - } - - template (omit) RequestorDescription m_requestorDescription( - in template (value) VehicleID p_id, - in template (omit) RequestorType p_type := omit, - in template (omit) RequestorPositionVector p_position := omit, - in template (omit) TransitVehicleStatus p_transitStatus := omit, - in template (omit) TransitVehicleOccupancy p_transitOccupancy := omit - ) := { - id := p_id, // The ID used in the BSM or CAM of the requestor - type_ := p_type, // Information regarding all type and class data about the requesting vehicle - position := p_position, // The location of the requesting vehicle - name := omit, // A human readable name for debugging use - routeName := omit, // A string for transit operations use - transitStatus := p_transitStatus, // current vehicle state (loading, etc.) - transitOccupancy := p_transitOccupancy, // current vehicle occupancy - transitSchedule := omit, // current vehicle schedule adherence - regional := omit - } - - template (value) VehicleID m_vehicleID( - in template (value) StationID p_stationID - ) := { - stationID := p_stationID - } - - template (omit) RequestorType m_requestorType( - in template (value) BasicVehicleRole p_role, - in template (omit) RequestSubRole p_subrole := omit, - in template (omit) RequestImportanceLevel p_request := omit - ) := { - role := p_role, // Basic role of this user at this time - subrole := p_subrole, // A local list with role based items - request := p_request, // A local list with request items - iso3883 := omit, - hpmsType := omit, // HPMS classification types - regional := omit - } - - template (value) RequestorPositionVector m_requestor_position( - in template (value) Position3D p_position - ) := { - position := p_position, - heading := omit, - speed := omit - } // End of template m_requestor_position - - template (value) Position3D m_position3D( - in template (value) Latitude p_latitude, - in template (value) Longitude p_longitude - ) := { - lat := p_latitude, // in 1/10th micro degrees - long := p_longitude, // in 1/10th micro degrees - elevation := omit, // in 10 cm units - regional := omit - } - - } // End of group sremTemplatesSend - - group sremTemplatesRecv { - - /** - * @desc Receive template for SREM Message - */ - template (present) SignalRequestMessage mw_defaultSrem := { - timeStamp := *, - second := ?, - sequenceNumber := *, - requests := *, - requestor := ?, - regional := * - } // End of template mw_defaultSrem - - /** - * @desc Receive template for SREM Message with no LayerType - */ - template (present) SignalRequestMessage mw_sremWellFormatted( - template (present) RequestorDescription p_requestor := ?, - template (present) SignalRequestList p_requests := ?, - template (present) MsgCount p_sequenceNumber := ?, - template (present) DSecond p_second := ?, - template MinuteOfTheYear p_timeStamp := * - ) modifies mw_defaultSrem := { - timeStamp := p_timeStamp, - second := p_second, - sequenceNumber := p_sequenceNumber, - requests := p_requests, - requestor := p_requestor - } // End of template mw_sremWellFormatted - - template (present) SignalRequestPackage mw_signalRequestPackage( - template (present) SignalRequest p_request := ? - ) := { - request := p_request, - minute := *, - second := *, - duration := *, - regional := * - } - - template SignalRequest mw_signalRequest( - template (present) IntersectionReferenceID p_id := ?, - template (present) RequestID p_requestID := ?, - template (present) PriorityRequestType p_requestType := priorityRequest, - template (present) IntersectionAccessPoint p_inBoundLane := ?, - template IntersectionAccessPoint p_outBoundLane := * - ) := { - id := p_id, - requestID := p_requestID, - requestType := p_requestType, - inBoundLane := p_inBoundLane, - outBoundLane := p_outBoundLane, - regional := * - } - - template (present) RequestorDescription mw_requestorDescription( - template (present) VehicleID p_id := ?, - template RequestorType p_type := *, - template RequestorPositionVector p_position := *, - template TransitVehicleStatus p_transitStatus := *, - template TransitVehicleOccupancy p_transitOccupancy := *, - template DeltaTime p_transitSchedule := * - ) := { - id := p_id, // The ID used in the BSM or CAM of the requestor - type_ := p_type, // Information regarding all type and class data about the requesting vehicle - position := p_position, // The location of the requesting vehicle - name := *, // A human readable name for debugging use - routeName := *, // A string for transit operations use - transitStatus := p_transitStatus, // current vehicle state (loading, etc.) - transitOccupancy := p_transitOccupancy, // current vehicle occupancy - transitSchedule := p_transitSchedule, // current vehicle schedule adherence - regional := * - } // End of template mw_requestorDescription - - template (present) RequestorPositionVector mw_requestor_position( - template (present) Position3D p_position := ? - ) := { - position := p_position, - heading := *, - speed := * - } // End of template mw_requestor_position - - template RequestorType mw_requestorType( - template (present) BasicVehicleRole p_role := ?, - template RequestSubRole p_subrole := *, - template RequestImportanceLevel p_request := * - ) := { - role := p_role, // Basic role of this user at this time - subrole := p_subrole, // A local list with role based items - request := p_request, // A local list with request items - iso3883 := *, - hpmsType := *, // HPMS classification types - regional := * - } // End of template mw_requestorType - - } // End of group sremTemplatesRecv - - } // End of group sremTemplates - - group ssemTemplates { - - /** - * @desc Send template for SignalStatusMessage Message - */ - template (value) SignalStatusMessage m_defaultSsem := { - timeStamp := omit, - second := PX_SECOND, - sequenceNumber := omit, - status := { - m_signalStatus( - PX_SEQUENCE_NUMBER, - m_requestorDescription( - m_vehicleID(f_getIutStationId() - )), - m_signalRequest( - m_intersectionReferenceID, - PX_REQUEST_ID, - priorityRequestTypeReserved, - { lane := 1 } - ) - ) - }, - regional := omit - } - - /** - * @desc Send template for SignalStatusMessage Message - */ - template (value) SignalStatusMessage m_ssem( - in SignalRequestMessage p_signalRequestMessage - ) modifies m_defaultSsem := { - second := p_signalRequestMessage.second, - status := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requestor, p_signalRequestMessage.requests[0].request) }, - regional := omit - } - - /** - * @desc Receive template for SSEM Message - */ - template (present) SignalStatusMessage mw_ssemWellFormatted( - template (present) MsgCount p_sequenceNumber := ?, - template (present) SignalStatus p_status := ? - ) := { - timeStamp := *, - second := ?, - sequenceNumber := p_sequenceNumber, - status := { p_status }, - regional := * - } - - template (value) SignalStatus m_signalStatus( - in template (value) MsgCount p_sequenceNumber, - in template (value) RequestorDescription p_requestor, - in template (value) SignalRequest p_signalRequest - ) := { - sequenceNumber := p_sequenceNumber, - id := p_signalRequest.id, - sigStatus := { m_signalStatusPackage(m_requester(p_requestor, p_signalRequest.requestID, p_sequenceNumber)) }, - regional := omit - } - - template (present) SignalStatus mw_signalStatus( - template (present) MsgCount p_sequenceNumber := ?, - template (present) IntersectionReferenceID p_id := ?, - template (present) SignalStatusPackage p_sigStatus := ? - ) := { - sequenceNumber := p_sequenceNumber, - id := p_id, - sigStatus := { p_sigStatus }, - regional := * - } - - template (value) SignalRequesterInfo m_requester( - in template (value) RequestorDescription p_requestor, - in template (value) RequestID p_request, - in template (value) MsgCount p_sequenceNumber - ) := { - id := p_requestor.id, - request := p_request, - sequenceNumber := p_sequenceNumber, - role := omit,//p_requestor.type_.role, - typeData := p_requestor.type_ - } - - template SignalRequesterInfo mw_requester( - template (present) VehicleID p_id := ?, - template (present) RequestID p_request := ?, - template (present) MsgCount p_sequenceNumber := ?, - template BasicVehicleRole role := * - ) := { - id := p_id, - request := p_request, - sequenceNumber := p_sequenceNumber, - role := *, - typeData := * - } - - template (value) SignalStatusPackage m_signalStatusPackage( - in template (value) SignalRequesterInfo p_requester - ) := { - requester := p_requester, - inboundOn := { - approach := 0 - }, - outboundOn := omit, - minute := omit, - second := omit, - duration := omit, - status := processing, - regional := omit - } - - template SignalStatusPackage mw_signalStatusPackage( - template (present) SignalRequesterInfo p_requester := ? - ) := { - requester := p_requester, - inboundOn := ?, - outboundOn := *, - minute := *, - second := *, - duration := *, - status := ?, - regional := * - } - - } // End of group ssemTemplates - - } // End of group sremSsemTemplates - -} // End of module LibItsSremSsem_Templates diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn deleted file mode 100644 index 48daa6c1..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn $ - * $Id: LibItsSremSsem_TestSystem.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ - * @desc Test System module for ITS SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_Time all; - import from LibCommon_Sync all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsSremSsem - import from LibItsSremSsem_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtSremInitialize, UtSremTrigger, UtSremUpdate, UtSremCancelation; - in - UtSremResults, UtSremEventInd , UtSsemEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - /** - * @desc Application MapSpat Port - */ - type port SremSsemPort message { in SremInd , SsemInd ; out SremReq , SsemReq } - - } // End of group interfacePorts - - /** - * @desc ITS System Adapter - */ - type component ItsSremSsemSystem { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port SremSsemPort sremSsemPort; - - } // End of component ITS System Adapter - - /** - * @desc Test component for ITS SREM-SSEM application layer - */ - type component ItsSremSsem extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port SremSsemPort sremSsemPort; - //timers - - //component variables - var SremInd vc_mapMsg; - var SsemInd vc_spatMsg; - var UtSremEventIndList vc_utSremEvents := {}; - var UtSsemEventIndList vc_utSsemEvents := {}; - - //default - var default vc_default := null; - - //global variables - var boolean vc_sremReceived := false; - var boolean vc_ssemReceived := false; - - var boolean vc_sremSsemDefaultActive := true; - } // End of component ItsSremSsem - - group ApplPrimitives { - - type record SremInd { - SREM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "LibItsSremSsem_asn1" - } - - type record of SremInd SremInds; - - type record SsemInd { - SSEM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc Appl SREM and SSEM Request Primitive - */ - type record SremReq { - SREM msgOut - } - with { - encode (msgOut) "PER" - } - type record SsemReq { - SSEM msgOut - } - with { - encode (msgOut) "PER" - } - - } with { - variant "" - encode "LibIts_Interface" - } // End of group ApplPrimitives - -} // End of module LibItsSremSsem_TestSystem diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn deleted file mode 100644 index 1fd49971..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn $ - * $Id: LibItsSremSsem_TypesAndValues.ttcn 1307 2016-12-13 07:51:14Z garciay $ - * @desc Module containing types and values for SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtSremInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Srem/Ssem IUT - * @member utSremInitialize - * @member utSremTriggerResult - * @member utSremUpdateResult - * @member utSremCancelationResult - */ - type union UtSremResults { - boolean utSremInitializeResult, - boolean utSremTriggerResult, - boolean utSremUpdateResult, - boolean utSremCancelationResult - } with { - variant "" - } // End of type UtSremResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtSremTrigger { - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel, - IntersectionID intersectionId - } with { - variant "FIELDORDER(msb)" - } - - type record of UtSremTrigger UtSremTriggerList; - - /** - * @desc Upper Tester message to request updating of an event at IUT - */ - type record UtSremUpdate { - RequestID requestID, - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request cancelation of an event at IUT - */ - type record UtSremCancelation { - RequestID requestID - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSremEventInd { - SREM sreMsg - } with { - encode (sreMsg) "PER" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSsemEventInd { - SSEM sseMsg - } with { - encode (sseMsg) "PER" - } - - /** - * @desc List of Upper Tester messages to check event/status on SREM IUT - */ - type record of UtSremEventInd UtSremEventIndList; - - /** - * @desc List of Upper Tester messages to check event/status on SSEM IUT - */ - type record of UtSsemEventInd UtSsemEventIndList; - - type record of RequestID RequestIDList; - - } with { - encode "UpperTester" - variant "" - } - -} with { - encode "LibItsSremSsem" -} // End of module LibItsSremSsem_TypesAndValues diff --git a/ttcn/SremSsem/module.mk b/ttcn/SremSsem/module.mk deleted file mode 100644 index b74c0602..00000000 --- a/ttcn/SremSsem/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsSremSsem_EncdecDeclarations.ttcn \ - LibItsSremSsem_Functions.ttcn \ - LibItsSremSsem_Pics.ttcn \ - LibItsSremSsem_Pixits.ttcn \ - LibItsSremSsem_Templates.ttcn \ - LibItsSremSsem_TestSystem.ttcn \ - LibItsSremSsem_TypesAndValues.ttcn -- GitLab From ba58b0d70b035751bcff8d13b0483c9eef2c18f1 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 11:53:45 +0200 Subject: [PATCH 5/6] Merging TTF002 in TTF011 - Phase1: AtsCAM, AtsDENM, AtsGeoNetworking, AtsSecurity, AtsPki --- ttcn/Common/module.mk | 2 ++ ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 ++-- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk index 343d2f12..d0b9f48c 100644 --- a/ttcn/Common/module.mk +++ b/ttcn/Common/module.mk @@ -11,4 +11,6 @@ sources := \ ifeq (,$(ITS_CONTAINER)) ITS_CONTAINER := defined sources += ../../asn1/cdd/ITS_Container.asn +else + sources += $(ITS_CONTAINER) # Set in config.mk endif diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index c7650134..8b2b26d0 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -16,8 +16,8 @@ module LibItsHttp_BinaryMessageBodyTypes { */ // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index 45c6df15..d988cfad 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -15,8 +15,8 @@ module LibItsHttp_BinaryTemplates { // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; -- GitLab From 8cc82f9090a74ea159ee1da9f26c3b94de153f3b Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 13:31:37 +0200 Subject: [PATCH 6/6] Change path to CDD --- ttcn/Common/module.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk index d0b9f48c..7f8bb5da 100644 --- a/ttcn/Common/module.mk +++ b/ttcn/Common/module.mk @@ -10,7 +10,5 @@ sources := \ ifeq (,$(ITS_CONTAINER)) ITS_CONTAINER := defined - sources += ../../asn1/cdd/ITS_Container.asn -else - sources += $(ITS_CONTAINER) # Set in config.mk + sources += ../../../AtsDENM/lib/asn1/cdd/ITS_Container.asn #../../asn1/cdd/ITS_Container.asn endif -- GitLab