diff --git a/data/gencerts.cfg b/data/gencerts.cfg index f95d1e9092f0fd137420bfdfa885f05ae8f951d2..b46dbc91d3e24f46c854e44f7bac388a7094ef08 100644 --- a/data/gencerts.cfg +++ b/data/gencerts.cfg @@ -5,7 +5,16 @@ reuse=yes format=hex # Reference time point. The begining of the current year is used by default -#reftime=2015-01-01 +#reftime=2016-01-01 -# location of the IUT position -reflocation=51.4744200:5.6240500 +# location of the IUT position (ETSI) +reflocation = 43.616949:7.053308 + +# custom AID to be used to test GenericMessageProfile +macro=CAM:36 +macro=DENM:37 + +# local region: Italy +macro=RGN_LOCAL:380 +# Other region: France +macro=RGN_OTHER:250 diff --git a/data/profiles/CERT_IUT_A_1_AT.xml b/data/profiles/CERT_IUT_A_1_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..d6daa57aed86936143bfe681185cdadb6baae725 --- /dev/null +++ b/data/profiles/CERT_IUT_A_1_AT.xml @@ -0,0 +1,29 @@ + + 2 + + + + + + + + + + + + + + + ÿÿ + ÿÿÿ + + + + + + + + + + + diff --git a/data/profiles/CERT_IUT_A_AT.xml b/data/profiles/CERT_IUT_A_AT.xml index f976b75ad2247ac2c019804140c11023efeb3666..c27b17a0840599510508829c7d27e525799df44d 100644 --- a/data/profiles/CERT_IUT_A_AT.xml +++ b/data/profiles/CERT_IUT_A_AT.xml @@ -14,8 +14,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_B_AT.xml b/data/profiles/CERT_IUT_B_AT.xml index a73f27bb9edb1b87d229fdecb90b8f97e4e701cc..4049cec395a26b2fd77859ead9ca95cd64e91506 100644 --- a/data/profiles/CERT_IUT_B_AT.xml +++ b/data/profiles/CERT_IUT_B_AT.xml @@ -14,8 +14,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_CAM_BO_02_AT.xml b/data/profiles/CERT_IUT_CAM_BO_02_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3667e1996c65be7855173f5d78e2ca9fd9c0e6b --- /dev/null +++ b/data/profiles/CERT_IUT_CAM_BO_02_AT.xml @@ -0,0 +1,30 @@ + + + 2 + + + + + + + + + + + + + + + ¿ÿ + + + + + + + + + + diff --git a/data/profiles/CERT_IUT_CAM_BO_03_AT.xml b/data/profiles/CERT_IUT_CAM_BO_03_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2e90b1759717578c6864bb1d9fb9eb4a145312e --- /dev/null +++ b/data/profiles/CERT_IUT_CAM_BO_03_AT.xml @@ -0,0 +1,30 @@ + + + 2 + + + + + + + + + + + + + + + ßÿ + + + + + + + + + + diff --git a/data/profiles/CERT_IUT_C_1_BV_AT.xml b/data/profiles/CERT_IUT_C_1_BV_AT.xml index 26aebfe0732d48fc1c06fecb678db9254e9c777c..3b27369f096858361d122b84d687c010d85e9d95 100644 --- a/data/profiles/CERT_IUT_C_1_BV_AT.xml +++ b/data/profiles/CERT_IUT_C_1_BV_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_C_2_BV_AT.xml b/data/profiles/CERT_IUT_C_2_BV_AT.xml index 37f39011ba235f83f04bd44de9e410eda114c2b3..83e0c11009090c874470d960f4fae9aeb49a2344 100644 --- a/data/profiles/CERT_IUT_C_2_BV_AT.xml +++ b/data/profiles/CERT_IUT_C_2_BV_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_C_3_BO_AT.xml b/data/profiles/CERT_IUT_C_3_BO_AT.xml index b32ba3cd24f14b22810be79247f233dd8b88bd56..8ecc41fd7049ee66d4bf1697381d6a8d2387ed21 100644 --- a/data/profiles/CERT_IUT_C_3_BO_AT.xml +++ b/data/profiles/CERT_IUT_C_3_BO_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_C_4_BO_AT.xml b/data/profiles/CERT_IUT_C_4_BO_AT.xml index c1f4c7a82e3fa0d3cbcab2db378fa57b504218eb..e72313feaf543f31ae2d602a98f80a7aec65b496 100644 --- a/data/profiles/CERT_IUT_C_4_BO_AT.xml +++ b/data/profiles/CERT_IUT_C_4_BO_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_C_5_BV_AT.xml b/data/profiles/CERT_IUT_C_5_BV_AT.xml index 465db5e3b2cb192006396011627ff86fd5f0c072..f48bd2a1312ac2e03aa4ee0fb0b6e6173d7e0c06 100644 --- a/data/profiles/CERT_IUT_C_5_BV_AT.xml +++ b/data/profiles/CERT_IUT_C_5_BV_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_C_AT.xml b/data/profiles/CERT_IUT_C_AT.xml index 489e97ba6668c949d1a448b24f23d6a44043525c..2b2acaf4606f49fb6d60b06c5ed624d9840a2f6d 100644 --- a/data/profiles/CERT_IUT_C_AT.xml +++ b/data/profiles/CERT_IUT_C_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_DENM_BO_01_AT.xml b/data/profiles/CERT_IUT_DENM_BO_01_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..1fe09f8d620038979e0bb7813e0309c6877af558 --- /dev/null +++ b/data/profiles/CERT_IUT_DENM_BO_01_AT.xml @@ -0,0 +1,31 @@ + + + 2 + + + + + + + + + + + + + + + ÿÿ + ÿÿ + + + + + + + + + + diff --git a/data/profiles/CERT_IUT_DENM_BO_02_AT.xml b/data/profiles/CERT_IUT_DENM_BO_02_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd144a6b60229887024ee82e940c5c50a438e523 --- /dev/null +++ b/data/profiles/CERT_IUT_DENM_BO_02_AT.xml @@ -0,0 +1,31 @@ + + + 2 + + + + + + + + + + + + + + + ÿÿ + ¿ÿÿ + + + + + + + + + + diff --git a/data/profiles/CERT_IUT_D_1_BV_AT.xml b/data/profiles/CERT_IUT_D_1_BV_AT.xml index 5ba4bb463bea1629ca982250fb249982f0f91e2e..ff64649e78d438e052b5ae6c021d35b9cf7e5d88 100644 --- a/data/profiles/CERT_IUT_D_1_BV_AT.xml +++ b/data/profiles/CERT_IUT_D_1_BV_AT.xml @@ -18,8 +18,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_D_2_BO_AT.xml b/data/profiles/CERT_IUT_D_2_BO_AT.xml index 917dda4093996f4c1f6c97805f843b5b5cfb4cc0..d58ef1fad627f71fc970c7f19d838aa4eed13afc 100644 --- a/data/profiles/CERT_IUT_D_2_BO_AT.xml +++ b/data/profiles/CERT_IUT_D_2_BO_AT.xml @@ -18,8 +18,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_D_3_BO_AT.xml b/data/profiles/CERT_IUT_D_3_BO_AT.xml index eaedd14e80d7af4d7db812f7d1a94f0d94adf401..7c8d81528c3211c4d5780c07ad21d6b0f7b6f587 100644 --- a/data/profiles/CERT_IUT_D_3_BO_AT.xml +++ b/data/profiles/CERT_IUT_D_3_BO_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_D_AT.xml b/data/profiles/CERT_IUT_D_AT.xml index 6f18477fdbe67f49775d4e36edf9f3dcd9773019..5b76c38c546380a1db33b334421f4accbc62f339 100644 --- a/data/profiles/CERT_IUT_D_AT.xml +++ b/data/profiles/CERT_IUT_D_AT.xml @@ -17,8 +17,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_IUT_E_AT.xml b/data/profiles/CERT_IUT_E_AT.xml index 98c893352786f348b6d7481bec710fdb98ce9520..8b292a7e78570592d8825d64e35f00d046320041 100644 --- a/data/profiles/CERT_IUT_E_AT.xml +++ b/data/profiles/CERT_IUT_E_AT.xml @@ -14,14 +14,15 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + - + diff --git a/data/profiles/CERT_TEST_ROOT.xml b/data/profiles/CERT_TEST_ROOT.xml index 3827eb911808b8926a3b6efe4d59691510ed28f5..ea6d441d37da3c10338c53200c112c0fe7642ddd 100644 --- a/data/profiles/CERT_TEST_ROOT.xml +++ b/data/profiles/CERT_TEST_ROOT.xml @@ -14,8 +14,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_01_01_BO_AT.xml b/data/profiles/CERT_TS_01_01_BO_AT.xml index 37131f235503046da5707b33946c49fb380c4a62..339b4751da9564a758073dc0b5e14f7b860fb65d 100644 --- a/data/profiles/CERT_TS_01_01_BO_AT.xml +++ b/data/profiles/CERT_TS_01_01_BO_AT.xml @@ -1,3 +1,6 @@ + 3 @@ -14,8 +17,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_01_02_BO_AT.xml b/data/profiles/CERT_TS_01_02_BO_AT.xml index 359d5fa426375b7f04b91345105e9da34bac1cb4..2c851705f2a6c3a2639714e7eb62ff72b77bb66e 100644 --- a/data/profiles/CERT_TS_01_02_BO_AT.xml +++ b/data/profiles/CERT_TS_01_02_BO_AT.xml @@ -1,3 +1,6 @@ + 1 @@ -14,8 +17,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_01_03_BO_AA.xml b/data/profiles/CERT_TS_01_03_BO_AA.xml index e288cecb306e86dc6c3d5e73db1fbac3f4230203..6e54233057113b6dffb71c34cf8e454f87f6cc7f 100644 --- a/data/profiles/CERT_TS_01_03_BO_AA.xml +++ b/data/profiles/CERT_TS_01_03_BO_AA.xml @@ -1,4 +1,6 @@ - + 3 @@ -15,8 +17,8 @@ - - + + diff --git a/data/profiles/CERT_TS_01_03_BO_AT.xml b/data/profiles/CERT_TS_01_03_BO_AT.xml index 61c12b270db665ada4b5c94df358deaa788445ee..b8699210bace708318e92c1c2a05ef88c91aac03 100644 --- a/data/profiles/CERT_TS_01_03_BO_AT.xml +++ b/data/profiles/CERT_TS_01_03_BO_AT.xml @@ -1,3 +1,6 @@ + 2 @@ -14,8 +17,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_01_04_BO_AA.xml b/data/profiles/CERT_TS_01_04_BO_AA.xml index 2d30bee7190e285d9f26102073192b4a477b9567..ca8a6207f86337da7b1a79ae9a0a19df9c99d6b3 100644 --- a/data/profiles/CERT_TS_01_04_BO_AA.xml +++ b/data/profiles/CERT_TS_01_04_BO_AA.xml @@ -1,4 +1,6 @@ - + 1 @@ -15,8 +17,12 @@ - - + + + + + + diff --git a/data/profiles/CERT_TS_01_04_BO_AT.xml b/data/profiles/CERT_TS_01_04_BO_AT.xml index 9325972b7324538cdacf73b32bf15ee7a3950c97..cfbef39feaaeb51e3556f8691948c546e86a1ce5 100644 --- a/data/profiles/CERT_TS_01_04_BO_AT.xml +++ b/data/profiles/CERT_TS_01_04_BO_AT.xml @@ -1,3 +1,6 @@ + 2 @@ -14,8 +17,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_02_01_BO_AT.xml b/data/profiles/CERT_TS_02_01_BO_AT.xml index f7dc8264a020b60dda1993d73c6685b9ee67ca28..057366a84f9407bae4a665ac1ce28c4b6109c99a 100644 --- a/data/profiles/CERT_TS_02_01_BO_AT.xml +++ b/data/profiles/CERT_TS_02_01_BO_AT.xml @@ -1,4 +1,4 @@ - + 2 @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_02_02_BO_AA.xml b/data/profiles/CERT_TS_02_02_BO_AA.xml index 9b1a8535b8468ef43f027848d392bc778c9307b4..4311e58f31a632caed612668099da440a8b023ac 100644 --- a/data/profiles/CERT_TS_02_02_BO_AA.xml +++ b/data/profiles/CERT_TS_02_02_BO_AA.xml @@ -1,4 +1,4 @@ - + 2 @@ -15,8 +15,12 @@ - - + + + + + + diff --git a/data/profiles/CERT_TS_02_02_BO_AT.xml b/data/profiles/CERT_TS_02_02_BO_AT.xml index b263a9c71cde3ef56640ed83090b3710cf07de4b..b7b5d8b7c66b2f4ca8c005a77d980eb4efdb4904 100644 --- a/data/profiles/CERT_TS_02_02_BO_AT.xml +++ b/data/profiles/CERT_TS_02_02_BO_AT.xml @@ -1,4 +1,4 @@ - + 2 @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_02_03_BO_AT.xml b/data/profiles/CERT_TS_02_03_BO_AT.xml index 7bfe25ef29dcd094041cb706b91c5377d109cfd8..f343300f4fd7198587bb72bb6589d35bc203575e 100644 --- a/data/profiles/CERT_TS_02_03_BO_AT.xml +++ b/data/profiles/CERT_TS_02_03_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_02_04_BO_AA.xml b/data/profiles/CERT_TS_02_04_BO_AA.xml index 9b80575baa55391a1e7c2ed3d83dcad47a4992ec..c07f01b411e7f81677b0603d9ecbfa1a5a8952a6 100644 --- a/data/profiles/CERT_TS_02_04_BO_AA.xml +++ b/data/profiles/CERT_TS_02_04_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_02_04_BO_AT.xml b/data/profiles/CERT_TS_02_04_BO_AT.xml index cf714970e7488de658007c62ebc106b06291bd07..5e1049011d825c9c67458d929fe8166cf6aa05e6 100644 --- a/data/profiles/CERT_TS_02_04_BO_AT.xml +++ b/data/profiles/CERT_TS_02_04_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_03_01_BO_AT.xml b/data/profiles/CERT_TS_03_01_BO_AT.xml index 9a4bf9fffe9bb50800079d4fce12aebda85583c5..52a527ef00dd18317bcc3dbcc261d2dd321214bf 100644 --- a/data/profiles/CERT_TS_03_01_BO_AT.xml +++ b/data/profiles/CERT_TS_03_01_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_03_02_BO_AA.xml b/data/profiles/CERT_TS_03_02_BO_AA.xml index 3af281c70cf9ea4b4438c6efab40601bc9ee943e..1fa779098cf62d0691656998d2ef1a5fdee17324 100644 --- a/data/profiles/CERT_TS_03_02_BO_AA.xml +++ b/data/profiles/CERT_TS_03_02_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_03_02_BO_AT.xml b/data/profiles/CERT_TS_03_02_BO_AT.xml index 70eb53182ea00de7087cd06544a4f0a609848adf..ed0ab6b7be6eb38121dc28660975cdb1d4e603bd 100644 --- a/data/profiles/CERT_TS_03_02_BO_AT.xml +++ b/data/profiles/CERT_TS_03_02_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_03_BO_CA.xml b/data/profiles/CERT_TS_03_BO_CA.xml index d81bc093a48d6d4e8cd26ed7e0fb73c925d02f5a..97bd6d87e89096f53c935c4c2ff47e9ad9ccb592 100644 --- a/data/profiles/CERT_TS_03_BO_CA.xml +++ b/data/profiles/CERT_TS_03_BO_CA.xml @@ -1,4 +1,7 @@ - + 2 @@ -15,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_04_01_BO_AA.xml b/data/profiles/CERT_TS_04_01_BO_AA.xml index 63393ed76262f1322ca59aaf6bbf58d5b757863e..bf5df0be8ffd6ed9572e7cd2c02d02bb5496fe19 100644 --- a/data/profiles/CERT_TS_04_01_BO_AA.xml +++ b/data/profiles/CERT_TS_04_01_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_04_01_BO_AT.xml b/data/profiles/CERT_TS_04_01_BO_AT.xml index cbf5c8c708d8fa56507f9f4dd9ca0d8ab8f84b61..1b2afb9a3bd4a189ccb7b82a2dc2ab039665c833 100644 --- a/data/profiles/CERT_TS_04_01_BO_AT.xml +++ b/data/profiles/CERT_TS_04_01_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_01_BV_AT.xml b/data/profiles/CERT_TS_06_01_BV_AT.xml index d29eb987d884a5cef6e2150eefa430f0181bf0e5..f530814c2ed796af6efbbb6e6d918869482841e7 100644 --- a/data/profiles/CERT_TS_06_01_BV_AT.xml +++ b/data/profiles/CERT_TS_06_01_BV_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_02_BV_AT.xml b/data/profiles/CERT_TS_06_02_BV_AT.xml index 35e7044a62d659a07a7fd1ec829c4b9302113be4..267224c3315667e8ae73ed1ae4c22f05a4c409a4 100644 --- a/data/profiles/CERT_TS_06_02_BV_AT.xml +++ b/data/profiles/CERT_TS_06_02_BV_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_03_BV_AT.xml b/data/profiles/CERT_TS_06_03_BV_AT.xml index 2a101d46dd6c571d5d60f21ef1f84cdfb8ef5fef..8d45ecf6d65834253c6070ee8400acde086e75c6 100644 --- a/data/profiles/CERT_TS_06_03_BV_AT.xml +++ b/data/profiles/CERT_TS_06_03_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_04_BV_AT.xml b/data/profiles/CERT_TS_06_04_BV_AT.xml index 0a824be868af325b52910407d3f536f4971d4842..ed83302c8bae6de4cd39e6810569790343139120 100644 --- a/data/profiles/CERT_TS_06_04_BV_AT.xml +++ b/data/profiles/CERT_TS_06_04_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_05_BV_AT.xml b/data/profiles/CERT_TS_06_05_BV_AT.xml index e53b03135216d34f1800a5ec61d791ea9443385b..45e97045a5a744950d4ebd59a64052b6c4fbc19a 100644 --- a/data/profiles/CERT_TS_06_05_BV_AT.xml +++ b/data/profiles/CERT_TS_06_05_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_06_BO_AT.xml b/data/profiles/CERT_TS_06_06_BO_AT.xml index f537316bf223381ba26a992943899098a4c06e01..ebf2181b868c759dad8063819bc2997f8c9468c4 100644 --- a/data/profiles/CERT_TS_06_06_BO_AT.xml +++ b/data/profiles/CERT_TS_06_06_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_07_BO_AA.xml b/data/profiles/CERT_TS_06_07_BO_AA.xml index b9d39508562c231613c350e7a778c58a011da8fc..b9bff83f0bb51f38722bbea661c7a2ff0ca852ff 100644 --- a/data/profiles/CERT_TS_06_07_BO_AA.xml +++ b/data/profiles/CERT_TS_06_07_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_06_07_BO_AT.xml b/data/profiles/CERT_TS_06_07_BO_AT.xml index 45ef0fad681f26e6824b26d8d0110062bd69a8f9..e20c37a49fc1bf394da6aab2698c29c302b3031b 100644 --- a/data/profiles/CERT_TS_06_07_BO_AT.xml +++ b/data/profiles/CERT_TS_06_07_BO_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_06_08_BO_AA.xml b/data/profiles/CERT_TS_06_08_BO_AA.xml index b5710c7204988740a063ef3e9050cd97ca69c433..f2f716dc01e44f0eeef698e1188d9eff50e0f575 100644 --- a/data/profiles/CERT_TS_06_08_BO_AA.xml +++ b/data/profiles/CERT_TS_06_08_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_06_08_BO_AT.xml b/data/profiles/CERT_TS_06_08_BO_AT.xml index cf87a21317c0e52d042695383408e01993696bd7..362d30e3d19a041054364fa6af21ea2665f32135 100644 --- a/data/profiles/CERT_TS_06_08_BO_AT.xml +++ b/data/profiles/CERT_TS_06_08_BO_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_01_BV_AT.xml b/data/profiles/CERT_TS_07_01_BV_AT.xml index f66a05168c3b051eb0a191da6985f12b84ac2b72..0bb75357411c040effaacb18995c87f51310ec4e 100644 --- a/data/profiles/CERT_TS_07_01_BV_AT.xml +++ b/data/profiles/CERT_TS_07_01_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_02_BV_AT.xml b/data/profiles/CERT_TS_07_02_BV_AT.xml index af11a377e29dbbca12663558949645928dc237fd..5fcc568f668867e68ebad617531ea2f1cefc4b09 100644 --- a/data/profiles/CERT_TS_07_02_BV_AT.xml +++ b/data/profiles/CERT_TS_07_02_BV_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_03_BV_AT.xml b/data/profiles/CERT_TS_07_03_BV_AT.xml index e89d6a9d9cdeb088dabaaeca0cfee7a24f4548d0..839177bbb33f45e00d8d7136018d7a9d5d23e7cb 100644 --- a/data/profiles/CERT_TS_07_03_BV_AT.xml +++ b/data/profiles/CERT_TS_07_03_BV_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_04_BV_AT.xml b/data/profiles/CERT_TS_07_04_BV_AT.xml index 231f372fcde9e841d9884505e3227893acadf019..4d3fb89c6fd3031289fae3b65d4c40f5f3455d5e 100644 --- a/data/profiles/CERT_TS_07_04_BV_AT.xml +++ b/data/profiles/CERT_TS_07_04_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_05_BV_AT.xml b/data/profiles/CERT_TS_07_05_BV_AT.xml index 2565ffb6e0638571f03da901db0aa35f68ef9987..7b3f9fb38cdc091a6d9407c782e24f1a1ef6eca3 100644 --- a/data/profiles/CERT_TS_07_05_BV_AT.xml +++ b/data/profiles/CERT_TS_07_05_BV_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_06_BO_AT.xml b/data/profiles/CERT_TS_07_06_BO_AT.xml index 472f8dccb30e7e141b13f1941c9bcf0f85076631..f0d74e4ccc0bbc59980f6e1aa93a3d33daac12ee 100644 --- a/data/profiles/CERT_TS_07_06_BO_AT.xml +++ b/data/profiles/CERT_TS_07_06_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_07_BO_AA.xml b/data/profiles/CERT_TS_07_07_BO_AA.xml index bba3238193132ec9d90c488f49064e8d9f2b5347..0632a2140f3a8ba729c1865132d590d934136b46 100644 --- a/data/profiles/CERT_TS_07_07_BO_AA.xml +++ b/data/profiles/CERT_TS_07_07_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_07_07_BO_AT.xml b/data/profiles/CERT_TS_07_07_BO_AT.xml index 3dc82d29b7f438a8e5dcbef8e8be00a6990cc6cc..279f5e477dabfe2612502af682d0b23457f5e449 100644 --- a/data/profiles/CERT_TS_07_07_BO_AT.xml +++ b/data/profiles/CERT_TS_07_07_BO_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_07_08_BO_AA.xml b/data/profiles/CERT_TS_07_08_BO_AA.xml index 446512a5fe6c6993cae88d6e71a3400540e8e06f..e6a33ec6e975a901840e2541bb1b3f5d176ac6f1 100644 --- a/data/profiles/CERT_TS_07_08_BO_AA.xml +++ b/data/profiles/CERT_TS_07_08_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_07_08_BO_AT.xml b/data/profiles/CERT_TS_07_08_BO_AT.xml index 2c9f88a22284be85de3ee68678bcce79903b54b1..f34be1f319dc1d3b17fd6e6a801de785db952b24 100644 --- a/data/profiles/CERT_TS_07_08_BO_AT.xml +++ b/data/profiles/CERT_TS_07_08_BO_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_01_BV_AT.xml b/data/profiles/CERT_TS_08_01_BV_AT.xml index 3c47fd6aa01038f9d636ecd9b408ec4963ea26cf..c69a1e892d91e546d75be20dfbf7caf125022f40 100644 --- a/data/profiles/CERT_TS_08_01_BV_AT.xml +++ b/data/profiles/CERT_TS_08_01_BV_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_02_BV_AT.xml b/data/profiles/CERT_TS_08_02_BV_AT.xml index 3209b620dd9863d415c4fa537dda7fc8913e54e2..e2b453d9204cd22eb5bb00db8f2d4de627c41b83 100644 --- a/data/profiles/CERT_TS_08_02_BV_AT.xml +++ b/data/profiles/CERT_TS_08_02_BV_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_03_BV_AT.xml b/data/profiles/CERT_TS_08_03_BV_AT.xml index eaf35aac0aea052a945ae566a3b8ddd87f528da4..05c7c7716b37292d30ec4d6f8d33e4020ad802e0 100644 --- a/data/profiles/CERT_TS_08_03_BV_AT.xml +++ b/data/profiles/CERT_TS_08_03_BV_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_04_BV_AT.xml b/data/profiles/CERT_TS_08_04_BV_AT.xml index 1b2b828e3970c28bff86de61f0a34738227fcbb0..f8039db436317cb6249301acb76ff076dbfbb7d2 100644 --- a/data/profiles/CERT_TS_08_04_BV_AT.xml +++ b/data/profiles/CERT_TS_08_04_BV_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_05_BV_AT.xml b/data/profiles/CERT_TS_08_05_BV_AT.xml index 422d84d030980f163b1a21ef4ae2afce64f63bc1..89805b455acf9e2b0ebb34c38bcc7c694b7d3d9b 100644 --- a/data/profiles/CERT_TS_08_05_BV_AT.xml +++ b/data/profiles/CERT_TS_08_05_BV_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_06_BO_AT.xml b/data/profiles/CERT_TS_08_06_BO_AT.xml index 23957092febce54606483c95bf873955a3c0d33e..ee6512417a5d37073e86d05c49c10c693b3d3bae 100644 --- a/data/profiles/CERT_TS_08_06_BO_AT.xml +++ b/data/profiles/CERT_TS_08_06_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_07_BO_AT.xml b/data/profiles/CERT_TS_08_07_BO_AT.xml index 3bd9134bb1e74e0ff0b66e651dc7feaf7d8f5646..d6d8a0577c8e528b95f875f27d6be401f4227623 100644 --- a/data/profiles/CERT_TS_08_07_BO_AT.xml +++ b/data/profiles/CERT_TS_08_07_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_08_BO_AA.xml b/data/profiles/CERT_TS_08_08_BO_AA.xml index f4d677c022ba7016549834145a21080d46111973..080baef18ade4b5d256f1c39e2f17ef02fdae1c3 100644 --- a/data/profiles/CERT_TS_08_08_BO_AA.xml +++ b/data/profiles/CERT_TS_08_08_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_08_08_BO_AT.xml b/data/profiles/CERT_TS_08_08_BO_AT.xml index 05dd2a2f897ac6e494a4e5de6e3bffc8435a802b..c9ba8b19c77cbe4345f8150f8d71a6f7b8c0c036 100644 --- a/data/profiles/CERT_TS_08_08_BO_AT.xml +++ b/data/profiles/CERT_TS_08_08_BO_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_08_09_BO_AA.xml b/data/profiles/CERT_TS_08_09_BO_AA.xml index 39c3d507996b75d2399a4eafa91db597b9c56bf7..75732f1bd98978ab36ced0b3607228a9af650a52 100644 --- a/data/profiles/CERT_TS_08_09_BO_AA.xml +++ b/data/profiles/CERT_TS_08_09_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_08_09_BO_AT.xml b/data/profiles/CERT_TS_08_09_BO_AT.xml index f0593163490fccc1f1447f8f275bda752c2b8616..45b7ffac496f8e4123e387c8012b4d32bd72d8bb 100644 --- a/data/profiles/CERT_TS_08_09_BO_AT.xml +++ b/data/profiles/CERT_TS_08_09_BO_AT.xml @@ -19,8 +19,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_09_01_BV_AT.xml b/data/profiles/CERT_TS_09_01_BV_AT.xml index fce56e7c942d0bdddc98a1a46d06411cb97b158c..0899040f4e013072f74b5270ef26634556dc29d6 100644 --- a/data/profiles/CERT_TS_09_01_BV_AT.xml +++ b/data/profiles/CERT_TS_09_01_BV_AT.xml @@ -18,14 +18,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_02_BV_AT.xml b/data/profiles/CERT_TS_09_02_BV_AT.xml index 83b0582cda7d99e6bab805d0167c1bba75cc24ef..c2f6a16c29d56428d4b0ca18a88141b314879579 100644 --- a/data/profiles/CERT_TS_09_02_BV_AT.xml +++ b/data/profiles/CERT_TS_09_02_BV_AT.xml @@ -18,14 +18,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_03_BV_AA.xml b/data/profiles/CERT_TS_09_03_BV_AA.xml index a6ab7b954cfba6c99d64a1295332f05317b6a1b3..c8180c380d07bc207f62f63950928517e1c623f6 100644 --- a/data/profiles/CERT_TS_09_03_BV_AA.xml +++ b/data/profiles/CERT_TS_09_03_BV_AA.xml @@ -16,8 +16,8 @@ - - + + diff --git a/data/profiles/CERT_TS_09_03_BV_AT.xml b/data/profiles/CERT_TS_09_03_BV_AT.xml index 525c88a317bdf868a6ae49f99b331d86b3cbab2c..d675d0f7ce323deea5e92820445c56042e886b30 100644 --- a/data/profiles/CERT_TS_09_03_BV_AT.xml +++ b/data/profiles/CERT_TS_09_03_BV_AT.xml @@ -16,14 +16,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_04_BV_AA.xml b/data/profiles/CERT_TS_09_04_BV_AA.xml index f181dc56132687b974e256de8f1c61f2417832df..3817996023bd0ed4ed5157152fefd1b4605b7f1e 100644 --- a/data/profiles/CERT_TS_09_04_BV_AA.xml +++ b/data/profiles/CERT_TS_09_04_BV_AA.xml @@ -16,8 +16,8 @@ - - + + diff --git a/data/profiles/CERT_TS_09_04_BV_AT.xml b/data/profiles/CERT_TS_09_04_BV_AT.xml index e1779cf1ccf45aad992e614b6451ba9618ff9c4c..9ba21e57f75d84debb81978442fb8998a4c5e06b 100644 --- a/data/profiles/CERT_TS_09_04_BV_AT.xml +++ b/data/profiles/CERT_TS_09_04_BV_AT.xml @@ -15,14 +15,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_05_BV_AA.xml b/data/profiles/CERT_TS_09_05_BV_AA.xml index f6452465841577e1a80480e975f39a94c8b0be00..1ef9c8750242fcbc15d03389d11cc0a4445b16ca 100644 --- a/data/profiles/CERT_TS_09_05_BV_AA.xml +++ b/data/profiles/CERT_TS_09_05_BV_AA.xml @@ -16,8 +16,8 @@ - - + + diff --git a/data/profiles/CERT_TS_09_05_BV_AT.xml b/data/profiles/CERT_TS_09_05_BV_AT.xml index 07b20684950184aac94b6af2127851a1479c5278..4895e477085b24c01a3af2cf9d7bc20c8f13d76f 100644 --- a/data/profiles/CERT_TS_09_05_BV_AT.xml +++ b/data/profiles/CERT_TS_09_05_BV_AT.xml @@ -15,14 +15,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_06_BV_AA.xml b/data/profiles/CERT_TS_09_06_BV_AA.xml index 52dacd5c4f2d0046ca4aaf3677c9ac32865b432c..010519d39bae122c96a3db523be9e7282becb74b 100644 --- a/data/profiles/CERT_TS_09_06_BV_AA.xml +++ b/data/profiles/CERT_TS_09_06_BV_AA.xml @@ -16,8 +16,8 @@ - - + + diff --git a/data/profiles/CERT_TS_09_06_BV_AT.xml b/data/profiles/CERT_TS_09_06_BV_AT.xml index 5e25cf05da6cdbf263cba13a818c3266cabd81bd..fd3c2cdd9a08102616c538d956832fca3979261e 100644 --- a/data/profiles/CERT_TS_09_06_BV_AT.xml +++ b/data/profiles/CERT_TS_09_06_BV_AT.xml @@ -19,14 +19,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_07_BO_AT.xml b/data/profiles/CERT_TS_09_07_BO_AT.xml index 35e1c598fdbbb47cbab82dad4e7c200f755b1b8a..3c679755eadb0075d77b9d1bfa14af37deeb8be1 100644 --- a/data/profiles/CERT_TS_09_07_BO_AT.xml +++ b/data/profiles/CERT_TS_09_07_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_09_08_BO_AA.xml b/data/profiles/CERT_TS_09_08_BO_AA.xml index e9fce7522db5a9475be25e7bb09bf241df743a36..ba562bbd0b547ad25539db36b3d0822066c00500 100644 --- a/data/profiles/CERT_TS_09_08_BO_AA.xml +++ b/data/profiles/CERT_TS_09_08_BO_AA.xml @@ -16,14 +16,14 @@ - - + + - + diff --git a/data/profiles/CERT_TS_09_08_BO_AT.xml b/data/profiles/CERT_TS_09_08_BO_AT.xml index 70fe3d432ae84fed7bef91c38440b3227421e590..92e74119c362864d752193ec2d38792280614255 100644 --- a/data/profiles/CERT_TS_09_08_BO_AT.xml +++ b/data/profiles/CERT_TS_09_08_BO_AT.xml @@ -16,14 +16,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_09_BO_AA.xml b/data/profiles/CERT_TS_09_09_BO_AA.xml index d1383ea6a4b56bf283c82487e873d714f4e92474..c2ccd68a14db4f24e023e65b1f0fd1b13759d8d7 100644 --- a/data/profiles/CERT_TS_09_09_BO_AA.xml +++ b/data/profiles/CERT_TS_09_09_BO_AA.xml @@ -16,14 +16,14 @@ - - + + - + diff --git a/data/profiles/CERT_TS_09_09_BO_AT.xml b/data/profiles/CERT_TS_09_09_BO_AT.xml index b609e8c9b67e23a3078224acb718fd682a3c3559..16c8555c09a2c69f88f6ca7a8700334713a003a8 100644 --- a/data/profiles/CERT_TS_09_09_BO_AT.xml +++ b/data/profiles/CERT_TS_09_09_BO_AT.xml @@ -16,14 +16,14 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ - + diff --git a/data/profiles/CERT_TS_09_10_BO_AT.xml b/data/profiles/CERT_TS_09_10_BO_AT.xml index c386224ef1adeeead4f0185c6f0a6be9d6be978e..b7d52d67450b9535bd0cde06c6c140826d6ba552 100644 --- a/data/profiles/CERT_TS_09_10_BO_AT.xml +++ b/data/profiles/CERT_TS_09_10_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_09_11_BO_AT.xml b/data/profiles/CERT_TS_09_11_BO_AT.xml index 5d3fcf335593aca7d1149d96eeb3674d01ca565f..441ab81f1abae1b4fea17bb3fea220761ca6e637 100644 --- a/data/profiles/CERT_TS_09_11_BO_AT.xml +++ b/data/profiles/CERT_TS_09_11_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_09_12_BO_AT.xml b/data/profiles/CERT_TS_09_12_BO_AT.xml index b06d81cc3385a788dd21839b406e53c34974eeff..b375f465b3d92977a3c31be60c5712a486378c1c 100644 --- a/data/profiles/CERT_TS_09_12_BO_AT.xml +++ b/data/profiles/CERT_TS_09_12_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_01_BO_AT.xml b/data/profiles/CERT_TS_10_01_BO_AT.xml index d8d7d40cfe2572bc5801ad8dcca5ee1c5501a3ef..59efb29f868fcb941f1f4b6fbca68319a8dd9773 100644 --- a/data/profiles/CERT_TS_10_01_BO_AT.xml +++ b/data/profiles/CERT_TS_10_01_BO_AT.xml @@ -17,8 +17,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_02_BO_AA.xml b/data/profiles/CERT_TS_10_02_BO_AA.xml index b33a792dc5e239b65986b072c85f3f47d80ff2f1..656a435c5cf8c769b09b29edb5724647bdc89a9f 100644 --- a/data/profiles/CERT_TS_10_02_BO_AA.xml +++ b/data/profiles/CERT_TS_10_02_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_10_02_BO_AT.xml b/data/profiles/CERT_TS_10_02_BO_AT.xml index 5b96c2330857ab58c11227b6526fb2a13854764f..e7944864da2ad93315409bf3cc952e65f1ad2aff 100644 --- a/data/profiles/CERT_TS_10_02_BO_AT.xml +++ b/data/profiles/CERT_TS_10_02_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_03_BO_AT.xml b/data/profiles/CERT_TS_10_03_BO_AT.xml index 7281731f9159aa31bf29bbece3afe4c2812340e9..d2610a9837eca59356b5bcf8581bc884036b3106 100644 --- a/data/profiles/CERT_TS_10_03_BO_AT.xml +++ b/data/profiles/CERT_TS_10_03_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_04_BO_AT.xml b/data/profiles/CERT_TS_10_04_BO_AT.xml index d0a8638dc782aab8d2e5f697cb5262e4193f0fd6..65f7276a2e3cc65dc794490a418c573d4378089b 100644 --- a/data/profiles/CERT_TS_10_04_BO_AT.xml +++ b/data/profiles/CERT_TS_10_04_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_05_BO_AA.xml b/data/profiles/CERT_TS_10_05_BO_AA.xml index 1b6f65259eaac270070a1f31158b25dfcc907821..2f05a28832dc26a90835f574bb244836d0c7f081 100644 --- a/data/profiles/CERT_TS_10_05_BO_AA.xml +++ b/data/profiles/CERT_TS_10_05_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_10_05_BO_AT.xml b/data/profiles/CERT_TS_10_05_BO_AT.xml index 0d1766f043b5fa7909ae88a79c5477b5b1f7ffcd..1f8268dae6af01ffa121e1dfbc1c3dbc4ce125af 100644 --- a/data/profiles/CERT_TS_10_05_BO_AT.xml +++ b/data/profiles/CERT_TS_10_05_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_10_06_BO_AA.xml b/data/profiles/CERT_TS_10_06_BO_AA.xml index 885417efafcb58f547fc1fa0d4b206ffdd6d738f..864c37310272095fd5ffbf1afe3ec8e30d44d7e6 100644 --- a/data/profiles/CERT_TS_10_06_BO_AA.xml +++ b/data/profiles/CERT_TS_10_06_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_10_06_BO_AT.xml b/data/profiles/CERT_TS_10_06_BO_AT.xml index c04edd179acae97e4b4fc6b08801cf2bb8fb159f..22e82416a5e6133c17d4534c4775e0acfaefc5a1 100644 --- a/data/profiles/CERT_TS_10_06_BO_AT.xml +++ b/data/profiles/CERT_TS_10_06_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_11_01_BO_AT.xml b/data/profiles/CERT_TS_11_01_BO_AT.xml index ffa19551b973d8dea3e0efbda20f038696ca8560..89d494c3c093a298a4e65af7fc16c124b2a84732 100644 --- a/data/profiles/CERT_TS_11_01_BO_AT.xml +++ b/data/profiles/CERT_TS_11_01_BO_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_11_02_BO_AT.xml b/data/profiles/CERT_TS_11_02_BO_AT.xml index 492f1fc672e92aa30466da6b8d03999be1281717..d6a3378787792199da51916a8915336becdec9a4 100644 --- a/data/profiles/CERT_TS_11_02_BO_AT.xml +++ b/data/profiles/CERT_TS_11_02_BO_AT.xml @@ -18,8 +18,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_11_03_BO_AA.xml b/data/profiles/CERT_TS_11_03_BO_AA.xml index b1eef723a3d2673730c0004ce230c915cd420641..18b17fd573e27d0aa9270310e7715f858c8a6873 100644 --- a/data/profiles/CERT_TS_11_03_BO_AA.xml +++ b/data/profiles/CERT_TS_11_03_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_11_03_BO_AT.xml b/data/profiles/CERT_TS_11_03_BO_AT.xml index 0230cc0c21aa345f3218700011ac058f9d3f08c0..c2a94e2c7984c8b87ecc3f8eb5b53090cbbd643e 100644 --- a/data/profiles/CERT_TS_11_03_BO_AT.xml +++ b/data/profiles/CERT_TS_11_03_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_11_04_BO_AA.xml b/data/profiles/CERT_TS_11_04_BO_AA.xml index c2b235baa83f5f43eb21ca9159a63149c16d3eaa..fae8f9cb4523d1dbda778961efef3a5550cec788 100644 --- a/data/profiles/CERT_TS_11_04_BO_AA.xml +++ b/data/profiles/CERT_TS_11_04_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_11_04_BO_AT.xml b/data/profiles/CERT_TS_11_04_BO_AT.xml index e702e1987d75767eb2ffac797fd0334866b1fe0a..fc4c54ffe4373c53e5d030b89f72d69349508602 100644 --- a/data/profiles/CERT_TS_11_04_BO_AT.xml +++ b/data/profiles/CERT_TS_11_04_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_12_02_BO_AT.xml b/data/profiles/CERT_TS_12_02_BO_AT.xml index 2d0f50a531cbee8f597cb95784c4a75da944fb8e..dac77d29d34310c9902990499d998224fa96cbe8 100644 --- a/data/profiles/CERT_TS_12_02_BO_AT.xml +++ b/data/profiles/CERT_TS_12_02_BO_AT.xml @@ -16,7 +16,7 @@ - ÿÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_12_03_BO_AT.xml b/data/profiles/CERT_TS_12_03_BO_AT.xml index cb22d88337d939e607f1336576cca989221d0b9a..987d059c100bf59439d646cc9578c971279d8daf 100644 --- a/data/profiles/CERT_TS_12_03_BO_AT.xml +++ b/data/profiles/CERT_TS_12_03_BO_AT.xml @@ -16,7 +16,7 @@ - ÿÿ + ÿÿ diff --git a/data/profiles/CERT_TS_12_04_BO_AT.xml b/data/profiles/CERT_TS_12_04_BO_AT.xml index 611b3813776264ad6c2cea5de3bee1049aa90e21..a65be0297266dc16f933b7bba3497befd4445fba 100644 --- a/data/profiles/CERT_TS_12_04_BO_AT.xml +++ b/data/profiles/CERT_TS_12_04_BO_AT.xml @@ -16,8 +16,8 @@ - ÿÿ - ÿÿ + ÿÿ + ÿÿ diff --git a/data/profiles/CERT_TS_13_01_BO_AA.xml b/data/profiles/CERT_TS_13_01_BO_AA.xml index ea70fd1145642312fafc9df3e2d61e14396eb38a..0c6b86f21e0ea75ea7c28659bc67afeb163eebca 100644 --- a/data/profiles/CERT_TS_13_01_BO_AA.xml +++ b/data/profiles/CERT_TS_13_01_BO_AA.xml @@ -15,7 +15,7 @@ - + diff --git a/data/profiles/CERT_TS_13_01_BO_AT.xml b/data/profiles/CERT_TS_13_01_BO_AT.xml index 5108864ebd1f07d716f0499ec40f6fcc4ca60a7e..714d5ff324b6c7525fa8cce48bf229e3dd860dc5 100644 --- a/data/profiles/CERT_TS_13_01_BO_AT.xml +++ b/data/profiles/CERT_TS_13_01_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_13_02_BO_AA.xml b/data/profiles/CERT_TS_13_02_BO_AA.xml index 7710491bffedef69f0928ffc89f2df93120be9f2..02fd818dd4d59b56908620589c6fb2b3ff9ca25d 100644 --- a/data/profiles/CERT_TS_13_02_BO_AA.xml +++ b/data/profiles/CERT_TS_13_02_BO_AA.xml @@ -15,7 +15,7 @@ - + diff --git a/data/profiles/CERT_TS_13_02_BO_AT.xml b/data/profiles/CERT_TS_13_02_BO_AT.xml index e57c39cd501851ae4ee15932174e3a83253488c0..14669193793a4e8897b88434d6c6f90240ac25c4 100644 --- a/data/profiles/CERT_TS_13_02_BO_AT.xml +++ b/data/profiles/CERT_TS_13_02_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_13_03_BO_AT.xml b/data/profiles/CERT_TS_13_03_BO_AT.xml index 3f4718d4fbe108e13fb024e9fa9869dd09fe0699..9e25718175f2e45f074be994b3c801483d7ce6e2 100644 --- a/data/profiles/CERT_TS_13_03_BO_AT.xml +++ b/data/profiles/CERT_TS_13_03_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_14_01_BO_AT.xml b/data/profiles/CERT_TS_14_01_BO_AT.xml index 7b55c15f2654a493ea7354f5f015bbe7ba178f19..0824eb677d297fc718ee7ee4c528321c51be89ca 100644 --- a/data/profiles/CERT_TS_14_01_BO_AT.xml +++ b/data/profiles/CERT_TS_14_01_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_14_02_BO_AT.xml b/data/profiles/CERT_TS_14_02_BO_AT.xml index 957520646096e91650576383fbbd1ffbd508426c..be0d03848385139c106484d2d98fccddabfc42b1 100644 --- a/data/profiles/CERT_TS_14_02_BO_AT.xml +++ b/data/profiles/CERT_TS_14_02_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_14_03_BO_AT.xml b/data/profiles/CERT_TS_14_03_BO_AT.xml index 730a637b2c6a2d40b735aae6636c28592893c7bd..9fade18f12feb255c447981929bc0f19d27366b9 100644 --- a/data/profiles/CERT_TS_14_03_BO_AT.xml +++ b/data/profiles/CERT_TS_14_03_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_15_01_BO_AA.xml b/data/profiles/CERT_TS_15_01_BO_AA.xml index ad402d50ef2b11e0efc4c3345857cf513a7af094..d0a163c17541cd320e4dcb9ceb1eafb8f15c8a57 100644 --- a/data/profiles/CERT_TS_15_01_BO_AA.xml +++ b/data/profiles/CERT_TS_15_01_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_15_01_BO_AT.xml b/data/profiles/CERT_TS_15_01_BO_AT.xml index 08fbcac090d2fa837d1575e7c265e0e05a24b880..b3c9973ff369c60e5c869207b0d0b97b0a5cdc79 100644 --- a/data/profiles/CERT_TS_15_01_BO_AT.xml +++ b/data/profiles/CERT_TS_15_01_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_15_02_BO_AA.xml b/data/profiles/CERT_TS_15_02_BO_AA.xml index db78b0156db8d0cd717e8b12f539b22e139aea67..016af415ac05ea6c8eae3164d4cdad88f463ead1 100644 --- a/data/profiles/CERT_TS_15_02_BO_AA.xml +++ b/data/profiles/CERT_TS_15_02_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_15_02_BO_AT.xml b/data/profiles/CERT_TS_15_02_BO_AT.xml index 7b6f7f26bb1e70ece570526baa898c83313eb9e0..28fb4c296a1dca5c0512f75a98271af12092d5de 100644 --- a/data/profiles/CERT_TS_15_02_BO_AT.xml +++ b/data/profiles/CERT_TS_15_02_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_15_02_BO_CA.xml b/data/profiles/CERT_TS_15_02_BO_CA.xml index 14e5bd480d0da901600584e596f5a88aae9653fc..828f53a0bad37215a2e208200664b9ab9f9d18a9 100644 --- a/data/profiles/CERT_TS_15_02_BO_CA.xml +++ b/data/profiles/CERT_TS_15_02_BO_CA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_15_03_BO_AA.xml b/data/profiles/CERT_TS_15_03_BO_AA.xml index bed4a17705c2e249c3b40ebd759adeae39b312a0..54e5a1f4ced7495f9a7381acb1dcf1be495a7ccc 100644 --- a/data/profiles/CERT_TS_15_03_BO_AA.xml +++ b/data/profiles/CERT_TS_15_03_BO_AA.xml @@ -15,8 +15,8 @@ - - + + diff --git a/data/profiles/CERT_TS_15_03_BO_AT.xml b/data/profiles/CERT_TS_15_03_BO_AT.xml index 7dc3e06a6d8ad76c72979f00380b6e467616a06a..f1cc617fbfa64ae4ac5470f40df3b8b28030f08f 100644 --- a/data/profiles/CERT_TS_15_03_BO_AT.xml +++ b/data/profiles/CERT_TS_15_03_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_16_01_BO_AT.xml b/data/profiles/CERT_TS_16_01_BO_AT.xml index f009a60fc04ae2fdd95accf68f4b99d93a5621ac..01c44df3ec4f231947cb34253c819affbaf778cc 100644 --- a/data/profiles/CERT_TS_16_01_BO_AT.xml +++ b/data/profiles/CERT_TS_16_01_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_17_01_BO_AT.xml b/data/profiles/CERT_TS_17_01_BO_AT.xml index 6804da738d8a2e15fc3437593c89fd471ff64680..c46ea08164d3356eb81454d699b4bee998eb9860 100644 --- a/data/profiles/CERT_TS_17_01_BO_AT.xml +++ b/data/profiles/CERT_TS_17_01_BO_AT.xml @@ -12,8 +12,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_17_02_BO_AA.xml b/data/profiles/CERT_TS_17_02_BO_AA.xml index 89fe9b7d11163cbcd22f067372c65cb876831c56..c6afd4446106e1e306d222a7a192ed89c4c3d8ef 100644 --- a/data/profiles/CERT_TS_17_02_BO_AA.xml +++ b/data/profiles/CERT_TS_17_02_BO_AA.xml @@ -12,8 +12,8 @@ - - + + diff --git a/data/profiles/CERT_TS_17_02_BO_AT.xml b/data/profiles/CERT_TS_17_02_BO_AT.xml index ba0b7c3012d4070894ef1ce48b671cefc54c2770..b4be643c40a19ebbcf9075c9bf05bb319a68bd06 100644 --- a/data/profiles/CERT_TS_17_02_BO_AT.xml +++ b/data/profiles/CERT_TS_17_02_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_17_03_BO_AT.xml b/data/profiles/CERT_TS_17_03_BO_AT.xml index 75b888fcd767eca8d27d3c172f820cefdfc29af4..84aeb8761f6f20e7da93563c25928400d2f4c120 100644 --- a/data/profiles/CERT_TS_17_03_BO_AT.xml +++ b/data/profiles/CERT_TS_17_03_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_17_04_BO_AT.xml b/data/profiles/CERT_TS_17_04_BO_AT.xml index 9927a3c75e824058bfe7e2eb895b613d300122b0..563da7bb162cacccc8c0a72e982d64779a3271c3 100644 --- a/data/profiles/CERT_TS_17_04_BO_AT.xml +++ b/data/profiles/CERT_TS_17_04_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_18_01_BO_AT.xml b/data/profiles/CERT_TS_18_01_BO_AT.xml index e6991d9112cbd6708fb633c7bd827d7eee824a44..e27229b863f7fdadde4f607e7c9f114a0380d625 100644 --- a/data/profiles/CERT_TS_18_01_BO_AT.xml +++ b/data/profiles/CERT_TS_18_01_BO_AT.xml @@ -10,8 +10,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_18_02_BO_AA.xml b/data/profiles/CERT_TS_18_02_BO_AA.xml index feec03711cee4edc72929288f1006207ba565fa2..e1895e9143542285fdf790d71c920a51b091720f 100644 --- a/data/profiles/CERT_TS_18_02_BO_AA.xml +++ b/data/profiles/CERT_TS_18_02_BO_AA.xml @@ -10,8 +10,8 @@ - - + + diff --git a/data/profiles/CERT_TS_18_02_BO_AT.xml b/data/profiles/CERT_TS_18_02_BO_AT.xml index ded5a9c80d1b410049abc5aaaacdd3be916c5dc8..4dc97ab4b32f3e5453397586a71ec82155fd49a8 100644 --- a/data/profiles/CERT_TS_18_02_BO_AT.xml +++ b/data/profiles/CERT_TS_18_02_BO_AT.xml @@ -15,8 +15,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ @@ -25,5 +25,5 @@ - + diff --git a/data/profiles/CERT_TS_19_01_BO_AT.xml b/data/profiles/CERT_TS_19_01_BO_AT.xml index dca349dd5ca98480c4932854977a1bce0c0e5910..c8fc0eda176b6fe9b4cb18a211556c0445250de5 100644 --- a/data/profiles/CERT_TS_19_01_BO_AT.xml +++ b/data/profiles/CERT_TS_19_01_BO_AT.xml @@ -14,8 +14,8 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ diff --git a/data/profiles/CERT_TS_A_AA.xml b/data/profiles/CERT_TS_A_AA.xml index 2f6f722d2f32e9c43f81798a6ca141c07c63e1e4..3012efe9c01cc4ee0c71988d11ee0ac2d1f5693e 100644 --- a/data/profiles/CERT_TS_A_AA.xml +++ b/data/profiles/CERT_TS_A_AA.xml @@ -15,8 +15,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_A_AT.xml b/data/profiles/CERT_TS_A_AT.xml index 617ad57ef255bf7dc169dea6448cc90f7bf86419..6951b3a0b17f932b3f7b48de88b5dc793c4fa9aa 100644 --- a/data/profiles/CERT_TS_A_AT.xml +++ b/data/profiles/CERT_TS_A_AT.xml @@ -14,8 +14,13 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + diff --git a/data/profiles/CERT_TS_A_EA.xml b/data/profiles/CERT_TS_A_EA.xml index 196b298e4de3d55909a868bdce3b4de220b98603..19a69349ef38dd721179b9a0c36af61cf8f7478d 100644 --- a/data/profiles/CERT_TS_A_EA.xml +++ b/data/profiles/CERT_TS_A_EA.xml @@ -14,8 +14,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_A_EC.xml b/data/profiles/CERT_TS_A_EC.xml index 2395ef3e33f9cd8bea3cb6fdd2a3c9ee908ddcb6..521a411b5b710895fb5931bf997c19010f7cd23f 100644 --- a/data/profiles/CERT_TS_A_EC.xml +++ b/data/profiles/CERT_TS_A_EC.xml @@ -14,8 +14,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_B1_AT.xml b/data/profiles/CERT_TS_B1_AT.xml new file mode 100755 index 0000000000000000000000000000000000000000..68f5464e4c608457525390107d25f7d60b96d8f7 --- /dev/null +++ b/data/profiles/CERT_TS_B1_AT.xml @@ -0,0 +1,33 @@ + + 2 + + + + + + + + + + + + + + + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + + + + + + + + + + + diff --git a/data/profiles/CERT_TS_B_AA.xml b/data/profiles/CERT_TS_B_AA.xml index 807d5527355fce73c22d075cd231ef73ff9fb9a3..c95838db02cc49827e09ffe7a524f7b857e1aae2 100644 --- a/data/profiles/CERT_TS_B_AA.xml +++ b/data/profiles/CERT_TS_B_AA.xml @@ -18,8 +18,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_B_AT.xml b/data/profiles/CERT_TS_B_AT.xml index 9f1c10ff04f549d34662a3acd35998e37be0c9e9..c58d56fcd7643baec8d0c4c4e27ca2e1ea48f421 100644 --- a/data/profiles/CERT_TS_B_AT.xml +++ b/data/profiles/CERT_TS_B_AT.xml @@ -14,8 +14,13 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + diff --git a/data/profiles/CERT_TS_CAM_BO_02_AT.xml b/data/profiles/CERT_TS_CAM_BO_02_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..172a1ae7aaee402f7a77e5531a5284e448e908b8 --- /dev/null +++ b/data/profiles/CERT_TS_CAM_BO_02_AT.xml @@ -0,0 +1,31 @@ + + + + 2 + + + + + + + + + + + + + + + ¿ÿ + + + + + + + + + + diff --git a/data/profiles/CERT_TS_CAM_BO_03_AT.xml b/data/profiles/CERT_TS_CAM_BO_03_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..9606aca8b0f249104351f479d526946356d304c0 --- /dev/null +++ b/data/profiles/CERT_TS_CAM_BO_03_AT.xml @@ -0,0 +1,30 @@ + + + 2 + + + + + + + + + + + + + + + ßÿ + + + + + + + + + + diff --git a/data/profiles/CERT_TS_C_AA.xml b/data/profiles/CERT_TS_C_AA.xml index 4a2e1987a0ff44390da0b9cc0518efaa94832739..f216f17fe7481a8ded2f4cc9691bd9474091de5c 100644 --- a/data/profiles/CERT_TS_C_AA.xml +++ b/data/profiles/CERT_TS_C_AA.xml @@ -17,8 +17,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_C_AT.xml b/data/profiles/CERT_TS_C_AT.xml index 303c3d3d11ac7c6ce97430884293d2a01df049e8..a3d6456b6579a87f92d16919f170290e4d392914 100644 --- a/data/profiles/CERT_TS_C_AT.xml +++ b/data/profiles/CERT_TS_C_AT.xml @@ -17,8 +17,13 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + diff --git a/data/profiles/CERT_TS_DENM_BO_01_AT.xml b/data/profiles/CERT_TS_DENM_BO_01_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ccb04c7dfbc9d9a738d0d9bd429042cce56dd48 --- /dev/null +++ b/data/profiles/CERT_TS_DENM_BO_01_AT.xml @@ -0,0 +1,28 @@ + + 2 + + + + + + + + + + + + + + + ÿÿ + ÿÿ + + + + + + + + + + diff --git a/data/profiles/CERT_TS_DENM_BO_02_AT.xml b/data/profiles/CERT_TS_DENM_BO_02_AT.xml new file mode 100644 index 0000000000000000000000000000000000000000..a37081f97f8cbef94e1e391a380dc64014c3bcc9 --- /dev/null +++ b/data/profiles/CERT_TS_DENM_BO_02_AT.xml @@ -0,0 +1,28 @@ + + 2 + + + + + + + + + + + + + + + ÿÿ + ¿ÿÿ + + + + + + + + + + diff --git a/data/profiles/CERT_TS_D_AA.xml b/data/profiles/CERT_TS_D_AA.xml index baf62ceb9383fb72dcdb4576b2d44c55c699237c..8b0a0f9a5f957a0e727bb9c47434ff820a5b5614 100644 --- a/data/profiles/CERT_TS_D_AA.xml +++ b/data/profiles/CERT_TS_D_AA.xml @@ -17,8 +17,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_D_AT.xml b/data/profiles/CERT_TS_D_AT.xml index 5c59460b5b2902f72b01985a9891bc82a43d1c28..04840be4ac6880243782b47041fa532fbc296b3d 100644 --- a/data/profiles/CERT_TS_D_AT.xml +++ b/data/profiles/CERT_TS_D_AT.xml @@ -17,8 +17,13 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + diff --git a/data/profiles/CERT_TS_E0_AA.xml b/data/profiles/CERT_TS_E0_AA.xml index 2849a9cbb99f3247dadf5c85ed93eed96110e453..786d69a88d16c9a0a69fe0493e8cc11bc428e85a 100644 --- a/data/profiles/CERT_TS_E0_AA.xml +++ b/data/profiles/CERT_TS_E0_AA.xml @@ -14,8 +14,13 @@ - - + + + + + + + diff --git a/data/profiles/CERT_TS_E1_AA.xml b/data/profiles/CERT_TS_E1_AA.xml index fc0f368de60786607bf8028f6a734bb0ef4dadbf..3e2c9db3256e016762b48acb79ff4a3dde7ee216 100644 --- a/data/profiles/CERT_TS_E1_AA.xml +++ b/data/profiles/CERT_TS_E1_AA.xml @@ -14,14 +14,19 @@ - - + + + + + + + - + diff --git a/data/profiles/CERT_TS_E_AA.xml b/data/profiles/CERT_TS_E_AA.xml index a339b1927284a4a8aa8c7dfa815876f3a9ae08b6..0fc9870011fc05addb996280e9f7413038980533 100644 --- a/data/profiles/CERT_TS_E_AA.xml +++ b/data/profiles/CERT_TS_E_AA.xml @@ -14,14 +14,19 @@ - - + + + + + + + - + diff --git a/data/profiles/CERT_TS_E_AT.xml b/data/profiles/CERT_TS_E_AT.xml index ef068ce5d9de43bd3672df716280457107a7a39e..3cce7b2b43443305c78b18d2a07b4d77ab5376c4 100644 --- a/data/profiles/CERT_TS_E_AT.xml +++ b/data/profiles/CERT_TS_E_AT.xml @@ -14,14 +14,19 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + - + diff --git a/data/profiles/CERT_TS_F_AT.xml b/data/profiles/CERT_TS_F_AT.xml index 6fb162cf91e5ec02e1c144c4e08bb92f4a2f8b57..2193a11a1e46d5637dee55ddb3aa7756aa22af7b 100644 --- a/data/profiles/CERT_TS_F_AT.xml +++ b/data/profiles/CERT_TS_F_AT.xml @@ -14,8 +14,13 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + + + ÿø + ÿÿà + diff --git a/data/profiles/CERT_TS_MSG_06_01_BO_AT.xml b/data/profiles/CERT_TS_MSG_06_01_BO_AT.xml index 1ca60d476004c134b9f9b4daf24045ce6201c1a4..39d0fc08979d9d127ceba3e03a7d773c13d08805 100644 --- a/data/profiles/CERT_TS_MSG_06_01_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_06_01_BO_AT.xml @@ -15,8 +15,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_06_02_BO_AT.xml b/data/profiles/CERT_TS_MSG_06_02_BO_AT.xml index 6080cb85b077d0d46aeb581a8d61d537f0eb44a3..91e15a60c17ebf076704c9f70fda43f83c5d3988 100644 --- a/data/profiles/CERT_TS_MSG_06_02_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_06_02_BO_AT.xml @@ -15,8 +15,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_01_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_01_BO_AT.xml index 96e1e2267522e811b0a177c1fe27047bb102c705..b71520617643cac11b2c9b171fc77e159a52e544 100644 --- a/data/profiles/CERT_TS_MSG_13_01_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_01_BO_AT.xml @@ -15,8 +15,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_02_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_02_BO_AT.xml index e20c72ed1981c130b6c8faeab6b190f67749be3f..2bdce4865f187b63538a897fa040c0c3d02541d1 100644 --- a/data/profiles/CERT_TS_MSG_13_02_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_02_BO_AT.xml @@ -15,8 +15,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_03_BO_AA.xml b/data/profiles/CERT_TS_MSG_13_03_BO_AA.xml index c1ee567cabf32865562dda9f1fde677f885b74f8..4d127b582d3eebadd367118fa5ee741f31d69f9b 100644 --- a/data/profiles/CERT_TS_MSG_13_03_BO_AA.xml +++ b/data/profiles/CERT_TS_MSG_13_03_BO_AA.xml @@ -18,8 +18,8 @@ - - + + diff --git a/data/profiles/CERT_TS_MSG_13_03_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_03_BO_AT.xml index d79af3200013477ec458d13b5505cd059839af8b..c20890d23646264d1dfd2852dfaaeadbb3d78d73 100644 --- a/data/profiles/CERT_TS_MSG_13_03_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_03_BO_AT.xml @@ -18,8 +18,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_04_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_04_BO_AT.xml index f5505729851fa572f2994dbff3cda0a543cd9a4c..9b1d129b370c9ee6f1137fa862b8dd6379236d8b 100644 --- a/data/profiles/CERT_TS_MSG_13_04_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_04_BO_AT.xml @@ -18,8 +18,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_05_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_05_BO_AT.xml index e2f0c32570d82fcf33b823f91a65709e99f1879e..83c86fa55f873b054f01f029e6d80b2663a67c0a 100644 --- a/data/profiles/CERT_TS_MSG_13_05_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_05_BO_AT.xml @@ -18,8 +18,9 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + diff --git a/data/profiles/CERT_TS_MSG_13_06_BO_AA.xml b/data/profiles/CERT_TS_MSG_13_06_BO_AA.xml index ee4cbb1fbc0f640ee5e17fd27311480c1bf7698a..e5cd18c6b25b2dc868a32b44f511517a111984af 100644 --- a/data/profiles/CERT_TS_MSG_13_06_BO_AA.xml +++ b/data/profiles/CERT_TS_MSG_13_06_BO_AA.xml @@ -17,8 +17,9 @@ - - + + + diff --git a/data/profiles/CERT_TS_MSG_13_06_BO_AT.xml b/data/profiles/CERT_TS_MSG_13_06_BO_AT.xml index 4843c04e1c13a96ba43cb0f369928038932f620d..990ea7cf2a342745efb2e7f28f4bbb47137f7ab7 100644 --- a/data/profiles/CERT_TS_MSG_13_06_BO_AT.xml +++ b/data/profiles/CERT_TS_MSG_13_06_BO_AT.xml @@ -1,6 +1,4 @@ - 2 @@ -18,14 +16,15 @@ - ÿÿ - ÿÿÿ + ÿÿ + ÿÿÿ + - + diff --git a/data/profiles/Makefile b/data/profiles/Makefile index 95ae0e3041c389d472ca9b8b0486c64135106d79..a8306f744329974385809703ad45df1c5d93a39a 100644 --- a/data/profiles/Makefile +++ b/data/profiles/Makefile @@ -1,4 +1,5 @@ outdir=../certificates +config=../gencerts.cfg installdir=C:\Users\filatov\Documents\Dropbox\Yann\certificates\PLU distzip=$(outdir)/plu_ts_certificates.zip @@ -8,18 +9,19 @@ distzip=$(outdir)/plu_ts_certificates.zip depdir=.deps keydir=$(outdir) -GENOPTS := -C config.cfg +GENOPTS := -C "$(config)" +itscertgen="../../itscertgen.exe" -itscertgen="../itscertgen.exe" profiles := $(wildcard CERT_*.xml) profiles_iut_at := $(wildcard CERT_IUT_*AT.xml) profiles_other := $(filter-out $(profiles_iut_at), $(profiles)) +profiles_root := $(wildcard CERT_*ROOT*.xml) certificates_iut_at := $(patsubst %.xml, $(outdir)/%.crt, $(profiles_iut_at)) certificates_other := $(patsubst %.xml, $(outdir)/%.crt, $(profiles_other)) certificates := $(certificates_iut_at) $(certificates_other) -depends := $(patsubst %.xml, $(depdir)/%.d, $(profiles)) +depends := $(patsubst %.xml, $(depdir)/%.d, $(filter-out $(profiles_root),$(profiles))) dirs := $(sort $(outdir) $(keydir) $(depdir)) distfiles := $(certificates_other) \ diff --git a/data/profiles/config.cfg b/data/profiles/config.cfg deleted file mode 100644 index 970d1eec1d9d2a141c15f321ebcb90d19c652fe3..0000000000000000000000000000000000000000 --- a/data/profiles/config.cfg +++ /dev/null @@ -1,15 +0,0 @@ -reuse=yes -format=hex - -# Use ETSI location as a reference one -# In a normal case the validity region of AT certificates is centered on this location -# AA certificate validity region can be shifted to the west depending of the test puprose. -reflocation=43.616916,7.053336 - -# Reference time (BT) considered as a begining of the validation period of the AT certificate -# Valid AT certificates will expires after 365 days after this date -# VAlidation period of other certificates is also based on this date: -# start time end time -# Root certificate: BT - 1 year BT + 2 years -# Valid AA certificates: BT BT + 1 year -reftime=2016-01-01 diff --git a/data/profiles/plu.cfg b/data/profiles/plu.cfg deleted file mode 100644 index 9920126d09fcbd624215b5322dc019106070912a..0000000000000000000000000000000000000000 --- a/data/profiles/plu.cfg +++ /dev/null @@ -1,3 +0,0 @@ -reuse=yes -format=hex -reflocation=51.4744200:5.6240500 diff --git a/javasrc/adapter/org/etsi/adapter/IGnssSupport.java b/javasrc/adapter/org/etsi/adapter/IGnssSupport.java index 40e65b2b4599f92fd43f07c670279fc181c1cd7d..ea179f2d31bfff7e499c20ef5ffdec13f72feec5 100644 --- a/javasrc/adapter/org/etsi/adapter/IGnssSupport.java +++ b/javasrc/adapter/org/etsi/adapter/IGnssSupport.java @@ -93,6 +93,13 @@ public interface IGnssSupport { */ public BigInteger getGpsTime(); + /** + * Signals when the requested time in the running scenario is reached + * @param time The requested time in msec. + * @return TRUE on success, FALSE otherwise + */ + public boolean awaitTimeInRunningScenario(AdapterPort notifier, int time); + /** * Dispose object */ diff --git a/javasrc/adapter/org/etsi/adapter/ITERequired.java b/javasrc/adapter/org/etsi/adapter/ITERequired.java index fddc6b2e116eb1e016a81264dd8aaef3d479d94b..f663cbd319819d817702bce5fe60f21fcf51864b 100644 --- a/javasrc/adapter/org/etsi/adapter/ITERequired.java +++ b/javasrc/adapter/org/etsi/adapter/ITERequired.java @@ -60,4 +60,15 @@ public interface ITERequired { * @return Value associated to the TA parameter */ Value getTaParameter(String param); + + /** + * Logs the debug message. + */ + void logDebug(String debugMessage); + + /** + * Logs the error message. + */ + void logError(String errorMessage); + } diff --git a/javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java b/javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java index f2dda88ff178d7bd7b56e05a9c1ff1b5e973327b..41a41a808a2edeeaa87179fddd7e545b439a2a3b 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java +++ b/javasrc/adapter/org/etsi/its/adapter/ComponentMgr.java @@ -12,6 +12,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Observer; +import org.etsi.adapter.TERFactory; import org.etsi.common.ITuple; import org.etsi.common.Tuple; import org.etsi.its.adapter.ports.IObservable; @@ -24,238 +25,238 @@ import org.etsi.ttcn.tri.TriPortId; */ public class ComponentMgr{ - /** - * Association Component ID <-> Component reference - */ - private LinkedHashMap mapCompNameToTriComp; + /** + * Association Component ID <-> Component reference + */ + private LinkedHashMap mapCompNameToTriComp; - /** - * Association Component ID <-> { (TTCN-3 Port reference / SUT Port reference) } - */ - private LinkedHashMap>> mapTriPortToTuple; + /** + * Association Component ID <-> { (TTCN-3 Port reference / SUT Port reference) } + */ + private LinkedHashMap>> mapTriPortToTuple; - /** - * Used to add Observer object - */ - private TestAdapter adapter; + /** + * Used to add Observer object + */ + private TestAdapter adapter; - /** - * Constructor - * @param adapter TestAdapter reference, required for Observer/Observable pattern - */ - public ComponentMgr(final TestAdapter adapter) { + /** + * Constructor + * @param adapter TestAdapter reference, required for Observer/Observable pattern + */ + public ComponentMgr(final TestAdapter adapter) { - this.adapter = adapter; - mapCompNameToTriComp = new LinkedHashMap(); - mapTriPortToTuple = new LinkedHashMap>>(); - } + this.adapter = adapter; + mapCompNameToTriComp = new LinkedHashMap(); + mapTriPortToTuple = new LinkedHashMap>>(); + } - /** - * Adds a new component - * If the component was already added, nothing is done - * @param component The component to add - */ - public void addComponent(TriComponentId component) { - // Sanity check - if(component == null) { - System.err.println("Error: Trying to add null component"); - return; - } + /** + * Adds a new component + * If the component was already added, nothing is done + * @param component The component to add + */ + public void addComponent(TriComponentId component) { + // Sanity check + if(component == null) { + TERFactory.getInstance().logError("Error: Trying to add null component"); + return; + } - if(!mapCompNameToTriComp.containsKey(component.getComponentId())) { - // Create an entry in the list of Component - mapCompNameToTriComp.put(component.getComponentId(), component); - if(!mapTriPortToTuple.containsKey(component.getComponentId())) { - // Create an entry in the list of Component/Ports - mapTriPortToTuple.put(component.getComponentId(), new LinkedHashMap>()); - } - } - } + if(!mapCompNameToTriComp.containsKey(component.getComponentId())) { + // Create an entry in the list of Component + mapCompNameToTriComp.put(component.getComponentId(), component); + if(!mapTriPortToTuple.containsKey(component.getComponentId())) { + // Create an entry in the list of Component/Ports + mapTriPortToTuple.put(component.getComponentId(), new LinkedHashMap>()); + } + } + } - /** - * Adds a new port to the specified component - * @param component The component reference - * @param portname The port name - * @param port The port to add - */ - public void addPort(final String componentName, final TriPortId ttcnPort, final IPort port) { - // Sanity checks - if(componentName.isEmpty() || (ttcnPort == null) || (port == null)) { - System.err.println("Wrong parameters"); - return; - } - if(!mapCompNameToTriComp.containsKey(componentName)) { - System.err.println("Error: Trying to add port to unknown component"); - return; - } - if(!mapTriPortToTuple.containsKey(componentName)) { - // Create an entry in the list of Component/Ports + /** + * Adds a new port to the specified component + * @param component The component reference + * @param portname The port name + * @param port The port to add + */ + public void addPort(final String componentName, final TriPortId ttcnPort, final IPort port) { + // Sanity checks + if(componentName.isEmpty() || (ttcnPort == null) || (port == null)) { + TERFactory.getInstance().logError("ComponentMgr.addPort: Wrong parameters"); + return; + } + if(!mapCompNameToTriComp.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.addPort: Trying to add port to unknown component"); + return; + } + if(!mapTriPortToTuple.containsKey(componentName)) { + // Create an entry in the list of Component/Ports mapTriPortToTuple.put(componentName, new LinkedHashMap>()); - } + } - Map> portItem = mapTriPortToTuple.get(componentName); - if(!portItem.containsKey(ttcnPort.getPortName())) { - portItem.put(ttcnPort.getPortName(), new Tuple(ttcnPort, port)); - ((IObservable)port).addObserver((Observer) adapter); - mapTriPortToTuple.put(componentName, portItem); - } - } + Map> portItem = mapTriPortToTuple.get(componentName); + if(!portItem.containsKey(ttcnPort.getPortName())) { + portItem.put(ttcnPort.getPortName(), new Tuple(ttcnPort, port)); + ((IObservable)port).addObserver((Observer) adapter); + mapTriPortToTuple.put(componentName, portItem); + } + } - /** - * Gets the component reference from its name - * @param componentName The component name - * @return The component reference if the component exists, null otherwise - */ - public TriComponentId getComponent(String componentName) { + /** + * Gets the component reference from its name + * @param componentName The component name + * @return The component reference if the component exists, null otherwise + */ + public TriComponentId getComponent(String componentName) { - // Sanity checks - if(componentName == null || componentName.isEmpty()) { - System.err.println("Invalid component"); - return null; - } + // Sanity checks + if(componentName == null || componentName.isEmpty()) { + TERFactory.getInstance().logError("ComponentMgr.getComponent: Invalid component"); + return null; + } - return mapCompNameToTriComp.get(componentName); - } + return mapCompNameToTriComp.get(componentName); + } - /** - * Retrieves the TTCN-3 port identifier (TriPortId) from component/port names - * @param componentName The component reference - * @param portName The port name - * @return The TTCN-3 port identifier if the component and the port exists, null otherwise - */ - public TriPortId getPortId(String componentName, String portName) { + /** + * Retrieves the TTCN-3 port identifier (TriPortId) from component/port names + * @param componentName The component reference + * @param portName The port name + * @return The TTCN-3 port identifier if the component and the port exists, null otherwise + */ + public TriPortId getPortId(String componentName, String portName) { - // Sanity checks - if(componentName.isEmpty() || portName.isEmpty()) { - System.err.println("Wrong parameters"); - return null; - } - if(!mapCompNameToTriComp.containsKey(componentName)) { - System.err.println("Unknown component"); - return null; - } - if(!mapTriPortToTuple.containsKey(componentName)) { - System.err.println("No port list entry"); - return null; - } + // Sanity checks + if(componentName.isEmpty() || portName.isEmpty()) { + TERFactory.getInstance().logError("ComponentMgr.getPortId: Wrong parameters"); + return null; + } + if(!mapCompNameToTriComp.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.getPortId: Unknown component"); + return null; + } + if(!mapTriPortToTuple.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.getPortId: No port list entry"); + return null; + } - Map> portItem = mapTriPortToTuple.get(componentName); - if(!portItem.containsKey(portName)) { - return null; - } - - ITuple item = portItem.get(portName); - return item.getA(); - } + Map> portItem = mapTriPortToTuple.get(componentName); + if(!portItem.containsKey(portName)) { + return null; + } + + ITuple item = portItem.get(portName); + return item.getA(); + } - /** - * Retrieves the test adapter port identifier (Port or IAdapterPort) from component/port names - * @param componentName The component owner - * @return The port reference if the component and the port exists, null otherwise - * - * @see Port - * @see IAdapterPort - */ - public IPort getPort(String componentName, String portName) { + /** + * Retrieves the test adapter port identifier (Port or IAdapterPort) from component/port names + * @param componentName The component owner + * @return The port reference if the component and the port exists, null otherwise + * + * @see Port + * @see IAdapterPort + */ + public IPort getPort(String componentName, String portName) { - // Sanity checks - if(componentName.isEmpty() || portName.isEmpty()) { - System.err.println("Wrong parameters"); - return null; - } - if(!mapCompNameToTriComp.containsKey(componentName)) { - System.err.println("Unknown component"); - return null; - } - if(!mapTriPortToTuple.containsKey(componentName)) { - System.err.println("No port list entry"); - return null; - } + // Sanity checks + if(componentName.isEmpty() || portName.isEmpty()) { + TERFactory.getInstance().logError("ComponentMgr.getPort: Wrong parameters"); + return null; + } + if(!mapCompNameToTriComp.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.getPort: Unknown component"); + return null; + } + if(!mapTriPortToTuple.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.getPort: No port list entry"); + return null; + } - Map> portItem = mapTriPortToTuple.get(componentName); - if(!portItem.containsKey(portName)) { - return null; - } - - ITuple item = portItem.get(portName); - return item.getB(); - } + Map> portItem = mapTriPortToTuple.get(componentName); + if(!portItem.containsKey(portName)) { + return null; + } + + ITuple item = portItem.get(portName); + return item.getB(); + } - /** - * Removes the specified component - * - * Note that after the port removal, if the component has no more port, it will be removed also - * - * @param component The component reference - */ - public void removeComponent(String componentName) { + /** + * Removes the specified component + * + * Note that after the port removal, if the component has no more port, it will be removed also + * + * @param component The component reference + */ + public void removeComponent(String componentName) { - removeAllPorts(); - } + removeAllPorts(); + } - /** - * Removes the specified port - * - * Note that all ports attached to this component will be removed also - * - * @param componentName The component name to remove - */ - public void removePort(String componentName, String portName) { + /** + * Removes the specified port + * + * Note that all ports attached to this component will be removed also + * + * @param componentName The component name to remove + */ + public void removePort(String componentName, String portName) { - // Sanity checks - if(componentName.isEmpty() || portName.isEmpty()) { - System.err.println("Wrong parameters"); - return; - } - if(!mapCompNameToTriComp.containsKey(componentName)) { - System.err.println("Unknown component"); - return; - } - if(!mapTriPortToTuple.containsKey(componentName)) { - System.err.println("No port list entry"); - return; - } - - Map> portItem = mapTriPortToTuple.get(componentName); - if(!portItem.containsKey(portName)) { - return; - } - // Remove Observers - ((IObservable)portItem.get(portName).getB()).deleteObservers(); + // Sanity checks + if(componentName.isEmpty() || portName.isEmpty()) { + TERFactory.getInstance().logError("ComponentMgr.removePort: Wrong parameters"); + return; + } + if(!mapCompNameToTriComp.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.removePort: Unknown component"); + return; + } + if(!mapTriPortToTuple.containsKey(componentName)) { + TERFactory.getInstance().logError("ComponentMgr.removePort: No port list entry"); + return; + } + + Map> portItem = mapTriPortToTuple.get(componentName); + if(!portItem.containsKey(portName)) { + return; + } + // Remove Observers + ((IObservable)portItem.get(portName).getB()).deleteObservers(); - // Call dispose - ((IPort)portItem.get(portName).getB()).dispose(); + // Call dispose + ((IPort)portItem.get(portName).getB()).dispose(); - // Remove item - portItem.remove(portName); - if(portItem.size() != 0) { - mapTriPortToTuple.put(componentName, portItem); - } else { - mapTriPortToTuple.remove(componentName); + // Remove item + portItem.remove(portName); + if(portItem.size() != 0) { + mapTriPortToTuple.put(componentName, portItem); + } else { + mapTriPortToTuple.remove(componentName); mapCompNameToTriComp.remove(componentName); if(mapCompNameToTriComp.isEmpty()) { mapCompNameToTriComp.clear(); } } - if(mapTriPortToTuple.isEmpty()) { - mapTriPortToTuple.clear(); - } - } - - /** - * Removes all ports. - */ - public void removeAllPorts() { - - // Remove all ports - for(Object componentName : mapTriPortToTuple.keySet().toArray()) { - Map> portItem = mapTriPortToTuple.get(componentName); - for(Object portName : portItem.keySet().toArray()) { - removePort((String)componentName, (String)portName); - } - } - - // Remove component mapping - mapCompNameToTriComp.clear(); - } + if(mapTriPortToTuple.isEmpty()) { + mapTriPortToTuple.clear(); + } + } + + /** + * Removes all ports. + */ + public void removeAllPorts() { + + // Remove all ports + for(Object componentName : mapTriPortToTuple.keySet().toArray()) { + Map> portItem = mapTriPortToTuple.get(componentName); + for(Object portName : portItem.keySet().toArray()) { + removePort((String)componentName, (String)portName); + } + } + + // Remove component mapping + mapCompNameToTriComp.clear(); + } } diff --git a/javasrc/adapter/org/etsi/its/adapter/Management.java b/javasrc/adapter/org/etsi/its/adapter/Management.java index ff611d9da941df8f83bb890c5bfec7365e908b00..fd79ff9c73f98925ecd575f51aac294663d1181a 100644 --- a/javasrc/adapter/org/etsi/its/adapter/Management.java +++ b/javasrc/adapter/org/etsi/its/adapter/Management.java @@ -48,7 +48,7 @@ public class Management implements IManagementTA, IManagementLayers { /** * Maximum time for getting Long position vector (in seconds) */ - private static final int GET_LPV_TIMEOUT = 10; + private static final int GET_LPV_TIMEOUT = 10; //FIXME: Might be a parameter rather than a constant /** * Interval for polling the location table during GetLpv (in ms) @@ -66,9 +66,10 @@ public class Management implements IManagementTA, IManagementLayers { private static final int longitude = Integer.decode(((CharstringValue)TERFactory.getInstance().getTaParameter("TsLongitude")).getString()); /** - * Secured mode status + * Enforce secured mode status */ - private static final String TsSecuredMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsSecuredMode")).getString(); + //private static String TsEnforceSecuredMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsEnforceSecuredMode")).getString(); + private static String TsEnforceSecuredMode = "false"; /** * Secured root path to access certificates & private keys @@ -83,7 +84,7 @@ public class Management implements IManagementTA, IManagementLayers { /** * ITS-AID for Secure other profile */ - private static final String TsItsAidOther = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsItsAidOther")).getString(); + private static final String TsItsAidOther = "141"; // GN-MGMT ((CharstringValue)TERFactory.getInstance().getTaParameter("TsItsAidOther")).getString(); /** * Link-layer address of Component @@ -142,11 +143,6 @@ public class Management implements IManagementTA, IManagementLayers { */ private Management() { - // Check for secured mode settings in TestAdapter configuration file - if (TsSecuredMode.equals("true")) { - setupSecuredMode(); - } - // For debug only: byte[] mid = new byte[] {(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00}; @@ -233,7 +229,7 @@ public class Management implements IManagementTA, IManagementLayers { @Override public byte[] getLongPositionVector(byte[] targetGnAddress) { byte[] mid = ByteHelper.extract(targetGnAddress, 2, 6); -// System.out.println("getLongPositionVector: Looking for Loc Entry: " + ByteHelper.byteArrayToString(mid)); + TERFactory.getInstance().logDebug("getLongPositionVector: Looking for Loc Entry: " + ByteHelper.byteArrayToString(mid)); long key = ByteHelper.byteArrayToLong(mid); for(int i = 0; i < GET_LPV_TIMEOUT; ++i) { if (locTable.containsKey(key)) { @@ -283,7 +279,7 @@ public class Management implements IManagementTA, IManagementLayers { long key = ByteHelper.byteArrayToLong(mid); ITuple entry = locTable.get(key); if(entry == null || entry.getA() < timestamp) { -// System.out.println("gnUpdateLocTable: Adding Loc Entry for: " + ByteHelper.byteArrayToString(mid)); +// TERFactory.getInstance().logDebug("gnUpdateLocTable: Adding Loc Entry for: " + ByteHelper.byteArrayToString(mid)); locTable.put(key, new Tuple(timestamp, lpv)); } } @@ -353,11 +349,18 @@ public class Management implements IManagementTA, IManagementLayers { // Ensure that management settings are reset beaconHeader = null; enqueueBeacon = null; + + locTable.clear(); } @Override public void setSecuredMode(final byte[] securityData) { - certificateId = ByteHelper.byteArrayWithLengthToString(ByteHelper.concat(ByteHelper.intToByteArray(securityData.length, 4), securityData)); + certificateId = ByteHelper.byteArrayWithLengthToString(ByteHelper.concat(ByteHelper.intToByteArray(securityData.length - 1, 4), securityData)); + if (securityData[securityData.length - 1] == 0x01) { + TsEnforceSecuredMode = "true"; + } else { + TsEnforceSecuredMode = "false"; + } setupSecuredMode(); } @@ -373,7 +376,7 @@ public class Management implements IManagementTA, IManagementLayers { @Override public boolean isEnforceSecuredModeSet() { - return TsSecuredMode.equals("true"); + return TsEnforceSecuredMode.equals("true"); } @Override @@ -412,12 +415,12 @@ public class Management implements IManagementTA, IManagementLayers { } /** - * @desc This method setup secured mode according to the Test adapter settings (@see TsSecuredMode flags). - * The secured mode could be overrided by test case secured mode configuration through AC primitives + * @desc This method setup secured mode according to ATS settings (AcSecPrimitive) and the Test adapter settings (TsEnforceSecuredMode flags) + * @see TsEnforceSecuredMode flags. * @remark This method shall be called by the constructor only */ private void setupSecuredMode() { -// System.out.println(">>> setupSecuredMode: " + certificateId); + TERFactory.getInstance().logDebug(">>> setupSecuredMode: " + certificateId); securedMode = true; ICertificatesIO _certCache = CertificatesIOFactory.getInstance(); @@ -428,26 +431,26 @@ public class Management implements IManagementTA, IManagementLayers { _certCache.readCertificate(certificateId, certificate); // Extract public keys atCertificate = certificate.toByteArray(); -// System.out.println("Management.setupSecuredModeFromTaConfig: certificate=" + ByteHelper.byteArrayToString(atCertificate)); + TERFactory.getInstance().logDebug("Management.setupSecuredMode: certificate=" + ByteHelper.byteArrayToString(atCertificate)); // Compute AT certificate digest byte[] atHash = CryptoLib.hashWithSha256(atCertificate); atCertificateDigest = ByteHelper.extract(atHash, atHash.length - 8, 8); -// System.out.println("Management.setupSecuredModeFromTaConfig: atCertificateDigest=" + ByteHelper.byteArrayToString(atCertificateDigest)); + TERFactory.getInstance().logDebug("Management.setupSecuredMode: atCertificateDigest=" + ByteHelper.byteArrayToString(atCertificateDigest)); int offset = 16; // FIXME To be enhanced // KeyX signingPublicKeyX = new byte[32]; System.arraycopy(atCertificate, offset, signingPublicKeyX, 0, 32); offset += 32; -// System.out.println("Management.setupSecuredModeFromTaConfig: signingPublicKeyX=" + ByteHelper.byteArrayToString(signingPublicKeyX)); + TERFactory.getInstance().logDebug("Management.setupSecuredMode: signingPublicKeyX=" + ByteHelper.byteArrayToString(signingPublicKeyX)); // KeyY signingPublicKeyY = new byte[32]; System.arraycopy(atCertificate, offset, signingPublicKeyY, 0, 32); -// System.out.println("Management.setupSecuredModeFromTaConfig: signingPublicKeyY=" + ByteHelper.byteArrayToString(signingPublicKeyY)); + TERFactory.getInstance().logDebug("Management.setupSecuredMode: signingPublicKeyY=" + ByteHelper.byteArrayToString(signingPublicKeyY)); // Extract private keys ByteArrayOutputStream signingPrivateKey = new ByteArrayOutputStream(); _certCache.readSigningKey(certificateId, signingPrivateKey); this.signingPrivateKey = signingPrivateKey.toByteArray().clone(); -// System.out.println("Management.setupSecuredModeFromTaConfig: signingPrivateKey=" + ByteHelper.byteArrayToString(this.signingPrivateKey)); + TERFactory.getInstance().logDebug("Management.setupSecuredMode: signingPrivateKey=" + ByteHelper.byteArrayToString(this.signingPrivateKey)); // TODO Add support of encryption } } diff --git a/javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java b/javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java index b5fe2fcce21e130f325ff9c467f888afae50ad41..973d601479bc09ec07f3d641927e2c54f7a3eb31 100644 --- a/javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java +++ b/javasrc/adapter/org/etsi/its/adapter/PcapMultiplexer.java @@ -29,7 +29,7 @@ import org.jnetpcap.PcapHeader; import org.jnetpcap.PcapIf; public class PcapMultiplexer implements Runnable { - + /** * Unique instance of the factory */ @@ -38,41 +38,51 @@ public class PcapMultiplexer implements Runnable { private static byte[] MAC_BROADCAST = new byte[]{(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF}; private StringBuilder errbuf = new StringBuilder(); // For any error msgs + + private String timestampOffset = ""; private PcapMultiplexer() { filter = ""; - - // Obtain the list of network interfaces - List alldevs = new ArrayList(); // Will be filled with NICs - - - int r = Pcap.findAllDevs(alldevs, errbuf); - if (r == Pcap.NOT_OK || alldevs.isEmpty()) { - System.err.printf("Can't read list of devices, error is %s", errbuf.toString()); - return; - } - - // Find the right interface - int ifaceIndex = 0; - String expectedIface = ((CharstringValue)TERFactory.getInstance().getTaParameter("LocalEthernetMAC")).getString().toLowerCase(); - for( ; ifaceIndex < alldevs.size(); ifaceIndex++) { - try { - if (expectedIface.equalsIgnoreCase(ByteHelper.byteArrayToString(alldevs.get(ifaceIndex).getHardwareAddress()))) { - // Interface found - break; + offlineMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("OfflineMode")).getString().toLowerCase().equals("true"); + if (!offlineMode) { + // Obtain the list of network interfaces + List alldevs = new ArrayList(); // Will be filled with NICs + + + int r = Pcap.findAllDevs(alldevs, errbuf); + if (r == Pcap.NOT_OK || alldevs.isEmpty()) { + TERFactory.getInstance().logError("Can't read list of devices, error is %s" + errbuf.toString()); + return; + } + + // Find the right interface + int ifaceIndex = 0; + String expectedIface = ((CharstringValue)TERFactory.getInstance().getTaParameter("LocalEthernetMAC")).getString().toLowerCase(); + for( ; ifaceIndex < alldevs.size(); ifaceIndex++) { + try { + if (expectedIface.equalsIgnoreCase(ByteHelper.byteArrayToString(alldevs.get(ifaceIndex).getHardwareAddress()))) { + // Interface found + break; + } + } catch (IOException e) { + // ignore } - } catch (IOException e) { - // ignore } + // Check result + if (ifaceIndex == alldevs.size()) { + throw new RuntimeException(String.format("PcapMultiplexer: Network interface %s not found", expectedIface)); + } + + device = alldevs.get(ifaceIndex); + //TERFactory.getInstance().logDebug("Listening: " + device.getName()); + } else { + file = ((CharstringValue)TERFactory.getInstance().getTaParameter("PcapFile")).getString().toLowerCase(); + if ((file == null) || file.isEmpty()) { + throw new RuntimeException(String.format("PcapMultiplexer: failed to open '%s'", file)); + } + timestampOffset = ((CharstringValue)TERFactory.getInstance().getTaParameter("OffsetTime")).getString().toLowerCase(); } - // Check result - if (ifaceIndex == alldevs.size()) { - throw new RuntimeException(String.format("EthernetLayer.register: Network interface %s not found", expectedIface)); - } - - device = alldevs.get(ifaceIndex); - System.out.println("Listening: " + device.getName()); } /** @@ -84,26 +94,29 @@ public class PcapMultiplexer implements Runnable { } public synchronized void register(Layer client, byte[] macAddress, short frameType) { - System.out.println(">>>PcapMultiplexer.registering: " + frameType); + //TERFactory.getInstance().logDebug(">>>PcapMultiplexer.registering: " + frameType); if(clientsToMacs.isEmpty()) { - // Open interface - int snaplen = 64 * 1024; // Capture all packets, no truncation - int flags = Pcap.MODE_PROMISCUOUS; // capture all packets - int timeout = 10; // 10 millis - pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf); - - if (pcap == null) { - System.err.printf("Error while opening device for capture: " - + errbuf.toString()); - return; + if (!offlineMode) { // Open interface + int snaplen = 64 * 1024; // Capture all packets, no truncation + int flags = Pcap.MODE_PROMISCUOUS; // capture all packets + int timeout = 10; // 10 millis + pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf); + } else { // Open file + pcap = Pcap.openOffline(file, errbuf); + } + if (pcap == null) { // Check result + TERFactory.getInstance().logError("Error while opening device for capture: " + errbuf.toString()); + return; } captureThread = new Thread(this); - captureThread.start(); - filter = ""; + captureThread.start(); + if (!timestampOffset.isEmpty()) { + filter = "frame time_delta " + timestampOffset + " and "; + } } else { - System.out.println("Another Client !"); + //TERFactory.getInstance().logDebug("Another Client !"); filter = filter + " and "; } @@ -114,7 +127,7 @@ public class PcapMultiplexer implements Runnable { } filter = filter + "not ether src " + strMacAddress; - System.out.println("New filter: " + filter); + //TERFactory.getInstance().logDebug("New filter: " + filter); // Apply filter PcapBpfProgram bpfFilter = new PcapBpfProgram(); @@ -122,7 +135,7 @@ public class PcapMultiplexer implements Runnable { int netmask = 0; int r = pcap.compile(bpfFilter, filter, optimize, netmask); if (r != Pcap.OK) { - System.out.println("Filter error: " + pcap.getErr()); + //TERFactory.getInstance().logDebug("Filter error: " + pcap.getErr()); } pcap.setFilter(bpfFilter); @@ -164,7 +177,7 @@ public class PcapMultiplexer implements Runnable { if(byteBuffer.remaining() < 14) { return; } - + Map lowerInfo = new HashMap(); // Extract Dst info @@ -199,6 +212,14 @@ public class PcapMultiplexer implements Runnable { } }; + if (offlineMode) { + try { + Thread.sleep(4000); // TOTO Use a parameter instead of an hardcoded value + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } pcap.loop(-1, handler, null); } @@ -207,17 +228,41 @@ public class PcapMultiplexer implements Runnable { if(clientsToMacs.containsKey(client.toString())) { byte[] packet = ByteHelper.concat( - dest, - clientsToMacs.get(client.toString()), - ByteHelper.intToByteArray(clientsToFrameTypes.get(client.toString()), 2), - payload); - + dest, + clientsToMacs.get(client.toString()), + ByteHelper.intToByteArray(clientsToFrameTypes.get(client.toString()), 2), + payload); + pcap.sendPacket(packet); return packet; } return null; } + public void resetFilter(String pcapFilter) { + // Sanity check + if ((pcapFilter == null) || pcapFilter.isEmpty()) { + return; + } + + filter = pcapFilter; + TERFactory.getInstance().logDebug("resetFilter: New filter: " + filter); + + // Apply filter + PcapBpfProgram bpfFilter = new PcapBpfProgram(); + int optimize = 0; // 1 means true, 0 means false + int netmask = 0; + int r = pcap.compile(bpfFilter, filter, optimize, netmask); + if (r == Pcap.NOT_OK) { + TERFactory.getInstance().logError("Filter error: " + pcap.getErr()); + } else { + r = pcap. setFilter(bpfFilter); + if (r == Pcap.NOT_OK) { + TERFactory.getInstance().logError("Filter error: " + pcap.getErr()); + } + } + } + /** * Jpcap capture device */ @@ -228,9 +273,12 @@ public class PcapMultiplexer implements Runnable { */ private Thread captureThread; - PcapIf device; + PcapIf device = null; + boolean offlineMode = false; + String file = ""; private String filter; private Map clientsToMacs = new HashMap(); private Map clientsToFrameTypes = new HashMap(); private HashMap clientsToLayers = new HashMap(); + } \ No newline at end of file diff --git a/javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java b/javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java index e4819a4bf3ea1afd77b6a7fb78668a1c8de8da27..2741311d21993c18016e4599b044dd31407217bf 100644 --- a/javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java +++ b/javasrc/adapter/org/etsi/its/adapter/SecurityHelper.java @@ -11,7 +11,11 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import org.etsi.adapter.TERFactory; import org.etsi.common.ByteHelper; +//import org.etsi.its.adapter.layers.ETSI; + + import de.fraunhofer.sit.c2x.CryptoLib; @@ -21,6 +25,18 @@ public class SecurityHelper { public static SecurityHelper getInstance() { return Instance; } + /** + * SSP value + * @see ETSI TS 103 097 + */ + public static final String SEC_SSP = "SSP"; + + /** + * ITS-AID value + * @see ETSI TS 103 097 + */ + public static final String SEC_ITS_AID = "ITS_AID"; + /** * Storage for received certificates */ @@ -30,12 +46,12 @@ public class SecurityHelper { _neighborsCertificates = new HashMap(); } - public byte[] size2tls(final int length) { + public byte[] size2tls(final int intx_value) { byte[] result = null; - if (length < 128) { // One byte length - result = new byte[] { (byte)length }; + if (intx_value < 128) { // One byte length + result = new byte[] { (byte)intx_value }; } else { - long lv = length; + long lv = intx_value; long bitLen = bitLength(lv); long byteLen = byteLength(bitLen); long flags = (long) ((byteLen | 1) << (byteLen * Byte.SIZE - bitLength(byteLen) - 1)); @@ -86,58 +102,62 @@ public class SecurityHelper { return (long) Math.ceil(d / Byte.SIZE); } - public byte[] checkSecuredProfileAndExtractPayload(final byte[] p_message, final int p_offset, final boolean p_enforceSecurityCheck, final int p_itsAidOther) { - System.out.println(">>> SecurityHelper.checkSecuredProfileAndExtractPayload: " + ByteHelper.byteArrayToString(p_message)); + public byte[] checkSecuredProfileAndExtractPayload(final byte[] p_message, final int p_offset, final boolean p_enforceSecurityCheck, final int p_itsAidOther, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> SecurityHelper.checkSecuredProfileAndExtractPayload: " + ByteHelper.byteArrayToString(p_message)); ByteArrayInputStream decvalue = new ByteArrayInputStream(p_message, p_offset, p_message.length - p_offset); // Check version if (decvalue.read() != 2) { - System.err.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong version number"); if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong version number"); return null; } } // Extract header fields length and header fields long headerFieldsLength = tls2size(decvalue); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: headerFieldsLength:" + headerFieldsLength); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: headerFieldsLength:" + headerFieldsLength); byte[] headerFields = new byte[(int) headerFieldsLength]; decvalue.read(headerFields, 0, (int) headerFieldsLength); ByteArrayOutputStream certificateKeys = new ByteArrayOutputStream(); - if (!checkHeaderfields(headerFields, certificateKeys, p_enforceSecurityCheck, p_itsAidOther)) { - System.err.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Headerfields"); + if (!checkHeaderfields(headerFields, certificateKeys, p_enforceSecurityCheck, p_itsAidOther, lowerInfo)) { if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Headerfields"); return null; } } byte[] aaSigningPublicKeyX = null, aaSigningPublicKeyY = null; - byte[] keys = certificateKeys.toByteArray(); - if ((keys[0] == 0x02) || (keys[0] == 0x03)) { // Key length = 32 bytes - aaSigningPublicKeyX = ByteHelper.extract(keys, 1, 32); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); - } else { // Key length = 64 bytes - aaSigningPublicKeyX = ByteHelper.extract(keys, 1, 32); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); - aaSigningPublicKeyY = ByteHelper.extract(keys, 33, 32); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + if (p_enforceSecurityCheck) { + byte[] keys = certificateKeys.toByteArray(); + if ((keys[0] == 0x02) || (keys[0] == 0x03)) { // Key length = 32 bytes + aaSigningPublicKeyX = ByteHelper.extract(keys, 1, 32); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + } else { // Key length = 64 bytes + aaSigningPublicKeyX = ByteHelper.extract(keys, 1, 32); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + aaSigningPublicKeyY = ByteHelper.extract(keys, 33, 32); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + } } // FIXME Add encryption support - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: headerFields:" + ByteHelper.byteArrayToString(headerFields)); +// if (p_enforceSecurityCheck) { +// } + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: headerFields:" + ByteHelper.byteArrayToString(headerFields)); // Extract payload, decvalue is updated with the payload if (decvalue.read() != 1) { - System.err.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Payload type"); + //TERFactory.getInstance().logError("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Payload type"); if (p_enforceSecurityCheck) { // Drop it return null; } } long payloadLength = tls2size(decvalue); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: payloadLength:" + payloadLength); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: payloadLength:" + payloadLength); byte[] payload = new byte[(int) payloadLength]; decvalue.read(payload, 0, (int) payloadLength); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: payload:" + ByteHelper.byteArrayToString(payload)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: payload:" + ByteHelper.byteArrayToString(payload)); if (p_enforceSecurityCheck) { // Extract Secure Trailer long secureTrailerLength = tls2size(decvalue); byte[] secureTrailer = new byte[(int) secureTrailerLength]; @@ -145,39 +165,39 @@ public class SecurityHelper { ByteArrayOutputStream signature = new ByteArrayOutputStream(); if (!extractMessageSignature(secureTrailer, signature)) { // Drop it - System.err.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Signatures"); + //TERFactory.getInstance().logError("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Wrong Signatures"); return null; } - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: signature:" + ByteHelper.byteArrayToString(signature.toByteArray())); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: signature:" + ByteHelper.byteArrayToString(signature.toByteArray())); // Build signed data byte[] toBeVerifiedData = ByteHelper.extract( p_message, p_offset, p_message.length - (int)(p_offset + secureTrailerLength - 1 /* Exclude signature structure but keep signature type and signature length */) ); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload:" + ByteHelper.byteArrayToString(toBeVerifiedData)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload:" + ByteHelper.byteArrayToString(toBeVerifiedData)); boolean result; try { - if (aaSigningPublicKeyY == null) { - // FIXME FSCOM: Check how t verify compressed signature - return payload; - } + if (aaSigningPublicKeyY == null) { + // FIXME FSCOM: Check how t verify compressed signature + return payload; + } result = CryptoLib.verifyWithEcdsaNistp256WithSha256( toBeVerifiedData, signature.toByteArray(), aaSigningPublicKeyX, aaSigningPublicKeyY ); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Verify signature: " + new Boolean(result)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: Verify signature: " + new Boolean(result)); if (!result) { // Drop packet - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: toBeVerifiedData :" + ByteHelper.byteArrayToString(toBeVerifiedData)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: toBeVerifiedData :" + ByteHelper.byteArrayToString(toBeVerifiedData)); // Calculate Digest digest from the buffer toBeVerifiedData - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Hash :" + ByteHelper.byteArrayToString(CryptoLib.hashWithSha256(toBeVerifiedData))); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: signature :" + ByteHelper.byteArrayToString(signature.toByteArray())); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); - System.out.println("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); - System.err.println("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Invalid signature"); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: Hash :" + ByteHelper.byteArrayToString(CryptoLib.hashWithSha256(toBeVerifiedData))); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: signature :" + ByteHelper.byteArrayToString(signature.toByteArray())); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkSecuredProfileAndExtractPayload: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); + //TERFactory.getInstance().logError("SecurityHelper.checkSecuredProfileAndExtractPayload: Drop packet - Invalid signature"); return null; } @@ -187,19 +207,19 @@ public class SecurityHelper { } // Drop packet - System.err.println("<<< SecurityHelper.checkSecuredProfileAndExtractPayload: dropped"); + //TERFactory.getInstance().logError("<<< SecurityHelper.checkSecuredProfileAndExtractPayload: dropped"); return null; } return payload; } - public boolean checkHeaderfields(final byte[] p_headerfields, final ByteArrayOutputStream p_keys, final boolean p_enforceSecurityCheck, final int p_itsAidOther) { - System.out.println(">>> SecurityHelper.checkHeaderfields: " + ByteHelper.byteArrayToString(p_headerfields)); + public boolean checkHeaderfields(final byte[] p_headerfields, final ByteArrayOutputStream p_keys, final boolean p_enforceSecurityCheck, final int p_itsAidOther, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> SecurityHelper.checkHeaderfields: " + ByteHelper.byteArrayToString(p_headerfields)); // Sanity check if (p_headerfields.length == 0) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Invalid header fields"); + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Invalid header fields"); return false; } // Extract digest or certificate @@ -212,7 +232,7 @@ public class SecurityHelper { (p_headerfields[signerInfoTypeIndex + 1] != 0x03) // SignerInfo Type: certificate chain (3) ) ) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Certificate"); + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Certificate"); if (p_enforceSecurityCheck) { // Drop it return false; @@ -222,19 +242,19 @@ public class SecurityHelper { if (p_headerfields[signerInfoTypeIndex] == 0x02) { // SignerInfo Type: Certificate (2) signerInfoTypeIndex += 1; // Extract certificate because of it is an Other message profile - byte[] certificate = decodeCertificate(p_headerfields, signerInfoTypeIndex, p_keys, p_enforceSecurityCheck); + byte[] certificate = decodeCertificate(p_headerfields, signerInfoTypeIndex, p_keys, p_enforceSecurityCheck, lowerInfo); if (certificate == null) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Certificate not decoded"); + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Certificate not decoded"); if (p_enforceSecurityCheck) { // Drop it return false; } } - System.out.println("SecurityHelper.checkHeaderfields: Certificate=" + ByteHelper.byteArrayToString(certificate)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Certificate=" + ByteHelper.byteArrayToString(certificate)); // Add it in our map Long lKey = ByteHelper.byteArrayToLong(calculateDigestFromCertificate(certificate)); if (!_neighborsCertificates.containsKey(lKey)) { - System.out.println("SecurityHelper.checkHeaderfields: Add keys for " + ByteHelper.byteArrayToString(calculateDigestFromCertificate(certificate)) + " / " + lKey); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Add keys for " + ByteHelper.byteArrayToString(calculateDigestFromCertificate(certificate)) + " / " + lKey); _neighborsCertificates.put(lKey, p_keys); } signerInfoTypeIndex += certificate.length; @@ -243,11 +263,11 @@ public class SecurityHelper { byte[] hashedid8 = ByteHelper.extract(p_headerfields, signerInfoTypeIndex, Long.SIZE / Byte.SIZE); signerInfoTypeIndex += (Long.SIZE / Byte.SIZE); Long lKey = ByteHelper.byteArrayToLong(hashedid8); - System.out.println("SecurityHelper.checkHeaderfields: Certificate digest with SHA256=" + lKey + "/ " + ByteHelper.byteArrayToString(hashedid8)); - if (!_neighborsCertificates.containsKey(lKey) || (_neighborsCertificates.get(lKey) == null)) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Unknown HahedId8"); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Certificate digest with SHA256=" + lKey + " / " + ByteHelper.byteArrayToString(hashedid8)); + if (!_neighborsCertificates.containsKey(lKey) || (_neighborsCertificates.get(lKey) == null)) { //FIXME as long as the cert chain is not complete, it should not be seen as error -> raise CR if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Unknown HahedId8"); return false; } } @@ -255,9 +275,10 @@ public class SecurityHelper { p_keys.write(_neighborsCertificates.get(lKey).toByteArray()); } catch (Exception e) { // Drop it - e.printStackTrace(); + //e.printStackTrace(); if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: key " + lKey + "_neighbors certificates table"); return false; } } @@ -265,66 +286,66 @@ public class SecurityHelper { signerInfoTypeIndex += 1; ByteArrayInputStream ba = new ByteArrayInputStream(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex)); int certChainLength = (int) this.tls2size(ba); - System.out.println("SecurityHelper.checkHeaderfields: Certchain length = " + certChainLength); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Certchain length = " + certChainLength); signerInfoTypeIndex += this.size2tls(certChainLength).length; ByteArrayOutputStream keys; do { // Extract certificate because of it is an Other message profile keys = new ByteArrayOutputStream(); - byte[] certificate = decodeCertificate(p_headerfields, signerInfoTypeIndex, keys, p_enforceSecurityCheck); + byte[] certificate = decodeCertificate(p_headerfields, signerInfoTypeIndex, keys, p_enforceSecurityCheck, lowerInfo); if (certificate == null) { // Drop it - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Failed to decode chain of certificate"); + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Failed to decode chain of certificate"); return false; } - System.out.println("SecurityHelper.checkHeaderfields: Certificate=" + ByteHelper.byteArrayToString(certificate)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Certificate=" + ByteHelper.byteArrayToString(certificate)); // Add it in our map Long lKey = ByteHelper.byteArrayToLong(calculateDigestFromCertificate(certificate)); if (!_neighborsCertificates.containsKey(lKey)) { - System.out.println("SecurityHelper.checkHeaderfields: Add keys for " + ByteHelper.byteArrayToString(calculateDigestFromCertificate(certificate)) + " / " + lKey); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Add keys for " + ByteHelper.byteArrayToString(calculateDigestFromCertificate(certificate)) + " / " + lKey); _neighborsCertificates.put(lKey, p_keys); } certChainLength -= certificate.length; signerInfoTypeIndex += certificate.length; - System.out.println("SecurityHelper.checkHeaderfields: Extracted certificate = " + ByteHelper.byteArrayToString(certificate)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: Extracted certificate = " + ByteHelper.byteArrayToString(certificate)); } while (certChainLength > 0); } // Check generation time if (p_headerfields[signerInfoTypeIndex++] != 0x00) { // Header Field: Generation Time (0) if (p_enforceSecurityCheck) { // Drop it - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - GenerationTime not found"); + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - GenerationTime not found"); return false; } } long generationTime = ByteHelper.byteArrayToLong(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, Long.SIZE / Byte.SIZE)); - System.out.println("SecurityHelper.checkHeaderfields: generationTime=" + generationTime); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: generationTime=" + generationTime); if (Math.abs(System.currentTimeMillis() - generationTime) < 1000) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - GenerationTime out of range"); if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - GenerationTime out of range"); return false; } } signerInfoTypeIndex += (Long.SIZE / Byte.SIZE); if (signerInfoTypeIndex < p_headerfields.length) { - System.out.println("SecurityHelper.checkHeaderfields: dump #1=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: dump #1=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); if (p_headerfields[signerInfoTypeIndex] == 0x03) { // Header Field: Generation Location (3) signerInfoTypeIndex += 1; byte[] lat = ByteHelper.extract(p_headerfields, signerInfoTypeIndex, 4); signerInfoTypeIndex += 4; - System.out.println("SecurityHelper.checkHeaderfields: latitude=" + ByteHelper.byteArrayToString(lat)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: latitude=" + ByteHelper.byteArrayToString(lat)); byte[] lon = ByteHelper.extract(p_headerfields, signerInfoTypeIndex, 4); signerInfoTypeIndex += 4; - System.out.println("SecurityHelper.checkHeaderfields: longitude=" + ByteHelper.byteArrayToString(lon)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: longitude=" + ByteHelper.byteArrayToString(lon)); byte[] ele = ByteHelper.extract(p_headerfields, signerInfoTypeIndex, 2); signerInfoTypeIndex += 2; - System.out.println("SecurityHelper.checkHeaderfields: elevation=" + ByteHelper.byteArrayToString(ele)); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: elevation=" + ByteHelper.byteArrayToString(ele)); } } if (signerInfoTypeIndex < p_headerfields.length) { - System.out.println("SecurityHelper.checkHeaderfields: dump #2=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: dump #2=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); if (p_headerfields[signerInfoTypeIndex] == 0x05) { // Header Field: Its AID (5) signerInfoTypeIndex += 1; // Check ItsAid @@ -334,38 +355,55 @@ public class SecurityHelper { (p_headerfields[signerInfoTypeIndex] != 0x25) && // DENM (p_headerfields[signerInfoTypeIndex] != p_itsAidOther) ) { - System.err.println("SecurityHelper.checkHeaderfields: Drop packet - Unknown ItsAid value"); if (p_enforceSecurityCheck) { // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Unknown ItsAid value"); return false; } } - System.out.println("SecurityHelper.checkHeaderfields: ItsAid=" + p_headerfields[signerInfoTypeIndex]); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: ItsAid=" + p_headerfields[signerInfoTypeIndex]); + lowerInfo.put(SecurityHelper.SEC_ITS_AID, ByteHelper.intToByteArray(p_headerfields[signerInfoTypeIndex], Integer.SIZE / Byte.SIZE)); + signerInfoTypeIndex += 1; + } else { // FIXME To be refined + signerInfoTypeIndex += 1; + if ( + (p_headerfields[signerInfoTypeIndex] != 0x89) && // SPATEM + (p_headerfields[signerInfoTypeIndex] != 0x8a) && // MAPEM + (p_headerfields[signerInfoTypeIndex] != 0x8b) && // IVIM + (p_headerfields[signerInfoTypeIndex] != 0x8d) && // EVCSN TODO Use the correct value + (p_headerfields[signerInfoTypeIndex] != 0x8c) // SREM/SSEM + ) { + if (p_enforceSecurityCheck) { + // Drop it + //TERFactory.getInstance().logError("SecurityHelper.checkHeaderfields: Drop packet - Unknown ItsAid value"); + return false; + } + } + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: ItsAid=" + p_headerfields[signerInfoTypeIndex]); + lowerInfo.put(SecurityHelper.SEC_ITS_AID, ByteHelper.intToByteArray(p_headerfields[signerInfoTypeIndex], Integer.SIZE / Byte.SIZE)); signerInfoTypeIndex += 1; - } else { - // FIXME to be continued } } } if (signerInfoTypeIndex < p_headerfields.length) { // TODO check other fields - System.out.println("SecurityHelper.checkHeaderfields: dump #3=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); + //TERFactory.getInstance().logDebug("SecurityHelper.checkHeaderfields: dump #3=" + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, signerInfoTypeIndex, p_headerfields.length - signerInfoTypeIndex))); } return true; } - public byte[] decodeCertificate(final byte[] p_headerfields, final int p_offset, final ByteArrayOutputStream p_keys, final boolean p_enforceSecurityCheck) { - System.out.println(">>> SecurityHelper.decodeCertificate: " + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, p_offset, p_headerfields.length - p_offset))); + public byte[] decodeCertificate(final byte[] p_headerfields, final int p_offset, final ByteArrayOutputStream p_keys, final boolean p_enforceSecurityCheck, Map p_lowerInfo) { + //TERFactory.getInstance().logDebug(">>> SecurityHelper.decodeCertificate: " + ByteHelper.byteArrayToString(ByteHelper.extract(p_headerfields, p_offset, p_headerfields.length - p_offset))); ByteArrayInputStream headerfields = new ByteArrayInputStream(p_headerfields, p_offset, p_headerfields.length - p_offset); - System.out.println("SecurityHelper.decodeCertificate: headerfields length=" + headerfields.available()); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: headerfields length=" + headerfields.available()); ByteArrayOutputStream cert = new ByteArrayOutputStream(); // FIXME To be removed try { // Version cert.write((byte)headerfields.read()); if (cert.toByteArray()[0] != 0x02) { - System.err.println("SecurityHelper.decodeCertificate: Wrong version number"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Wrong version number"); if (p_enforceSecurityCheck) { // Drop it return null; @@ -378,7 +416,7 @@ public class SecurityHelper { case 0x01: byte[] digest = new byte[8]; headerfields.read(digest, 0, digest.length); - System.out.println("SecurityHelper.decodeCertificate: hashedid8=" + ByteHelper.byteArrayToString(digest)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: hashedid8=" + ByteHelper.byteArrayToString(digest)); cert.write(digest); break; // FIXME To be continued @@ -389,7 +427,7 @@ public class SecurityHelper { (subjectInfoType != 0x01) && // Subject Info: authorization ticket (1) (subjectInfoType != 0x02) // Subject Info: authorization authority (2) ) { - System.err.println("SecurityHelper.decodeCertificate: Subject Info: authorization authority/ticket expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Subject Info: authorization authority/ticket expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); return null; } cert.write(subjectInfoType); @@ -399,7 +437,7 @@ public class SecurityHelper { byte[] subjectInfo = new byte[(int) length]; headerfields.read(subjectInfo, 0, subjectInfo.length); cert.write(subjectInfo); - System.out.println("SecurityHelper.decodeCertificate: subjectInfo: " + ByteHelper.byteArrayToString(subjectInfo)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: subjectInfo: " + ByteHelper.byteArrayToString(subjectInfo)); } else { cert.write(0x00); } @@ -410,30 +448,30 @@ public class SecurityHelper { byte[] b = new byte[(int) length]; headerfields.read(b, 0, b.length); cert.write(b); - System.out.println("SecurityHelper.decodeCertificate: Subject Attributes length=" + length + " / " + headerfields.available()); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Subject Attributes length=" + length + " / " + headerfields.available()); ByteArrayInputStream subjectAttributes = new ByteArrayInputStream(b); if (subjectAttributes.read() == 0x00) { // Subject Attribute: verification key (0) - Mandatory if (subjectAttributes.read() == 0x00) { // Public Key Alg: ecdsa nistp256 with sha256 (0) - byte v = (byte) subjectAttributes.read(); + byte v = (byte) subjectAttributes.read(); p_keys.write(v); - System.out.println("SecurityHelper.decodeCertificate: ECC Point Type: =" + v); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: ECC Point Type: =" + v); if (v == 0x02) { // ECC Point Type: compressed lsb y-0(2) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Verification lsb y-1 key=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Verification lsb y-1 key=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } else if (v == 0x03) { // ECC Point Type: compressed lsb y-1(3) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Verification lsb y-1 key=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Verification lsb y-1 key=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } else if (v == 0x04) { // ECC Point Type: uncompressed (4) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Verification key1=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Verification key1=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Verification key2=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Verification key2=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } // FIXME To be continued } // FIXME To be continued @@ -444,26 +482,26 @@ public class SecurityHelper { if (v == 0x01) { // // Subject Attribute: encryption key (1) if (subjectAttributes.read() == 0x01) { // Public Key Alg: ecdsa nistp256 (1) if (subjectAttributes.read() == 0x00) { // Symmetric Algorithm: aes 128 ccm (0) - v = (byte) subjectAttributes.read(); + v = (byte) subjectAttributes.read(); p_keys.write(v); - System.out.println("SecurityHelper.decodeCertificate: ECC Point Type: =" + v); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: ECC Point Type: =" + v); if (v == 0x02) { // ECC Point Type: compressed lsb y-0(2) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Encryption lsb y-0 key=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Encryption lsb y-0 key=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } else if (v == 0x03) { // ECC Point Type: compressed lsb y-1(3) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Encryption lsb y-1 key=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Encryption lsb y-1 key=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } else if (v == 0x04) { // ECC Point Type: uncompressed (4) byte[] key = new byte[32]; subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Encryption key1=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Encryption key1=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); subjectAttributes.read(key, 0, 32); - System.out.println("SecurityHelper.decodeCertificate: Encryption key2=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Encryption key2=" + ByteHelper.byteArrayToString(key)); p_keys.write(key); } // FIXME To be continued } // FIXME To be continued @@ -475,41 +513,49 @@ public class SecurityHelper { // Assurance level if (v != 0x02) { - System.err.println("SecurityHelper.decodeCertificate: Assurance level expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Assurance level expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); return null; } v = (byte) subjectAttributes.read(); // Skip assurance level value - System.out.println("SecurityHelper.decodeCertificate: assurance level value=" + v); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: assurance level value=" + v); if (subjectInfoType == 0x01) { // Authorization Ticket if (subjectAttributes.read() != 0x21) { // Subject Attribute: its aid ssp list (33) - System.err.println("SecurityHelper.decodeCertificate: Its aid ssp list expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Its aid ssp list expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); return null; } length = tls2size(subjectAttributes); - System.out.println("SecurityHelper.decodeCertificate: Its aid ssp length=" + length); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Its aid ssp length=" + length); byte[] its_aid_ssp_list = new byte[(int) length]; subjectAttributes.read(its_aid_ssp_list, 0, (int) length); - System.out.println("SecurityHelper.decodeCertificate: its_aid_list=" + ByteHelper.byteArrayToString(its_aid_ssp_list)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: its_aid_list=" + ByteHelper.byteArrayToString(its_aid_ssp_list)); + byte[] padding = new byte[32 - (int) length]; + ByteHelper.fill(padding, 32 - (int) length, (byte)0x00); + p_lowerInfo.put( + SecurityHelper.SEC_SSP, + ByteHelper.concat( + padding, + its_aid_ssp_list + )); // TODO Process ATS AID list } else if (subjectInfoType == 0x02) { // Authorization Authority if (subjectAttributes.read() != 0x20) { // Subject Attribute: its aid ssp (32) - System.err.println("SecurityHelper.decodeCertificate: Its aid list expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Its aid list expected - " + ByteHelper.byteArrayToString(cert.toByteArray())); return null; } length = tls2size(subjectAttributes); - System.out.println("SecurityHelper.decodeCertificate: its_aid_list length=" + length); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: its_aid_list length=" + length); byte[] its_aid_list = new byte[(int) length]; subjectAttributes.read(its_aid_list, 0, (int) length); - System.out.println("SecurityHelper.decodeCertificate: its_aid_list=" + ByteHelper.byteArrayToString(its_aid_list)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: its_aid_list=" + ByteHelper.byteArrayToString(its_aid_list)); // TODO Process ATS AID list } else { - System.err.println("SecurityHelper.decodeCertificate: Unknown subjectInfoType - " + subjectInfoType); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Unknown subjectInfoType - " + subjectInfoType); return null; } // Validity restrictions length = tls2size(headerfields); - System.out.println("SecurityHelper.decodeCertificate: Length=" + length + " / " + headerfields.available()); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Length=" + length + " / " + headerfields.available()); cert.write(size2tls((int)length)); v = (byte)headerfields.read(); if (v == 0x00) { // Validity Restriction: time end (0) @@ -518,11 +564,11 @@ public class SecurityHelper { headerfields.read(time, 0, 4); cert.write(time); int endTime = ByteHelper.byteArrayToInt(time); - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: endTime=" + endTime); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: endTime=" + endTime); // Check times long currentTime = (System.currentTimeMillis() - 1072915200000L) / 1000L; if (currentTime > endTime) { - System.err.println("SecurityHelper.decodeCertificate: Validity Restriction: time end not matched"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Validity Restriction: time end not matched"); return null; } v = (byte)headerfields.read(); @@ -533,16 +579,16 @@ public class SecurityHelper { headerfields.read(time, 0, 4); cert.write(time); int startTime = ByteHelper.byteArrayToInt(time); - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: startTime=" + startTime); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: startTime=" + startTime); headerfields.read(time, 0, 4); cert.write(time); int endTime = ByteHelper.byteArrayToInt(time); - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: endTime=" + endTime); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: endTime=" + endTime); // Check times long currentTime = (System.currentTimeMillis() - 1072915200000L) / 1000L; - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: currentTime=" + currentTime); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: currentTime=" + currentTime); if ((currentTime < startTime) || (currentTime > endTime)) { - System.err.println("SecurityHelper.decodeCertificate: Validity Restriction: time start and end not matched"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Validity Restriction: time start and end not matched"); return null; } v = (byte)headerfields.read(); @@ -553,14 +599,14 @@ public class SecurityHelper { headerfields.read(time, 0, 4); cert.write(time); int startTime = ByteHelper.byteArrayToInt(time); - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: startTime=" + startTime); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: startTime=" + startTime); byte[] dur = new byte[2]; headerfields.read(dur, 0, 2); cert.write(dur); short duration = ByteHelper.byteArrayToShort(dur); - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: duration=" + duration); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: duration=" + duration); int unit = (duration & 0xe0000) >>> 13; - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: unit=" + unit); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: unit=" + unit); long value = (duration & 0x1fff); switch (unit) { case 0: @@ -573,14 +619,14 @@ public class SecurityHelper { value *= 3600; break; default: - System.err.println("SecurityHelper.decodeCertificate: Validity Restriction: time start and duration not processed"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Validity Restriction: time start and duration not processed"); value = Long.MAX_VALUE; } // End of 'switch' statement - System.out.println("SecurityHelper.decodeCertificate: Validity Restriction: value=" + value); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Validity Restriction: value=" + value); // Check times long currentTime = (System.currentTimeMillis() - 1072915200000L) / 1000L; if ((currentTime < startTime) || (currentTime > (startTime + value))) { - System.err.println("SecurityHelper.decodeCertificate: Validity Restriction: time start and duration not matched"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Validity Restriction: time start and duration not matched"); return null; } v = (byte)headerfields.read(); @@ -596,15 +642,15 @@ public class SecurityHelper { byte[] lat = new byte[4]; headerfields.read(lat, 0, lat.length); cert.write(lat); - System.out.println("SecurityHelper.decodeCertificate: Circle lat=" + ByteHelper.byteArrayToString(lat)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Circle lat=" + ByteHelper.byteArrayToString(lat)); byte[] lon = new byte[4]; headerfields.read(lon, 0, lon.length); cert.write(lon); - System.out.println("SecurityHelper.decodeCertificate: Circle lon=" + ByteHelper.byteArrayToString(lon)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Circle lon=" + ByteHelper.byteArrayToString(lon)); byte[] rad = new byte[2]; headerfields.read(rad, 0, rad.length); cert.write(rad); - System.out.println("SecurityHelper.decodeCertificate: Circle rad=" + ByteHelper.byteArrayToInt(rad)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Circle rad=" + ByteHelper.byteArrayToInt(rad)); } else if (v == 0x02) { // rectangle (2) int rlength = (int) tls2size(headerfields); cert.write(size2tls(rlength)); @@ -621,10 +667,10 @@ public class SecurityHelper { byte[] llon = new byte[4]; headerfields.read(llon, 0, llon.length); cert.write(llon); - System.out.println("SecurityHelper.decodeCertificate: Rectangle ulat=" + ByteHelper.byteArrayToString(ulat)); - System.out.println("SecurityHelper.decodeCertificate: Rectangle ulon=" + ByteHelper.byteArrayToString(ulon)); - System.out.println("SecurityHelper.decodeCertificate: Rectangle llat=" + ByteHelper.byteArrayToString(llat)); - System.out.println("SecurityHelper.decodeCertificate: Rectangle llon=" + ByteHelper.byteArrayToString(llon)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Rectangle ulat=" + ByteHelper.byteArrayToString(ulat)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Rectangle ulon=" + ByteHelper.byteArrayToString(ulon)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Rectangle llat=" + ByteHelper.byteArrayToString(llat)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Rectangle llon=" + ByteHelper.byteArrayToString(llon)); rlength -= 4 * 4; } } else if (v == 0x03) { // polygon (3) @@ -638,14 +684,14 @@ public class SecurityHelper { byte[] lon = new byte[4]; headerfields.read(lon, 0, lon.length); cert.write(lon); - System.out.println("SecurityHelper.decodeCertificate: poly point lat=" + ByteHelper.byteArrayToString(lat)); - System.out.println("SecurityHelper.decodeCertificate: poly point lon=" + ByteHelper.byteArrayToString(lon)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: poly point lat=" + ByteHelper.byteArrayToString(lat)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: poly point lon=" + ByteHelper.byteArrayToString(lon)); plength -= 2 * 4; } headerfields.read(polygonalRegion, 0, polygonalRegion.length); cert.write(polygonalRegion); // TODO Process Validity Restriction - System.out.println("SecurityHelper.decodeCertificate: polygonal=" + ByteHelper.byteArrayToString(polygonalRegion)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: polygonal=" + ByteHelper.byteArrayToString(polygonalRegion)); } else if (v == 0x04) { // id (4) v = (byte)headerfields.read(); @@ -656,15 +702,15 @@ public class SecurityHelper { int lr = (int) tls2size(headerfields); cert.write(size2tls((int) lr)); // TODO Process Validity Restriction - System.out.println("SecurityHelper.decodeCertificate: Region t=" + v); - System.out.println("SecurityHelper.decodeCertificate: Region ri=" + ByteHelper.byteArrayToString(ri)); - System.out.println("SecurityHelper.decodeCertificate: Region lr=" + lr); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Region t=" + v); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Region ri=" + ByteHelper.byteArrayToString(ri)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Region lr=" + lr); } else { - System.err.println("SecurityHelper.decodeCertificate: Unexpected geographical region"); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Unexpected geographical region"); return null; } } - System.out.println("SecurityHelper.decodeCertificate: Before signature: " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Before signature: " + ByteHelper.byteArrayToString(cert.toByteArray())); // Signature byte publicKeyAlg = (byte)headerfields.read(); cert.write(publicKeyAlg); @@ -677,25 +723,25 @@ public class SecurityHelper { byte[] key = new byte[64]; headerfields.read(key, 0, key.length); cert.write(key); - System.out.println("SecurityHelper.decodeCertificate: Signature=" + ByteHelper.byteArrayToString(key)); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Signature=" + ByteHelper.byteArrayToString(key)); break; } // End of 'switch' statement break; } // End of 'switch' statement // TODO Check certificate signature - System.out.println("SecurityHelper.decodeCertificate: Processed cert=" + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logDebug("SecurityHelper.decodeCertificate: Processed cert=" + ByteHelper.byteArrayToString(cert.toByteArray())); return cert.toByteArray(); } catch (IOException e) { e.printStackTrace(); } - System.err.println("SecurityHelper.decodeCertificate: Unsupported certificate - " + ByteHelper.byteArrayToString(cert.toByteArray())); + //TERFactory.getInstance().logError("SecurityHelper.decodeCertificate: Unsupported certificate - " + ByteHelper.byteArrayToString(cert.toByteArray())); return null; } public boolean extractMessageSignature(final byte[] p_secureTrailer, final ByteArrayOutputStream p_signature) { - System.out.println(">>> SecurityHelper.extractMessageSignature: " + ByteHelper.byteArrayToString(p_secureTrailer)); + //TERFactory.getInstance().logDebug(">>> SecurityHelper.extractMessageSignature: " + ByteHelper.byteArrayToString(p_secureTrailer)); // Sanity check if (p_secureTrailer.length == 0) { @@ -706,15 +752,15 @@ public class SecurityHelper { int secureTrailerIndex = 0; if (p_secureTrailer[secureTrailerIndex++] == 0x01) { // Trailer Type: signature (1) if (p_secureTrailer[secureTrailerIndex++] == 0x00) { // Public Key Alg: ecdsa nistp256 with sha256 (0) - byte v = p_secureTrailer[secureTrailerIndex++]; - if ((v == 0x00) || (v == 0x02)) { // ECC Point Type: compressed lsb y-0 (2) + byte v = p_secureTrailer[secureTrailerIndex++]; + if ((v == 0x00) || (v == 0x02)) { // ECC Point Type: compressed lsb y-0 (2) if (p_secureTrailer.length == (3 + 2 * 32)) { // Build the signature vector try { p_signature.write(new byte[] { (byte)0x00, (byte)0x00 }); p_signature.write(ByteHelper.extract(p_secureTrailer, 3, 64)); - System.out.println("<<< SecurityHelper.extractMessageSignature: true"); + //TERFactory.getInstance().logDebug("<<< SecurityHelper.extractMessageSignature: true"); return true; } catch (IOException e) { e.printStackTrace(); @@ -725,14 +771,14 @@ public class SecurityHelper { } // FIXME To be continued // Else, drop it - System.err.println("SecurityHelper.extractMessageSignature: Drop packet - Wrong signature"); + //TERFactory.getInstance().logError("SecurityHelper.extractMessageSignature: Drop packet - Wrong signature"); return false; } public byte[] calculateDigestFromCertificate(final byte[] p_toBeHashedData) { - System.out.println("SecurityHelper.calculateDigestFromCertificate: " + ByteHelper.byteArrayToString(p_toBeHashedData)); + //TERFactory.getInstance().logDebug("SecurityHelper.calculateDigestFromCertificate: " + ByteHelper.byteArrayToString(p_toBeHashedData)); byte[] hash = CryptoLib.hashWithSha256(p_toBeHashedData); - System.out.println("SecurityHelper.calculateDigestFromCertificate: " + ByteHelper.byteArrayToString(hash)); + //TERFactory.getInstance().logDebug("SecurityHelper.calculateDigestFromCertificate: " + ByteHelper.byteArrayToString(hash)); return ByteHelper.extract(hash, hash.length - 8, 8); } diff --git a/javasrc/adapter/org/etsi/its/adapter/TestAdapter.java b/javasrc/adapter/org/etsi/its/adapter/TestAdapter.java index c4094a4c5dae3687ad053fd3a7c68dfac0bfba60..7da167882811e90c32aeed9c458ae62ffc23a1fb 100644 --- a/javasrc/adapter/org/etsi/its/adapter/TestAdapter.java +++ b/javasrc/adapter/org/etsi/its/adapter/TestAdapter.java @@ -14,6 +14,7 @@ import java.util.Observer; import org.etsi.adapter.ITERequired; import org.etsi.adapter.TERFactory; import org.etsi.its.adapter.ports.AdapterControlPort; +import org.etsi.its.adapter.ports.ConfigTesterPort; import org.etsi.its.adapter.ports.IPort; import org.etsi.its.adapter.ports.PortEvent; import org.etsi.its.adapter.ports.ProtocolPortFactory; @@ -92,6 +93,8 @@ public class TestAdapter implements TriCommunicationSA, Observer { port = new AdapterControlPort(portName, ComponentId); } else if (tsiPortId.getPortName().toLowerCase().endsWith("utport")) { port = new UpperTesterPort(portName, ComponentId); + } else if (tsiPortId.getPortName().toLowerCase().endsWith("cfport")) { + port = new ConfigTesterPort(portName, ComponentId); } else { String componentName = compPortId.getComponent().getComponentName(); @@ -141,7 +144,7 @@ public class TestAdapter implements TriCommunicationSA, Observer { } port.send(message.getEncodedMessage()); - return required.getTriStatus(TriStatus.TRI_OK); + return required.getTriStatus(TriStatus.TRI_OK); } /* (non-Javadoc) diff --git a/javasrc/adapter/org/etsi/its/adapter/UdpMultiplexer.java b/javasrc/adapter/org/etsi/its/adapter/UdpMultiplexer.java new file mode 100644 index 0000000000000000000000000000000000000000..804b6734afdddf556864281fd4aad0d4461039ac --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/UdpMultiplexer.java @@ -0,0 +1,152 @@ +package org.etsi.its.adapter; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.util.HashMap; +import java.util.Map; +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.UdpMultiplexer; +import org.etsi.its.adapter.layers.Layer; + +public class UdpMultiplexer { + + /** + * Parameter name for UDP port destination + */ + public static final String UDP_PORT_KEY = "Udport"; + + public String UdpAddress = "10.200.1.101"; // FIXME Use a generic way to retrieve UDP settings + + public int UdpRecvPort = 18501; // FIXME Use a generic way to retrieve UDP settings + + public int UdpSendPort = 18502; // FIXME Use a generic way to retrieve UDP settings + + /** + * Unique instance of the factory + */ + private static final UdpMultiplexer instance = new UdpMultiplexer(); + + private Map clientsToMacs = new HashMap(); + + //private Map clientsToFrameTypes = new HashMap(); + + private HashMap clientsToLayers = new HashMap(); + + private DatagramSocket iutSocket; + private InetAddress iutAddress; + private int iutPort; + private Thread iutThread; + + /** + * Gets the unique factory instance + * @return UdpMultiplexer instance + */ + public static UdpMultiplexer getInstance(){ + return instance; + } + + public UdpMultiplexer() { + } + + public synchronized void register(Layer client, byte[] macAddress, short frameType) { + //TERFactory.getInstance().logDebug(">>>UdpMultiplexer.registering: " + frameType); + + if(clientsToMacs.isEmpty()) { + try { + iutAddress = InetAddress.getByName(UdpAddress); + //TERFactory.getInstance().logDebug("UdpIpLayer.register: IUT Address: " + iutAddress.getHostAddress()); + iutPort = UdpSendPort; + iutSocket = new DatagramSocket(UdpRecvPort); + iutThread = new UdpThread(iutSocket); + iutThread.start(); + } catch (Exception e) { + e.printStackTrace(); + } + } + // Register client + clientsToMacs.put(client.toString(), macAddress); + clientsToLayers.put(client.toString(), client); + //clientsToFrameTypes.put(client.toString(), frameType); + } + + public synchronized void unregister(Layer client) { + if(clientsToMacs.containsKey(client.toString())) { + clientsToMacs.remove(client.toString()); + //clientsToFrameTypes.remove(client.toString()); + clientsToLayers.remove(client.toString()); + + if(clientsToMacs.isEmpty()) { + iutSocket.close(); + iutThread.interrupt(); + try { + iutThread.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + + public byte[] send(Layer client, byte[] dest, byte[] payload, Map params) { + + if(clientsToMacs.containsKey(client.toString())) { + + DatagramPacket packet = null; + if(params.containsKey(UDP_PORT_KEY)) { + packet = new DatagramPacket(payload, payload.length, iutAddress, Integer.parseInt((String) params.get(UDP_PORT_KEY))); + } else { + packet = new DatagramPacket(payload, payload.length, iutAddress, iutPort); + } + try { + iutSocket.send(packet); + return packet.getData(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + return null; + } + + private class UdpThread extends Thread { + + private DatagramSocket taSocket; + private boolean running = true; + + public UdpThread(DatagramSocket taSocket) throws IOException { + this.taSocket = taSocket; + } + + @Override + public void run() { + + while(running) { + try { + byte[] buf = new byte[4096]; + + // receive packet + DatagramPacket packet = new DatagramPacket(buf, buf.length); + taSocket.receive(packet); + + byte[] buffer = ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()); + if(buffer.length < 28) { + continue; + } + + Map lowerInfo = new HashMap(); + lowerInfo.put(Layer.RECEPTION_TIMESTAMP, System.currentTimeMillis()); + + // Dispatch + for (String mapKey : clientsToMacs.keySet()) { + clientsToLayers.get(mapKey).receive(buffer, lowerInfo); + } + } catch (IOException e) { + running = false; + } + } + } + } + +} diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/BtpLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/BtpLayer.java index 8c4d593a2e26d799b84f3a5059e918207a402375..ee098d08bf8d3f69e31eb38ed74fe6e6ba2d0783 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/BtpLayer.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/BtpLayer.java @@ -23,108 +23,108 @@ public class BtpLayer extends Layer { /** * Parameter name for BTP packet type */ - public static final String BTP_TYPE = "BtpType"; - + public static final String BTP_TYPE = "BtpType"; + /** * Parameter name for BTP destination port - */ - public static final String BTP_DSTPORT = "BtpDstPort"; + */ + public static final String BTP_DSTPORT = "BtpDstPort"; /** * Parameter name for BTP source port - */ - public static final String BTP_SRCPORT = "BtpSrcPort"; - + */ + public static final String BTP_SRCPORT = "BtpSrcPort"; + /** * Parameter name for BTP destination port information - */ - public static final String BTP_DSTPORTINFO = "BtpDstPortInfo"; - + */ + public static final String BTP_DSTPORTINFO = "BtpDstPortInfo"; + /** * BTP packet type A */ - public static final int TYPE_A = 0; - + public static final int TYPE_A = 0; + /** * BTP packet type B - */ - public static final int TYPE_B = 1; - + */ + public static final int TYPE_B = 1; + /** * Constructor * @param management Layer management instance * @param lowerStack Lower protocol stack */ - public BtpLayer(IManagementLayers management, Stack lowerStack) { - super(management, lowerStack); - } + public BtpLayer(IManagementLayers management, Stack lowerStack) { + super(management, lowerStack); + } - /* (non-Javadoc) - * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) - */ - @Override - public boolean send(byte[] message, Map params) { - - // Destination Port (16 bits) - int dstPort; - try { - dstPort = (Integer)params.get(BTP_DSTPORT); - } - catch (NullPointerException e) { - dstPort = 0; - } - byte[] encapsulated = ByteHelper.intToByteArray(dstPort, 2); - - if(params.get(BTP_TYPE).equals(TYPE_A)) { - // Source Port (16 bits) - int srcPort; - try { - srcPort = (Integer)params.get(BTP_SRCPORT); - } - catch (NullPointerException e) { - srcPort = 0; - } - encapsulated = ByteHelper.concat(encapsulated, ByteHelper.intToByteArray(srcPort, 2)); - } - else { - // Destination port info (16 bits) - int dstPortInfo; - try { - dstPortInfo = (Integer)params.get(BTP_DSTPORTINFO); - } - catch (NullPointerException e) { - dstPortInfo = 0; - } - encapsulated = ByteHelper.concat(encapsulated, ByteHelper.intToByteArray(dstPortInfo, 2)); - } + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) + */ + @Override + public boolean send(byte[] message, Map params) { + + // Destination Port (16 bits) + int dstPort; + try { + dstPort = (Integer)params.get(BTP_DSTPORT); + } + catch (NullPointerException e) { + dstPort = 0; + } + byte[] encapsulated = ByteHelper.intToByteArray(dstPort, 2); + + if(params.get(BTP_TYPE).equals(TYPE_A)) { + // Source Port (16 bits) + int srcPort; + try { + srcPort = (Integer)params.get(BTP_SRCPORT); + } + catch (NullPointerException e) { + srcPort = 0; + } + encapsulated = ByteHelper.concat(encapsulated, ByteHelper.intToByteArray(srcPort, 2)); + } + else { + // Destination port info (16 bits) + int dstPortInfo; + try { + dstPortInfo = (Integer)params.get(BTP_DSTPORTINFO); + } + catch (NullPointerException e) { + dstPortInfo = 0; + } + encapsulated = ByteHelper.concat(encapsulated, ByteHelper.intToByteArray(dstPortInfo, 2)); + } - // Update params -// if(lowerLayerName != null && lowerLayerName.equals("GN")) { -// params.put(GnLayer.GN_NEXTHEADER, "BTP-A"); // TODO Alex to confirm removal -// } - - return super.send(ByteHelper.concat(encapsulated, message), params); - } - - /* (non-Javadoc) - * @see org.etsi.its.adapter.layers.Layer#receive(byte[]) - */ - @Override - public void receive(byte[] message, Map lowerInfo) { - - byte[] dstPort = new byte[2]; - System.arraycopy(message, 0, dstPort, 0, 2); - - byte[] srcPort = new byte[2]; - System.arraycopy(message, 2, srcPort, 0, 2); - - int payloadLength = message.length - 4; - byte[] payload = new byte[payloadLength]; - System.arraycopy(message, 4, payload, 0, payloadLength); - + // Update params +// if(lowerLayerName != null && lowerLayerName.equals("GN")) { +// params.put(GnLayer.GN_NEXTHEADER, "BTP-A"); // TODO Alex to confirm removal +// } + + return super.send(ByteHelper.concat(encapsulated, message), params); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#receive(byte[]) + */ + @Override + public void receive(byte[] message, Map lowerInfo) { + + byte[] dstPort = new byte[2]; + System.arraycopy(message, 0, dstPort, 0, 2); + + byte[] srcPort = new byte[2]; + System.arraycopy(message, 2, srcPort, 0, 2); + + int payloadLength = message.length - 4; + byte[] payload = new byte[payloadLength]; + System.arraycopy(message, 4, payload, 0, payloadLength); + lowerInfo.put(BTP_DSTPORT, dstPort); lowerInfo.put(BTP_DSTPORTINFO, srcPort); - - super.receive(payload, lowerInfo); - } + + super.receive(payload, lowerInfo); + } } diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/CommsigniaLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/CommsigniaLayer.java new file mode 100644 index 0000000000000000000000000000000000000000..22226ee1c6051c291864274c24f4c34a9163d829 --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/layers/CommsigniaLayer.java @@ -0,0 +1,296 @@ +package org.etsi.its.adapter.layers; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; +import java.util.concurrent.TimeoutException; + +import org.etsi.adapter.TERFactory; +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.IManagementLayers; +import org.etsi.its.adapter.PcapMultiplexer; + +import com.commsignia.v2x.client.ITSApplication; +import com.commsignia.v2x.client.MessageSet; +import com.commsignia.v2x.client.exception.ClientException; +import com.commsignia.v2x.client.model.BTPType; +import com.commsignia.v2x.client.model.InjectData; +import com.commsignia.v2x.client.model.InjectData.Builder; +import com.commsignia.v2x.client.model.InjectData.Type; +import com.commsignia.v2x.client.model.dev.DeviceInfoResponse; +import com.commsignia.v2x.client.model.dev.FacilityModule; + +public class CommsigniaLayer extends Layer implements IEthernetSpecific { + + private static final byte[] DeviceMacAddress = new byte[] { (byte)0x70, (byte)0xb3, (byte)0xd5, (byte)0xf2, (byte)0xa1, (byte)0xe3 }; + private static final String TargetHost = "10.200.1.101"; + private static final int TargetPort = 7942; + private static final int SourcePort = 7943; + private static final int ItsAid = 5; + private static final int InterfaceID = 2; + private static final int TxPowerDbm = -32; // Max value: -33dBm, RSU: -30dBm, Lab: -10dBm + private static String pcapFilter = null; + + /** + * Well-known Ethernet broadcast address + */ + public static byte[] MAC_BROADCAST = new byte[]{(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF}; + + /** + * Parameter name for Link-Layer destination + */ + public static final String LINK_LAYER_DESTINATION = "LinkLayerDestination"; + + private Map ClientsToMacs = new HashMap(); + private Map ClientsToFrameTypes = new HashMap(); + private HashMap ClientsToLayers = new HashMap(); + + /** + * Constructor + * @param management Layer management instance + * @param lowerStack Lower protocol stack + */ + public CommsigniaLayer(IManagementLayers management, Stack lowerStack) { + super(management, lowerStack); + + MessageSet defaultMessageSet = MessageSet.C; + itsApplication = new ITSApplication(ItsAid, TargetHost, TargetPort, defaultMessageSet); + try { + itsApplication.connect(1000); + itsApplication.registerBlocking(); +// itsApplication.setFacilityModuleStatus(FacilityModule.BSM, false); +// itsApplication.setFacilityModuleStatus(FacilityModule.CAM, false); +// itsApplication. gnBindBlocking(BTPType.NONE, 65535); + } catch (TimeoutException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#register(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void register(Layer upperLayer) { + TERFactory.getInstance().logDebug(">>> CommsigniaLayer.register: " + upperLayer); + + if(registeredUpperLayer == null) { + super.register(upperLayer); + + try { + Method getEthernetType = registeredUpperLayer.getClass().getMethod("getEthernetType", (Class[])null); + if (getEthernetType != null) { + upperLayerFrameType = (Short) getEthernetType.invoke(registeredUpperLayer, (Object[]) null); + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + + localMacAddress = management.getLinkLayerAddress(); + PcapMultiplexer.getInstance().register(this, DeviceMacAddress, this.getEthernetType()); + } + + if(ClientsToMacs.isEmpty()) { + pcapFilter = + "udp dst port " + SourcePort + +// " and not ether[0x56:4]==0x04e54800 and not ether[0x56:4]==0x04f02122 and not ether[0x56:4]==0xa60e3f16 and not ether[0x56:4]==0x04e54800 and not ether[0x56:4]==0x92232f44 and not ether[0x56:4]==0x4a74556d" + + " and not ether[0x56:4]==0x4a74556d" + + " and "; + } else { + TERFactory.getInstance().logDebug("CommsigniaLayer.register: Another Client !"); + pcapFilter = pcapFilter + " and "; + } + // Update Filter + String strMacAddress = String.format("%02x%02x%02x%02x", localMacAddress[0], localMacAddress[1], localMacAddress[2], localMacAddress[3]); +// String strMacAddress = String.format("%02x", localMacAddress[0]); +// for(int i=1; i < localMacAddress.length; i++) { +// strMacAddress += String.format(":%02x", localMacAddress[i]); +// } + //udp dst port 7493 && wlan src 8b:ad:f0:0d:01:02 + pcapFilter = pcapFilter + "not ether[0x56:4]==0x" + strMacAddress; + // Reset filter + System.out.println("Reset PCAP filter: " + pcapFilter); + PcapMultiplexer.getInstance().resetFilter(pcapFilter); + // Register client + ClientsToMacs.put(this.toString(), localMacAddress); + ClientsToLayers.put(this.toString(), upperLayer); + ClientsToFrameTypes.put(this.toString(), upperLayerFrameType); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#receive(byte[]) + */ + @Override + public void receive(byte[] message, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> CommsigniaLayer.receive: " + ByteHelper.byteArrayToString(message)); + + if (message.length <= 20+8+29+26) { // TODO To be refine + // Skip it + return; + } + ByteBuffer byteBuffer = ByteBuffer.wrap(message); + + // Skip C2P protocol + byteBuffer.position( + 20 + // IP Layer: 45 00 01 1f 13 8c 00 00 80 11 6b 0b ac 11 0f 26 ff ff ff ff + 8 + // UDP Layer: 75 30 1f 07 01 0b a6 cd + 34 + // C2P Layer: 12 00 00 33 41 00 00 03 5c ac 00 02 0c 02 35 a4 e9 01 6b 49 d2 01 3f ff 00 00 7f ff 16 + 4 // IEEE 802.11L Layer: 88 00 00 00 00 + ); + + // Extract Dst + byte[] dst = new byte[6]; + byteBuffer.get(dst, 0, dst.length); + lowerInfo.put(EthernetLayer.LINK_LAYER_DESTINATION, dst); + + // Skip Src + byteBuffer.position(byteBuffer.position() + 6); + + // Skip IEEE 802.11L Layer + byteBuffer.position(byteBuffer.position() + 10); + + // Skip LLC header + byteBuffer.position(byteBuffer.position() + 6); + + // Extract FrameType info + byte[] rawFrameType = new byte[2]; + byteBuffer.get(rawFrameType, 0, rawFrameType.length); + short frameType = ByteHelper.byteArrayToInt(rawFrameType).shortValue(); + + // Extract Data + byte[] data = new byte[byteBuffer.remaining()]; + byteBuffer.get(data, 0, byteBuffer.remaining()); + + // Dispatch + for (String mapKey : ClientsToMacs.keySet()) { + if(frameType == ClientsToFrameTypes.get(mapKey)) { + if(Arrays.equals(dst, MAC_BROADCAST) || Arrays.equals(dst, ClientsToMacs.get(mapKey))) { + ClientsToLayers.get(mapKey).receive(data, lowerInfo); + } + } + } + + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) + */ + @Override + public boolean send(byte[] message, Map params) { + //TERFactory.getInstance().logDebug(">>> CommsigniaLayer.send: " + ByteHelper.byteArrayToString(message)); + + byte[] dst = (byte[])params.get(LINK_LAYER_DESTINATION); + if(dst == null) { + dst = MAC_BROADCAST; + } + + byte[] packet = ByteHelper.concat( + dst, + localMacAddress, + ByteHelper.intToByteArray(upperLayerFrameType, 2), + message + ); + + try { + String dstAddress = String.format( + "%02x:%02x:%02x:%02x:%02x:%02x", + dst[0], + dst[1], + dst[2], + dst[3], + dst[4], + dst[5]); + String srcAddress = String.format( + "%02x:%02x:%02x:%02x:%02x:%02x", + localMacAddress[0], + localMacAddress[1], + localMacAddress[2], + localMacAddress[3], + localMacAddress[4], + localMacAddress[5]); + Builder build = new InjectData.Builder(); + build + .withDstAddress(dstAddress) + .withSrcAddress(srcAddress) + .withType(Type.GNP) + .withInterfaceID(InterfaceID) + .withTxPowerDbm(TxPowerDbm) + .withData(message); + InjectData injectData = build.build(); + //TERFactory.getInstance().logDebug("CommsigniaLayer.send: " + ByteHelper.byteArrayToString(injectData.getData())); + + itsApplication.sendOnRadioBlocking(injectData); + //TERFactory.getInstance().logDebug("<<< CommsigniaLayer.send: " + ByteHelper.byteArrayToString(packet)); + return true;//super.send(packet, params); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); + } + + return false; + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#unregister(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void unregister(Layer upperLayer) { + PcapMultiplexer.getInstance().unregister(this); + if(ClientsToMacs.containsKey(this.toString())) { + ClientsToMacs.remove(this.toString()); + ClientsToFrameTypes.remove(this.toString()); + ClientsToLayers.remove(this.toString()); + + if(ClientsToMacs.isEmpty()) { + if (itsApplication != null) { + try { +// itsApplication.gnCloseBlocking(BTPType.NONE, 65535); + itsApplication.deregisterBlocking(); + } catch (ClientException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + itsApplication.shutdown(); + itsApplication = null; + } + } + } + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.IEthernetSpecific#getEthernetType() + */ + @Override + public short getEthernetType() { + return (short)0x0800; + } + + /** + * Local Ethernet address + */ + private byte[] localMacAddress; + + /** + * Upper layer's frame type + */ + private short upperLayerFrameType; + + private ITSApplication itsApplication = null; + +} diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/EthernetLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/EthernetLayer.java index 2b15bbaa86b15bc855056a91c39b71167c4e1096..803e4902375ebc4f00daf3f530f5e7478a87ead3 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/EthernetLayer.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/EthernetLayer.java @@ -20,7 +20,7 @@ import org.etsi.its.adapter.PcapMultiplexer; * Implementation of Ethernet layer using jpcap (background thread) */ public class EthernetLayer extends Layer { - + /** * Well-known Ethernet broadcast address */ diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/GnLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/GnLayer.java index b6e5450348389dec7a23e02c1d814052480ae74d..13d4e8484eff6db92ff590b4d06d8115a2d4b4c1 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/GnLayer.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/GnLayer.java @@ -90,7 +90,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { * Parameter name for packet's lifetime */ public static final String GN_LIFETIME = "GnLifetime"; - + /** * GeoNetworking header type for unknown messages */ @@ -237,7 +237,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { */ @Override public boolean send(byte[] message, Map params) { - System.out.println(">>> GnLayer.send: " + ByteHelper.byteArrayToString(message)); + //TERFactory.getInstance().logDebug(">>> GnLayer.send: " + ByteHelper.byteArrayToString(message)); byte [] extHdr = null; int ht; @@ -296,10 +296,10 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { if (!management.isSecuredModeSet()) { // Secure mode disabled toBeSent = ByteHelper.concat(basicHdr, commonHdr, extHdr, message); } else { - toBeSent = createSecuredMessage(basicHdr, commonHdr, extHdr, message); + toBeSent = createSecuredMessage(basicHdr, commonHdr, extHdr, message, params); } - System.out.println("<<< GnLayer.send: " + ByteHelper.byteArrayToString(toBeSent)); + //TERFactory.getInstance().logDebug("<<< GnLayer.send: " + ByteHelper.byteArrayToString(toBeSent)); return super.send(toBeSent, params); } @@ -308,7 +308,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { */ @Override public void receive(byte[] message, Map lowerInfo) { - System.out.println(">>> GnLayer.receive: " + ByteHelper.byteArrayToString(message)); + //TERFactory.getInstance().logDebug(">>> GnLayer.receive: " + ByteHelper.byteArrayToString(message)); byte[] basicHdr = new byte[4]; System.arraycopy(message, 0, basicHdr, 0, 4); @@ -350,7 +350,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { params.put(GN_DEPV, depv); params.put(GN_TYPE, HT_LS); params.put(GN_SUBTYPE, HST_LSREPLY); - System.out.println("GnLayer.receive: Send LS_REPLAY in unsecured mode"); + //TERFactory.getInstance().logDebug("GnLayer.receive: Send LS_REPLAY in unsecured mode"); send(null, params); } } @@ -361,23 +361,34 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { else { // Other messages if(payloadLength > 0) { - byte[] payload = new byte[payloadLength]; - System.arraycopy(message, message.length - payloadLength, payload, 0, payloadLength); + byte[] mpayload = new byte[payloadLength]; + int extendedHeader = 0; + if (headerType == 1) { // Beacon + extendedHeader = 24; + } else if (headerType == 4) { // Geo Broadcast + extendedHeader = 44; + } else if (headerType == 5) { // Topology-Scoped Broadcast + extendedHeader = 28; + } // TODO To be continued + System.arraycopy(message, basicHdr.length + commonHdr.length + extendedHeader, mpayload, 0, payloadLength); lowerInfo.put(GN_NEXTHEADER, nextHeader); lowerInfo.put(GN_TYPE, headerType); lowerInfo.put(GN_SUBTYPE, headerSubType); lowerInfo.put(GN_LIFETIME, lifetime); lowerInfo.put(GN_TRAFFICCLASS, trafficClass); - super.receive(payload, lowerInfo); + super.receive(mpayload, lowerInfo); } } + // Security disable, null will be translated into omit + lowerInfo.put(SecurityHelper.SEC_SSP, null); + lowerInfo.put(SecurityHelper.SEC_ITS_AID, null); } else if (nextHeader == 0x02) { // Secured tag - byte[] payload = SecurityHelper.getInstance().checkSecuredProfileAndExtractPayload(message, basicHdr.length, management.isEnforceSecuredModeSet(), management.getItsAidOther()); + byte[] payload = SecurityHelper.getInstance().checkSecuredProfileAndExtractPayload(message, basicHdr.length, management.isEnforceSecuredModeSet(), management.getItsAidOther(), lowerInfo); if (payload != null) { -// System.out.println("GnLayer.receive: payload=" + ByteHelper.byteArrayToString(payload)); + //TERFactory.getInstance().logDebug("GnLayer.receive: payload=" + ByteHelper.byteArrayToString(payload)); byte[] commonHdr = new byte[8]; System.arraycopy(payload, 0, commonHdr, 0, 8); -// System.out.println("GnLayer.receive: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); + //TERFactory.getInstance().logDebug("GnLayer.receive: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); nextHeader = (byte)((commonHdr[0] & (byte)0xF0) >> 4); int trafficClass = (int)(commonHdr[2]); @@ -389,7 +400,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { byte[] pl = new byte[2]; System.arraycopy(commonHdr, 4, pl , 0, 2); int payloadLength = ByteHelper.byteArrayToInt(pl); -// System.out.println("GnLayer.receive: Message payload length=" + payloadLength); + //TERFactory.getInstance().logDebug("GnLayer.receive: Message payload length=" + payloadLength); if(headerType == HT_LS) { // Process LS messages @@ -408,7 +419,7 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { params.put(GN_DEPV, depv); params.put(GN_TYPE, HT_LS); params.put(GN_SUBTYPE, HST_LSREPLY); - System.out.println("GnLayer.receive: Send LS_REPLAY in secured mode"); + //TERFactory.getInstance().logDebug("GnLayer.receive: Send LS_REPLAY in secured mode"); send(null, params); } } else { @@ -418,8 +429,16 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { // Other messages if(payloadLength > 0) { byte[] mpayload = new byte[payloadLength]; - System.arraycopy(payload, commonHdr.length + 44/*Topology-Scoped Broadcast*/, mpayload, 0, payloadLength); -// System.out.println("GnLayer.receive: Message =" + ByteHelper.byteArrayToString(mpayload)); + int extendedHeader = 0; + if (headerType == 1) { // Beacon + extendedHeader = 24; + } else if (headerType == 4) { // Geo Broadcast + extendedHeader = 44; + } else if (headerType == 5) { // Topology-Scoped Broadcast + extendedHeader = 28; + } // TODO To be continued + System.arraycopy(payload, commonHdr.length + extendedHeader, mpayload, 0, payloadLength); + //TERFactory.getInstance().logDebug("GnLayer.receive: Message =" + ByteHelper.byteArrayToString(mpayload)); lowerInfo.put(GN_NEXTHEADER, nextHeader); lowerInfo.put(GN_TYPE, headerType); lowerInfo.put(GN_SUBTYPE, headerSubType); @@ -430,7 +449,8 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { } } else { // Drop it - System.err.println("GnLayer.receive: Invalid basic header type"); + // FIXME as long as the cert chain is not complete, it should not be seen as error -> raise CR + //TERFactory.getInstance().logError("GnLayer.receive: Invalid basic header type"); return; } } @@ -633,8 +653,8 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { return ByteHelper.concat(tsb, depv); } - private byte[] createSecuredMessage(final byte[] basicHdr, final byte[] commonHdr, final byte[] extHdr, final byte[] message) { - System.out.println(">>> GnLayer.createSecuredMessage: "+ ByteHelper.byteArrayToString(message)); + private byte[] createSecuredMessage(final byte[] basicHdr, final byte[] commonHdr, final byte[] extHdr, final byte[] message, Map params) { + //TERFactory.getInstance().logDebug(">>> GnLayer.createSecuredMessage"); // SecuredMessage payload length int payloadLength = commonHdr.length + extHdr.length + message.length; @@ -642,113 +662,153 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { // Build the generation time value long curtime = System.currentTimeMillis(); byte[] generationTime = ByteHelper.longToByteArray((long)(curtime - 1072915200000L) * 1000L, Long.SIZE / Byte.SIZE); // In microseconds - System.out.println("GnLayer.createSecuredMessage: generationTime=" + ByteHelper.byteArrayToString(generationTime)); + //TERFactory.getInstance().logDebug("GnLayer.createSecuredMessage: generationTime=" + ByteHelper.byteArrayToString(generationTime)); // Build the payload to be signed - byte[] headersField = ByteHelper.concat( - ByteHelper.concat( // SecuredMessage HeaderFields - new byte[] { - (byte)0x80, // signerInfo - (byte)0x01 // Certificate digest with ecdsap256 - }, - management.getAtCertificateDigest(), // Hashed8 - new byte[] { - (byte)0x00, // generationTime - }, - generationTime // Time64 value - ) - ); - if ((commonHdr[0] & 0xF0) == 0x01) { // Next header = Btp-A + byte[] headersField = null; + boolean withCertificate = true; // FIXME Check that GnLayer is really used only for PICS_xxxM_RECEPTION tests. If so, always add AT certificate + if (withCertificate) { + headersField = ByteHelper.concat( + ByteHelper.concat( // SecuredMessage HeaderFields + new byte[] { + (byte)0x80, // signerInfo + (byte)0x02 // Certificate + }, + management.getAtCertificate(), // Hashed8 + new byte[] { + (byte)0x00, // generationTime + }, + generationTime // Time64 value + ) + ); + } else { + headersField = ByteHelper.concat( + ByteHelper.concat( // SecuredMessage HeaderFields + new byte[] { + (byte)0x80, // signerInfo + (byte)0x01 // Certificate digest with ecdsap256 + }, + management.getAtCertificateDigest(), // Hashed8 + new byte[] { + (byte)0x00, // generationTime + }, + generationTime // Time64 value + ) + ); + } + int its_aid = -1; + switch ((int) params.get(BtpLayer.BTP_DSTPORT)) { + case 2001: // CAM + its_aid = 36; + break; + case 2002: // DENM + its_aid = 37; + break; + case 2003: // MAPEM + its_aid = 137; + break; + case 2004: // SPATEM + its_aid = 138; + break; + case 2006: // IVIM + its_aid = 140; + break; + case 2007: // SREM/SSEM + // No break; + case 2008: + its_aid = 140; + break; + case 2010: + its_aid = 100; // FIXME Use the correct value + break; + } // End of 'switch' statement + if (its_aid == 36) { // CAM headersField = ByteHelper.concat( headersField, new byte[] { - (byte)0x05, // its-aid - (byte)0x24 // 36 = CAM + (byte)0x05, // its-aid + (byte)its_aid // 36 = CAM } ); - } else if ((commonHdr[0] & 0xF0) == 0x02) { // Next header = Btp-B + } else if (its_aid == 37) { // DENM headersField = ByteHelper.concat( headersField, new byte[] { (byte)0x03 // GenerationLocation - }, - management.getLatitude(), // Latitude - management.getLongitude(), // Longitude - new byte[] { (byte)0x00, (byte)0x00 }, // Elevation + }, + management.getLatitude(), // Latitude + management.getLongitude(), // Longitude + new byte[] { (byte)0x00, (byte)0x00 }, // Elevation new byte[] { - (byte)0x05, // its-aid - (byte)0x25 // 37 = DENM + (byte)0x05, // its-aid + (byte)its_aid // 37 = DENM } ); } else { // Add Its-Aid for Other profile - int itsAid = management.getItsAidOther(); byte[] b; - if (itsAid < 128) { - b = new byte[] { (byte)itsAid }; - } else if (itsAid < Short.MAX_VALUE) { - b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + if (its_aid < 128) { + b = new byte[] { (byte)its_aid }; } else { - b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + b = SecurityHelper.getInstance().size2tls(its_aid); } headersField = ByteHelper.concat( headersField, new byte[] { - (byte)0x03 // GenerationLocation - }, - management.getLatitude(), // Latitude - management.getLongitude(), // Longitude - new byte[] { (byte)0x00, (byte)0x00 }, // Elevation + (byte)0x03 // GenerationLocation + }, + management.getLatitude(), // Latitude + management.getLongitude(), // Longitude + new byte[] { (byte)0x00, (byte)0x00 }, // Elevation new byte[] { (byte)0x05 // Its-aid }, - b + b // Other profile ); } + byte[] payloadLengthTls = SecurityHelper.getInstance().size2tls(payloadLength); + byte[] headersFieldLength = null; + if (headersField.length < 127) { + headersFieldLength = new byte[] { (byte)headersField.length }; + } else { + headersFieldLength = SecurityHelper.getInstance().size2tls(headersField.length); + } byte[] toBeSignedData = ByteHelper.concat( new byte[] { // SecuredMessage version (byte)0x02 // version }, - new byte[] { (byte)headersField.length }, // HeadersField length + headersFieldLength, // HeadersField length headersField, // HeaderFields new byte[] { // SecuredMessage Payloads (byte)0x01, // Secured payload type: signed (1) - (byte)payloadLength, // Data payload length }, + payloadLengthTls, // Data payload length commonHdr, extHdr, message, // End of SecuredMessage Payloads - new byte[] { (byte)0x01 }, // Signature - new byte[] { (byte)0x43 } // Signature length + new byte[] { (byte)0x43 }, // Signature length + new byte[] { (byte)0x01 } // Signature ); - System.out.println("GnLayer.createSecuredMessage: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); + //TERFactory.getInstance().logDebug("GnLayer.createSecuredMessage: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); byte[] toBeSent = null; try { - // Calculate the hash - byte[] hash = CryptoLib.hashWithSha256(toBeSignedData); - System.out.println("GnLayer.createSecuredMessage: hash=" + ByteHelper.byteArrayToString(hash)); - // Signed the hash - byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(hash, management.getSigningPrivateKey()); - System.out.println("GnLayer.createSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); + // Signed the data + byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(toBeSignedData, management.getSigningPrivateKey()); + //TERFactory.getInstance().logDebug("GnLayer.createSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); // Add signature toBeSent = ByteHelper.concat( basicHdr, toBeSignedData, - new byte[] { 0x01, 0x00, 0x02 }, // Signature header + new byte[] { + (byte)0x00, // Public Key Alg: ecdsa nistp256 with sha256 (0) + (byte)0x02 // ECC Point Type: compressed lsb y-0 (2) + }, // Signature header ByteHelper.extract(signatureBytes, 2, signatureBytes.length - 2) ); } catch (Exception e) { e.printStackTrace(); } - System.out.println("GnLayer.createSecuredMessage: toBeSent=" + ByteHelper.byteArrayToString(toBeSent)); + //TERFactory.getInstance().logDebug("GnLayer.createSecuredMessage: toBeSent=" + ByteHelper.byteArrayToString(toBeSent)); return toBeSent; } diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/Layer.java b/javasrc/adapter/org/etsi/its/adapter/layers/Layer.java index beb49aa82db993e3828af98f8bc08446279b497f..e988fc5515f0bc78a0f964b849fcf4604371fadb 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/Layer.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/Layer.java @@ -24,104 +24,104 @@ public abstract class Layer { public static final String RECEPTION_TIMESTAMP = "ReceptionTimestamp"; - /** - * Constructor - * @param management Layer management instance + /** + * Constructor + * @param management Layer management instance * @param lowerStack Lower protocol stack - */ - public Layer(IManagementLayers management, Stack lowerStack) { - this.management = management; - this.lowerStack = lowerStack; - this.initialized = false; - } - - /** - * Initialises lower stack - */ - protected void initialize() { - if(!initialized && lowerStack != null && !lowerStack.isEmpty()) { - lowerLayerName = lowerStack.pop(); - lowerLayer = LayerFactory.getInstance().createLayer(management, lowerLayerName, lowerStack); - lowerLayer.register(this); - } - initialized = true; - } - - /** - * Transmits a message to registered lower layer after encapsulation + */ + public Layer(IManagementLayers management, Stack lowerStack) { + this.management = management; + this.lowerStack = lowerStack; + this.initialized = false; + } + + /** + * Initialises lower stack + */ + protected void initialize() { + if(!initialized && lowerStack != null && !lowerStack.isEmpty()) { + lowerLayerName = lowerStack.pop(); + lowerLayer = LayerFactory.getInstance().createLayer(management, lowerLayerName, lowerStack); + lowerLayer.register(this); + } + initialized = true; + } + + /** + * Transmits a message to registered lower layer after encapsulation * @param message Encoded message to be sent * @param params Layer parameters for sending message - * @return true if send operation is successful, false otherwise - */ - public boolean send(byte[] message, Map params) { - if(lowerLayer != null) { - return lowerLayer.send(message, params); - } - return true; - } - - /** - * Callback method invoked by registered lower layer upon message reception from lower stack - * @param message Message received from lower layer - * @param lowerInfo Additional information transmitted by lower layers - * @param receptionTime Message reception time - */ - public void receive(byte[] message, Map lowerInfo) { - if(registeredUpperLayer != null) { - registeredUpperLayer.receive(message, lowerInfo); - } - } - - /** - * Registers an upper layer. - * This method will also cause current layer to initialise its lower stack - * Messages received from lower layer will now be transmitted to upper layer, if necessary - * @param upperLayer Instance of the upper layer - */ - public void register(Layer upperLayer) { - registeredUpperLayer = upperLayer; - initialize(); - } - - /** - * Unregisters upper layer. - * This method will also cause current layer to unregister from its lower layer - * @param upperLayer - */ - public void unregister(Layer upperLayer) { - registeredUpperLayer = null; - if(lowerLayer != null) { - lowerLayer.unregister(this); - } - } - - /** - * Name of the lower layer - */ - protected String lowerLayerName; - - /** - * Registered upper layer instance - */ - protected Layer registeredUpperLayer = null; - - /** - * Lower layer instance - */ - protected Layer lowerLayer = null; - - /** - * Management instance - */ - protected IManagementLayers management = null; - - /** - * Lower stack - */ - private Stack lowerStack; - - /** - * Set to true if lower stack has been initialised (true if layer is operational), false otherwise - */ - private boolean initialized; + * @return true if send operation is successful, false otherwise + */ + public boolean send(byte[] message, Map params) { + if(lowerLayer != null) { + return lowerLayer.send(message, params); + } + return true; + } + + /** + * Callback method invoked by registered lower layer upon message reception from lower stack + * @param message Message received from lower layer + * @param lowerInfo Additional information transmitted by lower layers + * @param receptionTime Message reception time + */ + public void receive(byte[] message, Map lowerInfo) { + if(registeredUpperLayer != null) { + registeredUpperLayer.receive(message, lowerInfo); + } + } + + /** + * Registers an upper layer. + * This method will also cause current layer to initialise its lower stack + * Messages received from lower layer will now be transmitted to upper layer, if necessary + * @param upperLayer Instance of the upper layer + */ + public void register(Layer upperLayer) { + registeredUpperLayer = upperLayer; + initialize(); + } + + /** + * Unregisters upper layer. + * This method will also cause current layer to unregister from its lower layer + * @param upperLayer + */ + public void unregister(Layer upperLayer) { + registeredUpperLayer = null; + if(lowerLayer != null) { + lowerLayer.unregister(this); + } + } + + /** + * Name of the lower layer + */ + protected String lowerLayerName; + + /** + * Registered upper layer instance + */ + protected Layer registeredUpperLayer = null; + + /** + * Lower layer instance + */ + protected Layer lowerLayer = null; + + /** + * Management instance + */ + protected IManagementLayers management = null; + + /** + * Lower stack + */ + private Stack lowerStack; + + /** + * Set to true if lower stack has been initialised (true if layer is operational), false otherwise + */ + private boolean initialized; } diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/LayerFactory.java b/javasrc/adapter/org/etsi/its/adapter/layers/LayerFactory.java index 79fe65d5a87e57b30cb2231e9a048bcac9c96bce..65ec1c681038e61264ee90e80a268e7b455385a9 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/LayerFactory.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/LayerFactory.java @@ -13,14 +13,8 @@ import java.util.Map; import java.util.Stack; import java.util.TreeMap; +import org.etsi.adapter.TERFactory; import org.etsi.its.adapter.IManagementLayers; -import org.etsi.its.adapter.layers.test.BtpSourceLayer; -import org.etsi.its.adapter.layers.test.CamSourceLayer; -import org.etsi.its.adapter.layers.test.DebugLayer; -import org.etsi.its.adapter.layers.test.DenmSourceLayer; -import org.etsi.its.adapter.layers.test.Gn6SourceLayer; -import org.etsi.its.adapter.layers.test.GnSourceLayer; -import org.etsi.its.adapter.layers.test.LoopbackLayer; /** * Layer factory (Singleton) @@ -46,6 +40,10 @@ public class LayerFactory { layers.put("GN", GnLayer.class); layers.put("G5", G5Layer.class); layers.put("ETH", EthernetLayer.class); + layers.put("UdpIp", UdpIpLayer.class); + layers.put("UdpIpCSG", UdpIpCommsigniaLayer.class); + layers.put("CSG", CommsigniaLayer.class); + layers.put("UdpIpMarben", UdpIpMarbenLayer.class); // layers.put("Loopback", LoopbackLayer.class); // layers.put("Debug", DebugLayer.class); @@ -72,7 +70,7 @@ public class LayerFactory { * @return Protocol port instance */ public Layer createLayer(IManagementLayers management, String layerName, Stack lowerStack) { -// System.out.println(">>> LayerFactory.createLayer: " + layerName); + //TERFactory.getInstance().logDebug(">>> LayerFactory.createLayer: " + layerName); Layer layer = null; Class[] ctorParams = {IManagementLayers.class, lowerStack.getClass()}; diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpCommsigniaLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpCommsigniaLayer.java new file mode 100644 index 0000000000000000000000000000000000000000..e49b590ceadad3d0a3a91f3f0f26c8b43ad2fe1d --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpCommsigniaLayer.java @@ -0,0 +1,124 @@ +package org.etsi.its.adapter.layers; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; + +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.IManagementLayers; +import org.etsi.its.adapter.UdpMultiplexer; + +public class UdpIpCommsigniaLayer extends UdpIpLayer { + + private static String UdpAddress = "80.98.62.165"; //"10.200.1.101"; // FIXME Use a generic way to retrieve UDP settings + + private static int UdpRecvPort = 18501; // FIXME Use a generic way to retrieve UDP settings + + private static int UdpSendPort = 18502; // FIXME Use a generic way to retrieve UDP settings + + private Map clientsToFrameTypes = new HashMap(); + + public UdpIpCommsigniaLayer(IManagementLayers management, Stack lowerStack) { + super(management, lowerStack); + UdpMultiplexer.getInstance().UdpAddress = UdpAddress; + UdpMultiplexer.getInstance().UdpRecvPort = UdpRecvPort; + UdpMultiplexer.getInstance().UdpSendPort = UdpSendPort; + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#register(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void register(Layer upperLayer) { + if(registeredUpperLayer == null) { + super.register(upperLayer); + // Workaround for Commsignia CAM send module + Map lowerInfo = new HashMap(); + lowerInfo.put(UdpMultiplexer.getInstance().UDP_PORT_KEY, new Integer(UdpRecvPort).toString()); + super.send(new byte[] { (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA }, lowerInfo); + } else { + super.register(upperLayer); + } + clientsToFrameTypes.put(this.toString(), upperLayerFrameType); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#unregister(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void unregister(Layer upperLayer) { + super.unregister(upperLayer); + clientsToFrameTypes.remove(this.toString(), upperLayerFrameType); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) + */ + @Override + public boolean send(byte[] message, Map params) { + //TERFactory.getInstance().logDebug("UdpIpLayer.send: " + ByteHelper.byteArrayToString(message)); + + byte[] dst = (byte[])params.get(LINK_LAYER_DESTINATION); + if(dst == null) { + dst = MAC_BROADCAST; + } + + byte[] buffer = ByteHelper.concat( + new byte[] { (byte) 0xe0 }, + localMacAddress, + dst, + ByteHelper.intToByteArray(message.length, Short.SIZE / Byte.SIZE) , + message + ); + + return super.send(buffer, params); + } + + public void receive(byte[] message, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> UdpIpLayer.run: Receive packet from " + packet.getSocketAddress() + "/" + packet.getPort()); + + if (message.length < 36) { + // Skip it + return; + } + + ByteBuffer byteBuffer = ByteBuffer.wrap(message); + //TERFactory.getInstance().logDebug("UdpIpLayer.run: Receive packet from " + ByteHelper.byteArrayToString(byteBuffer.array())); + + // Skip IEEE 802.11L Layer: 88 00 00 00 00 + byteBuffer.position(4); + + // Extract Dst + byte[] dst = new byte[6]; + byteBuffer.get(dst, 0, dst.length); + lowerInfo.put(EthernetLayer.LINK_LAYER_DESTINATION, dst); + + // Skip Src + byteBuffer.position(byteBuffer.position() + 6); + + // Skip LLC header + byteBuffer.position(byteBuffer.position() + 16); + + // Extract FrameType info + byte[] rawFrameType = new byte[2]; + byteBuffer.get(rawFrameType, 0, rawFrameType.length); + short frameType = ByteHelper.byteArrayToInt(rawFrameType).shortValue(); + + if (clientsToFrameTypes.containsKey(this.toString())) { + if(frameType == clientsToFrameTypes.get(this.toString())) { + if(Arrays.equals(dst, MAC_BROADCAST) || Arrays.equals(dst, localMacAddress)) { + if(registeredUpperLayer != null) { + // Extract Data + byte[] data = new byte[byteBuffer.remaining() - 4]; // Remove CRC added by the device + byteBuffer.get(data, 0, byteBuffer.remaining() - 4); + + registeredUpperLayer.receive(data, lowerInfo); + } + } + } + } + } + +} diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpLayer.java index fd8ccefb7a74687ed02444b171c9b672ce66b443..afde6f35a3358772d78840c1f174323d245be8b9 100644 --- a/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpLayer.java +++ b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpLayer.java @@ -1,37 +1,45 @@ +/** + * Implementation of Udp layer using jpcap (background thread) + * + * @author ETSI / STF424 + * @version $URL: https://forge.etsi.org/svn/ITS/branches/STF517/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpLayer.java $ + * $Id: UdpIpLayer.java 2518 2016-09-02 05:27:47Z garciay $ + * + */ package org.etsi.its.adapter.layers; -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.util.HashMap; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.Map; import java.util.Stack; -import org.etsi.common.ByteHelper; import org.etsi.its.adapter.IManagementLayers; +import org.etsi.its.adapter.UdpMultiplexer; +/** + * Implementation of Udp layer using jpcap (background thread) + */ public class UdpIpLayer extends Layer { - + /** + * Well-known Udp broadcast address + */ + public static byte[] MAC_BROADCAST = new byte[]{(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF}; + + /** + * Parameter name for Link-Layer destination + */ + public static final String LINK_LAYER_DESTINATION = "LinkLayerDestination"; + + /** + * Constructor + * @param management Layer management instance + * @param lowerStack Lower protocol stack + */ public UdpIpLayer(IManagementLayers management, Stack lowerStack) { super(management, lowerStack); } - /* (non-Javadoc) - * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) - */ - @Override - public boolean send(byte[] message, Map params) { - DatagramPacket packet = new DatagramPacket(message, message.length, iutAddress, iutPort); - try { - iutSocket.send(packet); - } catch (IOException e) { - e.printStackTrace(); - } - return true; - } - /* (non-Javadoc) * @see org.etsi.its.adapter.layers.Layer#register(org.etsi.its.adapter.layers.Layer) */ @@ -39,65 +47,64 @@ public class UdpIpLayer extends Layer { public void register(Layer upperLayer) { if(registeredUpperLayer == null) { super.register(upperLayer); + try { - iutAddress = InetAddress.getByName("127.0.0.1"); - //System.out.println("IUT Address: " + iutAddress.getHostAddress()); - iutPort = 3750; - iutSocket = new DatagramSocket(3751); - iutThread = new UdpThread(iutSocket); - iutThread.start(); - } catch (Exception e) { + Method getEthernetType = registeredUpperLayer.getClass().getMethod("getEthernetType", (Class[])null); + if (getEthernetType != null) { + upperLayerFrameType = (Short) getEthernetType.invoke(registeredUpperLayer, (Object[]) null); + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { e.printStackTrace(); } + + localMacAddress = management.getLinkLayerAddress(); + UdpMultiplexer.getInstance().register(this, localMacAddress, upperLayerFrameType); + } } /* (non-Javadoc) - * @see org.etsi.its.adapter.layers.Layer#unregister(org.etsi.its.adapter.layers.Layer) + * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) */ @Override - public void unregister(Layer upperLayer) { - iutSocket.close(); - iutThread.interrupt(); - try { - iutThread.join(); - } catch (InterruptedException e) { - e.printStackTrace(); + public boolean send(byte[] message, Map params) { + + byte[] dst = (byte[])params.get(LINK_LAYER_DESTINATION); + if(dst == null) { + dst = MAC_BROADCAST; } - super.unregister(upperLayer); + + byte[] sent = UdpMultiplexer.getInstance().send(this, dst, message, params); + + return super.send(sent, params); } - private DatagramSocket iutSocket; - private InetAddress iutAddress; - private int iutPort; - private Thread iutThread; - - private class UdpThread extends Thread { - - private DatagramSocket taSocket; - private boolean running = true; + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#unregister(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void unregister(Layer upperLayer) { - public UdpThread(DatagramSocket taSocket) throws IOException { - this.taSocket = taSocket; - } - - @Override - public void run() { - - while(running) { - try { - byte[] buf = new byte[4096]; - Map lowerInfo = new HashMap(); - - // receive packet - DatagramPacket packet = new DatagramPacket(buf, buf.length); - taSocket.receive(packet); - lowerInfo.put(Layer.RECEPTION_TIMESTAMP, System.currentTimeMillis()); - receive(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), lowerInfo); - } catch (IOException e) { - running = false; - } - } - } + UdpMultiplexer.getInstance().unregister(this); } + + /** + * Local Udp address + */ + protected byte[] localMacAddress; + + /** + * Upper layer's frame type + */ + protected short upperLayerFrameType; + } + diff --git a/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpMarbenLayer.java b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpMarbenLayer.java new file mode 100644 index 0000000000000000000000000000000000000000..c52cfb90e18bec5f8ae256e974a68306cc770b90 --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/layers/UdpIpMarbenLayer.java @@ -0,0 +1,76 @@ +package org.etsi.its.adapter.layers; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; + +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.IManagementLayers; +import org.etsi.its.adapter.UdpMultiplexer; + +public class UdpIpMarbenLayer extends UdpIpLayer { + + // Marben 88:ceres 182:Jupiter VM32G + private static String UdpAddress = "192.168.7.182"; //"10.200.1.101"; // FIXME Use a generic way to retrieve UDP settings + + private static int UdpRecvPort = 3751; //18501; // FIXME Use a generic way to retrieve UDP settings + + private static int UdpSendPort = 3750; //18502; // FIXME Use a generic way to retrieve UDP settings + + private Map clientsToFrameTypes = new HashMap(); + + public UdpIpMarbenLayer(IManagementLayers management, Stack lowerStack) { + super(management, lowerStack); + UdpMultiplexer.getInstance().UdpAddress = UdpAddress; + UdpMultiplexer.getInstance().UdpRecvPort = UdpRecvPort; + UdpMultiplexer.getInstance().UdpSendPort = UdpSendPort; + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#register(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void register(Layer upperLayer) { + if(registeredUpperLayer == null) { + super.register(upperLayer); + // Workaround for Marben CAM send module + Map lowerInfo = new HashMap(); + lowerInfo.put(UdpMultiplexer.getInstance().UDP_PORT_KEY, new Integer(UdpRecvPort).toString()); + super.send(new byte[] { (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA }, lowerInfo); + } else { + super.register(upperLayer); + } + clientsToFrameTypes.put(this.toString(), upperLayerFrameType); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#unregister(org.etsi.its.adapter.layers.Layer) + */ + @Override + public void unregister(Layer upperLayer) { + super.unregister(upperLayer); + clientsToFrameTypes.remove(this.toString(), upperLayerFrameType); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.layers.Layer#send(byte[], java.util.Map) + */ + @Override + public boolean send(byte[] message, Map params) { + System.out.println("UdpIpMarbenLayer.send: " + ByteHelper.byteArrayToString(message)); + + return super.send(message, params); // ML(Marben) : no lower header added + } + + public void receive(byte[] message, Map lowerInfo) { + + System.out.println("UdpIpMarbenLayer.run: Received packet " + ByteHelper.byteArrayToString(message)); + + lowerInfo.put(EthernetLayer.LINK_LAYER_DESTINATION, MAC_BROADCAST); + + registeredUpperLayer.receive(message, lowerInfo); // no MAC+LLC headers expected for Marben (ML) + } + +} diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/AdapterControlPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/AdapterControlPort.java index 05ce2026efc285830d8cdfbaf7d9d1177d123fdb..cb767d45dd154dd3c31fa2b1943db1bfd899c731 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/AdapterControlPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/AdapterControlPort.java @@ -26,12 +26,15 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl private static final byte AcGnPrimitive = 0; private static final byte AcGn6Primitive = 1; private static final byte AcGnssPrimitive = 2; + private static final byte AcSecPrimitive = 3; /* AdapterControl Response */ private static final byte AcGnResponse = 0; //private static final byte AcGn6Response = 1; public static final byte AcGnssResponse = 2; public static final byte AcGnssDistanceCovered = 3; + public static final byte AcGnssTimeReached = 4; + public static final byte AcSecResponse = 5; /* GN Commands */ private static final byte AcStartBeaconing = 0; @@ -41,9 +44,7 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl private static final byte AcStartBeaconingMultipleNeighbour = 4; private static final byte AcStopBeaconingMultipleNeighbour = 5; private static final byte AcGetLongPosVector = 6; - private static final byte AcEnableSecurity = 7; - private static final byte AcDisableSecurity = 8; - + /* GN Responses */ protected static final byte AcGnResponseFailure = 0; protected static final byte AcLongPosVector = 6; @@ -55,7 +56,13 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl private static final byte AcAwaitDistanceToCover = 0x73; private static final byte AcChangeSpead = 0x74; private static final byte AcChangeHeading = 0x75; + private static final byte AcAwaitTimeInRunningScenario = 0x76; + /* Set the certificate to be used by the Test Adapter */ + private static final byte AcEnableSecurity = 0x7a; + private static final byte AcDisableSecurity = 0x7b; + + public static final byte AcTrue = 0x01; public static final byte AcFalse = 0x00; @@ -101,7 +108,7 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl Management.getInstance(getComponentName()).stopBeaconing(); break; case AcStartPassBeaconing: - ProcessAcStartPassBeaconing(data); + Management.getInstance(getComponentName()).startEnqueueingBeacons(data); break; case AcStopPassBeaconing: Management.getInstance(getComponentName()).stopEnqueueingBeacons(); @@ -112,12 +119,6 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl case AcStopBeaconingMultipleNeighbour: // TODO break; - case AcEnableSecurity: - Management.getInstance(getComponentName()).setSecuredMode(data); - break; - case AcDisableSecurity: - Management.getInstance(getComponentName()).unsetSecuredMode(); - break; } } break; @@ -172,6 +173,10 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl case AcChangeHeading: // ChangeHeading(heading); break; + case AcAwaitTimeInRunningScenario: + int time = ByteHelper.byteArrayToInt(data); + AwaitTimeInRunningScenario(time); + break; } } else { @@ -180,6 +185,17 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl result = false; } break; + case AcSecPrimitive: + switch (message[1]) { + case AcEnableSecurity: + byte[] data = ByteHelper.extract(message, 2, message.length - 2); + ProcessAcEnableSecurity(data); + break; + case AcDisableSecurity: + ProcessAcDisableSecurity(); + break; + } // End of 'switch' statement + break; default: ByteHelper.dump("Unsupported AC primitive", message); break; @@ -221,15 +237,6 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl }).start(); } - private void ProcessAcStartPassBeaconing(final byte[] beacon) { - - byte[] response = {(byte)AcGnResponse, (byte)AcGnResponseFailure, (byte)AcFalse}; - Management.getInstance(getComponentName()).startEnqueueingBeacons(beacon); - - setChanged(); - notifyObservers(new PortEvent(response, getPortName(), getComponentName())); - } - private void LoadScenario(final int scenario) { new Thread(new Runnable() { @Override @@ -283,6 +290,45 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl }).start(); } + private void AwaitTimeInRunningScenario(final int time) { + new Thread(new Runnable() { + @Override + public void run() { + boolean result = GNSS.awaitTimeInRunningScenario(AdapterControlPort.this, time); + byte[] response = {(byte)AcGnssResponse, (byte)(result?AcFalse:AcTrue)}; + setChanged(); + notifyObservers(new PortEvent(response, getPortName(), getComponentName())); + } + }).start(); + } + + private void ProcessAcEnableSecurity(final byte[] data) { + new Thread(new Runnable() { + @Override + public void run() { + Management.getInstance(getComponentName()).setSecuredMode(data); + byte[] response = {(byte)AcSecResponse, (byte)AcTrue }; + + setChanged(); + notifyObservers(new PortEvent(response, getPortName(), getComponentName())); + } + }).start(); + } + + private void ProcessAcDisableSecurity() { + new Thread(new Runnable() { + @Override + public void run() { + Management.getInstance(getComponentName()).unsetSecuredMode(); + byte[] response = {(byte)AcSecResponse, (byte)AcTrue }; + + setChanged(); + notifyObservers(new PortEvent(response, getPortName(), getComponentName())); + } + }).start(); + } + + @Override public void dispose() { if (gnssScenarioSupport) { diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/BtpPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/BtpPort.java index 3a101683955dde01ce4bdea0a043b5f5c53a096c..6229e38c1420e22f807abc3e0bb4e2bb8aa40b36 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/BtpPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/BtpPort.java @@ -39,7 +39,7 @@ public class BtpPort extends ProtocolPort { // Encode with GN next header info - BTP A or BTP B byte[] msgInd = ByteHelper.concat( - new byte[] { (byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + new byte[] { ((Byte)(lowerInfo.get(GnLayer.GN_NEXTHEADER))).byteValue() }, message ); super.receive(msgInd, lowerInfo); diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/CamPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/CamPort.java index 4c4a090006af3c9417404e0835202ff625454425..b8fe4bfd32cc8ac6f72c73fd806851f885692f18 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/CamPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/CamPort.java @@ -11,7 +11,9 @@ package org.etsi.its.adapter.ports; import java.util.HashMap; import java.util.Map; +import org.etsi.adapter.TERFactory; import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.SecurityHelper; import org.etsi.its.adapter.layers.BtpLayer; import org.etsi.its.adapter.layers.GnLayer; @@ -36,24 +38,37 @@ public class CamPort extends ProtocolPort { */ @Override public void receive(byte[] message, Map lowerInfo) { -// System.out.println(">>> denmPort.receive: " + ByteHelper.byteArrayToString(message)); +// TERFactory.getInstance().logDebug(">>> CamPort.receive: " + ByteHelper.byteArrayToString(message)); - if (message[1] != 0x02) { // Check that received packet has CAM message id - System.err.println("camPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); + if (message[1] != 0x02) { // Check that received packet has CAM message id - See ETSI TS 102 894 + TERFactory.getInstance().logDebug("CamPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); return; // Drop it } // Encode with CAM indication header byte[] msgInd = ByteHelper.concat( message, - new byte[] { (byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), + new byte[] { (Byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) ); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } super.receive(msgInd, lowerInfo); } diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/ConfigTesterPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/ConfigTesterPort.java index 07aa6ed0b1d362df42dbb9e65ad38cd66caaef7f..1c3f081c809dc6c3635720f3da361ad94fcee9ed 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/ConfigTesterPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/ConfigTesterPort.java @@ -1,5 +1,15 @@ package org.etsi.its.adapter.ports; +/** + * Upper Tester port implementation. This port is used to trigger IUT's upper interface + * + * @author ETSI / STF424 + * @version $URL$ + * $Id$ + * + */ + +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; @@ -31,25 +41,25 @@ public class ConfigTesterPort extends AdapterPort implements IPort, IObservable */ public ConfigTesterPort(final String portName, final String componentName) { super(portName, componentName); - + // UDP connection parameters String settings = ((CharstringValue)TERFactory.getInstance().getTaParameter("ConfigTesterSettings")).getString(); Matcher matcher = settingsPattern.matcher(settings); if (matcher.find()) { - try { + try { cfPeerAddress = InetAddress.getByName(matcher.group(1)); } catch (UnknownHostException e1) { e1.printStackTrace(); - } + } cfPeerPort = Integer.parseInt(matcher.group(2)); } else { - - } + // FIXME + } + + // UDP socket for communication with Configuration module running = true; - - // UDP socket for communication with UT try { - cfSocket = new DatagramSocket(); + cfSocket = new DatagramSocket(cfPeerPort + 1); cfThread = new UdpThread(cfSocket); cfThread.start(); } catch (Exception e) { @@ -59,20 +69,24 @@ public class ConfigTesterPort extends AdapterPort implements IPort, IObservable @Override public boolean send(final byte[] message) { - - DatagramPacket packet = new DatagramPacket(message, message.length, cfPeerAddress, cfPeerPort); try { + ByteArrayOutputStream dataToSent = new ByteArrayOutputStream(); + dataToSent.write(message); + byte[] output = dataToSent.toByteArray(); + DatagramPacket packet = new DatagramPacket(output, output.length, cfPeerAddress, cfPeerPort); cfSocket.send(packet); - } catch (IOException e) { + + return true; + } catch (Exception e) { e.printStackTrace(); - return false; - } - return true; - } - + } + + return false; + } + @Override public void dispose() { - if(running) { + if(running) { running = false; if(cfThread != null) { try { @@ -81,49 +95,50 @@ public class ConfigTesterPort extends AdapterPort implements IPort, IObservable } catch (InterruptedException e) { e.printStackTrace(); } - } + } } } - + private DatagramSocket cfSocket; private Thread cfThread; private InetAddress cfPeerAddress = null; private int cfPeerPort = 0; private Pattern settingsPattern = Pattern.compile(SETTINGS_PATTERN); - + /** * Indicates whether the port is still active. Setting this field to false will cause - * the UDP communication with Config Tester to be stopped + * the UDP communication with Upper Tester to be stopped */ private volatile boolean running; private class UdpThread extends Thread { - + private DatagramSocket taSocket; public UdpThread(DatagramSocket taSocket) throws IOException { this.taSocket = taSocket; - } - - @Override + } + + @Override public void run() { - + while(running) { - try { + try { byte[] buf = new byte[4096]; - + // receive packet DatagramPacket packet = new DatagramPacket(buf, buf.length); taSocket.receive(packet); - - setChanged(); + + setChanged(); notifyObservers(new PortEvent(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), getPortName(), getComponentName())); - } catch (IOException e) { + } catch (IOException e) { running = false; - } + } } taSocket.close(); } - } + + } // End of class UdpThread } // End of class ConfigTesterPort diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/DenmPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/DenmPort.java index 47703be450ed7edb5e627ac010a87cbaec867eb1..9ef087f76ceadfd8e8b422ea803f632c5d11f3b1 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/DenmPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/DenmPort.java @@ -11,7 +11,9 @@ package org.etsi.its.adapter.ports; import java.util.HashMap; import java.util.Map; +import org.etsi.adapter.TERFactory; import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.SecurityHelper; import org.etsi.its.adapter.layers.BtpLayer; import org.etsi.its.adapter.layers.GnLayer; @@ -36,24 +38,37 @@ public class DenmPort extends ProtocolPort { */ @Override public void receive(byte[] message, Map lowerInfo) { -// System.out.println(">>> denmPort.receive: " + ByteHelper.byteArrayToString(message)); +// TERFactory.getInstance().logDebug(">>> DenmPort.receive: " + ByteHelper.byteArrayToString(message)); - if (message[1] != 0x01) { // Check that received packet has DENM message id - System.err.println("denmPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); + if (message[1] != 0x01) { // Check that received packet has DENM message id - See ETSI TS 102 894 + TERFactory.getInstance().logDebug("DenmPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); return; // Drop it } // Encode with DENM indication header byte[] msgInd = ByteHelper.concat( message, - new byte[] { (byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), + new byte[] { (Byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) ); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } super.receive(msgInd, lowerInfo); } diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/GnPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/GnPort.java index b43c1160e348ba0f2e6469deed274062baff6db9..a95528960367670262492cc08c792088af54cb3d 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/GnPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/GnPort.java @@ -98,17 +98,15 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific long currentTime = System.currentTimeMillis(); byte[] tst = ByteHelper.intToByteArray((int)(((currentTime - 1072915200000L) % modulo) - 3000), 4); System.arraycopy(tst, 0, beaconHeader, 20, 4); - /* TODO Uncomment to get secured beacon*/if (!management.isSecuredModeSet()) { // Secure mode disabled + if (!management.isSecuredModeSet()) { // Secure mode disabled send(beaconHeader, params); - /* TODO Uncomment to get secured beacon*/ } else { // Send a secured beacon byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false); // triggerTime = currentTime; // Send the secured beacon - //System.out.println("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader)); + //TERFactory.getInstance().logDebug("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader)); send(securedBeaconHeader, params); } -/* TODO Uncomment to get secured beacon*/ try { Thread.sleep(management.getGnBeaconInterval()); } catch (InterruptedException e) { @@ -119,22 +117,18 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific } private byte[] buildSecuredBeacon(final byte[] p_beacon, byte[] p_tst, final long p_currentTime, final boolean p_sendDigest) { - //System.out.println("GnPort.buildSecuredBeacon (1): " + ByteHelper.byteArrayToString(p_beacon)); + //TERFactory.getInstance().logDebug("GnPort.buildSecuredBeacon (1): " + ByteHelper.byteArrayToString(p_beacon)); byte[] basicHeader = ByteHelper.extract(p_beacon, 0, 4); basicHeader[0] &= 0xFE; basicHeader[0] |= 0x02; // Secured mode - // Update the beacon timestamp field - byte[] beacon = ByteHelper.concat( - ByteHelper.extract(p_beacon, 4, 16), // Extract Common Header + GN address - p_tst, // Update the timestamp field - ByteHelper.extract(p_beacon, 20, p_beacon.length - 4 - 20) // Add remaining bytes - ); - //System.out.println("GnPort.buildSecuredBeacon (2): " + ByteHelper.byteArrayToString(beacon)); + // Basic Header is not part of signed data + byte[] beacon = ByteHelper.extract(p_beacon, 4, p_beacon.length - 4); + //TERFactory.getInstance().logDebug("GnPort.buildSecuredBeacon (2): " + ByteHelper.byteArrayToString(beacon)); // Prepare the message to be signed byte[] toBeSignedData = buildToBeSignedData(beacon, p_currentTime, p_sendDigest); - //System.out.println("GnPort.buildSecuredBeacon: toBeSignedData " + ByteHelper.byteArrayToString(toBeSignedData)); + //TERFactory.getInstance().logDebug("GnPort.buildSecuredBeacon: toBeSignedData " + ByteHelper.byteArrayToString(toBeSignedData)); // Sign the message byte[] securedBeaconHeader = signSecuredMessage(toBeSignedData); @@ -143,7 +137,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific } private byte[] buildToBeSignedData(final byte[] p_beacon, final long p_currentTime, final boolean p_sendDigest) { - //System.out.println("GnPort.buildToBeSignedData: " + ByteHelper.byteArrayToString(p_beacon)); + //TERFactory.getInstance().logDebug("GnPort.buildToBeSignedData: " + ByteHelper.byteArrayToString(p_beacon)); // Build the SignerInfo field byte[] signerInfo = null; @@ -167,7 +161,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific // Build the generation time value byte[] generationTime = ByteHelper.longToByteArray((long)(p_currentTime - 1072915200000L) * 1000L, Long.SIZE / Byte.SIZE); // In microseconds - //System.out.println("GnPort.buildToBeSignedData: generationTime=" + ByteHelper.byteArrayToString(generationTime)); + //TERFactory.getInstance().logDebug("GnPort.buildToBeSignedData: generationTime=" + ByteHelper.byteArrayToString(generationTime)); byte[] headersField = ByteHelper.concat( ByteHelper.concat( // SecuredMessage HeaderFields signerInfo, // signerInfo @@ -182,18 +176,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific byte[] b; if (itsAid < 128) { b = new byte[] { (byte)itsAid }; - } else if (itsAid < Short.MAX_VALUE) { - b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); } else { - b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + b = SecurityHelper.getInstance().size2tls(itsAid); } headersField = ByteHelper.concat( headersField, @@ -204,12 +188,12 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific management.getLongitude(), // Longitude new byte[] { (byte)0x00, (byte)0x00 }, // Elevation new byte[] { - (byte)0x05 // Its-aid + (byte)0x05 // Its-aid }, b ); byte[] headersFieldLength = SecurityHelper.getInstance().size2tls(headersField.length); - //System.out.println("GnPort.buildToBeSignedData: headersField=" + ByteHelper.byteArrayToString(headersField)); + //TERFactory.getInstance().logDebug("GnPort.buildToBeSignedData: headersField=" + ByteHelper.byteArrayToString(headersField)); byte[] toBeSignedData = ByteHelper.concat( new byte[] { // SecuredMessage version (byte)0x02 // version @@ -224,23 +208,20 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific new byte[] { (byte)0x43 }, // Signature length new byte[] { (byte)0x01 } // Signature ); - //System.out.println("GnPort.buildToBeSignedData: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); + //TERFactory.getInstance().logDebug("GnPort.buildToBeSignedData: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); return toBeSignedData; } private byte[] signSecuredMessage(final byte[] p_toBeSignedData) { - //System.out.println("GnPort.signSecuredMessage: toBeSignedData: " + ByteHelper.byteArrayToString(p_toBeSignedData)); + //TERFactory.getInstance().logDebug("GnPort.signSecuredMessage: toBeSignedData: " + ByteHelper.byteArrayToString(p_toBeSignedData)); - // Calculate the hash - byte[] hash = CryptoLib.hashWithSha256(p_toBeSignedData); - //System.out.println("GnPort.signSecuredMessage: hash=" + ByteHelper.byteArrayToString(hash)); byte[] securedBeaconHeader = null; - // Signed the hash + // Signed the data byte[] signatureBytes; try { - signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(hash, management.getSigningPrivateKey()); - //System.out.println("GnPort.signSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); + signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(p_toBeSignedData, management.getSigningPrivateKey()); + //TERFactory.getInstance().logDebug("GnPort.signSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); // Add signature securedBeaconHeader = ByteHelper.concat( p_toBeSignedData, @@ -252,12 +233,14 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ); -/* boolean result = CryptoLib.verifyWithEcdsaNistp256WithSha256(p_toBeSignedData, signatureBytes, management.getSigningPublicKeyX(), management.getSigningPublicKeyY()); - //System.out.println("GnPort.signSecuredMessage: Verify signature: pubX" + ByteHelper.byteArrayToString(management.getSigningPublicKeyX())); - //System.out.println("GnPort.signSecuredMessage: Verify signature: pubY" + ByteHelper.byteArrayToString(management.getSigningPublicKeyY())); - //System.out.println("GnPort.signSecuredMessage: Verify signature: " + new Boolean(result));*/ - - //System.out.println("<<< GnPort.signSecuredMessage: sendBeacon: " + ByteHelper.byteArrayToString(securedBeaconHeader)); + if (management.isEnforceSecuredModeSet()) { + boolean result = CryptoLib.verifyWithEcdsaNistp256WithSha256(p_toBeSignedData, signatureBytes, management.getSigningPublicKeyX(), management.getSigningPublicKeyY()); + //TERFactory.getInstance().logDebug("GnPort.signSecuredMessage: Verify signature: pubX" + ByteHelper.byteArrayToString(management.getSigningPublicKeyX())); + //TERFactory.getInstance().logDebug("GnPort.signSecuredMessage: Verify signature: pubY" + ByteHelper.byteArrayToString(management.getSigningPublicKeyY())); + //TERFactory.getInstance().logDebug("GnPort.signSecuredMessage: Verify signature: " + new Boolean(result));*/ + //TERFactory.getInstance().logDebug("<<< GnPort.signSecuredMessage: sendBeacon: " + ByteHelper.byteArrayToString(securedBeaconHeader)); + return (result) ? securedBeaconHeader : null; + } return securedBeaconHeader; } catch (Exception e) { e.printStackTrace(); @@ -271,19 +254,19 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific */ @Override public boolean send(byte[] message) { - //System.out.println(">>> GnPort.send: " + ByteHelper.byteArrayToString(message)); + //TERFactory.getInstance().logDebug(">>> GnPort.send: " + ByteHelper.byteArrayToString(message)); HashMap params = new HashMap(); - byte[] destMacAddress = ByteHelper.extract(message, message.length - 6, 6); - message = ByteHelper.extract(message, 0, message.length - 6); + byte[] destMacAddress = ByteHelper.extract(message, message.length - 10, 6); + int its_aid = ByteHelper.byteArrayToInt(ByteHelper.extract(message, message.length - 4, 4)); + message = ByteHelper.extract(message, 0, message.length - 10); params.put(EthernetLayer.LINK_LAYER_DESTINATION, destMacAddress); if (management.isSecuredModeSet()) { // Secure mode disabled - message = createSecuredMessage(message); + message = createSecuredMessage(message, its_aid); } // ByteHelper.dump("GnPort.send", message); - //System.out.println("\n\n"); return send(message, params); } @@ -292,7 +275,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific */ @Override public void receive(byte[] message, Map lowerInfo) { - //System.out.println(">>> GnPort.receive: " + ByteHelper.byteArrayToString(message)); + //TERFactory.getInstance().logDebug(">>> GnPort.receive: " + ByteHelper.byteArrayToString(message)); byte[] basicHdr = new byte[4]; System.arraycopy(message, 0, basicHdr, 0, 4); @@ -310,15 +293,24 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific int sopvPos = 12; if(headerType != HT_BEACON && !(headerType == HT_TSB && headerSubType == HST_SHB) ) { sopvPos += 4; - } - System.arraycopy(message, sopvPos, sopv, 0, 24); + } + try { + System.arraycopy(message, sopvPos, sopv, 0, 24); + } + catch (IndexOutOfBoundsException e) { // Decoding issue + return; + } + //TERFactory.getInstance().logDebug("GnPort.receive: sopv=" + ByteHelper.byteArrayToString(sopv)); + // Security disable, null will be translated into omit + lowerInfo.put(SecurityHelper.SEC_SSP, null); + lowerInfo.put(SecurityHelper.SEC_ITS_AID, null); } else if ((basicHdr[0] & 0x0f) == 0x02) { // Secured tag - byte[] payload = SecurityHelper.getInstance().checkSecuredProfileAndExtractPayload(message, basicHdr.length, management.isEnforceSecuredModeSet(), management.getItsAidOther()); + byte[] payload = SecurityHelper.getInstance().checkSecuredProfileAndExtractPayload(message, basicHdr.length, management.isEnforceSecuredModeSet(), management.getItsAidOther(), lowerInfo); if (payload != null) { - //System.out.println("GnPort.receive: payload=" + ByteHelper.byteArrayToString(payload)); + //TERFactory.getInstance().logDebug("GnPort.receive: payload=" + ByteHelper.byteArrayToString(payload)); byte[] commonHdr = new byte[8]; System.arraycopy(payload, 0, commonHdr, 0, 8); - //System.out.println("GnPort.receive: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); + //TERFactory.getInstance().logDebug("GnPort.receive: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); byte[] htHst = new byte[1]; System.arraycopy(commonHdr, 1, htHst, 0, 1); headerType = (int)(htHst[0] >> 4); @@ -331,15 +323,15 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific System.arraycopy(payload, sopvPos, sopv, 0, 24); } else { // Drop it - System.err.println("GnPort.receive: Invalid packet"); + TERFactory.getInstance().logError("GnPort.receive: Invalid packet"); return; } } else { // Drop it - System.err.println("GnPort.receive: Invalid basic header type"); + TERFactory.getInstance().logError("GnPort.receive: Invalid basic header type"); return; } - //System.out.println("GnPort.receive: sopv=" + ByteHelper.byteArrayToString(sopv)); + //TERFactory.getInstance().logDebug("GnPort.receive: sopv=" + ByteHelper.byteArrayToString(sopv)); byte[] gn = new byte[8]; System.arraycopy(sopv, 0, gn, 0, 8); @@ -363,6 +355,19 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific // Encode with GN indication header // Extract LINK_LAYER_DESTINATION byte[] msgInd = ByteHelper.concat(message, (byte[])lowerInfo.get(EthernetLayer.LINK_LAYER_DESTINATION)); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } super.receive(msgInd, lowerInfo); } } @@ -383,8 +388,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific super.dispose(); } - private byte[] createSecuredMessage(final byte[] message) { - System.out.println(">>> GnPort.createSecuredMessage: " + ByteHelper.byteArrayToString(message)); + private byte[] createSecuredMessage(final byte[] message, int its_aid) { + //TERFactory.getInstance().logDebug(">>> GnPort.createSecuredMessage:" + ByteHelper.byteArrayToString(message)); // Extract and update the basicHeader byte[] basicHdr = ByteHelper.extract(message, 0, 4); @@ -394,11 +399,11 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific // Set nextHeader to secured basicHdr[0] &= 0xFE; basicHdr[0] |= 0x02; - //System.out.println("GnPort.createSecuredMessage: basicHdr=" + ByteHelper.byteArrayToString(basicHdr)); + //TERFactory.getInstance().logDebug("GnPort.createSecuredMessage: basicHdr=" + ByteHelper.byteArrayToString(basicHdr)); // Extract and update the basicHeader byte[] commonHdr = ByteHelper.extract(message, 4, 8); - //System.out.println("GnPort.createSecuredMessage: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); + //TERFactory.getInstance().logDebug("GnPort.createSecuredMessage: commonHdr=" + ByteHelper.byteArrayToString(commonHdr)); // Extract SecuredMessage payload byte[] securedPayload = ByteHelper.extract(message, 4, message.length - 4); @@ -421,45 +426,34 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific generationTime // Time64 value ) ); - if ((commonHdr[0] & 0xF0) == 0x10) { // Next header = Btp-A + if (its_aid == 36) { // CAM headersField = ByteHelper.concat( headersField, new byte[] { - (byte)0x05, // its-aid - (byte)0x24 // 26 = CAM + (byte)0x05, // its-aid + (byte)its_aid // 36 = CAM } ); - } else if ((commonHdr[0] & 0xF0) == 0x20) { // Next header = Btp-B + } else if (its_aid == 37) { // DENM headersField = ByteHelper.concat( headersField, new byte[] { - (byte)0x03 // GenerationLocation + (byte)0x03 // GenerationLocation }, - management.getLatitude(), // Latitude - management.getLongitude(), // Longitude - new byte[] { (byte)0x00, (byte)0x00 }, // Elevation + management.getLatitude(), // Latitude + management.getLongitude(), // Longitude + new byte[] { (byte)0x00, (byte)0x00 }, // Elevation new byte[] { - (byte)0x05, // its-aid - (byte)0x25 // 27 = DENM + (byte)0x05, // its-aid + (byte)its_aid // 37 = DENM } ); } else { // Add Its-Aid for Other profile - int itsAid = management.getItsAidOther(); byte[] b; - if (itsAid < 128) { - b = new byte[] { (byte)itsAid }; - } else if (itsAid < Short.MAX_VALUE) { - b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + if (its_aid < 128) { + b = new byte[] { (byte)its_aid }; } else { - b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + b = SecurityHelper.getInstance().size2tls(its_aid); } headersField = ByteHelper.concat( headersField, @@ -472,9 +466,10 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific new byte[] { (byte)0x05 // Its-aid }, - b + b // Other profile ); } + byte[] payloadLengthTls = SecurityHelper.getInstance().size2tls(payloadLength); byte[] toBeSignedData = ByteHelper.concat( new byte[] { // SecuredMessage version (byte)0x02 // version @@ -483,35 +478,34 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific headersField, // HeaderFields new byte[] { // SecuredMessage Payloads (byte)0x01, // Secured payload type: signed (1) - (byte)payloadLength, // Data payload length }, + payloadLengthTls, // Data payload length securedPayload, - new byte[] { (byte)0x01 }, // Signature - new byte[] { (byte)0x43 } // Signature length + new byte[] { (byte)0x43 }, // Signature length + new byte[] { (byte)0x01 } // Signature ); - //System.out.println("GnPort.createSecuredMessage: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); + //TERFactory.getInstance().logDebug("GnPort.createSecuredMessage: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); byte[] toBeSent = null; try { - // Calculate the hash - byte[] hash = CryptoLib.hashWithSha256(toBeSignedData); - //System.out.println("GnPort.createSecuredMessage: hash=" + ByteHelper.byteArrayToString(hash)); - // Signed the hash - byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(hash, management.getSigningPrivateKey()); - //System.out.println("GnPort.createSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); + // Signed the data + byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(toBeSignedData, management.getSigningPrivateKey()); + //TERFactory.getInstance().logDebug("GnPort.createSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); // Add signature toBeSent = ByteHelper.concat( basicHdr, toBeSignedData, - new byte[] { 0x01, 0x00, 0x02 }, // Signature header + new byte[] { + (byte)0x00, // Public Key Alg: ecdsa nistp256 with sha256 (0) + (byte)0x02 // ECC Point Type: compressed lsb y-0 (2) + }, // Signature header ByteHelper.extract(signatureBytes, 2, signatureBytes.length - 2) ); } catch (Exception e) { e.printStackTrace(); } - //System.out.println("GnPort.createSecuredMessage: toBeSent=" + ByteHelper.byteArrayToString(toBeSent)); - //System.out.println("\n\n"); + //TERFactory.getInstance().logDebug("GnPort.createSecuredMessage: toBeSent=" + ByteHelper.byteArrayToString(toBeSent)); return toBeSent; } diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/IvimPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/IvimPort.java new file mode 100644 index 0000000000000000000000000000000000000000..cfda5dc16a37e19f3bf179bafbe90d6687a2f642 --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/ports/IvimPort.java @@ -0,0 +1,95 @@ +/** + * CAM port implementation + * + * @author ETSI / STF424 + * @version $URL$ + * $Id$ + * + */ +package org.etsi.its.adapter.ports; + +import java.util.HashMap; +import java.util.Map; + +import org.etsi.adapter.TERFactory; +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.SecurityHelper; +import org.etsi.its.adapter.layers.BtpLayer; +import org.etsi.its.adapter.layers.GnLayer; + +/** + * CAM port implementation + */ +public class IvimPort extends ProtocolPort { + + /** + * Constructor + * @param portName Name of the port + * @param componentName Name of the component owning this port instance + * @param lowerStackDesc Description of the port's lower stack in the form "Layer/Layer/Layer/..." + * @param linkLayerAddress Link-layer address to be used by this port as source address (null if not applicable) + */ + public IvimPort(String portName, String componentName, String lowerStackDesc, String linkLayerAddress) { + super(portName, componentName, lowerStackDesc, linkLayerAddress); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.ProtocolPort#receive(byte[], java.util.Map) + */ + @Override + public void receive(byte[] message, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> IvimPort.receive: " + ByteHelper.byteArrayToString(message)); + + if (message[1] != 0x06) { // Check that received packet has IVIM message id - See ETSI TS 102 894 + TERFactory.getInstance().logDebug("IvimPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); + return; // Drop it + } + + // Encode with CAM indication header + byte[] msgInd = ByteHelper.concat( + message, + new byte[] { (Byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) + ); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } + super.receive(msgInd, lowerInfo); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.IPort#send(byte[]) + */ + @Override + public boolean send(byte[] message) { + + HashMap params = new HashMap(); + params.put(BtpLayer.BTP_TYPE, BtpLayer.TYPE_B); + params.put(BtpLayer.BTP_DSTPORT, 2006); + params.put(BtpLayer.BTP_SRCPORT, 500); + params.put(GnLayer.GN_TYPE, GnLayer.HT_GEOBROADCAST); + params.put(GnLayer.GN_SUBTYPE, GnLayer.HST_MULTIHOP); + params.put(GnLayer.GN_LATITUDE, ByteHelper.byteArrayToLong(management.getLatitude())); + params.put(GnLayer.GN_LONGITUDE, ByteHelper.byteArrayToLong(management.getLongitude())); + params.put(GnLayer.GN_DISTANCEA, 0); + params.put(GnLayer.GN_DISTANCEB, 0); + params.put(GnLayer.GN_ANGLE, 0); + params.put(GnLayer.GN_NEXTHEADER, "BTP-B"); + return send(message, params); + } +} diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/MapSpatPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/MapSpatPort.java deleted file mode 100644 index 4bf5e27aaa1911c7254ad5eaf643ef116e01da19..0000000000000000000000000000000000000000 --- a/javasrc/adapter/org/etsi/its/adapter/ports/MapSpatPort.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.etsi.its.adapter.ports; - -import java.util.HashMap; -import java.util.Map; - -import org.etsi.common.ByteHelper; -import org.etsi.its.adapter.layers.BtpLayer; -import org.etsi.its.adapter.layers.GnLayer; - -public class MapSpatPort extends ProtocolPort { - - /** - * Constructor - * @param portName Name of the port - * @param componentName Name of the component owning this port instance - * @param lowerStackDesc Description of the port's lower stack in the form "Layer/Layer/Layer/..." - * @param linkLayerAddress Link-layer address to be used by this port as source address (null if not applicable) - */ - public MapSpatPort(String portName, String componentName, String lowerStackDesc, String linkLayerAddress) { - super(portName, componentName, lowerStackDesc, linkLayerAddress); - } - - /* (non-Javadoc) - * @see org.etsi.its.adapter.ports.ProtocolPort#receive(byte[], java.util.Map) - */ - @Override - public void receive(byte[] message, Map lowerInfo) { - - // Encode with CAM indication header - byte[] msgInd = ByteHelper.concat( - message, - new byte[] { (byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), - ByteHelper.intToByteArray((int) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), - (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), - (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) - ); - super.receive(msgInd, lowerInfo); - } - - /* (non-Javadoc) - * @see org.etsi.its.adapter.ports.IPort#send(byte[]) - */ - @Override - public boolean send(byte[] message) { - - HashMap params = new HashMap(); - params.put(BtpLayer.BTP_TYPE, BtpLayer.TYPE_B); - if (message[1] == 0x5) { - params.put(BtpLayer.BTP_DSTPORT, 2003); - } - else { - params.put(BtpLayer.BTP_DSTPORT, 2004); - } - params.put(BtpLayer.BTP_SRCPORT, 500); - params.put(GnLayer.GN_TYPE, GnLayer.HT_TSB); - params.put(GnLayer.GN_SUBTYPE, GnLayer.HST_MULTIHOP); - params.put(GnLayer.GN_LATITUDE, ByteHelper.byteArrayToLong(management.getLatitude())); - params.put(GnLayer.GN_LONGITUDE, ByteHelper.byteArrayToLong(management.getLongitude())); - params.put(GnLayer.GN_NEXTHEADER, "BTP-B"); - return send(message, params); - } -} // End of class MapSpatPort - diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/MapemSpatemPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/MapemSpatemPort.java new file mode 100644 index 0000000000000000000000000000000000000000..1b72ec59fb387cb40db5a19958cc8dd41ec84098 --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/ports/MapemSpatemPort.java @@ -0,0 +1,91 @@ +package org.etsi.its.adapter.ports; + +import java.util.HashMap; +import java.util.Map; + +import org.etsi.adapter.TERFactory; +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.SecurityHelper; +import org.etsi.its.adapter.layers.BtpLayer; +import org.etsi.its.adapter.layers.GnLayer; + +public class MapemSpatemPort extends ProtocolPort { + + /** + * Constructor + * @param portName Name of the port + * @param componentName Name of the component owning this port instance + * @param lowerStackDesc Description of the port's lower stack in the form "Layer/Layer/Layer/..." + * @param linkLayerAddress Link-layer address to be used by this port as source address (null if not applicable) + */ + public MapemSpatemPort(String portName, String componentName, String lowerStackDesc, String linkLayerAddress) { + super(portName, componentName, lowerStackDesc, linkLayerAddress); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.ProtocolPort#receive(byte[], java.util.Map) + */ + @Override + public void receive(byte[] message, Map lowerInfo) { + //TERFactory.getInstance().logDebug(">>> MapemSpatemPort.receive: " + ByteHelper.byteArrayToString(message)); + + if ((message[1] != 0x04) && (message[1] != 0x05)) { // Check that received packet has MAPEM/SPATEM message id - See ETSI TS 102 894 + TERFactory.getInstance().logDebug("MapemSpatemPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); + return; // Drop it + } + + // Encode with MAPEM/SPATEM indication header + byte[] msgInd = ByteHelper.concat( + message, + new byte[] { (Byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) + ); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } + super.receive(msgInd, lowerInfo); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.IPort#send(byte[]) + */ + @Override + public boolean send(byte[] message) { + + HashMap params = new HashMap(); + params.put(BtpLayer.BTP_TYPE, BtpLayer.TYPE_B); + if (message[1] == 0x5) { // MAPEM, see ITS-Container + params.put(BtpLayer.BTP_DSTPORT, 2003); + } else if (message[1] == 0x4) { // SPATEM, see ITS-Container + params.put(BtpLayer.BTP_DSTPORT, 2004); + } else { + params.put(BtpLayer.BTP_DSTPORT, 0); + } + params.put(BtpLayer.BTP_SRCPORT, 0); + params.put(GnLayer.GN_TYPE, GnLayer.HT_GEOBROADCAST); + params.put(GnLayer.GN_SUBTYPE, GnLayer.HST_MULTIHOP); + params.put(GnLayer.GN_LATITUDE, ByteHelper.byteArrayToLong(management.getLatitude())); + params.put(GnLayer.GN_LONGITUDE, ByteHelper.byteArrayToLong(management.getLongitude())); + params.put(GnLayer.GN_DISTANCEA, 0); + params.put(GnLayer.GN_DISTANCEB, 0); + params.put(GnLayer.GN_ANGLE, 0); + params.put(GnLayer.GN_NEXTHEADER, "BTP-B"); + return send(message, params); + } +} // End of class MapSpatPort + diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/ProtocolPortFactory.java b/javasrc/adapter/org/etsi/its/adapter/ports/ProtocolPortFactory.java index 565a585bf1dba1ed036634fcba99dda2b37929a2..bb2cc5b7d6a28894f104169894c8f269c4ea7d5e 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/ProtocolPortFactory.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/ProtocolPortFactory.java @@ -12,6 +12,8 @@ import java.lang.reflect.Constructor; import java.util.Map; import java.util.TreeMap; +import org.etsi.adapter.TERFactory; + /** * Protocol port factory (Singleton) */ @@ -34,7 +36,9 @@ public class ProtocolPortFactory { // Register the ports - Refer to TTCN-3 component LibIts_TestSystem.ItsSystem for ports name ports.put("camPort", CamPort.class); ports.put("denmPort", DenmPort.class); - ports.put("mapSpatPort", MapSpatPort.class); + ports.put("mapemSpatemPort", MapemSpatemPort.class); + ports.put("ivimPort", IvimPort.class); + ports.put("sremSsemPort", SremSsemPort.class); ports.put("btpPort", BtpPort.class); ports.put("geoNetworkingPort", GnPort.class); ports.put("ipv6OverGeoNetworkingPort", Gn6Port.class); @@ -60,7 +64,7 @@ public class ProtocolPortFactory { * @return Protocol port instance */ public ProtocolPort createPort(String portName, String componentName, String lowerStackDesc, String linkLayerAddress) { -// System.out.println(">>> ProtocolPortFactory.createPort: " + portName + ", " + componentName + ", " + lowerStackDesc + ", " + linkLayerAddress); + //TERFactory.getInstance().logDebug(">>> ProtocolPortFactory.createPort: " + portName + ", " + componentName + ", " + lowerStackDesc + ", " + linkLayerAddress); ProtocolPort port = null; Class[] ctorParams = {portName.getClass(), componentName.getClass(), lowerStackDesc.getClass(), linkLayerAddress.getClass()}; diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/SremSsemPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/SremSsemPort.java new file mode 100644 index 0000000000000000000000000000000000000000..3f1db373c4b767f71daa24e7c59940257e6b81c7 --- /dev/null +++ b/javasrc/adapter/org/etsi/its/adapter/ports/SremSsemPort.java @@ -0,0 +1,88 @@ +package org.etsi.its.adapter.ports; + +import java.util.HashMap; +import java.util.Map; + +import org.etsi.adapter.TERFactory; +import org.etsi.common.ByteHelper; +import org.etsi.its.adapter.SecurityHelper; +import org.etsi.its.adapter.layers.BtpLayer; +import org.etsi.its.adapter.layers.GnLayer; + +public class SremSsemPort extends ProtocolPort { + + /** + * Constructor + * @param portName Name of the port + * @param componentName Name of the component owning this port instance + * @param lowerStackDesc Description of the port's lower stack in the form "Layer/Layer/Layer/..." + * @param linkLayerAddress Link-layer address to be used by this port as source address (null if not applicable) + */ + public SremSsemPort(String portName, String componentName, String lowerStackDesc, String linkLayerAddress) { + super(portName, componentName, lowerStackDesc, linkLayerAddress); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.ProtocolPort#receive(byte[], java.util.Map) + */ + @Override + public void receive(byte[] message, Map lowerInfo) { +// TERFactory.getInstance().logDebug(">>> SremSsemPort.receive: " + ByteHelper.byteArrayToString(message)); + + if ((message[1] != 0x09) && (message[1] != 0x0A)) { // Check that received packet has SREM/SSEM message id - See ETSI TS 102 894 + TERFactory.getInstance().logDebug("SremSsemPort.receive: drop packet " + ByteHelper.byteArrayToString(message)); + return; // Drop it + } + + // Encode with SREM/SSEM indication header + byte[] msgInd = ByteHelper.concat( + message, + new byte[] { (Byte) lowerInfo.get(GnLayer.GN_NEXTHEADER) }, + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_SUBTYPE), 1), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_LIFETIME), Integer.SIZE / Byte.SIZE), + ByteHelper.intToByteArray((Integer) lowerInfo.get(GnLayer.GN_TRAFFICCLASS), 1), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORT), + (byte[]) lowerInfo.get(BtpLayer.BTP_DSTPORTINFO) + ); + // Add security info to pass to the ATS + if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { + byte[] buf = new byte[32]; + msgInd = ByteHelper.concat(msgInd, buf); + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); + } + if (lowerInfo.get(SecurityHelper.SEC_ITS_AID) == null) { // It shall not be possible to have SSP absent and ATS_AID present but... + msgInd = ByteHelper.concat(msgInd, new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }); + + } else { + msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_ITS_AID)); + } + super.receive(msgInd, lowerInfo); + } + + /* (non-Javadoc) + * @see org.etsi.its.adapter.ports.IPort#send(byte[]) + */ + @Override + public boolean send(byte[] message) { + + HashMap params = new HashMap(); + params.put(BtpLayer.BTP_TYPE, BtpLayer.TYPE_B); + if (message[1] == 0x9) { // SREM, see ITS-Container + params.put(BtpLayer.BTP_DSTPORT, 2007); + } else if (message[1] == 0xa) { // SSEM, see ITS-Container + params.put(BtpLayer.BTP_DSTPORT, 2008); + } else { + params.put(BtpLayer.BTP_DSTPORT, 0); + } + params.put(BtpLayer.BTP_SRCPORT, 0); + params.put(GnLayer.GN_TYPE, GnLayer.HT_TSB); + params.put(GnLayer.GN_SUBTYPE, GnLayer.HST_MULTIHOP); + params.put(GnLayer.GN_LATITUDE, ByteHelper.byteArrayToLong(management.getLatitude())); + params.put(GnLayer.GN_LONGITUDE, ByteHelper.byteArrayToLong(management.getLongitude())); + params.put(GnLayer.GN_NEXTHEADER, "BTP-B"); + return send(message, params); + } +} // End of class MapSpatPort + diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/UpperTesterPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/UpperTesterPort.java index 87f2a9f8c78ae7b2d7f7f8e5fa19384de66b534f..7c0432c4ba1e220ef36fc223ad13f71fafc9531c 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/UpperTesterPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/UpperTesterPort.java @@ -64,6 +64,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { private ByteArrayOutputStream _hashedId8; private ByteArrayOutputStream _signingPrivateKey; + + private String _offlineMode = ""; /** * Constructor @@ -79,6 +81,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { _utSecuredMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("UtSecuredMode")).getString(); _utSecuredRootPath = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsSecuredRootPath")).getString(); _utSecuredConfiId = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsSecuredConfiId")).getString(); + _offlineMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("OfflineMode")).getString().toLowerCase(); String settings = ((CharstringValue)TERFactory.getInstance().getTaParameter("UpperTesterSettings")).getString(); Matcher matcher = settingsPattern.matcher(settings); if (matcher.find()) { @@ -97,13 +100,13 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { _certificate = new ByteArrayOutputStream(); CertificatesIOFactory.getInstance().loadCertificates(_utSecuredRootPath, _utSecuredConfiId); if (CertificatesIOFactory.getInstance().readCertificate(CertificateId, _certificate)) { -// System.out.println("UpperTesterPort.UpperTesterPort: _certificate=" + ByteHelper.byteArrayToString(_certificate.toByteArray())); +// TERFactory.getInstance().logDebug("UpperTesterPort.UpperTesterPort: _certificate=" + ByteHelper.byteArrayToString(_certificate.toByteArray())); _hashedId8 = new ByteArrayOutputStream(); _signingPrivateKey = new ByteArrayOutputStream(); CertificatesIOFactory.getInstance().readCertificateDigest(CertificateId, _hashedId8); -// System.out.println("UpperTesterPort.UpperTesterPort: _hashedId8=" + ByteHelper.byteArrayToString(_hashedId8.toByteArray())); +// TERFactory.getInstance().logDebug("UpperTesterPort.UpperTesterPort: _hashedId8=" + ByteHelper.byteArrayToString(_hashedId8.toByteArray())); CertificatesIOFactory.getInstance().readSigningKey(CertificateId, _signingPrivateKey); -// System.out.println("UpperTesterPort.UpperTesterPort: _signingPrivateKey=" + ByteHelper.byteArrayToString(_signingPrivateKey.toByteArray())); +// TERFactory.getInstance().logDebug("UpperTesterPort.UpperTesterPort: _signingPrivateKey=" + ByteHelper.byteArrayToString(_signingPrivateKey.toByteArray())); _isSecuredMode = true; } @@ -112,7 +115,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { // UDP socket for communication with UT running = true; try { - utSocket = new DatagramSocket(); + utSocket = new DatagramSocket(/*utPeerPort*/); utThread = new UdpThread(utSocket); utThread.start(); } catch (Exception e) { @@ -122,41 +125,83 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { @Override public boolean send(final byte[] message) { -/* FIXME: For debug only. Uncomment if no UT - try { - Thread.sleep(500); - } catch (InterruptedException e) { - // Do nothing, we do not care - } - - setChanged(); - byte[] rsp; - switch (message[0]) { - case 0x00: - rsp = new byte[]{(byte)0x01, (byte)0x01}; - break; - case 0x02: // UtChangePosition - // No break; - case 0x03: - // No break; - case 0x04: - // No break; - case 0x05: - rsp = new byte[]{(byte)0x24, (byte)0x01}; - break; - case 0x10: // UtDenmTrigger - rsp = new byte[]{(byte)0x11, (byte)0x01}; - break; - default: - if ((message[0] >= 0x30) && (message[0] <= 0x3F)) { // UtCamTrigger_xxx - rsp = new byte[]{(byte)0x21, (byte)0x01}; - } else { - rsp = new byte[]{(byte)0x41, (byte)0x01}; - } - break; + if (/*true or */_offlineMode.equals("true")) { /* FIXME: For debug only. Uncomment if no UT - Do not forget the return true below*/ + try { + Thread.sleep(500); + } catch (InterruptedException e) { + // Do nothing, we do not care + } + + setChanged(); + byte[] rsp; + switch (message[0]) { + case (byte)0x00: + rsp = new byte[]{(byte)0x01, (byte)0x01}; + break; + case (byte)0x02: // UtChangePosition + rsp = new byte[]{(byte)0x03, (byte)0x01}; + break; + case (byte)0x04: // UtChangePseudonym + rsp = new byte[]{(byte)0x05, (byte)0x01}; + break; + case (byte)0x06: // UtActivatePositionTime + rsp = new byte[]{(byte)0x07, (byte)0x01}; + break; + case (byte)0x08: // UtDeactivatePositionTime + rsp = new byte[]{(byte)0x09, (byte)0x01}; + break; + case (byte)0x10: // UtDenmTrigger + rsp = ByteHelper.concat( + new byte[]{ (byte)0x11, (byte)0x01 }, + new byte[] { (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA }, // StationID + new byte[] { (byte)0x01, (byte)0xFF } // SequenceNumber + ); + break; + case (byte)0x12: // UtDenmUpdate + rsp = ByteHelper.concat( + new byte[]{ (byte)0x13, (byte)0x01 }, + new byte[] { (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA }, // StationID + new byte[] { (byte)0x01, (byte)0xFF } // SequenceNumber + ); + break; + case (byte)0x14: // UtDenmTermination + rsp = new byte[]{(byte)0x15, (byte)0x01}; + break; + //reserved(0x92), + case (byte)0x93: // UtSec_setCertificate + case (byte)0x94: // UtSec_setPrivateKey + case (byte)0x95: // UtSec_setTrustPoint( + rsp = new byte[]{(byte)0x91, (byte)0x01}; // UtSecResult + break; + case (byte)0xA0: // UtMapemSpatemTrigger + rsp = new byte[]{(byte)0xA1, (byte)0x01}; // UtMapemSpatemTriggerResult + break; + case (byte)0xA4: // UtIvimTrigger + rsp = new byte[]{(byte)0xA5, (byte)0x01, (byte)0xA0, (byte)0xA0}; // UtIvimTriggerResult + break; + case (byte)0xA6: // UtIvimUpdate + rsp = new byte[]{(byte)0xA7, (byte)0x01, (byte)0xA0, (byte)0xA0}; // UtIvimUpdateResult + break; + case (byte)0xA8: // UtIvimTermination + rsp = new byte[]{(byte)0xA9, (byte)0x01, (byte)0xA0, (byte)0xA0}; // UtIvimTerminationResult + break; + case (byte)0xAB: // UtSremTrigger + rsp = new byte[]{(byte)0xAC, (byte)0x01}; // UtSremTriggerResult + break; + case (byte)0xAD: // UtSremUpdate + rsp = new byte[]{(byte)0xAE, (byte)0x01}; // UtSremUpdateResult + break; + default: + if ((message[0] >= (byte)0x30) && (message[0] <= (byte)0x3F)) { // UtCamTrigger_xxx + rsp = new byte[]{(byte)0x21, (byte)0x00}; // UtCamTriggerResult + } else { + rsp = new byte[]{(byte)0x24, (byte)0x00}; + } + break; + } + notifyObservers(new PortEvent(rsp, getPortName(), getComponentName())); } - notifyObservers(new PortEvent(rsp, getPortName(), getComponentName())); - if(true) +/* FIXME: For debug only if(true) return true; */ try { @@ -237,8 +282,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { notifyObservers(new PortEvent(payload, getPortName(), getComponentName())); } // else, packet was dropped } else { // Notify received payload - setChanged(); - notifyObservers(new PortEvent(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), getPortName(), getComponentName())); + setChanged(); + notifyObservers(new PortEvent(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), getPortName(), getComponentName())); } } catch (IOException e) { running = false; @@ -250,7 +295,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { } // End of class UdpThread private byte[] checkSecuredOtherProfileAndExtractPayload(final byte[] p_message) { - System.out.println(">>> UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: " + ByteHelper.byteArrayToString(p_message)); + TERFactory.getInstance().logDebug(">>> UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: " + ByteHelper.byteArrayToString(p_message)); ByteHelper.dump("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: ", p_message); ByteArrayInputStream decvalue = new ByteArrayInputStream(p_message); @@ -258,37 +303,37 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { // Check version if (decvalue.read() != 2) { // Drop it - System.err.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong version number"); + TERFactory.getInstance().logError("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong version number"); return null; } // Extract header fields length and header fields long headerFieldsLength = SecurityHelper.getInstance().tls2size(decvalue); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: headerFieldsLength:" + headerFieldsLength); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: headerFieldsLength:" + headerFieldsLength); byte[] headerFields = new byte[(int) headerFieldsLength]; decvalue.read(headerFields, 0, (int) headerFieldsLength); ByteArrayOutputStream certificateKeys = new ByteArrayOutputStream(); if (!checkHeaderfields(headerFields, certificateKeys)) { // Drop it - System.err.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Headerfields"); + TERFactory.getInstance().logError("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Headerfields"); return null; } byte[] aaSigningPublicKeyX, aaSigningPublicKeyY; aaSigningPublicKeyX = ByteHelper.extract(certificateKeys.toByteArray(), 0, 32); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); aaSigningPublicKeyY = ByteHelper.extract(certificateKeys.toByteArray(), 32, 32); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: headerFields:" + ByteHelper.byteArrayToString(headerFields)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: headerFields:" + ByteHelper.byteArrayToString(headerFields)); // Extract payload, decvalue is updated with the payload if (decvalue.read() != 1) { // Drop it - System.err.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Payload type"); + TERFactory.getInstance().logError("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Payload type"); return null; } long payloadLength = SecurityHelper.getInstance().tls2size(decvalue); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: payloadLength:" + payloadLength); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: payloadLength:" + payloadLength); byte[] payload = new byte[(int) payloadLength]; decvalue.read(payload, 0, (int) payloadLength); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: payload:" + ByteHelper.byteArrayToString(payload)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: payload:" + ByteHelper.byteArrayToString(payload)); // Extract Secure Trailer long secureTrailerLength = SecurityHelper.getInstance().tls2size(decvalue); byte[] secureTrailer = new byte[(int) secureTrailerLength]; @@ -296,36 +341,34 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { ByteArrayOutputStream signature = new ByteArrayOutputStream(); if (!extractMessageSignature(secureTrailer, signature)) { // Drop it - System.err.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Signatures"); + TERFactory.getInstance().logError("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Wrong Signatures"); return null; } - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: signature:" + ByteHelper.byteArrayToString(signature.toByteArray())); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: signature:" + ByteHelper.byteArrayToString(signature.toByteArray())); // Build signed data byte[] toBeVerifiedData = ByteHelper.extract( p_message, 0, p_message.length - (int)(secureTrailerLength - 1 /* Exclude signature structure but keep signature type and signature length */) ); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload:" + ByteHelper.byteArrayToString(toBeVerifiedData)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload:" + ByteHelper.byteArrayToString(toBeVerifiedData)); // Calculate Digest digest from the buffer toBeVerifiedData - byte[] hash = CryptoLib.hashWithSha256(toBeVerifiedData); boolean result; try { result = CryptoLib.verifyWithEcdsaNistp256WithSha256( - hash, + toBeVerifiedData, signature.toByteArray(), aaSigningPublicKeyX, aaSigningPublicKeyY ); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Verify signature: " + new Boolean(result)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Verify signature: " + new Boolean(result)); if (!result) { // Drop packet - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: toBeVerifiedData :" + ByteHelper.byteArrayToString(toBeVerifiedData)); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Hash :" + ByteHelper.byteArrayToString(hash)); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: signature :" + ByteHelper.byteArrayToString(signature.toByteArray())); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); - System.out.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); - System.err.println("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Invalid signature"); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: toBeVerifiedData :" + ByteHelper.byteArrayToString(toBeVerifiedData)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: signature :" + ByteHelper.byteArrayToString(signature.toByteArray())); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); + TERFactory.getInstance().logError("UpperTesterPort.checkSecuredOtherProfileAndExtractPayload: Drop packet - Invalid signature"); return null; } @@ -339,7 +382,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { } private boolean checkHeaderfields(byte[] p_headerfields, final ByteArrayOutputStream p_keys) { // TODO Common with GnLayer and UpperTester, to be grouped - System.out.println(">>> UpperTesterPort.checkHeaderfields: " + ByteHelper.byteArrayToString(p_headerfields)); + TERFactory.getInstance().logDebug(">>> UpperTesterPort.checkHeaderfields: " + ByteHelper.byteArrayToString(p_headerfields)); // Sanity check if (p_headerfields.length == 0) { @@ -352,20 +395,20 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { (p_headerfields[signerInfoTypeIndex++] != 0x02) // SignerInfo Type: certificate (2) ) { // Drop it - System.err.println("UpperTesterPort.checkHeaderfields: Drop packet - Certificate"); + TERFactory.getInstance().logError("UpperTesterPort.checkHeaderfields: Drop packet - Certificate"); return false; } // Extract certificate because of it is an Other message profile byte[] certificate = decodeCertificate(p_headerfields, signerInfoTypeIndex, p_keys); signerInfoTypeIndex += certificate.length; - System.out.println("UpperTesterPort.checkHeaderfields: Certificate:" + ByteHelper.byteArrayToString(certificate)); + TERFactory.getInstance().logDebug("UpperTesterPort.checkHeaderfields: Certificate:" + ByteHelper.byteArrayToString(certificate)); // TODO check other fields return true; } private byte[] decodeCertificate(final byte[] p_headerfields, final int p_offset, final ByteArrayOutputStream p_keys) { // TODO Common with GnLayer and UpperTester, to be grouped - System.out.println("UpperTesterPort.decodeCertificate"); + TERFactory.getInstance().logDebug("UpperTesterPort.decodeCertificate"); ByteArrayInputStream headerfields = new ByteArrayInputStream(p_headerfields, p_offset, p_headerfields.length - p_offset); ByteArrayOutputStream cert = new ByteArrayOutputStream(); // FIXME To be removed @@ -373,7 +416,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { // Version cert.write((byte)headerfields.read()); if (cert.toByteArray()[0] != 0x02) { - System.out.println("UpperTesterPort.decodeCertificate: Wrong version number"); + TERFactory.getInstance().logDebug("UpperTesterPort.decodeCertificate: Wrong version number"); return null; } // SignerInfo type @@ -460,12 +503,12 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { e.printStackTrace(); } - System.out.println("UpperTesterPort.decodeCertificate: Unsupported certificate"); + TERFactory.getInstance().logDebug("UpperTesterPort.decodeCertificate: Unsupported certificate"); return null; } private boolean extractMessageSignature(final byte[] p_secureTrailer, final ByteArrayOutputStream p_signature) { // TODO Common with GnLayer and UpperTester, to be grouped - System.out.println(">>> UpperTesterPort.extractMessageSignature: " + ByteHelper.byteArrayToString(p_secureTrailer)); + TERFactory.getInstance().logDebug(">>> UpperTesterPort.extractMessageSignature: " + ByteHelper.byteArrayToString(p_secureTrailer)); // Sanity check if (p_secureTrailer.length == 0) { @@ -483,7 +526,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { p_signature.write(new byte[] { (byte)0x00, (byte)0x00 }); p_signature.write(ByteHelper.extract(p_secureTrailer, 3, 64)); - System.out.println("UpperTesterPort.extractMessageSignature: true"); + TERFactory.getInstance().logDebug("UpperTesterPort.extractMessageSignature: true"); return true; } catch (IOException e) { e.printStackTrace(); @@ -494,7 +537,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { } // FIXME To be continued // Else, drop it - System.err.println("UpperTesterPort.extractMessageSignature: Drop packet - Wrong signature"); + TERFactory.getInstance().logError("UpperTesterPort.extractMessageSignature: Drop packet - Wrong signature"); return false; } @@ -516,20 +559,20 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { 16, // Set position at the beginning of the public keys 32 ); -// System.out.println("UpperTesterPort.DispatchMessage: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); +// TERFactory.getInstance().logDebug("UpperTesterPort.DispatchMessage: aaSigningPublicKeyX:" + ByteHelper.byteArrayToString(aaSigningPublicKeyX)); byte[] aaSigningPublicKeyY = ByteHelper.extract( _certificate.toByteArray(), 16 + 32, 32 ); -// System.out.println("UpperTesterPort.DispatchMessage: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); +// TERFactory.getInstance().logDebug("UpperTesterPort.DispatchMessage: aaSigningPublicKeyY:" + ByteHelper.byteArrayToString(aaSigningPublicKeyY)); // Build the generation time value byte[] generationTime = ByteHelper.longToByteArray( System.currentTimeMillis(), Long.SIZE / Byte.SIZE ); // In microseconds -// System.out.println("UpperTesterPort.buildToBeSignedData: generationTime=" + ByteHelper.byteArrayToString(generationTime)); +// TERFactory.getInstance().logDebug("UpperTesterPort.buildToBeSignedData: generationTime=" + ByteHelper.byteArrayToString(generationTime)); byte[] headersField = ByteHelper.concat( ByteHelper.concat( // SecuredMessage HeaderFields signerInfo, // signerInfo @@ -544,18 +587,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { byte[] b; if (itsAid < 128) { b = new byte[] { (byte)itsAid }; - } else if (itsAid < Short.MAX_VALUE) { - b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); } else { - b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); - b = ByteHelper.concat( - SecurityHelper.getInstance().size2tls(b.length), - b - ); + b = SecurityHelper.getInstance().size2tls(itsAid); } headersField = ByteHelper.concat( headersField, @@ -565,7 +598,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { b ); byte[] headersFieldLength = SecurityHelper.getInstance().size2tls(headersField.length); -// System.out.println("UpperTesterPort.buildToBeSignedData: headersField=" + ByteHelper.byteArrayToString(headersField)); +// TERFactory.getInstance().logDebug("UpperTesterPort.buildToBeSignedData: headersField=" + ByteHelper.byteArrayToString(headersField)); byte[] payload = p_securedData.toByteArray(); byte[] toBeSignedData = ByteHelper.concat( new byte[] { // SecuredMessage version @@ -581,20 +614,17 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { new byte[] { (byte)0x43 }, // Signature length new byte[] { (byte)0x01 } // Signature ); -// System.out.println("UpperTesterPort.buildToBeSignedData: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); +// TERFactory.getInstance().logDebug("UpperTesterPort.buildToBeSignedData: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData)); p_toBeSignedData.write(toBeSignedData); } private void signSecuredMessage(final ByteArrayOutputStream p_toBeSignedData, final ByteArrayOutputStream p_securedMessage) throws Exception { -// System.out.println("UpperTesterPort.signSecuredMessage: toBeSignedData: " + ByteHelper.byteArrayToString(p_toBeSignedData.toByteArray())); - // Calculate the hash - byte[] hash = CryptoLib.hashWithSha256(p_toBeSignedData.toByteArray()); -// System.out.println("UpperTesterPort.signSecuredMessage: hash=" + ByteHelper.byteArrayToString(hash)); +// TERFactory.getInstance().logDebug("UpperTesterPort.signSecuredMessage: toBeSignedData: " + ByteHelper.byteArrayToString(p_toBeSignedData.toByteArray())); byte[] securedBeaconHeader = null; - // Signed the hash - byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(hash, new BigInteger(_signingPrivateKey.toByteArray())); -// System.out.println("UpperTesterPort.signSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); + // Signed the data + byte[] signatureBytes = CryptoLib.signWithEcdsaNistp256WithSha256(p_toBeSignedData.toByteArray(), new BigInteger(_signingPrivateKey.toByteArray())); +// TERFactory.getInstance().logDebug("UpperTesterPort.signSecuredMessage: signatureBytes=" + ByteHelper.byteArrayToString(signatureBytes)); // Add signature securedBeaconHeader = ByteHelper.concat( p_toBeSignedData.toByteArray(), @@ -605,7 +635,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { ByteHelper.extract(signatureBytes, 2, signatureBytes.length - 2) ); p_securedMessage.write(securedBeaconHeader); -// System.out.println("<<< UpperTesterPort.signSecuredMessage: sendBeacon: " + ByteHelper.byteArrayToString(p_securedMessage.toByteArray())); +// TERFactory.getInstance().logDebug("<<< UpperTesterPort.signSecuredMessage: sendBeacon: " + ByteHelper.byteArrayToString(p_securedMessage.toByteArray())); } } // End of class UpperTesterPort diff --git a/javasrc/adapter/org/etsi/its/adapter/ports/V2GPort.java b/javasrc/adapter/org/etsi/its/adapter/ports/V2GPort.java index 5677064550bfacae63420031d59c234da2604014..dd16d3740b736ad7b81e4141affe8fb22ab7ae3b 100644 --- a/javasrc/adapter/org/etsi/its/adapter/ports/V2GPort.java +++ b/javasrc/adapter/org/etsi/its/adapter/ports/V2GPort.java @@ -118,7 +118,7 @@ public class V2GPort extends ProtocolPort { } } - System.out.println("V2Gport initialized"); + TERFactory.getInstance().logDebug("V2Gport initialized"); } /* (non-Javadoc) diff --git a/javasrc/certificatesio/org/etsi/certificates/Helpers.java b/javasrc/certificatesio/org/etsi/certificates/Helpers.java index a250c33faf8b4c09adaa66c2084497bd74cea857..128a06badb68d9f37a235e4874ed0d87bd1ef8c2 100644 --- a/javasrc/certificatesio/org/etsi/certificates/Helpers.java +++ b/javasrc/certificatesio/org/etsi/certificates/Helpers.java @@ -87,7 +87,7 @@ public final class Helpers { @Override public boolean accept(final File p_dirName, final String p_fileName) { String name = p_fileName.toLowerCase(); -// System.out.println("getFileListingNoSort: " + name + " - " + p_extension + " - " + name.endsWith(p_extension)); +// TERFactory.getInstance().logDebug("getFileListingNoSort: " + name + " - " + p_extension + " - " + name.endsWith(p_extension)); if (!p_extension.isEmpty() && !name.endsWith(p_extension)) { return false; } @@ -95,7 +95,7 @@ public final class Helpers { if (p_excludedPatterns != null) { for (String excludePattern : p_excludedPatterns) { if (name.indexOf(excludePattern) != -1) { -// System.out.println("getFileListingNoSort: exclusion criteria=" + excludePattern); +// TERFactory.getInstance().logDebug("getFileListingNoSort: exclusion criteria=" + excludePattern); return false; } } diff --git a/javasrc/certificatesio/org/etsi/certificates/io/CertificatesIO.java b/javasrc/certificatesio/org/etsi/certificates/io/CertificatesIO.java index 46de4eea31e48cb5283b02455b15d5e79a22adb1..53c0fa87e99d5d7c2d0a67d7ae180f217df627ba 100644 --- a/javasrc/certificatesio/org/etsi/certificates/io/CertificatesIO.java +++ b/javasrc/certificatesio/org/etsi/certificates/io/CertificatesIO.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.etsi.adapter.TERFactory; import org.etsi.certificates.Helpers; import org.etsi.common.ByteHelper; @@ -85,7 +86,7 @@ public class CertificatesIO implements ICertificatesIO { */ @Override public boolean loadCertificates(final String p_rootDirectory, final String p_configId) { // E.g. , cfg01 -// System.out.println(">>> CertificatesIO.loadCertificates: " + p_rootDirectory + ", " + p_configId + " - " + _areCertificatesLoaded); + TERFactory.getInstance().logDebug(">>> CertificatesIO.loadCertificates: '" + p_rootDirectory + "', '" + p_configId + "' - " + _areCertificatesLoaded); // Sanity check if (_areCertificatesLoaded) { @@ -104,7 +105,7 @@ public class CertificatesIO implements ICertificatesIO { File certsPath = new File(_fullPathCerts); if (!certsPath.exists()) { - System.err.println("CertificatesIO.loadCertificates: path '" + _fullPathCerts + "' does not found"); + TERFactory.getInstance().logError("CertificatesIO.loadCertificates: path '" + _fullPathCerts + "' does not found"); return false; } @@ -114,7 +115,7 @@ public class CertificatesIO implements ICertificatesIO { String path = new String(_fullPathCerts + "/" + p_configId); certsPath = new File(path); if (!certsPath.exists()) { - System.err.println("CertificatesIO.loadCertificates: path '" + path + "' does not found"); + TERFactory.getInstance().logError("CertificatesIO.loadCertificates: path '" + path + "' does not found"); return false; } loadMemoryCache(certsPath); // Load certificates and keys and return @@ -148,7 +149,7 @@ public class CertificatesIO implements ICertificatesIO { */ @Override public boolean readCertificate(final String key, final ByteArrayOutputStream certificate) { -// System.out.println(">>> CertificatesIO.readCertificate: " + key); +// TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificate: " + key); String certKey; if (_cachedReverseCertificatesDigest.containsKey(key)) { @@ -165,18 +166,18 @@ public class CertificatesIO implements ICertificatesIO { e.printStackTrace(); } }else{ - System.err.println("CertificatesIO.readCertificate: key '" + key + "' not found"); + TERFactory.getInstance().logError("CertificatesIO.readCertificate: key '" + key + "' not found"); } return false; } @Override public boolean readCertificateDigest(final String certificateId, final ByteArrayOutputStream digest) { -// System.out.println(">>> CertificatesIO.readCertificateDigest: " + certificateId); +// TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificateDigest: " + certificateId); // Sanity check if (!_cachedCertificatesDigest.containsKey(certificateId)) { - System.err.println("CertificatesIO.readCertificateDigest: key '" + certificateId + "' not found"); + TERFactory.getInstance().logError("CertificatesIO.readCertificateDigest: key '" + certificateId + "' not found"); return false; } @@ -198,7 +199,7 @@ public class CertificatesIO implements ICertificatesIO { */ @Override public boolean readSigningKey(final String keyName, final ByteArrayOutputStream key) { -// System.out.println(">>> CertificatesIO.readSigningKey: " + keyName); +// TERFactory.getInstance().logDebug(">>> CertificatesIO.readSigningKey: " + keyName); try { String certKey; @@ -300,15 +301,15 @@ public class CertificatesIO implements ICertificatesIO { }else if(n == 8){ bytes = Arrays.copyOfRange(bytes, 0, 8); }else{ - System.err.println("CertificatesIO: " + filename + ": wrong digest file length\n"); + TERFactory.getInstance().logError("CertificatesIO: " + filename + ": wrong digest file length\n"); return; } _cachedCertificatesDigest.put(certName, bytes); -// System.out.println("CertificatesIO.addDigestItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); +// TERFactory.getInstance().logDebug("CertificatesIO.addDigestItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); } private void addCertItem(final File p_certFile) throws FileNotFoundException, IOException { -// System.out.println(">>> CertificatesIO.addItem: " + p_certFile); +// TERFactory.getInstance().logDebug(">>> CertificatesIO.addItem: " + p_certFile); // Load the keys file name String filename = p_certFile.getName(); @@ -321,14 +322,14 @@ public class CertificatesIO implements ICertificatesIO { fsKeys.close(); bytes = ByteHelper.hexStringToByteArray(new String(bytes)); _cachedCertificates.put(certName, bytes); -// System.out.println("CertificatesIO.addItem: Store cert " + certName + " - " + ByteHelper.byteArrayToString(bytes)); +// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store cert " + certName + " - " + ByteHelper.byteArrayToString(bytes)); // calculate digest bytes = calculateDigestFromCertificate(bytes); _cachedCertificatesDigest.put(certName, bytes); -// System.out.println("CertificatesIO.addItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); +// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); _cachedReverseCertificatesDigest.put(ByteHelper.byteArrayToString(bytes), certName); -// System.out.println("CertificatesIO.addItem: Store reverse digest " + ByteHelper.byteArrayToString(bytes) + " - " + certName); +// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store reverse digest " + ByteHelper.byteArrayToString(bytes) + " - " + certName); // Load Private Keys filename = p_certFile.getPath(); @@ -348,13 +349,13 @@ public class CertificatesIO implements ICertificatesIO { l = 32; } if(l != 32){ - System.err.println("CertificatesIO: " + f.getName() + ": wrong data length[" + l + "\n"); + TERFactory.getInstance().logError("CertificatesIO: " + f.getName() + ": wrong data length[" + l + "\n"); } if (!_cachedSigningPrivateKey.containsKey(certName)) { _cachedSigningPrivateKey.put(certName, bytes); } }else{ - System.err.println("CertificatesIO: " + f.getName() + ": wrong key file length\n"); + TERFactory.getInstance().logError("CertificatesIO: " + f.getName() + ": wrong key file length\n"); } } }catch(FileNotFoundException e){} diff --git a/javasrc/codec/org/etsi/ttcn/codec/CodecBuffer.java b/javasrc/codec/org/etsi/ttcn/codec/CodecBuffer.java index f6bac23662a5b3c51dd38cc80c4b532ad610a4e8..3d180115c0fc30ef10a9e7ed6240a41a97e28b37 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/CodecBuffer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/CodecBuffer.java @@ -8,7 +8,8 @@ package org.etsi.ttcn.codec; import java.util.Map; import java.util.TreeMap; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.adapter.TERFactory; +import org.etsi.common.ByteHelper; public class CodecBuffer { @@ -131,10 +132,10 @@ public class CodecBuffer { * @see setMarkers() */ public void runCallbacks() { -// System.out.println("Running callbacks..."); +// TERFactory.getInstance().logDebug("Running callbacks..."); for(Map.Entry entry : markers.entrySet()) { String key = entry.getKey(); -// System.out.println("Running callback: " + key); +// TERFactory.getInstance().logDebug("Running callback: " + key); Marker marker = entry.getValue(); IMarkerCallback callback = marker.getCallback(); if(callback != null) { @@ -311,6 +312,8 @@ public class CodecBuffer { bits = 0; buffer = new byte[] {}; } + } else { + result = new byte[] {}; } return result; // TODO: move markers @@ -362,16 +365,16 @@ public class CodecBuffer { public byte[] getBytes(int start, int nbBytes) { if(start > buffer.length) { - System.err.println("bad start: " + start); + TERFactory.getInstance().logDebug("bad start: " + start); return null; } if((start + nbBytes) > buffer.length) { - System.err.println("bad length: " + (start + nbBytes) + " (" + buffer.length + " bytes remaining)"); + TERFactory.getInstance().logDebug("bad length: " + (start + nbBytes) + " (" + buffer.length + " bytes remaining)"); return null; } if(nbBytes < 0) { - System.err.println("bad length: " + (nbBytes) + " (" + buffer.length + " bytes remaining)"); + TERFactory.getInstance().logDebug("bad length: " + (nbBytes) + " (" + buffer.length + " bytes remaining)"); return null; } @@ -408,11 +411,11 @@ public class CodecBuffer { // leading partial byte complete bytes trailing partial byte if(byteIndex > buffer.length) { - System.err.println("bad start: " + byteIndex + "(" + start + ")" + " (" + buffer.length + " bytes remaining)"); + TERFactory.getInstance().logDebug("bad start: " + byteIndex + "(" + start + ")" + " (" + buffer.length + " bytes remaining)"); return null; } if((byteIndex + nbBytes) > buffer.length) { - System.err.println("bad length: " + (byteIndex + nbBytes) + "(" + nbBits + ")" + " (" + buffer.length + " bytes remaining)"); + TERFactory.getInstance().logDebug("bad length: " + (byteIndex + nbBytes) + "(" + nbBits + ")" + " (" + buffer.length + " bytes remaining)"); return null; } diff --git a/javasrc/codec/org/etsi/ttcn/codec/CodecFactory.java b/javasrc/codec/org/etsi/ttcn/codec/CodecFactory.java index df4f59ffe6f738ddd78609402d4cb45df8bca0ce..90892f875a389b39e37e448d177340b2b6653bdf 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/CodecFactory.java +++ b/javasrc/codec/org/etsi/ttcn/codec/CodecFactory.java @@ -9,6 +9,7 @@ import java.lang.reflect.Constructor; import java.util.Map; import java.util.TreeMap; +import org.etsi.adapter.TERFactory; import org.etsi.ttcn.tci.TciCDProvided; import org.etsi.ttcn.tci.TciTypeClass; import org.etsi.ttcn.codec.generic.Bitstring; @@ -61,11 +62,11 @@ public class CodecFactory { // initialize additional codec plugins org.etsi.ttcn.codec.its.adapter.Plugin.init(); org.etsi.ttcn.codec.its.uppertester.Plugin.init(); + org.etsi.ttcn.codec.its.configtester.Plugin.init(); org.etsi.ttcn.codec.its.geonetworking.Plugin.init(); org.etsi.ttcn.codec.its.btp.Plugin.init(); org.etsi.ttcn.codec.its.security.Plugin.init(); org.etsi.ttcn.codec.its.facilities.Plugin.init(); - org.etsi.ttcn.codec.its.mapspat.Plugin.init(); } } @@ -77,11 +78,12 @@ public class CodecFactory { return null; } -// System.out.println("getExternalCodec: Search external codec for " + encoding); + //TERFactory.getInstance().logDebug("getExternalCodec: Search external codec for " + encoding); codec = externalCodecs.get(encoding); if(codec != null) { - System.out.print(String.format("%50s", encoding)); - System.out.println(" ==> " + codec.getClass().getName()); + //TERFactory.getInstance().logDebug(String.format("%50s", encoding)); + //TERFactory.getInstance().logDebug(" ==> " + codec.getClass().getName()); + System.out.println(String.format("%50s", encoding) + " ==> " + codec.getClass().getName()); return codec; } return null; @@ -89,10 +91,12 @@ public class CodecFactory { public ICodec getCodec(MainCodec mainCodec, int classType, String encoding, String typeName) { - System.out.print(String.format("%50s", typeName + "(" + encoding + ")")); + //TERFactory.getInstance().logDebug(String.format("%50s", typeName + "(" + encoding + ")")); + System.out.println(String.format("%50s", typeName + "(" + encoding + ")")); Class cls = null; Class[] ctorParams = {MainCodec.class}; + //TERFactory.getInstance().logDebug("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName); System.out.println("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName); cls = codecs.get(classType + '/' + encoding + '/' + typeName); if(cls == null) { @@ -103,6 +107,7 @@ public class CodecFactory { } if(cls != null) { + //TERFactory.getInstance().logDebug(" ==> " + cls.getName()); System.out.println(" ==> " + cls.getName()); try { Constructor ctor = cls.getConstructor(ctorParams); @@ -113,12 +118,13 @@ public class CodecFactory { } } - System.out.println(" ==> No codec found !"); + //TERFactory.getInstance().logDebug(" ==> No codec found !"); + System.out.println(" ==> No codec found !"); return new Dummy(mainCodec); } public void setCodec(int classType, String encoding, String typeName, Class codec) { -// System.out.println("setCodec: add " + classType + "/" + encoding + "/" + typeName + "/" + codec); + //TERFactory.getInstance().logDebug("setCodec: add " + classType + "/" + encoding + "/" + typeName + "/" + codec); codecs.put(classType + '/' + encoding + '/' + typeName, codec); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/MainCodec.java b/javasrc/codec/org/etsi/ttcn/codec/MainCodec.java index 87a2666dbb006e08f932cdb634431769692438c3..0377d9007dfdbdeaec6cefc65763e8f847d5525d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/MainCodec.java +++ b/javasrc/codec/org/etsi/ttcn/codec/MainCodec.java @@ -9,7 +9,7 @@ import java.util.Map; import java.util.TreeMap; import org.etsi.codec.ITciCDWrapper; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.TciCDProvided; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; @@ -23,14 +23,10 @@ public class MainCodec extends ICodec { } public Value triDecode(TriMessage message, Type decodingHypothesis) { -// System.out.println("############################################################################################"); - return decode(new CodecBuffer(message.getEncodedMessage()), decodingHypothesis); } public TriMessage triEncode(Value value) { -// System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); - CodecBuffer encoded = encode(value); encoded.runCallbacks(); return new TriMessageImpl(encoded.getBytes()); @@ -38,7 +34,7 @@ public class MainCodec extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> MainCodec.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> MainCodec.decode: " + decodingHypothesis.getName()); // ByteHelper.dump(">>> MainCodec.decode: ", buf.getBytes()); CodecFactory cf = CodecFactory.getInstance(); @@ -46,21 +42,20 @@ public class MainCodec extends ICodec { TciCDProvided extCodec = cf.getExternalCodec(decodingHypothesis.getTypeEncoding()); if(extCodec != null) { return extCodec.decode(new TriMessageImpl(buf.getBytes()), decodingHypothesis); - } else { - ICodec codec = cf.getCodec( - this, - decodingHypothesis.getTypeClass(), - decodingHypothesis.getTypeEncoding(), - decodingHypothesis.getName() - ); - codec.preDecode(buf, decodingHypothesis); - - // TODO To be removed, for debug purpose only + } + ICodec codec = cf.getCodec( + this, + decodingHypothesis.getTypeClass(), + decodingHypothesis.getTypeEncoding(), + decodingHypothesis.getName() + ); + codec.preDecode(buf, decodingHypothesis); + + // TODO To be removed, for debug purpose only // Value decValue = codec.decode(buf, decodingHypothesis); -// System.out.println("<<< MainCodec.decode: " + decValue); +// TERFactory.getInstance().logDebug("<<< MainCodec.decode: " + decValue); // return decValue; - return codec.decode(buf, decodingHypothesis); - } + return codec.decode(buf, decodingHypothesis); } catch(Throwable e) { e.printStackTrace(); return null; @@ -69,48 +64,51 @@ public class MainCodec extends ICodec { @Override public CodecBuffer encode(Value value) { + //TERFactory.getInstance().logDebug(">>> MainCodec.encode: " + value); + //System.out.println(">>> MainCodec.encode: " + value); CodecFactory cf = CodecFactory.getInstance(); TciCDProvided extCodec = cf.getExternalCodec(value.getValueEncoding()); if(extCodec != null) { - return new CodecBuffer(extCodec.encode(value).getEncodedMessage()); + TriMessage enc = extCodec.encode(value); + if (enc != null) { + return new CodecBuffer(enc.getEncodedMessage()/*extCodec.encode(value).getEncodedMessage()*/); + } // else continue } - else { - ICodec codec = CodecFactory.getInstance().getCodec( - this, - value.getType().getTypeClass(), - value.getValueEncoding(), - value.getType().getName() - ); - CodecBuffer preBuf = codec.preEncode(value); - CodecBuffer buf = codec.encode(value); - if(preBuf != null) { - preBuf.append(buf); - buf = preBuf; - } - -// ByteHelper.dump("<<< MainCodec.encode: ", buf.getBytes()); - return buf; + ICodec codec = CodecFactory.getInstance().getCodec( + this, + value.getType().getTypeClass(), + value.getValueEncoding(), + value.getType().getName() + ); + CodecBuffer preBuf = codec.preEncode(value); + CodecBuffer buf = codec.encode(value); + if(preBuf != null) { + preBuf.append(buf); + buf = preBuf; } + + //ByteHelper.dump("<<< MainCodec.encode: ", buf.getBytes()); + return buf; } public String getHint(String key) { -// System.out.println("getHint: " + key + ": " + hints.get(key)); +// TERFactory.getInstance().logDebug("getHint: " + key + ": " + hints.get(key)); return hints.get(key); } public void setHint(String key, String value) { -// System.out.println("setHint: " + key + ", " + value); +// TERFactory.getInstance().logDebug("setHint: " + key + ", " + value); hints.put(key, value); } public java.lang.Boolean getPresenceHint(String key) { -// System.out.println("getPresenceHint: " + key + ": " + presenceHints.get(key)); +// TERFactory.getInstance().logDebug("getPresenceHint: " + key + ": " + presenceHints.get(key)); return presenceHints.get(key); } public void setPresenceHint(String key, java.lang.Boolean value) { -// System.out.println("setPresenceHint: " + key + ", " + value); +// TERFactory.getInstance().logDebug("setPresenceHint: " + key + ", " + value); presenceHints.put(key, value); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Bitstring.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Bitstring.java index 5ec901f1243e2f7898e954e3e0fc2cdd73f3e8c3..ab44105670785d3995e046e850f137aebb4df24c 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Bitstring.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Bitstring.java @@ -21,11 +21,11 @@ public class Bitstring extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Bitstring.decode: " + decodingHypothesis.getTypeEncoding()); +// TERFactory.getInstance().logDebug(">>> Bitstring.decode: " + decodingHypothesis.getTypeEncoding()); BitstringValue bv = (BitstringValue)decodingHypothesis.newInstance(); int lengthInBits = getEncodingLength(decodingHypothesis.getTypeEncoding()); -// System.out.println("Bitstring.decode: lengthInBits=" + lengthInBits); +// TERFactory.getInstance().logDebug("Bitstring.decode: lengthInBits=" + lengthInBits); CodecBuffer value = new CodecBuffer(); value.setBits(buf.readBits(lengthInBits), lengthInBits); @@ -40,7 +40,7 @@ public class Bitstring extends ICodec { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> Bitstring.encode: " + value); +// TERFactory.getInstance().logDebug(">>> Bitstring.encode: " + value); BitstringValue bv = (BitstringValue)value; CodecBuffer encoded = new CodecBuffer(); diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Enumerated.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Enumerated.java index 0f4349850c98ec880b4f37658f4397d2b7c60a68..3b9e00ff9078935d3c2dd668ea96966907f6abe8 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Enumerated.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Enumerated.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.generic; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; import org.etsi.ttcn.tci.EnumeratedValue; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.codec.ICodec; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; @@ -21,7 +21,7 @@ public class Enumerated extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Enumerated.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> Enumerated.decode: " + decodingHypothesis.getName()); EnumeratedValue ev = (EnumeratedValue)decodingHypothesis.newInstance(); int lengthInBits = 0; @@ -43,7 +43,7 @@ public class Enumerated extends ICodec { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> Enumerated.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Enumerated.encode: " + value.getType().getName()); EnumeratedValue ev = (EnumeratedValue)value; int lengthInBits = 0; diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Float.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Float.java index c227c2c919e619b30a0b320b891a51afd4457f72..66aae1f89815490d7838b86cfe57ded8f1abfd65 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Float.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Float.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.generic; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.ICodec; import org.etsi.ttcn.codec.MainCodec; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.FloatValue; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; @@ -21,21 +21,21 @@ public class Float extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Float.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> Float.decode: " + decodingHypothesis.getName()); FloatValue fv = mainCodec.getTciCDRequired().getFloat(); fv.setFloat(ByteHelper.byteArrayToFloat(buf.readBits(java.lang.Float.SIZE))); -// System.out.println("<<< Float.decode: " + fv.getFloat()); +// TERFactory.getInstance().logDebug("<<< Float.decode: " + fv.getFloat()); return fv; } @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> Float.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Float.encode: " + value.getType().getName()); FloatValue fv = (FloatValue)value; -// System.out.println("Float.encode: " + fv.getFloat()); +// TERFactory.getInstance().logDebug("Float.encode: " + fv.getFloat()); byte[] encoded = ByteHelper.floatToByteArray(fv.getFloat()); CodecBuffer res = new CodecBuffer(); res.setBits(encoded, encoded.length * Byte.SIZE); diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Integer.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Integer.java index acde3fc9ab38e639e6262682a3cdb8d3718ba1ff..7faab3d099147b69d57d71b6c77bb60c3390672d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Integer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Integer.java @@ -12,7 +12,7 @@ import java.util.regex.Pattern; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; import org.etsi.ttcn.tci.IntegerValue; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.codec.ICodec; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; @@ -27,7 +27,7 @@ public class Integer extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Integer.decode: " + decodingHypothesis.getName()); + //TERFactory.getInstance().logDebug(">>> Integer.decode: " + decodingHypothesis.getName()); IntegerValue iv = null; int lengthInBits; @@ -49,7 +49,14 @@ public class Integer extends ICodec { value = buf.readBits(lengthInBits); try { - Matcher matcher = UNSIGNED_VARIANT.matcher(decodingHypothesis.getTypeEncodingVariant()); + hint = mainCodec.getHint(decodingHypothesis.getName() + "Sign"); + Matcher matcher; + if (hint==null) { + matcher = UNSIGNED_VARIANT.matcher(decodingHypothesis.getTypeEncodingVariant()); + } + else { + matcher = UNSIGNED_VARIANT.matcher(hint); + } if(matcher.find()) { // Unsigned integer if(lengthInBits >= java.lang.Integer.SIZE) { @@ -65,7 +72,7 @@ public class Integer extends ICodec { } } catch(Exception e) { -// System.out.println("Integer.encode: " + decodingHypothesis.getTypeEncoding() + ", " + decodingHypothesis.getTypeEncodingVariant()); +// TERFactory.getInstance().logDebug("Integer.encode: " + decodingHypothesis.getTypeEncoding() + ", " + decodingHypothesis.getTypeEncodingVariant()); // Assume unsigned integer if(lengthInBits >= java.lang.Integer.SIZE) { iv = mainCodec.getTciCDRequired().setInteger(new BigInteger(1, value)); @@ -80,7 +87,7 @@ public class Integer extends ICodec { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> Integer.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Integer.encode: " + value.getType().getName()); IntegerValue iv = (IntegerValue)value; byte[] encoded = null; @@ -91,8 +98,8 @@ public class Integer extends ICodec { // Get length String hint = mainCodec.getHint(value.getType().getName() + "Len"); if(hint == null) { -// System.out.println("Integer.encode: " + value.getValueEncodingVariant() + ", " + value.getValueEncoding()); -// System.out.println("Integer.encode: " + value.getType().getTypeEncodingVariant() + ", " + value.getType().getTypeEncoding()); +// TERFactory.getInstance().logDebug("Integer.encode: " + value.getValueEncodingVariant() + ", " + value.getValueEncoding()); +// TERFactory.getInstance().logDebug("Integer.encode: " + value.getType().getTypeEncodingVariant() + ", " + value.getType().getTypeEncoding()); if (value.getType().getTypeEncodingVariant() != null) { lengthInBits = getVariantBitLength(value.getType().getTypeEncodingVariant()); } else { @@ -104,7 +111,7 @@ public class Integer extends ICodec { } lengthInBytes = lengthInBits / 8 + (((lengthInBits % 8) > 0)?1:0); -// System.out.println(String.format("Integer.encode: length: %d", lengthInBytes)); +// TERFactory.getInstance().logDebug(String.format("Integer.encode: length: %d", lengthInBytes)); if (lengthInBits > java.lang.Integer.SIZE) { encoded = ByteHelper.longToByteArray(mainCodec.getTciCDRequired().getBigInteger(iv), lengthInBytes); } else { diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Octetstring.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Octetstring.java index acb960224f3b246fd77c89a7c2f5d1fbd3c07ccb..e03770124b7bc93ac972d688bdf65b503eabe9e6 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Octetstring.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Octetstring.java @@ -20,7 +20,7 @@ public class Octetstring extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Octetstring.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> Octetstring.decode: " + decodingHypothesis.getName()); OctetstringValue ov = (OctetstringValue)decodingHypothesis.newInstance(); byte[] value = null; @@ -31,7 +31,7 @@ public class Octetstring extends ICodec { if(hint == null) { lengthInBytes = getEncodingLength(decodingHypothesis.getTypeEncoding()); if (lengthInBytes == 0) { -// System.out.println("Octetstring.decode: Decode full buffer"); +// TERFactory.getInstance().logDebug("Octetstring.decode: Decode full buffer"); lengthInBytes = buf.getNbBytes(); } } @@ -50,7 +50,7 @@ public class Octetstring extends ICodec { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> Octetstring.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Octetstring.encode: " + value.getType().getName()); OctetstringValue ov = (OctetstringValue)value; byte[] encoded = new byte[ov.getLength()]; diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Record.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Record.java index e047b86afe72cd90f664ff2058fb9aeb14214aa8..282f6aa2f178987c544824e707a2516fd3bd29d6 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Record.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Record.java @@ -5,6 +5,7 @@ */ package org.etsi.ttcn.codec.generic; +import org.etsi.adapter.TERFactory; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; import org.etsi.ttcn.tci.RecordValue; @@ -37,7 +38,7 @@ public class Record extends ICodec { if(fv == null) { if(mainCodec.getHint(fields[i] + "IgnoreErrorOnOptionalField") != null) { // Set to omit + warning if optional - System.err.println("Unable to decode optional field '" + fields[i] + "'. Setting to 'omit'"); + //TERFactory.getInstance().logDebug("Unable to decode optional field '" + fields[i] + "'. Setting to 'omit'"); rv.setFieldOmitted(fields[i]); } else { diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/RecordOf.java b/javasrc/codec/org/etsi/ttcn/codec/generic/RecordOf.java index d9c1075855802fc84eaf6e8978d3d43de4cf94b6..b308fc4cfc3d4c32aa7513406dc0e3a02265bdba 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/RecordOf.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/RecordOf.java @@ -20,7 +20,7 @@ public class RecordOf extends ICodec { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> RecordOf.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> RecordOf.decode: " + decodingHypothesis.getName()); RecordOfValue rov = (RecordOfValue)decodingHypothesis.newInstance(); String lenHint = mainCodec.getHint(decodingHypothesis.getName() + "Len"); @@ -48,7 +48,7 @@ public class RecordOf extends ICodec { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> RecordOf.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> RecordOf.encode: " + value.getType().getName()); RecordOfValue rov = (RecordOfValue)value; CodecBuffer buf = new CodecBuffer(); diff --git a/javasrc/codec/org/etsi/ttcn/codec/generic/Union.java b/javasrc/codec/org/etsi/ttcn/codec/generic/Union.java index 04556c4912b0f5bac05100b4aaa27d9a7c78643d..981dc2098b0bdfd2c1d186889fef09f66e733768 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/generic/Union.java +++ b/javasrc/codec/org/etsi/ttcn/codec/generic/Union.java @@ -25,19 +25,19 @@ public class Union extends ICodec { String variant = ""; variant = mainCodec.getHint(decodingHypothesis.getName()); -// System.out.println("Union: Looking for variant " + decodingHypothesis.getName() + "/" + variant); + //TERFactory.getInstance().logDebug("Union: Looking for variant " + decodingHypothesis.getName() + "/" + variant); if(variant != null) { Value value = uv.getVariant(variant); if (value == null) { value = mainCodec.getTciCDRequired().getUnionValue(decodingHypothesis, variant); if (value != null) { -// System.out.println("Union (TCT3): " + value.getType().getName()); + //TERFactory.getInstance().logDebug("Union (TCT3): " + value.getType().getName()); uv.setVariant(variant, mainCodec.decode(buf, value.getType())); return uv; } } else { -// System.out.println("Union (TTWB): " + value.getType().getName()); + //TERFactory.getInstance().logDebug("Union (TTWB): " + value.getType().getName()); uv.setVariant(variant, mainCodec.decode(buf, value.getType())); return uv; } @@ -57,11 +57,11 @@ public class Union extends ICodec { if (value == null) { value = mainCodec.getTciCDRequired().getUnionValue(decodingHypothesis, mainCodec.getHint(variants[i])); if (value != null) { -// System.out.println("Union (TCT3): " + value.getType().getName()); + //TERFactory.getInstance().logDebug("Union (TCT3): " + value.getType().getName()); vv = mainCodec.decode(buf, value.getType()); } } else { -// System.out.println("Union (TTWB): " + value.getType().getName()); + //TERFactory.getInstance().logDebug("Union (TTWB): " + value.getType().getName()); vv = mainCodec.decode(buf, value.getType()); } } else { diff --git a/javasrc/codec/org/etsi/ttcn/codec/ipv6/AnyIcmpv6Message.java b/javasrc/codec/org/etsi/ttcn/codec/ipv6/AnyIcmpv6Message.java index 69fbe32d80f32777227ae9406dae25f4eef84f75..2d9656422ae16f7390d59c11eee9f4dd5770d2e8 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/ipv6/AnyIcmpv6Message.java +++ b/javasrc/codec/org/etsi/ttcn/codec/ipv6/AnyIcmpv6Message.java @@ -7,7 +7,7 @@ import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.IMarkerCallback; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class AnyIcmpv6Message extends Record implements IMarkerCallback { diff --git a/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6ExtHdr.java b/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6ExtHdr.java index de40cb9c14ef9fbb1d10ee8e640391b11fc7b5f3..02d0bca443953b9c0f23eef1ac7321fc6165b9a7 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6ExtHdr.java +++ b/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6ExtHdr.java @@ -7,7 +7,7 @@ import org.etsi.ttcn.codec.generic.Record; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class Ipv6ExtHdr extends Record { diff --git a/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6Header.java b/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6Header.java index b469f3d8095fa4b801db8d33a42ee600ab9a343a..f88805ddb9c9db778c81fc835feec7a3e4df1e40 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6Header.java +++ b/javasrc/codec/org/etsi/ttcn/codec/ipv6/Ipv6Header.java @@ -5,7 +5,7 @@ import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.IMarkerCallback; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class Ipv6Header extends Record implements IMarkerCallback { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/AcEnableSecurity.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcEnableSecurity.java similarity index 68% rename from javasrc/codec/org/etsi/ttcn/codec/its/security/AcEnableSecurity.java rename to javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcEnableSecurity.java index 6fb59bcf94c49b1f97ae252893d1a2e43c39cf7d..1cb61fa3332bd58c7dbc14527a10dc8495367b3a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/AcEnableSecurity.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcEnableSecurity.java @@ -3,12 +3,11 @@ * @version $URL$ * $Id$ */ -package org.etsi.ttcn.codec.its.security; +package org.etsi.ttcn.codec.its.adapter; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -20,13 +19,13 @@ public class AcEnableSecurity extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> AcEnableSecurity.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> AcEnableSecurity.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> AcEnableSecurity.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> AcEnableSecurity.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("certificateId")) { mainCodec.setHint(decodingHypothesis.getName() + "Len", String.valueOf(buf.getNbBytes())); @@ -35,7 +34,7 @@ public class AcEnableSecurity extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> AcEnableSecurity.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> AcEnableSecurity.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class AcEnableSecurity diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcFsapPrimitive.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcFsapPrimitive.java index ef49daf256af310f4073de436cb9206a0b736f64..084fe339a70da4b163594f51dba97ec28c631f6d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcFsapPrimitive.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcFsapPrimitive.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.adapter; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Union; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.UnionValue; public class AcFsapPrimitive extends Union { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnPrimitive.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnPrimitive.java index 922dc5e5c7b452637880028c14e1f89e35773a50..5002d3b4d47ed285fd9d2b02dfe22ce1bef2af6a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnPrimitive.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnPrimitive.java @@ -10,7 +10,7 @@ import org.etsi.ttcn.tci.UnionValue; import org.etsi.ttcn.codec.generic.Union; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class AcGnPrimitive extends Union { @@ -52,12 +52,6 @@ public class AcGnPrimitive extends Union { case 6: primitive = "getLongPosVector"; break; - case 7: - primitive = "enableSecurity"; - break; - case 8: - primitive = "disableSecurity"; - break; } mainCodec.setHint(decodingHypothesis.getName(), primitive); @@ -93,12 +87,6 @@ public class AcGnPrimitive extends Union { else if(variant.equals("getLongPosVector")) { primitiveId = 6; } - else if(variant.equals("acEnableSecurity")) { - primitiveId = 7; - } - else if(variant.equals("acDisableSecurity")) { - primitiveId = 8; - } buf.appendBytes(ByteHelper.intToByteArray(primitiveId, 1)); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnResponse.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnResponse.java index c51ca16fdc8c3d46330f27d15857a85d8dee022c..e70a81848bf42f24d25bb8ad570df3e474a3f192 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnResponse.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnResponse.java @@ -5,12 +5,13 @@ */ package org.etsi.ttcn.codec.its.adapter; +import org.etsi.adapter.TERFactory; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.UnionValue; import org.etsi.ttcn.codec.generic.Union; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class AcGnResponse extends Union { @@ -23,7 +24,7 @@ public class AcGnResponse extends Union { // Read message id (AcGnResponse) if(0x00 != (0x00FF & buf.readBytes(1)[0])) { - System.out.println("Bad hypothesis"); + TERFactory.getInstance().logDebug("Bad hypothesis"); return; } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnssPrimitive.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnssPrimitive.java index aa57f2570eba11c2a2e45044849909cf62dafd17..369d8a3049b4e2cc4b6648d01f8c86e3b94976a4 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnssPrimitive.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcGnssPrimitive.java @@ -5,7 +5,7 @@ import org.etsi.ttcn.tci.UnionValue; import org.etsi.ttcn.codec.generic.Union; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class AcGnssPrimitive extends Union { @@ -44,6 +44,9 @@ public class AcGnssPrimitive extends Union { case 0x75: primitive = "changeHeading"; break; + case 0x76: + primitive = "timeInRunningScenario"; + break; } mainCodec.setHint(decodingHypothesis.getName(), primitive); @@ -76,6 +79,10 @@ public class AcGnssPrimitive extends Union { else if(variant.equals("changeHeading")) { primitiveId = 0x75; } + else if(variant.equals("timeInRunningScenario")) { + primitiveId = 0x76; + mainCodec.setHint("integerLen", "32"); + } buf.appendBytes(ByteHelper.intToByteArray(primitiveId, 1)); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecPrimitive.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecPrimitive.java new file mode 100644 index 0000000000000000000000000000000000000000..d646b0671de3f682471a8db36bc6bc593bc598bf --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecPrimitive.java @@ -0,0 +1,58 @@ +package org.etsi.ttcn.codec.its.adapter; + +import org.etsi.ttcn.codec.CodecBuffer; +import org.etsi.ttcn.codec.MainCodec; +import org.etsi.ttcn.codec.generic.Union; +import org.etsi.common.ByteHelper; +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.UnionValue; + +public class AcSecPrimitive extends Union { + + public AcSecPrimitive(MainCodec mainCodec) { + super(mainCodec); + } + + @Override + protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { + + // Read message id (AcSecPrimitive) + if(0x00 != (0x00FF & buf.readBytes(1)[0])) { + return; + } + + // Read primitive id + int primitiveId = 0x00FF & buf.readBytes(1)[0]; + String primitive = ""; + + switch(primitiveId) { + case 0x7a: + primitive = "acEnableSecurity"; + break; + case 0x7b: + primitive = "acDisableSecurity"; + break; + } + + mainCodec.setHint(decodingHypothesis.getName(), primitive); + } + + @Override + protected void preEncode(CodecBuffer buf, UnionValue uv) { + String variant = uv.getPresentVariantName(); + int primitiveId = -1; + + // Append AcSecPrimitive message id + buf.appendBytes(ByteHelper.intToByteArray(3, 1)); + + // Append primitive id + if(variant.equals("acEnableSecurity")) { + primitiveId = 0x7a; + mainCodec.setHint("ScenarioLen", "16"); + } + else if(variant.equals("acDisableSecurity")) { + primitiveId = 0x7b; + } + buf.appendBytes(ByteHelper.intToByteArray(primitiveId, 1)); + } +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecResponse.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..24e5501a16ae5ac35dc6ad4c29c5b9035ea006cb --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/AcSecResponse.java @@ -0,0 +1,33 @@ +package org.etsi.ttcn.codec.its.adapter; + +import org.etsi.ttcn.codec.CodecBuffer; +import org.etsi.ttcn.codec.MainCodec; +import org.etsi.ttcn.codec.generic.Boolean; +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; + +public class AcSecResponse extends Boolean { + + private static final int AcSecResponse = 0x05; + + public AcSecResponse(MainCodec mainCodec) { + super(mainCodec); + } + + @Override + public Value decode(CodecBuffer buf, Type decodingHypothesis) { + + byte[] readId = buf.readBytes(1); + if(readId[0] != AcSecResponse) { + return null; + } + + return super.decode(buf, decodingHypothesis); + } + + @Override + public CodecBuffer preEncode(Value value) { + return new CodecBuffer(new byte[] {0x02}); + } + +} // End of class AcSecResponse diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/Plugin.java index 04a7c23ceec9fe10c6be52d30d0cfca119352a31..fdb3cc20d63207f51305ede951e52a33f016c293 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/adapter/Plugin.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/adapter/Plugin.java @@ -13,10 +13,13 @@ public class Plugin { public static void init() { CodecFactory cf = CodecFactory.getInstance(); + cf.setCodec(TciTypeClass.RECORD, "AdapterControl", "AcEnableSecurity", AcEnableSecurity.class); cf.setCodec(TciTypeClass.UNION, "AdapterControl", "AcGnPrimitive", AcGnPrimitive.class); cf.setCodec(TciTypeClass.UNION, "AdapterControl", "AcGnResponse", AcGnResponse.class); cf.setCodec(TciTypeClass.UNION, "AdapterControl", "AcFsapPrimitive", AcFsapPrimitive.class); cf.setCodec(TciTypeClass.UNION, "AdapterControl", "AcGnssPrimitive", AcGnssPrimitive.class); cf.setCodec(TciTypeClass.BOOLEAN, "AdapterControl", "AcGnssResponse", AcGnssResponse.class); + cf.setCodec(TciTypeClass.UNION, "AdapterControl", "AcSecPrimitive", AcSecPrimitive.class); + cf.setCodec(TciTypeClass.BOOLEAN, "AdapterControl", "AcSecResponse", AcSecResponse.class); } } \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/btp/BtpPacket.java b/javasrc/codec/org/etsi/ttcn/codec/its/btp/BtpPacket.java index 9bfd3cf3ac5fe697a99b1e45807bcdb15ff50af1..77318820a5a63fa69b94849750b3a4c089c5b396 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/btp/BtpPacket.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/btp/BtpPacket.java @@ -20,7 +20,7 @@ public class BtpPacket extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> BtpPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> BtpPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis); if(fieldName.equals("payload")) { if (buf.getNbBytes() == 0) { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/btp/DecodedBtpPayload.java b/javasrc/codec/org/etsi/ttcn/codec/its/btp/DecodedBtpPayload.java index f8b5f746294f973ca8c2ad0febeb863febe525d9..6e876bdd44195bb21593f00dcaae2b4a2ac00080 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/btp/DecodedBtpPayload.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/btp/DecodedBtpPayload.java @@ -1,9 +1,7 @@ package org.etsi.ttcn.codec.its.btp; -import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Union; -import org.etsi.ttcn.tci.Type; public class DecodedBtpPayload extends Union { @@ -12,14 +10,15 @@ public class DecodedBtpPayload extends Union { setLengths(); } - private void setLengths() { + private void setLengths() { // See LibItsBtp_TypesAndValues TTCN-3 module mainCodec.setHint("camPacket", "camPacket"); mainCodec.setHint("denmPacket", "denmPacket"); + mainCodec.setHint("mapemPacket", "mapemPacket"); + mainCodec.setHint("spatemPacket", "spatemPacket"); + mainCodec.setHint("ivimPacket", "ivimPacket"); + mainCodec.setHint("evcsnPacket", "evcsnPacket"); + mainCodec.setHint("sremPacket", "sremPacket"); + mainCodec.setHint("ssemPacket", "ssemPacket"); } - @Override - protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> DecodedBtpPayload.preDecode: " + decodingHypothesis); - - } } // End of class DecodedBtpPayload diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/configtester/CfEvent.java b/javasrc/codec/org/etsi/ttcn/codec/its/configtester/CfEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..250b633e68fe06cf6e5f51717375ecff014dc92d --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/configtester/CfEvent.java @@ -0,0 +1,22 @@ +package org.etsi.ttcn.codec.its.configtester; + +import org.etsi.ttcn.codec.CodecBuffer; +import org.etsi.ttcn.codec.MainCodec; +import org.etsi.ttcn.codec.generic.Charstring; +import org.etsi.ttcn.tci.Type; + +public class CfEvent extends Charstring { + + public CfEvent(MainCodec mainCodec) { + super(mainCodec); + } + + @Override + protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { + // Set Length for CfEvent + mainCodec.setHint("CfEventLen", new Integer(buf.getNbBytes()).toString()); + + return; + } + +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/configtester/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/configtester/Plugin.java new file mode 100644 index 0000000000000000000000000000000000000000..951f1bcdcd2faf17822e5c19a36f31e99f972366 --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/configtester/Plugin.java @@ -0,0 +1,23 @@ +/** + * @author ETSI / STF517 / Yann garcia + * @version $URL$ + * $Id$ + */ +package org.etsi.ttcn.codec.its.configtester; + +import org.etsi.ttcn.tci.TciTypeClass; +import org.etsi.ttcn.codec.CodecFactory; + +import org.etsi.ttcn.codec.generic.Record; +import org.etsi.ttcn.codec.generic.Boolean; + +public class Plugin { + + public static void init() { + // Basics + CodecFactory cf = CodecFactory.getInstance(); + cf.setCodec(TciTypeClass.RECORD, "ConfigTester", "", Record.class); + cf.setCodec(TciTypeClass.BOOLEAN, "ConfigTester", "", Boolean.class); + cf.setCodec(TciTypeClass.CHARSTRING, "ConfigTester", "", CfEvent.class); + } +} \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java b/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java index be2fef93cda34da2c547b5cf15055a0efa69a1c2..5d2e7a1bcb662cd1732b4c744436dd53781bdd2c 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java @@ -20,9 +20,9 @@ public class FacilitiesInd extends Record { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> FacilitiesInd.preDecode: " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> FacilitiesInd.preDecode: " + decodingHypothesis); - int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16; + int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16 - 256 - 32; // FIXME Add support of SSP (Bit256) & ITS-AID (UInt32) extra fields: fixed size (256) is not nice! int offset = 0; messageBuffer = buf.getBuffer(offset, msgLen); offset += msgLen; @@ -33,11 +33,13 @@ public class FacilitiesInd extends Record { gnTc = buf.getBuffer(offset, 8); offset += 8; btpDestinationPort = buf.getBuffer(offset, 16); offset += 16; btpInfo = buf.getBuffer(offset, 16); offset += 16; + ssp = buf.getBuffer(offset, 256); offset += 256; + its_aid = buf.getBuffer(offset, 32); offset += 32; } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> FacilitiesInd.preDecodeField: " + fieldName + " - " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> FacilitiesInd.preDecodeField: " + fieldName + " - " + decodingHypothesis); if(fieldName.equals("gnNextHeader")) { buf.overwriteWith(gnNh); @@ -60,6 +62,12 @@ public class FacilitiesInd extends Record { else if(fieldName.equals("btpInfo")) { buf.overwriteWith(btpInfo); } + else if(fieldName.equals("ssp")) { + buf.overwriteWith(ssp); + } + else if(fieldName.equals("its_aid")) { + buf.overwriteWith(its_aid); + } else { buf.overwriteWith(messageBuffer); } @@ -84,4 +92,6 @@ public class FacilitiesInd extends Record { private CodecBuffer gnTc = null; private CodecBuffer btpDestinationPort = null; private CodecBuffer btpInfo = null; + private CodecBuffer ssp = null; + private CodecBuffer its_aid = null; } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/facilities/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/facilities/Plugin.java index e3be39d7ae2d199461874f38a021d7537c572ff5..acd62ee1b2cb61cda016928515cadbd2c9e40f86 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/facilities/Plugin.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/facilities/Plugin.java @@ -15,7 +15,11 @@ public class Plugin { CodecFactory cf = CodecFactory.getInstance(); cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "CamInd", FacilitiesInd.class); cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "DenmInd", FacilitiesInd.class); - cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "MapInd", FacilitiesInd.class); - cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SpatInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "MapemInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SpatemInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "IvimInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "EvcsnInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SremInd", FacilitiesInd.class); + cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SsemInd", FacilitiesInd.class); } } \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/BasicHeader.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/BasicHeader.java index 380aa94754e63aeb0f12784877943fa9109f0129..cc49f737b09acc12ad1d8208e5f851eeeb3c0e90 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/BasicHeader.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/BasicHeader.java @@ -28,7 +28,7 @@ public class BasicHeader extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> BasicHeader.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> BasicHeader.postEncodeField: " + fieldName); if(fieldName.equals("nextHeader")) { mainCodec.setHint("GnNextHeader", Integer.toString(buf.getBytes(buf.getNbBytes() - 1, 1)[0])); @@ -37,12 +37,12 @@ public class BasicHeader extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> BasicHeader.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> BasicHeader.preDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> BasicHeader.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> BasicHeader.postDecodeField: " + fieldName + ", " + decodingHypothesis); if(fieldName.equals("nextHeader")) { int nh = ((EnumeratedValue)(rv.getField(fieldName))).getInt(); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/CommonHeader.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/CommonHeader.java index ff08131b3f371524219a0854ef63fb7b21852678..c45cc5ec0cd4cbf417fd2f5f2aa124525333dfa5 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/CommonHeader.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/CommonHeader.java @@ -10,11 +10,12 @@ import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.IMarkerCallback; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.EnumeratedValue; import org.etsi.ttcn.tci.IntegerValue; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.UnionValue; public class CommonHeader extends Record implements IMarkerCallback { @@ -31,7 +32,7 @@ public class CommonHeader extends Record implements IMarkerCallback { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> CommonHeader.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> CommonHeader.postEncodeField: " + fieldName); if(fieldName.equals("nextHeader")) { int nh = buf.getBits(buf.getNbBits() - 4, 4)[0]; @@ -43,18 +44,25 @@ public class CommonHeader extends Record implements IMarkerCallback { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> CommonHeader.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> CommonHeader.preDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> CommonHeader.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> CommonHeader.postDecodeField: " + fieldName + ", " + decodingHypothesis); if(fieldName.equals("nextHeader")) { int nh = ((EnumeratedValue)(rv.getField(fieldName))).getInt(); mainCodec.setHint("GnNextHeader", Integer.toString(nh)); } + else if(fieldName.equals("headerTST")) { + String headerTST = ((UnionValue)(rv.getField(fieldName))).getPresentVariantName(); + if (headerTST.equals("beaconHdr")) { + mainCodec.setHint("IsBeacon", "true"); + } + } + else if(fieldName.equals("plLength")) { // int pl = ((IntegerValue)(rv.getField(fieldName))).getInteger(); TTWB iterface is getInt, TCI shall be getInteger int pl = mainCodec.getTciCDRequired().getInteger((IntegerValue)(rv.getField(fieldName))); @@ -64,7 +72,7 @@ public class CommonHeader extends Record implements IMarkerCallback { @Override public void run(String markerName, CodecBuffer leftBuf, CodecBuffer rightBuf) { -// System.out.println(">>> CommonHeader.run"); +// TERFactory.getInstance().logDebug(">>> CommonHeader.run"); if(markerName.equals("plLength")) { int pl = java.lang.Integer.parseInt(mainCodec.getHint("payloadLength")); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GN_Address.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GN_Address.java index 6d8143b5db0ace8ce4dbb2c77211c14619870c5a..55af58cf658f64ff0832fd50dade85e5c14d7500 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GN_Address.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GN_Address.java @@ -21,18 +21,18 @@ public class GN_Address extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> GN_Address.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> GN_Address.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GN_Address.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GN_Address.preDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GN_Address.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GN_Address.postDecodeField: " + fieldName + ", " + decodingHypothesis); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPacket.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPacket.java index ebe8e8019c965c534b10b66f8ccc7527e21149b9..c197645b59c4a46a2ee8e0f30cd5124153d60b8a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPacket.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPacket.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.geonetworking; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.OctetstringValue; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -29,14 +29,14 @@ public class GeoNetworkingPacket extends Record { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> GeoNetworkingPacket.encode: " + value); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.encode: " + value); return super.encode(value); } @Override public CodecBuffer preEncode(Value value) { -// System.out.println(">>> GeoNetworkingPacket.preEncode: " + value); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.preEncode: " + value); String gnNextHeader = mainCodec.getHint("GnNextHeader"); isSecuredMode = (boolean)((gnNextHeader != null) && gnNextHeader.equals("32")); @@ -46,7 +46,7 @@ public class GeoNetworkingPacket extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> GeoNetworkingPacket.postEncodeField: " + fieldName + ", " + isSecuredMode); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.postEncodeField: " + fieldName + ", " + isSecuredMode); if (isSecuredMode && fieldName.equals("packet")) { // Ignore 'packet' encoding by reseting the CodecBuffer content @@ -56,33 +56,33 @@ public class GeoNetworkingPacket extends Record { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> GeoNetworkingPacket.decode: " + decodingHypothesis + ", " + isSecuredMode); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.decode: " + decodingHypothesis + ", " + isSecuredMode); packetValue = null; // Reset value Value result = super.decode(buf, decodingHypothesis); // Normal decoding -// System.out.println("GeoNetworkingPacket.decode: Normal decoding=" + result); - if(isSecuredMode) { +// TERFactory.getInstance().logDebug("GeoNetworkingPacket.decode: Normal decoding=" + result); + if(isSecuredMode && (result != null)) { // Override 'packet' field RecordValue rv = (RecordValue) result; rv.setField("packet", packetValue); } -// System.out.println("<<< GeoNetworkingPacket.decode: " + result); +// TERFactory.getInstance().logDebug("<<< GeoNetworkingPacket.decode: " + result); return result; } @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> GeoNetworkingPacket.preDecode: " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.preDecode: " + decodingHypothesis); String gnNextHeader = mainCodec.getHint("GnNextHeader"); isSecuredMode = (boolean)((gnNextHeader != null) && gnNextHeader.equals("2")); -// System.out.println("GeoNetworkingPacket.preDecode: isSecuredMode=" + isSecuredMode); +// TERFactory.getInstance().logDebug("GeoNetworkingPacket.preDecode: isSecuredMode=" + isSecuredMode); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GeoNetworkingPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis + ", " + isSecuredMode); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis + ", " + isSecuredMode); if(isSecuredMode) { if (fieldName.equals("packet")) { @@ -97,7 +97,7 @@ public class GeoNetworkingPacket extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GeoNetworkingPacket.postDecodeField: " + fieldName + ", " + rv); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPacket.postDecodeField: " + fieldName + ", " + rv); if(isSecuredMode) { if(fieldName.equals("securedMsg")) { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPdu.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPdu.java index 593aff7aec4b227914c8f1792c0ad8fe0d2d7692..2740de956cb592dced0b17524a9c65c026e630fa 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPdu.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GeoNetworkingPdu.java @@ -18,17 +18,17 @@ public class GeoNetworkingPdu extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> GeoNetworkingPdu.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPdu.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GeoNetworkingPdu.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPdu.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GeoNetworkingPdu.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> GeoNetworkingPdu.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class GeoNetworkingPdu diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnIndReq.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnIndReq.java index a136be53af69523cd2519b5cdce7fee55b155c5e..95bd460ddb21e1bc2a581f074511b3697eef0a61 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnIndReq.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnIndReq.java @@ -20,20 +20,28 @@ public class GnIndReq extends Record { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> GnIndReq.preDecode: " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnIndReq.preDecode: " + decodingHypothesis); - int msgLen = buf.getNbBits() - 48; + int msgLen = buf.getNbBits() - 48 - 256/*SSP*/ - 32/*ItsAid*/; messageBuffer = buf.getBuffer(0, msgLen); macBuffer = buf.getBuffer(msgLen, 48); + msgLen += 48; + sspBuffer = buf.getBuffer(msgLen, 256/*SSP*/); + msgLen += 256/*SSP*/; + itsaidBuffer = buf.getBuffer(msgLen, 32/*ItsAid*/); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis); if(fieldName.equals("macDestinationAddress")) { buf.overwriteWith(macBuffer); + } else if(fieldName.equals("ssp")) { + buf.overwriteWith(sspBuffer); + } else if(fieldName.equals("its_aid")) { + buf.overwriteWith(itsaidBuffer); } else { buf.overwriteWith(messageBuffer); @@ -42,17 +50,19 @@ public class GnIndReq extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override public CodecBuffer encode(Value value) { -// System.out.println("GnIndReq.encode: " + value); +// TERFactory.getInstance().logDebug("GnIndReq.encode: " + value); return super.encode(value); } private CodecBuffer messageBuffer = null; private CodecBuffer macBuffer = null; + private CodecBuffer sspBuffer = null; + private CodecBuffer itsaidBuffer = null; } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnNonSecuredPacket.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnNonSecuredPacket.java index 5f7152dc5db3078c2eaf520b2dd3c9734f302777..7143f481650cd70da158278544e8d927d3ea5358 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnNonSecuredPacket.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/GnNonSecuredPacket.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.geonetworking; import org.etsi.ttcn.codec.generic.Record; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; import org.etsi.ttcn.tci.Value; @@ -23,13 +23,13 @@ public class GnNonSecuredPacket extends Record { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> GnNonSecuredPacket.preDecode: " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.preDecode: " + decodingHypothesis); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnNonSecuredPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.preDecodeField: " + fieldName + ", " + decodingHypothesis); // FIXME Yann if payload length is 0, why payload is not set to omit? // if(fieldName.equals("payload")) { @@ -41,13 +41,13 @@ public class GnNonSecuredPacket extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnNonSecuredPacket.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.postDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> GnNonSecuredPacket.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.postEncodeField: " + fieldName); if(fieldName.equals("payload")) { // Compute Payload's length and set a hint @@ -58,14 +58,14 @@ public class GnNonSecuredPacket extends Record { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> GnNonSecuredPacket.encode: " + value); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.encode: " + value); return super.encode(value); } @Override public CodecBuffer preEncode(Value value) { -// System.out.println(">>> GnNonSecuredPacket.preEncode: " + value); +// TERFactory.getInstance().logDebug(">>> GnNonSecuredPacket.preEncode: " + value); mainCodec.setHint("payloadLength", Integer.toString(0)); return new CodecBuffer(); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/HeaderTST.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/HeaderTST.java index c481eea836b4633d186c6c8eefd76d7362fccf83..2fbddd80c428040f23a5a3bf3a08a62eb17c30ef 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/HeaderTST.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/HeaderTST.java @@ -18,7 +18,7 @@ public class HeaderTST extends Union { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> HeaderTST.preDecode: " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> HeaderTST.preDecode: " + decodingHypothesis); int hdrType = 0x00FF & buf.getBits(0, 4)[0]; String variant = ""; diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/LongPosVector.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/LongPosVector.java index 10a309db7177060ce80fe59eabaec9a7b38d7206..9aa048a1a2cb802b43f850ccf7c3b9e38af0f973 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/LongPosVector.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/LongPosVector.java @@ -19,17 +19,17 @@ public class LongPosVector extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> LongPosVector.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> LongPosVector.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> LongPosVector.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> LongPosVector.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> LongPosVector.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> LongPosVector.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class LongPosVector diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/Payload.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/Payload.java index 944564d15065e8d6d2f8d89d085fc0f2feabb4e0..df35fd6f7d3f20b8897a39f66af5ca88e968cf88 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/Payload.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/Payload.java @@ -5,6 +5,7 @@ */ package org.etsi.ttcn.codec.its.geonetworking; +import org.etsi.adapter.TERFactory; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; @@ -19,7 +20,7 @@ public class Payload extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Payload.preDecode" + decodingHypothesis); + //TERFactory.getInstance().logDebug(">>> Payload.preDecode" + decodingHypothesis); if(fieldName.equals("decodedPayload")) { String nhHint = mainCodec.getHint("GnNextHeader"); @@ -53,15 +54,15 @@ public class Payload extends Record { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> Payload.preDecode: " + decodingHypothesis); + //TERFactory.getInstance().logDebug(">>> Payload.preDecode: " + decodingHypothesis); // Sanity check on pl int pl = java.lang.Integer.parseInt(mainCodec.getHint("payloadLength")); int remainingBytesForPayload = buf.getNbBytes(); - if(pl != remainingBytesForPayload) { - System.err.println("Error: bad payload length or message truncated " - + "(indicated: " + pl + " - real: " + remainingBytesForPayload + ")"); + String hint = mainCodec.getHint("IsBeacon"); + if(pl != remainingBytesForPayload && hint==null) { + //TERFactory.getInstance().logDebug("Error: bad payload length or message truncated " + "(indicated: " + pl + " - real: " + remainingBytesForPayload + ")"); pl = Math.min(remainingBytesForPayload, pl); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/TrafficClass.java b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/TrafficClass.java index 405a64dfdd25c0acf1352258745006fb206a7f63..42c1e430493ada07c90f0cd81680c1cdb5ee3f77 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/TrafficClass.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/geonetworking/TrafficClass.java @@ -21,18 +21,18 @@ public class TrafficClass extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> TrafficClass.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> TrafficClass.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> TrafficClass.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> TrafficClass.preDecodeField: " + fieldName + ", " + decodingHypothesis); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> TrafficClass.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// TERFactory.getInstance().logDebug(">>> TrafficClass.postDecodeField: " + fieldName + ", " + decodingHypothesis); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/MapSpatIndReq.java b/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/MapSpatIndReq.java index 8460f9ae188a94fc3d24a05f4838d713e73d7357..210dd185df4c3aeeea5b12d92f3e4a8117be924d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/MapSpatIndReq.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/MapSpatIndReq.java @@ -1,53 +1,54 @@ package org.etsi.ttcn.codec.its.mapspat; -import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.codec.MainCodec; -import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.tci.RecordValue; -import org.etsi.ttcn.tci.Type; -import org.etsi.ttcn.tci.Value; +// TODO To be removed +//import org.etsi.ttcn.codec.CodecBuffer; +//import org.etsi.ttcn.codec.MainCodec; +//import org.etsi.ttcn.codec.generic.Record; +//import org.etsi.ttcn.tci.RecordValue; +//import org.etsi.ttcn.tci.Type; +//import org.etsi.ttcn.tci.Value; -public class MapSpatIndReq extends Record { - - public MapSpatIndReq(MainCodec mainCodec) { - super(mainCodec); - } - - @Override - protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> MapSpatIndReq.preDecode: " + decodingHypothesis); - - int msgLen = buf.getNbBits() - 48; - - messageBuffer = buf.getBuffer(0, msgLen); - macBuffer = buf.getBuffer(msgLen, 48); - } - - @Override - protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> MapSpatIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis); - - if(fieldName.equals("macDestinationAddress")) { - buf.overwriteWith(macBuffer); - } - else { - buf.overwriteWith(messageBuffer); - } - } - - @Override - protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> MapSpatIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis); - - } - - @Override - public CodecBuffer encode(Value value) { -// System.out.println("MapSpatIndReq.encode: " + value); - - return super.encode(value); - } - - private CodecBuffer messageBuffer = null; - private CodecBuffer macBuffer = null; -} // End of class MapSpatIndReq +//public class MapSpatIndReq extends Record { +// +// public MapSpatIndReq(MainCodec mainCodec) { +// super(mainCodec); +// } +// +// @Override +// protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { +//// System.out.println(">>> MapSpatIndReq.preDecode: " + decodingHypothesis); +// +// int msgLen = buf.getNbBits() - 48; +// +// messageBuffer = buf.getBuffer(0, msgLen); +// macBuffer = buf.getBuffer(msgLen, 48); +// } +// +// @Override +// protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { +//// System.out.println(">>> MapSpatIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis); +// +// if(fieldName.equals("macDestinationAddress")) { +// buf.overwriteWith(macBuffer); +// } +// else { +// buf.overwriteWith(messageBuffer); +// } +// } +// +// @Override +// protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { +//// System.out.println(">>> MapSpatIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis); +// +// } +// +// @Override +// public CodecBuffer encode(Value value) { +//// System.out.println("MapSpatIndReq.encode: " + value); +// +// return super.encode(value); +// } +// +// private CodecBuffer messageBuffer = null; +// private CodecBuffer macBuffer = null; +//} // End of class MapSpatIndReq diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/Plugin.java index 184ab901914faf429c2caad51ff3a4e942f242b3..931e075a71c016c20466ea66e80bfb304cd9cf78 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/Plugin.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/mapspat/Plugin.java @@ -5,15 +5,16 @@ */ package org.etsi.ttcn.codec.its.mapspat; -import org.etsi.ttcn.tci.TciTypeClass; -import org.etsi.ttcn.codec.CodecFactory; - -public class Plugin { - - public static void init() { - - CodecFactory cf = CodecFactory.getInstance(); - cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "MapReq", MapSpatIndReq.class); - cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SpatReq", MapSpatIndReq.class); - } -} \ No newline at end of file +//TODO To be removed +//import org.etsi.ttcn.tci.TciTypeClass; +//import org.etsi.ttcn.codec.CodecFactory; +// +//public class Plugin { +// +// public static void init() { +// +// CodecFactory cf = CodecFactory.getInstance(); +// cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "MapReq", MapSpatIndReq.class); +// cf.setCodec(TciTypeClass.RECORD, "LibIts_Interface", "SpatReq", MapSpatIndReq.class); +// } +//} \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/AesCcm.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/AesCcm.java index 8eb63f7c401ba821407838c9eacd813d5b7faea2..dd0c1283e775ee5b005bfbe1302a45e5298f2533 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/AesCcm.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/AesCcm.java @@ -33,17 +33,17 @@ public class AesCcm extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> AesCcm.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> AesCcm.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> AesCcm.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> AesCcm.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> AesCcm.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> AesCcm.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class AesCcm diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/Certificate.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/Certificate.java index 8625a5c20b0b69470d1fd51c5296630ea2b9edac..e2a2ffe4dbb4d192faf3e9d6c6701be32824c967 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/Certificate.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/Certificate.java @@ -19,17 +19,17 @@ public class Certificate extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> Certificate.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> Certificate.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Certificate.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Certificate.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Certificate.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Certificate.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class Certificate \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/CertificateWithAlgo.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/CertificateWithAlgo.java index b1e460f05c07ac3d462a03392e51a8029124f965..af2307cded12beda8cf9e70a43d0b5a0d55bdfdf 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/CertificateWithAlgo.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/CertificateWithAlgo.java @@ -19,17 +19,17 @@ public class CertificateWithAlgo extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> CertificateWithAlgo.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> CertificateWithAlgo.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> CertificateWithAlgo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> CertificateWithAlgo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> CertificateWithAlgo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> CertificateWithAlgo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class CertificateWithAlgo diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/Duration.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/Duration.java index 7d550f5635923480e643389340523035d5cc424b..fe46041b93c9d796f5bc107ba6bba14bb059f738 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/Duration.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/Duration.java @@ -24,17 +24,17 @@ public class Duration extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> Duration.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> Duration.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Duration.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Duration.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Duration.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Duration.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class Duration \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/EccPoint.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/EccPoint.java index 3b16007ba8913394617835e270bbc86a2ceb57d8..6a7602bc60be31777ccfe4561e8559bd774ab13a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/EccPoint.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/EccPoint.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.security; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -30,7 +30,7 @@ public class EccPoint extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> EccPoint.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> EccPoint.postEncodeField: " + fieldName); if (fieldName.equals("type_")) { // Store EccPointType value @@ -49,7 +49,7 @@ public class EccPoint extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EccPoint.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EccPoint.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { byte type = buf.getBytes(0, 1)[0]; @@ -90,7 +90,7 @@ public class EccPoint extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EccPoint.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EccPoint.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class EccPoint diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/EcdsaSignature.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/EcdsaSignature.java index f58d5339927293a91e622cbd7861d78dcbbe511c..ac5b030216a6a9b077ec82c9292684b2a92a0ce6 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/EcdsaSignature.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/EcdsaSignature.java @@ -33,7 +33,7 @@ public class EcdsaSignature extends Record { */ @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> EcdsaSignature.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> EcdsaSignature.postEncodeField: " + fieldName); if (fieldName.equals("s")) { int type = Integer.parseInt(mainCodec.getHint("EccPointType")); @@ -48,7 +48,7 @@ public class EcdsaSignature extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EcdsaSignature.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EcdsaSignature.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("s")) { int type = Integer.parseInt(mainCodec.getHint("EccPointType")); @@ -63,7 +63,7 @@ public class EcdsaSignature extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EcdsaSignature.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EcdsaSignature.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class EcdsaSignature \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/EciesEncryptedKey.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/EciesEncryptedKey.java index 0369be9a62e87655abe1c7d0b3079154f94e1113..f48ac1a98a4ce40b65c12fb588ef2f39e3d18e5b 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/EciesEncryptedKey.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/EciesEncryptedKey.java @@ -26,7 +26,7 @@ public class EciesEncryptedKey extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> EciesEncryptedKey.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> EciesEncryptedKey.postEncodeField: " + fieldName); if (fieldName.equals("c")) { int type = Integer.parseInt(mainCodec.getHint("SymmetricAlgorithm")); @@ -40,7 +40,7 @@ public class EciesEncryptedKey extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EciesEncryptedKey.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EciesEncryptedKey.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("c")) { int type = Integer.parseInt(mainCodec.getHint("SymmetricAlgorithm")); @@ -56,7 +56,7 @@ public class EciesEncryptedKey extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EciesEncryptedKey.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EciesEncryptedKey.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class EciesEncryptedKey \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParameters.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParameters.java index 6efab9aa3db6c38a70f4ef680ac9833994696837..c2572bec060a3f7d78ed127ad49f16c888ed5ad5 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParameters.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParameters.java @@ -26,7 +26,7 @@ public class EncryptionParameters extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> EncryptionParameters.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> EncryptionParameters.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("symm_algorithm")) { byte type_ = buf.getBytes(0, 1)[0]; mainCodec.setHint("SymmetricAlgorithm", String.valueOf(type_)); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParametersContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParametersContainer.java index 4a80b6ef2bea585755730492134d595a085c4a71..f652531c669e9c5e870fd2e127f06c36553f835a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParametersContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParametersContainer.java @@ -24,7 +24,7 @@ public class EncryptionParametersContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> EncryptionParametersContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> EncryptionParametersContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("params")) { buf.appendBytes(new byte[] { (byte)((OctetstringValue)(uv.getVariant(uv.getPresentVariantName()))).getLength() } ); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegion.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegion.java index e0076375c6b85813e129dc9e6ea1e3c7ae48c6b0..1f8783928a9d5307c4c80e5f455cec414d04f17b 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegion.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegion.java @@ -41,7 +41,7 @@ public class GeographicRegion extends Record { */ @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GeographicRegion.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> GeographicRegion.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("region_type")) { byte type_ = buf.getBytes(0, 1)[0]; mainCodec.setPresenceHint("region", true); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegionContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegionContainer.java index a4be622514f2067b509bc4ee8ecf8d242fbd1a9d..8502b8c726188e0c9809d885a70edeb395cecfb2 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegionContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/GeographicRegionContainer.java @@ -19,7 +19,7 @@ public class GeographicRegionContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> GeographicRegionContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> GeographicRegionContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("other_region")) { // FIXME Check for opaque length encoding depending of the length value : <= 127 or > 127 diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/GnSecurityInd.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/GnSecurityInd.java index 82639a90aefbb37fc579ae5b101fcbb422b7fcda..be3aa102554981d9df387cd5f1a7a6940415f45a 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/GnSecurityInd.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/GnSecurityInd.java @@ -19,17 +19,17 @@ public class GnSecurityInd extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnSecurityInd.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> GnSecurityInd.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> GnSecurityInd.postDecode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> GnSecurityInd.postDecode: " + decodingHypothesis.getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> GnSecurityInd.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> GnSecurityInd.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class GnSecurityInd diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/HashedId3.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/HashedId3.java index fa114bb94cc5cb8585e8fbc87bf798aed361dc52..c6251a87a88cab6f17d64e7f443712efe5082d2f 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/HashedId3.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/HashedId3.java @@ -23,7 +23,7 @@ public class HashedId3 extends Octetstring { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> HashedId3.preDecode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> HashedId3.preDecode: " + decodingHypothesis.getName()); } } // End of class HashedId3 \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderField.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderField.java index f054e794c353cbd3b8b5213e2ea0b099f1a53a03..546805be0e0518f28390e95863a90714aa5f092c 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderField.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderField.java @@ -50,7 +50,8 @@ public class HeaderField extends Record { */ @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> HeaderField.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> HeaderField.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); + if (fieldName.equals("type_")) { byte type_ = buf.getBytes(0, 1)[0]; switch (type_) { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderFieldContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderFieldContainer.java index d52d4a54f1ccdcd41d6409c1f9446637870f8c32..71dd838b80f6659cce1cfa7e734362002d7e9c20 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderFieldContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/HeaderFieldContainer.java @@ -24,7 +24,7 @@ public class HeaderFieldContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> HeaderFieldContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> HeaderFieldContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("other_header")) { buf.appendBytes(new byte[] { (byte)((OctetstringValue)(uv.getVariant(uv.getPresentVariantName()))).getLength() } ); @@ -33,7 +33,7 @@ public class HeaderFieldContainer extends Union { @Override protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> HeaderFieldContainer.preDecode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> HeaderFieldContainer.preDecode: " + decodingHypothesis.getName()); } } // End of class HeaderFieldContainer diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/IntX.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/IntX.java index 916a12ec42855e408c493ff01ad22fe0f51d86ff..ca9a8e4a8fb765352cb1cb9b4de6589855615285 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/IntX.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/IntX.java @@ -5,6 +5,7 @@ */ package org.etsi.ttcn.codec.its.security; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Integer; @@ -31,12 +32,13 @@ public class IntX extends Integer { */ @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> IntX.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> IntX.decode: " + decodingHypothesis.getName()); // Read the first byte byte msb = buf.getBytes(0, 1)[0]; if ((msb & 0x80) == 0x00) { // Integer < 128 mainCodec.setHint("IntXLen", "8"); + mainCodec.setHint("HeaderFieldContainer.its_aidLen", "8"); // TCT3 workaround, i don't know how to abstract this :-( return super.decode(buf, decodingHypothesis); } else { // Decode the length. The encoding of the length shall use at most 7 bits set to 1 (see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.1 IntX) @@ -47,6 +49,7 @@ public class IntX extends Integer { } while (bit != 0x00); // Set the IntX length mainCodec.setHint(decodingHypothesis.getName() + "Len", String.valueOf(byteLen * Byte.SIZE )); + mainCodec.setHint("HeaderFieldContainer.its_aid" + "Len", String.valueOf(byteLen * Byte.SIZE )); // TCT3 workaround, i don't know how to abstract this :-( // Remove the length from the real integer value byte[] newBuf = buf.getBytes(); newBuf[0] &= (byte)(Math.pow(2.0, 8 - byteLen + 1) - 1); @@ -62,25 +65,13 @@ public class IntX extends Integer { */ @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> IntX.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> IntX.encode: " + value.getType().getName()); - if (mainCodec.getTciCDRequired().getInteger((IntegerValue)value) < 128) { - mainCodec.setHint("IntXLen", "8"); - return super.encode(value); - } else { - long iv = mainCodec.getTciCDRequired().getInteger((IntegerValue)value); - long bitLen = TlsHelper.getInstance().bitLength(iv); - long byteLen = TlsHelper.getInstance().byteLength(bitLen); - long flags = (long) ((byteLen | 1) << (byteLen * Byte.SIZE - TlsHelper.getInstance().bitLength(byteLen) - 1)); - long len = (long) (byteLen << (byteLen * Byte.SIZE - TlsHelper.getInstance().bitLength(byteLen) - 1)); - if ((flags & iv) != 0) { // We can encode the length on the MSB part - byteLen += 1; - len = (long) (byteLen << (byteLen * Byte.SIZE - TlsHelper.getInstance().bitLength(byteLen))); - } - mainCodec.setHint("integerLen", String.valueOf(byteLen * Byte.SIZE )); - IntegerValue newValue = mainCodec.getTciCDRequired().setInteger((int)(iv | len)); - return super.encode(newValue); - } + int iv = mainCodec.getTciCDRequired().getInteger((IntegerValue)value); + byte[] result = TlsHelper.getInstance().size2tls(iv); + mainCodec.setHint("integerLen", String.valueOf(result.length * Byte.SIZE )); + IntegerValue newValue = mainCodec.getTciCDRequired().setInteger(ByteHelper.byteArrayToInt(result)); + return super.encode(newValue); } } // End of class IntX diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ItsAidSsp.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ItsAidSsp.java index 401d50072125a4f00d6439d89f1c286aeb33e88e..9844279a1b5b08acd650e78cb898c3f7d691cdb9 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ItsAidSsp.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ItsAidSsp.java @@ -16,21 +16,15 @@ public class ItsAidSsp extends Record { public ItsAidSsp(MainCodec mainCodec) { super(mainCodec); -// setLengths(); } -// private void setLengths() { -// mainCodec.setHint("Bit2Len", "2"); -// mainCodec.setHint("Bit3Len", "3"); -// } -// @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> ItsAidSsp.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> ItsAidSsp.postEncodeField: " + fieldName); if (fieldName.equals("service_specific_permissions")) { CodecBuffer bufLen = new CodecBuffer(new byte[] { (byte)buf.getNbBytes() } ); -// System.out.println("ItsAidSsp.postEncodeField: bufLen = " + bufLen); +// TERFactory.getInstance().logDebug("ItsAidSsp.postEncodeField: bufLen = " + bufLen); bufLen.append(buf); buf.overwriteWith(bufLen); } @@ -38,20 +32,24 @@ public class ItsAidSsp extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ItsAidSsp.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ItsAidSsp.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("service_specific_permissions")) { - int len = buf.readBits(Byte.SIZE)[0]; // FIXME It depends of the len value : <= 127 or > 127 - // FIXME Check for opaque length encoding - //int len = ByteHelper.byteArrayToInt(buf.readBits(Integer.SIZE)); // field_sizeLen is 1 bytes -// System.out.println("ItsAidSsp.preDecodeField: len = " + len); - mainCodec.setHint("Oct1to31Len", Integer.toString(len)); + int len = buf.readBits(Byte.SIZE)[0]; // FIXME Should be IntX? +// TERFactory.getInstance().logDebug("ItsAidSsp.preDecodeField: len=" + len); + if (mainCodec.getHint("ServiceSpecificPermissionsContainer").equals("sspCAM")) { + mainCodec.setHint("SspCAMLen", Integer.toString(len - 1/* Version byte*/)); + } else if (mainCodec.getHint("ServiceSpecificPermissionsContainer").equals("sspDENM")) { + mainCodec.setHint("SspDENMLen", Integer.toString(len -1/* Version byte*/)); + } else { + mainCodec.setHint("ServiceSpecificPermissionsContainer.opaqueLen", Integer.toString(len - 1/* Version byte*/)); + } } } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ItsAidSsp.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ItsAidSsp.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("its_aid")) { //int itsaid = ((IntegerValue)(rv.getField(fieldName))).getInt(); @@ -60,6 +58,21 @@ public class ItsAidSsp extends Record { mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspCAM"); } else if (itsaid == 37) { mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspDENM"); + } else if (itsaid == 138) { + mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); + //mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspMAPEM"); + } else if (itsaid == 137) { + mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); + //mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspSPATEM"); + } else if (itsaid == 139) { + mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); + //mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspIVIM"); + } else if (itsaid == 140) { + mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); + //mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspSxEM"); + } else if (itsaid == 141) { + mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); + //mainCodec.setHint("ServiceSpecificPermissionsContainer", "sspGnMgmt"); } else { mainCodec.setHint("ServiceSpecificPermissionsContainer", "opaque"); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/Plugin.java index fa7af9640532d3ba0c41375719049fddc4614f02..9c24289c58827f341354a05ea38eeeb33bcc611c 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/Plugin.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/Plugin.java @@ -13,7 +13,6 @@ public class Plugin { public static void init() { CodecFactory cf = CodecFactory.getInstance(); - cf.setCodec(TciTypeClass.RECORD, "LibItsSecurity", "AcEnableSecurity", AcEnableSecurity.class); // Draft ETSI TS 103 097 V1.1.14 Clause 4.2 Specification of basic format elements cf.setCodec(TciTypeClass.RECORD, "LibItsSecurity", "PublicKey", PublicKey.class); cf.setCodec(TciTypeClass.RECORD, "LibItsSecurity", "EccPoint", EccPoint.class); @@ -112,6 +111,7 @@ public class Plugin { cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "HeaderFieldContainer.generation_time", Time64.class); cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "HeaderFieldContainer.expiry_time", Time32.class); cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "HeaderFieldContainer.its_aid", IntX.class); + cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "ItsAidSsp.its_aid", IntX.class); cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "ValidityRestrictionContainer.end_validity", Time32.class); cf.setCodec(TciTypeClass.SET_OF, "LibItsSecurity", "SignerInfoContainer.certificates", RecordOf.class); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/PublicKey.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/PublicKey.java index f3179567d0ad4f24024b16b58f87995f0ec85932..ce6b60c3129a952f1a28ddfd2311ae3b6da7564f 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/PublicKey.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/PublicKey.java @@ -33,7 +33,7 @@ public class PublicKey extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> PublicKey.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> PublicKey.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("algorithm")) { if (buf.getBytes(0, 1)[0] == c_ecdsa_nistp256_with_sha256) { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfo.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfo.java index dfd1be930cf8cd5626694b236778e3d554c07681..8671dcfebbf62f994aecaac39eaf87c198533f56 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfo.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfo.java @@ -27,7 +27,7 @@ public class RecipientInfo extends Record { } protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> RecipientInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> RecipientInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("pk_encryption")) { if (buf.getBytes(0, 1)[0] == c_ecies_nistp2561) { @@ -39,10 +39,10 @@ public class RecipientInfo extends Record { } protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> RecipientInfo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> RecipientInfo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> RecipientInfo.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> RecipientInfo.postEncodeField: " + fieldName); } } // End of class RecipientInfo \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfoContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfoContainer.java index 91eb620e8425d9c4cb016f631e68fa6dcd59e318..a7ec0d5bb8c348455eca62b2832f05441e60c31f 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfoContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecipientInfoContainer.java @@ -19,7 +19,7 @@ public class RecipientInfoContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> RecipientInfoContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> RecipientInfoContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("enc_key_other")) { // FIXME Check for opaque length encoding depending of the length value : <= 127 or > 127 diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecordOf.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecordOf.java index e3cbabb07c61a1e369afca8b6dc401882e0d64d2..14466a857a3a64bbb4403562d9805291fb0a7299 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/RecordOf.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/RecordOf.java @@ -21,10 +21,10 @@ public class RecordOf extends org.etsi.ttcn.codec.generic.RecordOf { @Override public Value decode(CodecBuffer buf, Type decodingHypothesis) { -// System.out.println(">>> security.RecordOf.decode: " + decodingHypothesis.getName()); +// TERFactory.getInstance().logDebug(">>> security.RecordOf.decode: " + decodingHypothesis.getName()); - int len = (int) TlsHelper.getInstance().tls2size(buf);// buf.readBytes(1)[0]; // Get number of items into the RecordOf -// System.out.println("security.RecordOf.decode: length=" + len); + int len = (int) TlsHelper.getInstance().tls2size(buf); +// TERFactory.getInstance().logDebug("security.RecordOf.decode: length=" + len); if (len == 0) { RecordOfValue rov = (RecordOfValue)decodingHypothesis.newInstance(); rov.setLength(0); @@ -36,6 +36,7 @@ public class RecordOf extends org.etsi.ttcn.codec.generic.RecordOf { RecordOfValue rov = (RecordOfValue)decodingHypothesis.newInstance(); while (newBuf.getNbBits() != 0) { recordOf.add(mainCodec.decode(newBuf, rov.getElementType())); +// TERFactory.getInstance().logDebug("security.RecordOf.decode: new len=" + newBuf.getNbBits() / Byte.SIZE + "/" + len); } // Fill it @@ -50,7 +51,7 @@ public class RecordOf extends org.etsi.ttcn.codec.generic.RecordOf { @Override public CodecBuffer encode(Value value) { -// System.out.println(">>> security.RecordOf.encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> security.RecordOf.encode: " + value.getType().getName()); CodecBuffer buf = super.encode(value); CodecBuffer bufLen = new CodecBuffer(TlsHelper.getInstance().size2tls(buf.getNbBytes())); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SecPayload.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SecPayload.java index d7cd5a0d7c8fd46f152c29ab2df4cae265b6017f..b70242079d686e56fb0eb0d219dc3c492e34f773 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SecPayload.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SecPayload.java @@ -26,7 +26,7 @@ public class SecPayload extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SecPayload.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SecPayload.postEncodeField: " + fieldName); if (fieldName.equals("data")) { // Store first the octetstring length as specified in Draft ETSI TS 103 097 V1.1.14 Clause 4.2 @@ -37,20 +37,20 @@ public class SecPayload extends Record { } protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SecPayload.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SecPayload.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { mainCodec.setPresenceHint("data", buf.getBytes(0, 1)[0] != c_signed_external); } else if (fieldName.equals("data") && (mainCodec.getPresenceHint("data") == true)) { int len = (int) TlsHelper.getInstance().tls2size(buf); -// System.out.println("SecPayload.preDecodeField: len = " + len); +// TERFactory.getInstance().logDebug("SecPayload.preDecodeField: len = " + len); mainCodec.setHint("octetstringLen", Integer.toString(len)); } } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SecPayload.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SecPayload.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class SecPayload \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SecuredMessage.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SecuredMessage.java index 06a9a9290b4e68bfb29cdf8ea3b481906d62790c..82103061abffbcfbb1bfc1391f4c651dbc416dc6 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SecuredMessage.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SecuredMessage.java @@ -17,7 +17,7 @@ public class SecuredMessage extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SecuredMessage.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SecuredMessage.postEncodeField: " + fieldName); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ServiceSpecificPermissions.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ServiceSpecificPermissions.java index 5a87c51f9e9784719033153b140311f4817b3fba..2dba0799749fa3b24eb956c68549000d3d9b4e38 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ServiceSpecificPermissions.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ServiceSpecificPermissions.java @@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.security; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -25,34 +25,22 @@ public class ServiceSpecificPermissions extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> ServiceSpecificPermissions.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> ServiceSpecificPermissions.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ServiceSpecificPermissions.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ServiceSpecificPermissions.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); - if (fieldName.equals("version")) { - byte version = buf.getBytes(0, 1)[0]; - switch (version) { - case (byte)0x01: - mainCodec.setHint("version", String.valueOf(version)); - break; - } // End of 'switch' statement - } else if (fieldName.equals("sspContainer")) { - if (mainCodec.getHint("version") != null) { - mainCodec.setPresenceHint(fieldName, true); - } else { - mainCodec.setPresenceHint(fieldName, false); - - } + if (fieldName.equals("sspContainer")) { + mainCodec.setPresenceHint(fieldName, true); } } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ServiceSpecificPermissions.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ServiceSpecificPermissions.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class ServiceSpecificPermissions diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/Signature.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/Signature.java index e996661d0a8408c0c88ea57ab86fb961a0042fa4..3db11f07fd69059d8b48d49b4908b89e021d54bd 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/Signature.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/Signature.java @@ -33,7 +33,7 @@ public class Signature extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> Signature.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> Signature.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("algorithm")) { if (buf.getBytes(0, 1)[0] == e_ecdsa_nistp256_with_sha256) { mainCodec.setHint("SignatureContainer", "ecdsa_signature"); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfo.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfo.java index c1c46a66279379ec5c66a39d890280df19e89e32..11faba49d400dc40abbdfc1c35fdd4ac8edbe87d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfo.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfo.java @@ -46,7 +46,7 @@ public class SignerInfo extends Record { */ @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SignerInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SignerInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { byte type_ = buf.getBytes(0, 1)[0]; diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfoContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfoContainer.java index 81734622e25251f666591014b1e5caf71ff6ac61..d4aeadf8db174c0a88d504e46c35cd6f15375a40 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfoContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SignerInfoContainer.java @@ -19,7 +19,7 @@ public class SignerInfoContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> SignerInfoContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> SignerInfoContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("certificates")) { // TODO To be continued diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SspCAM.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SspCAM.java index a312d64070a0ee0ae78c90518534aa574076680f..e146f7f51059f46990c516d19376b4af38c73662 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SspCAM.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SspCAM.java @@ -3,7 +3,7 @@ package org.etsi.ttcn.codec.its.security; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -20,19 +20,19 @@ public class SspCAM extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SspCAM.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SspCAM.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SspCAM.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SspCAM.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SspCAM.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SspCAM.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SspDENM.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SspDENM.java index bbb0c6af0da35414f4f292bcc27ee483e43d0a23..61aea6fa6bce71508f2dfe8800cec3e562703a7d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SspDENM.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SspDENM.java @@ -3,7 +3,7 @@ package org.etsi.ttcn.codec.its.security; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.RecordValue; import org.etsi.ttcn.tci.Type; @@ -20,19 +20,19 @@ public class SspDENM extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SspDENM.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SspDENM.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SspDENM.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SspDENM.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SspDENM.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SspDENM.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAssurance.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAssurance.java index 1cd77c3d9c6b4afb6c2a0aee024aa206b72c829a..b694b401287fca1417c4f3d4849f134facf0479b 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAssurance.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAssurance.java @@ -25,17 +25,17 @@ public class SubjectAssurance extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SubjectAssurance.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SubjectAssurance.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectAssurance.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectAssurance.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectAssurance.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectAssurance.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class SubjectAssurance \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttribute.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttribute.java index eddecdf2749f29d367a8de2a2800e8a97fdf9876..96ee2126e524a903789b1db868b1777626afe57e 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttribute.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttribute.java @@ -31,12 +31,12 @@ public class SubjectAttribute extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SubjectAttribute.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SubjectAttribute.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectAttribute.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectAttribute.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { byte type_ = buf.getBytes(0, 1)[0]; @@ -67,7 +67,7 @@ public class SubjectAttribute extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectAttribute.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectAttribute.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class SubjectAttribute \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttributeContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttributeContainer.java index c6e2fa3e65ea84f86edfef84ba0b8e97d30dbdcb..fbc4acc7aa3afdd9374a68dbd4e016bd950e10f1 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttributeContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectAttributeContainer.java @@ -19,7 +19,7 @@ public class SubjectAttributeContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> SubjectAttributeContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> SubjectAttributeContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("other_attribute")) { buf.appendBytes(new byte[] { (byte)((OctetstringValue)(uv.getVariant(uv.getPresentVariantName()))).getLength() } ); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectInfo.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectInfo.java index 30aad76a176f1de6d55c160771b5eae96be4f772..7f406806c4137723ec3890a44ae34720efffc3eb 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectInfo.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/SubjectInfo.java @@ -24,7 +24,7 @@ public class SubjectInfo extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> SubjectInfo.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> SubjectInfo.postEncodeField: " + fieldName); if (fieldName.equals("subject_name")) { CodecBuffer bufLen = new CodecBuffer(new byte[] { (byte)buf.getNbBytes() } ); @@ -35,20 +35,20 @@ public class SubjectInfo extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectInfo.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("subject_name")) { int len = buf.readBits(Byte.SIZE)[0]; // FIXME It depends of the len value : <= 127 or > 127 // FIXME Check for opaque length encoding //int len = ByteHelper.byteArrayToInt(buf.readBits(Integer.SIZE)); // field_sizeLen is 1 bytes -// System.out.println("SubjectInfo.preDecodeField: len = " + len); +// TERFactory.getInstance().logDebug("SubjectInfo.preDecodeField: len = " + len); mainCodec.setHint("Oct0to31Len", Integer.toString(len)); } } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> SubjectInfo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> SubjectInfo.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class SubjectInfo \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ThreeDLocation.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ThreeDLocation.java index e77aafa3b7ac7a1ad30dcd8cc72946e323dbe84e..f048953c03c99efda408705ecd15c93b29c5ecd1 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ThreeDLocation.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ThreeDLocation.java @@ -25,7 +25,7 @@ public class ThreeDLocation extends Record { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ThreeDLocation.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ThreeDLocation.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("elevation")) { mainCodec.setHint("Oct2Len", "2"); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/TlsHelper.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/TlsHelper.java index d3f4a36e33bc15ff20322c5f6ab58dd8e88eb4a4..93e93adf88ed0b7d68a677e1ea3faca7a71e8778 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/TlsHelper.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/TlsHelper.java @@ -6,7 +6,7 @@ package org.etsi.ttcn.codec.its.security; import org.etsi.ttcn.codec.CodecBuffer; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; public class TlsHelper { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ToBeSignedCertificate.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ToBeSignedCertificate.java index 4a2f3eb2e4ffc9fd509a92a62b5f749c0995e31f..e797b4d9565f93da2fd1a726da7a90559a3b42b0 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ToBeSignedCertificate.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ToBeSignedCertificate.java @@ -28,17 +28,17 @@ public class ToBeSignedCertificate extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> ToBeSignedCertificate.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> ToBeSignedCertificate.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ToBeSignedCertificate.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ToBeSignedCertificate.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ToBeSignedCertificate.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ToBeSignedCertificate.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class ToBeSignedCertificate diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerField.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerField.java index 33227d3262ccb6f4b24371aa90c5b1f0878b1d6a..2deed5267be0ff9c258ab14737f9f4d0f3f44b1d 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerField.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerField.java @@ -41,7 +41,7 @@ public class TrailerField extends Record { */ @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> TrailerField.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> TrailerField.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { byte type_ = buf.getBytes(0, 1)[0]; diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerFieldContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerFieldContainer.java index e783c8066f4378319ba6d7d54582280174e42f4d..9a634947f19ca6708e0f4f1027a6d6873a1a80e0 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerFieldContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/TrailerFieldContainer.java @@ -19,7 +19,7 @@ public class TrailerFieldContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> TrailerFieldContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> TrailerFieldContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("security_field")) { // FIXME Check for opaque length encoding depending of the length value : <= 127 or > 127 diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestriction.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestriction.java index 56ce8161af940a92bc4b9190575662e0165aee10..87b96756232af253b0e26e7e3fd0a7863bdeac38 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestriction.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestriction.java @@ -29,12 +29,12 @@ public class ValidityRestriction extends Record { @Override protected void postEncodeField(String fieldName, CodecBuffer buf) { -// System.out.println(">>> ValidityRestriction.postEncodeField: " + fieldName); +// TERFactory.getInstance().logDebug(">>> ValidityRestriction.postEncodeField: " + fieldName); } @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ValidityRestriction.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ValidityRestriction.preDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); if (fieldName.equals("type_")) { byte type_ = buf.getBytes(0, 1)[0]; @@ -60,7 +60,7 @@ public class ValidityRestriction extends Record { @Override protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { -// System.out.println(">>> ValidityRestriction.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); +// TERFactory.getInstance().logDebug(">>> ValidityRestriction.postDecodeField: " + fieldName + ", " + decodingHypothesis.getName() + ", " + rv.getType().getName()); } } // End of class ValidityRestriction \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestrictionContainer.java b/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestrictionContainer.java index c256de4f2db37f39c5782680493a91fe20317bfa..7330c9df09de73065646f257495a74ae4972a053 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestrictionContainer.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/security/ValidityRestrictionContainer.java @@ -19,7 +19,7 @@ public class ValidityRestrictionContainer extends Union { @Override protected void preEncode(CodecBuffer buf, UnionValue uv) { -// System.out.println(">>> ValidityRestrictionContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); +// TERFactory.getInstance().logDebug(">>> ValidityRestrictionContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName()); if (uv.getPresentVariantName().equals("data")) { buf.appendBytes(new byte[] { (byte)((OctetstringValue)(uv.getVariant(uv.getPresentVariantName()))).getLength() } ); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/Plugin.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/Plugin.java index c42d1acd421e43544068e8b779b528801dc06a10..01ee4f492dad54d35be7ce98c2bab708b3d564bf 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/Plugin.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/Plugin.java @@ -12,26 +12,46 @@ import org.etsi.ttcn.codec.generic.Record; public class Plugin { public static void init() { - + // Basics CodecFactory cf = CodecFactory.getInstance(); cf.setCodec(TciTypeClass.RECORD, "UpperTester", "", UtRecord.class); cf.setCodec(TciTypeClass.UNION, "UpperTester", "", UtUnion.class); cf.setCodec(TciTypeClass.BOOLEAN, "UpperTester", "", UtBoolean.class); + // Gn + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtGnEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "Payload", UtPayload.class); + // Common + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtChangePosition", UtChangePosition.class); + // DENM cf.setCodec(TciTypeClass.RECORD, "UpperTester", "SituationContainer", Record.class); cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmTrigger", UtDenmTrigger.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmUpdate", UtDenmUpdate.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "Payload", UtPayload.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtCamEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmUpdate", UtDenmUpdate.class); cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmEventInd", UtEventInd.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtGnEventInd", UtEventInd.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapEventInd", UtEventInd.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSpatEventInd", UtEventInd.class); cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmTermination", UtDenmTermination.class); cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmTriggerResult", UtDenmTermination.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmUpdateResult", UtDenmTermination.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtChangePosition", UtChangePosition.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapSpatTrigger", UtMapSpatTrigger.class); - cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapSpatTriggerResult", UtMapSpatTriggerResult.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtDenmUpdateResult", UtDenmTermination.class); + // CAM cf.setCodec(TciTypeClass.UNION, "UpperTester", "UtCamTrigger", UtCamTrigger.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtCamEventInd", UtEventInd.class); + // MAPEM/SPATEM + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapemEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSpatemEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapemSpatemTrigger", UtMapemSpatemTrigger.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtMapemSpatemTriggerResult", UtBoolean.class); + // IVIM + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimTrigger", UtIvimTrigger.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimUpdate", UtIvimUpdate.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimTermination", UtIvimTermination.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimTriggerResult", UtIvimTermination.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtIvimUpdateResult", UtIvimTermination.class); + // SREM/SSEM + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSremTrigger", UtSremTrigger.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSremTriggerResult", UtBoolean.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSremUpdate", UtSremUpdate.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSremUpdateResult", UtBoolean.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSremEventInd", UtEventInd.class); + cf.setCodec(TciTypeClass.RECORD, "UpperTester", "UtSsemEventInd", UtEventInd.class); + } } \ No newline at end of file diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtDenmTermination.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtDenmTermination.java index 45ed820af3b32654c42154a060d15061e11119eb..d03662641fc4ba5d10dc4621626a2877d1703c24 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtDenmTermination.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtDenmTermination.java @@ -16,7 +16,9 @@ public class UtDenmTermination extends UtRecord { private void setLengths() { mainCodec.setHint("StationIDLen", "32"); + mainCodec.setHint("StationIDSign", "unsigned"); mainCodec.setHint("SequenceNumberLen", "16"); + mainCodec.setHint("SequenceNumberSign", "unsigned"); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtEventInd.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtEventInd.java index a3d8776dc5e7cb8ff811c7de1258dd2497697b78..03143bec4eabc8fa693f2f91dc881483b12daac4 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtEventInd.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtEventInd.java @@ -15,7 +15,7 @@ public class UtEventInd extends UtRecord { @Override protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) { int length = ByteHelper.byteArrayToInt(buf.readBytes(Short.SIZE / Byte.SIZE)); - // TODO Check payload length + mainCodec.setHint(decodingHypothesis.getName() + "Len", Integer.toString(length)); } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTermination.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTermination.java new file mode 100644 index 0000000000000000000000000000000000000000..50d5489f7d021c15d9782a2fe951d0f4510730ab --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTermination.java @@ -0,0 +1,16 @@ +package org.etsi.ttcn.codec.its.uppertester; + +import org.etsi.ttcn.codec.MainCodec; + +public class UtIvimTermination extends UtRecord { + + public UtIvimTermination(MainCodec mainCodec) { + super(mainCodec); + setLengths(); + } + + private void setLengths() { + mainCodec.setHint("IviIdentificationNumberLen", "16"); + } + +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTrigger.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTrigger.java new file mode 100644 index 0000000000000000000000000000000000000000..1b00b34c83f1c93196d87790323ce80a13c6b1cc --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimTrigger.java @@ -0,0 +1,109 @@ +package org.etsi.ttcn.codec.its.uppertester; + +import java.util.HashMap; +import java.util.Map; + +import org.etsi.ttcn.codec.CodecBuffer; +import org.etsi.ttcn.codec.IMarkerCallback; +import org.etsi.ttcn.codec.MainCodec; +import org.etsi.ttcn.tci.RecordValue; +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; + +public class UtIvimTrigger extends UtRecord implements IMarkerCallback { + + private byte flags = 0x00; + + public UtIvimTrigger(MainCodec mainCodec) { + super(mainCodec); + } + + @Override + public Value decode(CodecBuffer buf, Type decodingHypothesis) { + setLengths(); + return super.decode(buf, decodingHypothesis); + } + + @Override + public CodecBuffer preEncode(Value value) { + setLengths(); + CodecBuffer buf = super.preEncode(value); + CodecBuffer bufFlags = new CodecBuffer(); + bufFlags.setMarker("flags", 0, this); + buf.append(bufFlags); + return buf; + } + + private void setLengths() { + mainCodec.setHint("TimestampItsLen", "48"); + } + + @Override + public CodecBuffer encode(Value value) { + + RecordValue rv = (RecordValue)value; + String[] fields = rv.getFieldNames(); + CodecBuffer buf = new CodecBuffer(); + + for(int i=0; i < fields.length; i++) { + Value fieldValue = rv.getField(fields[i]); + if(!fieldValue.notPresent()) { + CodecBuffer fieldBuf = mainCodec.encode(fieldValue); + postEncodeField(fields[i], fieldBuf); + buf.append(fieldBuf); + flags = (byte) (flags | (PresenceFlag.value(fields[i])).byteValue()); + } + else { + String hint = mainCodec.getHint(fieldValue.getType().getName() + "Len"); + if(hint != null) { + int lengthInBits = java.lang.Integer.parseInt(hint); + int lengthInBytes = lengthInBits / 8 + (((lengthInBits % 8) > 0)?1:0); + for(int j=0; j < lengthInBytes; j++) { + buf.appendBytes(new byte[]{0x00}); + } + } + } + } + + return buf; + } + + @Override + public void run(String markerName, CodecBuffer leftBuf, CodecBuffer rightBuf) { + CodecBuffer bufFlags = new CodecBuffer(new byte[] {flags}); + bufFlags.append(rightBuf); + rightBuf.setBytes(bufFlags.getBytes()); + } + + private enum PresenceFlag { + + /* DenmTrigger*/ + validFrom(0x80), + validTo(0x40), + repetitionInterval(0x20), + + /* Reserved */ + reserved(0x00); + + private byte value; + private static final Map PresenceFlags = new HashMap(); + + private PresenceFlag(int value) { + this.value = (byte)value; + } + + public static Byte value(String name) { + Byte res = PresenceFlags.get(name); + if(res == null) { + return value("reserved"); + } + return res; + } + + static { + for (PresenceFlag item : PresenceFlag.values()) { + PresenceFlags.put(item.name(), new Byte(item.value)); + } + } + } +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimUpdate.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimUpdate.java new file mode 100644 index 0000000000000000000000000000000000000000..2c4d6d09241576748e3be1f8feb4a4fa52d434a0 --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtIvimUpdate.java @@ -0,0 +1,109 @@ +package org.etsi.ttcn.codec.its.uppertester; + +import java.util.HashMap; +import java.util.Map; + +import org.etsi.ttcn.codec.CodecBuffer; +import org.etsi.ttcn.codec.IMarkerCallback; +import org.etsi.ttcn.codec.MainCodec; +import org.etsi.ttcn.tci.RecordValue; +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; + +public class UtIvimUpdate extends UtRecord implements IMarkerCallback { + + private byte flags = 0x00; + + public UtIvimUpdate(MainCodec mainCodec) { + super(mainCodec); + } + + @Override + public Value decode(CodecBuffer buf, Type decodingHypothesis) { + setLengths(); + return super.decode(buf, decodingHypothesis); + } + + @Override + public CodecBuffer preEncode(Value value) { + setLengths(); + CodecBuffer buf = super.preEncode(value); + CodecBuffer bufFlags = new CodecBuffer(); + bufFlags.setMarker("flags", 0, this); + buf.append(bufFlags); + return buf; + } + + private void setLengths() { + mainCodec.setHint("TimestampItsLen", "48"); + } + + @Override + public CodecBuffer encode(Value value) { + + RecordValue rv = (RecordValue)value; + String[] fields = rv.getFieldNames(); + CodecBuffer buf = new CodecBuffer(); + + for(int i=0; i < fields.length; i++) { + Value fieldValue = rv.getField(fields[i]); + if(!fieldValue.notPresent()) { + CodecBuffer fieldBuf = mainCodec.encode(fieldValue); + postEncodeField(fields[i], fieldBuf); + buf.append(fieldBuf); + flags = (byte) (flags | (PresenceFlag.value(fields[i])).byteValue()); + } + else { + String hint = mainCodec.getHint(fieldValue.getType().getName() + "Len"); + if(hint != null) { + int lengthInBits = java.lang.Integer.parseInt(hint); + int lengthInBytes = lengthInBits / 8 + (((lengthInBits % 8) > 0)?1:0); + for(int j=0; j < lengthInBytes; j++) { + buf.appendBytes(new byte[]{0x00}); + } + } + } + } + + return buf; + } + + @Override + public void run(String markerName, CodecBuffer leftBuf, CodecBuffer rightBuf) { + CodecBuffer bufFlags = new CodecBuffer(new byte[] {flags}); + bufFlags.append(rightBuf); + rightBuf.setBytes(bufFlags.getBytes()); + } + + private enum PresenceFlag { + + /* IvimUpdate */ + validFrom(0x80), + validTo(0x40), + repetitionInterval(0x20), + + /* Reserved */ + reserved(0x00); + + private byte value; + private static final Map PresenceFlags = new HashMap(); + + private PresenceFlag(int value) { + this.value = (byte)value; + } + + public static Byte value(String name) { + Byte res = PresenceFlags.get(name); + if(res == null) { + return value("reserved"); + } + return res; + } + + static { + for (PresenceFlag item : PresenceFlag.values()) { + PresenceFlags.put(item.name(), new Byte(item.value)); + } + } + } +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTriggerResult.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTriggerResult.java deleted file mode 100644 index cb228f2c9c1049acb86554b363e70a86374d48d2..0000000000000000000000000000000000000000 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTriggerResult.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.etsi.ttcn.codec.its.uppertester; - -import org.etsi.ttcn.codec.MainCodec; - -public class UtMapSpatTriggerResult extends UtRecord { - - public UtMapSpatTriggerResult(MainCodec mainCodec) { - super(mainCodec); - setLengths(); - } - - private void setLengths() { - mainCodec.setHint("MsgCountLen", "8"); - } - -} // End of class UtMapSpatTriggerResult diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTrigger.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapemSpatemTrigger.java similarity index 71% rename from javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTrigger.java rename to javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapemSpatemTrigger.java index fc4947ae823136e2fc4575aae394b898b9fb25e2..03fba6afd8855c44b93922c79de55821687ca4a3 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapSpatTrigger.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtMapemSpatemTrigger.java @@ -2,9 +2,9 @@ package org.etsi.ttcn.codec.its.uppertester; import org.etsi.ttcn.codec.MainCodec; -public class UtMapSpatTrigger extends UtRecord { +public class UtMapemSpatemTrigger extends UtRecord { - public UtMapSpatTrigger(MainCodec mainCodec) { + public UtMapemSpatemTrigger(MainCodec mainCodec) { super(mainCodec); setLengths(); } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPayload.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPayload.java index 87817cfdea90d4744a47963eaaac98093b122448..66b0b69207ce50014b4433b4b6d30d8764ab00ab 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPayload.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPayload.java @@ -9,7 +9,7 @@ import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.IMarkerCallback; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Record; -import org.etsi.ttcn.common.ByteHelper; +import org.etsi.common.ByteHelper; import org.etsi.ttcn.tci.Value; public class UtPayload extends Record implements IMarkerCallback { diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPduId.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPduId.java index ede498b0a6678b2d68fa9440d049395843894cc7..cb007ee5b4f9bc40dfba8b3c849abeced417b390 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPduId.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtPduId.java @@ -87,12 +87,28 @@ public enum UtPduId { UtSec_setCertificate(0x93), UtSec_setPrivateKey(0x94), UtSec_setTrustPoint(0x95), - - /* From LibItsMapSpat_TypesAndValues */ - UtMapSpatTrigger(0xA0), - UtMapSpatTriggerResult(0xA1), - UtMapEventInd(0xA2), - UtSpatEventInd(0xA3), + + /* IS */ + /* From LibItsMapemSpatem_TypesAndValues */ + UtMapemSpatemTrigger(0xA0), + UtMapemSpatemTriggerResult(0xA1), + UtMapemEventInd(0xA2), + UtSpatemEventInd(0xA3), + /* From LibItsIvim_TypesAndValues */ + UtIvimTrigger(0xA4), + UtIvimTriggerResult(0xA5), + UtIvimUpdate(0xA6), + UtIvimUpdateResult(0xA7), + UtIvimTermination(0xA8), + UtIvimTerminationResult(0xA9), + UtIvimEventInd(0xAA), + /* From LibItsSremSsem_TypesAndValues */ + UtSremTrigger(0xAB), + UtSremTriggerResult(0xAC), + UtSremUpdate(0xAD), + UtSremUpdateResult(0xAE), + UtSremEventInd(0xAF), + UtSsemEventInd(0xB0), // FIXME Not good, try to merge UtSremTriggerResult & UtSremUpdateResult /* Reserved */ reserved(0xFF); diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremTrigger.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremTrigger.java new file mode 100644 index 0000000000000000000000000000000000000000..cb1e2506cce91b2145cc21e1166498ea938b04a4 --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremTrigger.java @@ -0,0 +1,16 @@ +package org.etsi.ttcn.codec.its.uppertester; + +import org.etsi.ttcn.codec.MainCodec; + +public class UtSremTrigger extends UtRecord { + + public UtSremTrigger(MainCodec mainCodec) { + super(mainCodec); + setLengths(); + } + + private void setLengths() { + mainCodec.setHint("BasicVehicleRoleLen", "8"); + mainCodec.setHint("RequestImportanceLevelLen", "8"); + } +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremUpdate.java b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremUpdate.java new file mode 100644 index 0000000000000000000000000000000000000000..27beef116820fdc16125142e72b8d76d486da07c --- /dev/null +++ b/javasrc/codec/org/etsi/ttcn/codec/its/uppertester/UtSremUpdate.java @@ -0,0 +1,17 @@ +package org.etsi.ttcn.codec.its.uppertester; + +import org.etsi.ttcn.codec.MainCodec; + +public class UtSremUpdate extends UtRecord { + + public UtSremUpdate(MainCodec mainCodec) { + super(mainCodec); + setLengths(); + } + + private void setLengths() { + mainCodec.setHint("RequestIDLen", "8"); + mainCodec.setHint("BasicVehicleRoleLen", "8"); + mainCodec.setHint("RequestImportanceLevelLen", "8"); + } +} diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiHelper.java b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiHelper.java index 628b3b35c2046420c47528c83fba396d7071b83a..4bfaebeba11f5c5d16c5bace8977ac4b456013ea 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiHelper.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiHelper.java @@ -1,7 +1,7 @@ /** * @author ETSI / STF462 / Alexandre Berge - * @version $$URL$$ - * $$Id$$ + * @version $URL$$ + * $Id$$ */ package org.etsi.ttcn.codec.its.v2g; @@ -16,6 +16,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamResult; +import org.etsi.adapter.TERFactory; import org.etsi.common.ByteHelper; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; @@ -35,165 +36,165 @@ import com.siemens.ct.exi.helpers.DefaultEXIFactory; public class ExiHelper { - private static String schemaId = "v2g"; - private static boolean locked = false; - protected static String handshakeSchemaName = "ttcn_PowerUp\\xsd\\V2G_CI_AppProtocol.xsd"; - protected static String v2gSchemaName = "ttcn_PowerUp\\xsd\\V2G_CI_MsgBody.xsd"; + private static String schemaId = "v2g"; + private static boolean locked = false; + protected static String handshakeSchemaName = "ttcn_PowerUp\\xsd\\V2G_CI_AppProtocol.xsd"; + protected static String v2gSchemaName = "ttcn_PowerUp\\xsd\\V2G_CI_MsgBody.xsd"; - public static void setSchemaId(String schemaName) { - while(locked) { - try { + public static void setSchemaId(String schemaName) { + while(locked) { + try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } - } - System.err.println("Changing Schema ID:" +schemaName); - schemaId = schemaName; - } + } + TERFactory.getInstance().logError("Changing Schema ID:" +schemaName); + schemaId = schemaName; + } - public static void lockSchemaId() { - locked = true; - } + public static void lockSchemaId() { + locked = true; + } - private static void unlockSchemaId() { - locked = false; - } - - public static byte[] encode(byte[] xmlInput) { - InputStream xmlIn = new ByteArrayInputStream(xmlInput); - ByteArrayOutputStream exiOut = new ByteArrayOutputStream(); - - //ByteHelper.dump("encode EXI", xmlInput); - System.out.println("encode XML:" + new String(xmlInput)); + private static void unlockSchemaId() { + locked = false; + } + + public static byte[] encode(byte[] xmlInput) { + InputStream xmlIn = new ByteArrayInputStream(xmlInput); + ByteArrayOutputStream exiOut = new ByteArrayOutputStream(); + + //ByteHelper.dump("encode EXI", xmlInput); + TERFactory.getInstance().logDebug("encode XML:" + new String(xmlInput)); + + EXIFactory exiFactory = createEXIFactory(); + try { + EXIResult exiResult = new EXIResult(exiFactory); + exiResult.setOutputStream(exiOut); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(exiResult.getHandler()); + xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", + exiResult.getLexicalHandler()); + xmlReader.setProperty("http://xml.org/sax/properties/declaration-handler", + exiResult.getLexicalHandler()); + xmlReader.parse(new InputSource(xmlIn)); + } catch (Exception e) { + TERFactory.getInstance().logError("ERROR: Unable to EXI-encode message: " + e.getMessage()); + e.printStackTrace(); + return xmlInput; + } + + ByteHelper.dump("encode EXI", exiOut.toByteArray()); - EXIFactory exiFactory = createEXIFactory(); - try { - EXIResult exiResult = new EXIResult(exiFactory); - exiResult.setOutputStream(exiOut); - XMLReader xmlReader = XMLReaderFactory.createXMLReader(); - xmlReader.setContentHandler(exiResult.getHandler()); - xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", - exiResult.getLexicalHandler()); - xmlReader.setProperty("http://xml.org/sax/properties/declaration-handler", - exiResult.getLexicalHandler()); - xmlReader.parse(new InputSource(xmlIn)); - } catch (Exception e) { - System.err.println("ERROR: Unable to EXI-encode message: " + e.getMessage()); - e.printStackTrace(); - return xmlInput; - } - - ByteHelper.dump("encode EXI", exiOut.toByteArray()); - - return exiOut.toByteArray(); - } + return exiOut.toByteArray(); + } - public static byte[] decode(byte[] exiInput) { - InputStream exiIn = new ByteArrayInputStream(exiInput); - ByteArrayOutputStream xmlOut = new ByteArrayOutputStream(); + public static byte[] decode(byte[] exiInput) { + InputStream exiIn = new ByteArrayInputStream(exiInput); + ByteArrayOutputStream xmlOut = new ByteArrayOutputStream(); - ByteHelper.dump("decode EXI", exiInput); - - EXIFactory exiFactory = createEXIFactory(); - try { - EXISource exiSource = new EXISource(exiFactory); - XMLReader xmlReader = exiSource.getXMLReader(); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - SAXSource saxSource = new SAXSource(new InputSource(exiIn)); - saxSource.setXMLReader(xmlReader); - transformer.transform(saxSource, new StreamResult(xmlOut)); - } catch (Exception e) { - System.err.println("ERROR: Unable to EXI-decode message: " + e.getMessage()); - e.printStackTrace(); - unlockSchemaId(); - return exiInput; - } - - //ByteHelper.dump("decode XML:", xmlOut.toByteArray()); - try { - System.out.println("decode XML:" + xmlOut.toString("UTF-8")); + ByteHelper.dump("decode EXI", exiInput); + + EXIFactory exiFactory = createEXIFactory(); + try { + EXISource exiSource = new EXISource(exiFactory); + XMLReader xmlReader = exiSource.getXMLReader(); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + SAXSource saxSource = new SAXSource(new InputSource(exiIn)); + saxSource.setXMLReader(xmlReader); + transformer.transform(saxSource, new StreamResult(xmlOut)); + } catch (Exception e) { + TERFactory.getInstance().logError("ERROR: Unable to EXI-decode message: " + e.getMessage()); + e.printStackTrace(); + unlockSchemaId(); + return exiInput; + } + + //ByteHelper.dump("decode XML:", xmlOut.toByteArray()); + try { + TERFactory.getInstance().logDebug("decode XML:" + xmlOut.toString("UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - unlockSchemaId(); - return xmlOut.toByteArray(); - } - - private static EXIFactory createEXIFactory() { + unlockSchemaId(); + return xmlOut.toByteArray(); + } + + private static EXIFactory createEXIFactory() { - EXIFactory exiFactory = DefaultEXIFactory.newInstance(); - - try { - // Encoding options - EncodingOptions encodingOptions = EncodingOptions.createDefault(); - exiFactory.setEncodingOptions(encodingOptions); - - // Fidelity options - FidelityOptions fidelityOptions = FidelityOptions.createDefault(); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_STRICT, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_PREFIX, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_DTD, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_LEXICAL_VALUE, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_COMMENT, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_PI, false); - fidelityOptions.setFidelity(FidelityOptions.FEATURE_SC, false); - exiFactory.setFidelityOptions(fidelityOptions); - } - catch(Exception e) { - System.err.println("ERROR: Unable to setup EXIFactory: " + e.getMessage()); - e.printStackTrace(); - } - - // Coding mode - exiFactory.setCodingMode(CodingMode.BIT_PACKED); - - // Value partition capacity - exiFactory.setValuePartitionCapacity(0); - - // SCHEMA OPTIONS - loadGrammar(exiFactory); + EXIFactory exiFactory = DefaultEXIFactory.newInstance(); + + try { + // Encoding options + EncodingOptions encodingOptions = EncodingOptions.createDefault(); + exiFactory.setEncodingOptions(encodingOptions); + + // Fidelity options + FidelityOptions fidelityOptions = FidelityOptions.createDefault(); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_STRICT, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_PREFIX, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_DTD, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_LEXICAL_VALUE, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_COMMENT, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_PI, false); + fidelityOptions.setFidelity(FidelityOptions.FEATURE_SC, false); + exiFactory.setFidelityOptions(fidelityOptions); + } + catch(Exception e) { + TERFactory.getInstance().logError("ERROR: Unable to setup EXIFactory: " + e.getMessage()); + e.printStackTrace(); + } + + // Coding mode + exiFactory.setCodingMode(CodingMode.BIT_PACKED); + + // Value partition capacity + exiFactory.setValuePartitionCapacity(0); + + // SCHEMA OPTIONS + loadGrammar(exiFactory); - return exiFactory; - } - - private static void loadGrammar(EXIFactory exiFactory) { - GrammarFactory grammarFactory = GrammarFactory.newInstance(); - Grammars grammars = null; - MySchemaIdResolver schemaIdResolver = new MySchemaIdResolver(grammarFactory); - exiFactory.setSchemaIdResolver(schemaIdResolver); - try { - grammars = schemaIdResolver.resolveSchemaId(schemaId); - if (grammars != null) - exiFactory.setGrammars(grammars); - } catch (EXIException e) { - e.printStackTrace(); - } - } - - - private static class MySchemaIdResolver implements SchemaIdResolver { + return exiFactory; + } + + private static void loadGrammar(EXIFactory exiFactory) { + GrammarFactory grammarFactory = GrammarFactory.newInstance(); + Grammars grammars = null; + MySchemaIdResolver schemaIdResolver = new MySchemaIdResolver(grammarFactory); + exiFactory.setSchemaIdResolver(schemaIdResolver); + try { + grammars = schemaIdResolver.resolveSchemaId(schemaId); + if (grammars != null) + exiFactory.setGrammars(grammars); + } catch (EXIException e) { + e.printStackTrace(); + } + } + + + private static class MySchemaIdResolver implements SchemaIdResolver { - private GrammarFactory grammarFactory; - - public MySchemaIdResolver(GrammarFactory grammarFactory) { - this.grammarFactory = grammarFactory; - } - - @Override - public Grammars resolveSchemaId(String schemaId) throws EXIException { - Grammars grammars = null; - String explicitSchemaName = null; - if(schemaId.equals("handshake")) { - explicitSchemaName = handshakeSchemaName; - } - if(schemaId.equals("v2g")) { - explicitSchemaName = v2gSchemaName; - } - File schemaFile = new File(explicitSchemaName); - grammars = grammarFactory.createGrammars(schemaFile.getAbsolutePath()); - return grammars; - } - } + private GrammarFactory grammarFactory; + + public MySchemaIdResolver(GrammarFactory grammarFactory) { + this.grammarFactory = grammarFactory; + } + + @Override + public Grammars resolveSchemaId(String schemaId) throws EXIException { + Grammars grammars = null; + String explicitSchemaName = null; + if(schemaId.equals("handshake")) { + explicitSchemaName = handshakeSchemaName; + } + if(schemaId.equals("v2g")) { + explicitSchemaName = v2gSchemaName; + } + File schemaFile = new File(explicitSchemaName); + grammars = grammarFactory.createGrammars(schemaFile.getAbsolutePath()); + return grammars; + } + } } diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiUnion.java b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiUnion.java index c0a77dbc9bcf08a0bfb35042d1dae738bb6153c3..4634d3c44b936ca6e1c873d85b50300cfd003e31 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiUnion.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/ExiUnion.java @@ -1,7 +1,7 @@ /** * @author ETSI / STF462 / Alexandre Berge - * @version $$URL$$ - * $$Id$$ + * @version $URL$ + * $Id$ */ package org.etsi.ttcn.codec.its.v2g; diff --git a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/Sdp_Payload.java b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/Sdp_Payload.java index 5d2edaffecba782a90a8316b3838e7032375880a..65ee39b16034314cc519421c9289ad4eb53c9ec5 100644 --- a/javasrc/codec/org/etsi/ttcn/codec/its/v2g/Sdp_Payload.java +++ b/javasrc/codec/org/etsi/ttcn/codec/its/v2g/Sdp_Payload.java @@ -1,10 +1,11 @@ /** * @author ETSI / STF462 / Alexandre Berge - * @version $$URL$$ - * $$Id$$ + * @version $URL$ + * $Id$ */ package org.etsi.ttcn.codec.its.v2g; +import org.etsi.adapter.TERFactory; import org.etsi.ttcn.codec.CodecBuffer; import org.etsi.ttcn.codec.MainCodec; import org.etsi.ttcn.codec.generic.Union; @@ -28,7 +29,7 @@ public class Sdp_Payload extends Union { variant = "sdpResponse"; break; default: - System.err.println("Unable to decode " + decodingHypothesis.getName()); + TERFactory.getInstance().logError("Unable to decode " + decodingHypothesis.getName()); return; } mainCodec.setHint(decodingHypothesis.getName(), variant); diff --git a/javasrc/codec/org/etsi/ttcn/common/ByteHelper.java b/javasrc/codec/org/etsi/ttcn/common/ByteHelper.java deleted file mode 100644 index 0541d6d0de1cbca3798a5f8f260ffd2c076be8f3..0000000000000000000000000000000000000000 --- a/javasrc/codec/org/etsi/ttcn/common/ByteHelper.java +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @author ETSI / STF462 - * @version $URL$ - * $Id$ - */ -package org.etsi.ttcn.common; - -import java.nio.ByteBuffer; - -/* FIXME: to be merged with org.etsi.common.ByteHelper */ -public class ByteHelper { - - public static byte[] intToByteArray(final int value, final int length) { - byte[] b = new byte[length]; - for (int i = length - 1; i >= 0; i--) { - int offset = (b.length - 1 - i) * 8; - b[i] = (byte) ((value >>> offset) & 0xFF); - } - return b; - } - - public static byte[] longToByteArray(final long value, final int length) { - byte[] b = new byte[length]; - for (int i = length - 1; i >= 0; i--) { - int offset = (b.length - 1 - i) * 8; - b[i] = (byte) ((value >>> offset) & 0xFF); - } - return b; - } - - public static byte[] floatToByteArray(final float value) { - return ByteBuffer.allocate(Float.SIZE / Byte.SIZE).putFloat(value).array(); - } - - /** Convert a byte array into an integer assuming that the first byte is the most significant - * - * @param b The byte array to convert - * @return The integer value - */ - public static Integer byteArrayToInt(final byte[] b) { - // Sanity check - if ((b == null) || ((b.length * Byte.SIZE) > Integer.SIZE)) { - return Integer.MAX_VALUE; - } - - int value = 0; - for (int i = 0; i < b.length; i++) { - value = (value << 8) + (b[i] & 0xff); - } - - return new Integer(value); - } // End of method byteArrayToInt - - /** Convert a byte array into a signed integer assuming that padding bits are in first byte - * - * @param b The byte array to convert - * @param significantBits number of significant bits in the array - * @return The integer value - */ - public static int byteArrayToSignedInt(final byte[] b, final int significantBits) { - - int value = 0; - for (int i = 0; i < b.length; i++) { - value = (value << 8) + (b[i] & 0xff); - } - - int shift = 32 - significantBits; - - // Restore sign bit by shifting left and right - if(shift > 0) { - value <<= shift; - value >>= shift; - } - - return new Integer(value); - } - - /** Convert a byte array into a Long assuming that the first byte is the most significant - * - * @param b The byte array to convert - * @return The Long value - */ - public static Long byteArrayToLong(final byte[] b) { - // Sanity check - if ((b == null) || ((b.length * Byte.SIZE) > Long.SIZE)) { - return Long.MAX_VALUE; - } - - long value = 0; - for (int i = 0; i < b.length; i++) { - value = (value << 8) + (b[i] & 0xff); - } - - return new Long(value); - } // End of method byteArrayToLong - - public static Float byteArrayToFloat(final byte[] b) { - return ByteBuffer.wrap(b).getFloat(); - } - - public static byte[] hexStringToByteArray(final String s) { - String str = ""; - for(String ss : s.split("[^0-9A-Fa-f]")) { - str = str + ss; - } - int len = str.length(); - byte[] data = new byte[len / 2]; - for (int i = 0; i < len; i += 2) { - data[i / 2] = (byte) ((Character.digit(str.charAt(i), 16) << 4) - + Character.digit(str.charAt(i+1), 16)); - } - return data; - } - - public static byte[] concat(byte[]... arrays) { - int length = 0; - for (byte[] array : arrays) { - if(array != null) { - length += array.length; - } - } - byte[] result = new byte[length]; - int position = 0; - for (byte[] array : arrays) { - if(array != null) { - System.arraycopy(array, 0, result, position, array.length); - position += array.length; - } - } - return result; - } - - - /** Extract a sub part of a byte array - * @param array The original array - * @param offset The offset to start the extract operation - * @param length The number of bytes to extract - * @return The sub part of a provided byte array - */ - public static byte[] extract(byte[] array, int offset, int length) { - // Sanity check - if ((array == null) || (offset > array.length)) { - return null; - } - - byte[] result = new byte[length]; - System.arraycopy(array, offset, result, 0, length); - return result; - } - /** - * Dump a byte array in hex/ascii mode. - * @param label The dump label - * @param buffer The byte array to dump - */ - public synchronized static void dump(final String label, final byte[] buffer) - { - if ((buffer != null) && (buffer.length != 0)) - { - System.out.println(label); - StringBuilder finalHexLine = new StringBuilder(); - StringBuilder finalCharLine = new StringBuilder(); - int nCounter = 0; - int nOffset = 0; - // Flush header. - System.out.println(" HEX | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F : 0 1 2 3 4 5 6 7 8 9 A B C D E F "); - System.out.println("-----|+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-:--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); - for (int i = 0; i < buffer.length; ++i) - { - byte c = (byte)buffer[i]; - - String fmtHex = String.format("%02x ", c); - String fmtChar = String.format("%c ", Character.isISOControl((char)c) || c < 0 ? '.' : (char)c); - - if (nOffset % 16 == 0) - { - finalHexLine.append(String.format("%05x| ", nOffset)); - } - - finalHexLine.append(fmtHex); - finalCharLine.append(fmtChar); - if (nCounter == 15) - { - // Flush line. - System.out.println(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); - // Reset buffer. - finalHexLine.delete(0, finalHexLine.length()); - finalCharLine.delete(0, finalCharLine.length()); - - nCounter = 0; - } - else - { - nCounter++; - } - nOffset++; - } - if (nCounter < 16) - { - // Pad till 15. - for (int i = nCounter; i < 16; i++) - { - finalHexLine.append(" "); - finalCharLine.append(" "); - } - // Flush line. - System.out.println(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); - } - } - } -} diff --git a/javasrc/common/org/etsi/common/ByteHelper.java b/javasrc/common/org/etsi/common/ByteHelper.java index bcfc64f2261b468a757d9f16421d85324503faf5..dac128aa887b86cd1d0667efaca59bea4b07684a 100644 --- a/javasrc/common/org/etsi/common/ByteHelper.java +++ b/javasrc/common/org/etsi/common/ByteHelper.java @@ -8,6 +8,8 @@ package org.etsi.common; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import org.etsi.adapter.TERFactory; + public class ByteHelper { public static byte[] changeEndianness(byte [] in) { @@ -259,6 +261,22 @@ public class ByteHelper { return result; } + public static byte[] fill(final byte[] buffer, final int length, final byte pattern) { + byte[] result = new byte[length]; + if (buffer == null) { // Fill it + for(int i = 0; i < length; ++i) { + result[i] = pattern; + } // End of 'for' statement + } else { // + for(int i = 0; i < length - buffer.length; ++i) { + result[length - i - 1] = pattern; + } // End of 'for' statement + System.arraycopy(buffer, 0, result, 0, buffer.length); + } + + return result; + } + /** * Dump a byte array in hex/ascii mode. * @param label The dump label @@ -268,14 +286,14 @@ public class ByteHelper { { if ((buffer != null) && (buffer.length != 0)) { - System.out.println(label); + //TERFactory.getInstance().logDebug(label); StringBuilder finalHexLine = new StringBuilder(); StringBuilder finalCharLine = new StringBuilder(); int nCounter = 0; int nOffset = 0; // Flush header. - System.out.println(" HEX | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F : 0 1 2 3 4 5 6 7 8 9 A B C D E F "); - System.out.println("-----|+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-:--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); + //TERFactory.getInstance().logDebug(" HEX | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F : 0 1 2 3 4 5 6 7 8 9 A B C D E F "); + //TERFactory.getInstance().logDebug("-----|+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-:--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); for (int i = 0; i < buffer.length; ++i) { byte c = (byte)buffer[i]; @@ -293,7 +311,7 @@ public class ByteHelper { if (nCounter == 15) { // Flush line. - System.out.println(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); + //TERFactory.getInstance().logDebug(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); // Reset buffer. finalHexLine.delete(0, finalHexLine.length()); finalCharLine.delete(0, finalCharLine.length()); @@ -315,7 +333,7 @@ public class ByteHelper { finalCharLine.append(" "); } // Flush line. - System.out.println(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); + //TERFactory.getInstance().logDebug(String.format("%s : %s", finalHexLine.toString(), finalCharLine.toString())); } } } diff --git a/javasrc/extfunc/org/etsi/its/extfunc/IItsExternalFunctionsProvider.java b/javasrc/extfunc/org/etsi/its/extfunc/IItsExternalFunctionsProvider.java index a905fa4d14dbf84b92348bcfe6f4315fbf800833..89630f66de20adf41d9b4d2c57d29f09e1b10876 100644 --- a/javasrc/extfunc/org/etsi/its/extfunc/IItsExternalFunctionsProvider.java +++ b/javasrc/extfunc/org/etsi/its/extfunc/IItsExternalFunctionsProvider.java @@ -1,6 +1,6 @@ /** - * @author STF 424_ITS_Test_Platform - * @version $id$ + * @author STF 424_ITS_Test_Platform + * @version $id$ */ package org.etsi.its.extfunc; @@ -19,49 +19,88 @@ import org.etsi.ttcn.tci.RecordValue; */ public interface IItsExternalFunctionsProvider { - /** - * This external function gets the current time - * @return The current time in Epoch format - * - * TTCN-3 signature: - * external function fx_getCurrentTime() return TimestampIts; - */ - public IntegerValue fx_getCurrentTime(); + /** + * This external function gets the current time + * @return The current time in Epoch format + * + * TTCN-3 signature: + * external function fx_getCurrentTime() return TimestampIts; + */ + public IntegerValue fx_getCurrentTime(); + + /** + * This external function gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time + * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time + * + * TTCN-3 signature: + * external function fx_getCurrentTimeMark() return TimeMark; + */ + public IntegerValue fx_getCurrentTimeMark(); + + /** + * This external function gets the minutes of current UTC year + * @return The minutes of current UTC year + * + * TTCN-3 signature: + * external function fx_getMinuteOfTheYear() return MinuteOfTheYear; + */ + public IntegerValue fx_getMinuteOfTheYear(); + + /** + * This external function gets the milliseconds point in the current UTC minute + * @return The milliseconds point in the current UTC minute (0..60000) + * + * TTCN-3 signature: + * external function fx_getDSecond() return DSecond; + */ + public IntegerValue fx_getDSecond(); - /** - * This external function gets the current time - * @param p_latitudeA Latitude of node A - * @param p_longitudeA Longitude of node A - * @param p_latitudeB Latitude of node B - * @param p_longitudeB Longitude of node B - * @return The current time in Epoch format - * - * TTCN-3 signature: - * external function fx_computeDistance(in UInt32 p_latitudeA, in UInt32 p_longitudeA, in UInt32 p_latitudeB, in UInt32 p_longitudeB) return float; - */ - public FloatValue fx_computeDistance(final IntegerValue p_latitudeA, final IntegerValue p_longitudeA, final IntegerValue p_latitudeB, final IntegerValue p_longitudeB); + /** + * This external function gets the current time + * @param p_latitudeA Latitude of node A + * @param p_longitudeA Longitude of node A + * @param p_latitudeB Latitude of node B + * @param p_longitudeB Longitude of node B + * @return The current time in Epoch format + * + * TTCN-3 signature: + * external function fx_computeDistance(in UInt32 p_latitudeA, in UInt32 p_longitudeA, in UInt32 p_latitudeB, in UInt32 p_longitudeB) return float; + */ + public FloatValue fx_computeDistance(final IntegerValue p_latitudeA, final IntegerValue p_longitudeA, final IntegerValue p_latitudeB, final IntegerValue p_longitudeB); - /** - * External function to 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) - * @param p_latitude Computed position's latitude - * @param p_longitude Computed position's longitude - * - * TTCN-3 signature: - * external function fx_computePositionUsingDistance(in UInt32 p_refLatitude, in Uint32 p_refLongitude, in integer p_distance, in integer p_orientation, out UInt32 p_latitude, out UInt32 p_longitude); - */ - public void fx_computePositionUsingDistance(final IntegerValue p_refLatitude, final IntegerValue p_refLongitude, final FloatValue p_distance, final IntegerValue p_orientation, IntegerValue p_latitude, IntegerValue p_longitude); - - /** + /** + * External function to 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) + * @param p_latitude Computed position's latitude + * @param p_longitude Computed position's longitude + * + * TTCN-3 signature: + * external function fx_computePositionUsingDistance(in UInt32 p_refLatitude, in Uint32 p_refLongitude, in integer p_distance, in integer p_orientation, out UInt32 p_latitude, out UInt32 p_longitude); + */ + public void fx_computePositionUsingDistance(final IntegerValue p_refLatitude, final IntegerValue p_refLongitude, final FloatValue p_distance, final IntegerValue p_orientation, IntegerValue p_latitude, IntegerValue p_longitude); + + /** + * External function to compute a position using a reference position, a distance and an orientation + * @param p_iutLongPosVector Reference position + * @param p_rotation Rotation value (in degrees) + * @param p_latitude Computed position's latitude + * @param p_longitude Computed position's longitude + * + * TTCN-3 signature: + * external function fx_computePositionFromRotation(in UInt32 p_refLatitude, in Uint32 p_refLongitude, in Uint32 p_cenLatitude, in Uint32 p_cenLongitude, in Int32 p_rotation, out UInt32 p_latitude, out UInt32 p_longitude); + */ + public void fx_computePositionFromRotation(final IntegerValue p_refLatitude, final IntegerValue p_refLongitude, final IntegerValue p_cenLatitude, final IntegerValue p_cenLongitude, final IntegerValue p_rotation, IntegerValue p_latitude, IntegerValue p_longitude); + + /** * External function to compute radius of a given circular area * @param p_squareMeters Square meters of an circular area * @return Computed radius in meters */ public FloatValue fx_computeRadiusFromCircularArea(final FloatValue p_squareMeters); - - /** + + /** * External function to compute timestamp based on current time * @return Unix-Epoch-Time mod 2^32 * diff --git a/javasrc/extfunc/org/etsi/its/extfunc/ItsExternalFunctionsProvider.java b/javasrc/extfunc/org/etsi/its/extfunc/ItsExternalFunctionsProvider.java index 5ec5503c150fd5d3735c2f1b2f9013893866c642..dd814ee45830df19f52cfe0880bafebe35a7228c 100644 --- a/javasrc/extfunc/org/etsi/its/extfunc/ItsExternalFunctionsProvider.java +++ b/javasrc/extfunc/org/etsi/its/extfunc/ItsExternalFunctionsProvider.java @@ -10,9 +10,8 @@ import java.io.IOException; import java.math.BigInteger; import java.net.InetAddress; import java.net.UnknownHostException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.logging.Logger; @@ -52,11 +51,6 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid */ public static final String Version = "1.0.0.0"; - /** - * Logger instance - */ - private final static Logger _logger = Logger.getLogger("org.etsi.its"); - /** * Unique instance of TciCDWrapper class */ @@ -73,7 +67,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid private static final String GNSS_SCENARIO_SUPPORT = "GnssScenarioSupport"; private IGnssSupport GNSS; private boolean gnssScenarioSupport; - + /** * Reference to the ePassport files manager */ @@ -83,8 +77,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * Default ctor */ public ItsExternalFunctionsProvider() { - _logger.entering("ItsExternalFunctionsProvider", "Constructor", - String.format("version:%s", Version)); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "Constructor", String.format("version:%s", Version)); _tcicdWrapper = TciCDWrapperFactory.getTciCDInstance(); @@ -110,31 +103,63 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid @Override public synchronized IntegerValue fx_getCurrentTime() { IntegerValue now = null; - _logger.entering("ItsExternalFunctionsProvider", "fx_getCurrentTime"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getCurrentTime"); if (gnssScenarioSupport) { now = _tcicdWrapper.setInteger(GNSS.getGpsTime()); } else { - String datestr="01/01/2004 00:00:00 +0000"; - DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss Z"); - try { -// System.out.println("ItsExternalFunctionsProvider.fx_getCurrentTime: " + ((java.util.Date)formatter.parse(datestr)).getTime()); +// TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider.fx_getCurrentTime: " + ((java.util.Date)formatter.parse(datestr)).getTime()); now = _tcicdWrapper.setInteger( new BigInteger( 1, - ByteHelper.longToByteArray(System.currentTimeMillis() - ((java.util.Date)formatter.parse(datestr)).getTime(), Long.SIZE / Byte.SIZE) + ByteHelper.longToByteArray(System.currentTimeMillis() - ITS_REF_TIME, Long.SIZE / Byte.SIZE) ) ); - } catch (ParseException e) { - now = _tcicdWrapper.setInteger(0); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getCurrentTime", String.format("%10d", _tcicdWrapper.getBigInteger(now))); } + return now; + } // End of method fx_getCurrentTime + + @Override + public IntegerValue fx_getCurrentTimeMark() { + IntegerValue now = null; + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getCurrentTimeMark"); + + ZonedDateTime t = ZonedDateTime.now(ZoneOffset.UTC); + now = _tcicdWrapper.setInteger(new Integer((t.getMinute() * 60 + t.getSecond()) * 10)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_getCurrentTime", String.format("%10d", _tcicdWrapper.getBigInteger(now))); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getCurrentTimeMark", String.format("%4d", _tcicdWrapper.getBigInteger(now))); + return now; + } + + @Override + public IntegerValue fx_getMinuteOfTheYear() { + IntegerValue now = null; + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getMinuteOfTheYear"); + + ZonedDateTime t = ZonedDateTime.now(ZoneOffset.UTC); + now = _tcicdWrapper.setInteger(new Integer((t.getDayOfYear() - 1) * 24 * 60 + t.getHour() * 60 + t.getMinute())); + + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getMinuteOfTheYear", String.format("%4d", _tcicdWrapper.getBigInteger(now))); + return now; + } + + public IntegerValue fx_getDSecond() { + IntegerValue now = null; + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getDSecond"); + + ZonedDateTime t = ZonedDateTime.now(ZoneOffset.UTC); + int i = new Integer(t.getSecond() + Math.round(t.getNano() / 1000)); + if (i > 65535) { + i = 65535; } + now = _tcicdWrapper.setInteger(i); + + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getDSecond", String.format("%4d", _tcicdWrapper.getBigInteger(now))); return now; - } // End of method fx_getCurrentTime - + } + /** * This external function gets the current time * @@ -156,7 +181,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid public synchronized FloatValue fx_computeDistance( final IntegerValue p_latitudeA, final IntegerValue p_longitudeA, final IntegerValue p_latitudeB, final IntegerValue p_longitudeB) { -// _logger.entering("ItsExternalFunctionsProvider", "fx_computeDistance", +// //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_computeDistance", // String.format("%d, %d, %d, %d", // p_latitudeA.getInteger(), // p_longitudeA.getInteger(), @@ -178,7 +203,6 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid long d = Math.round(Math.sqrt(Math.pow(dlat * rbis, 2) + Math.pow(dlong * rbis * Math.cos(dlat), 2))); dist.setFloat(d); -// System.out.println("Distance: " + d); return dist; } // End of method fx_computeDistance @@ -209,14 +233,14 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid final IntegerValue p_refLongitude, final FloatValue p_distance, final IntegerValue p_orientation, IntegerValue p_latitude, IntegerValue p_longitude) { -// _logger.entering( +// //TERFactory.getInstance().logDebug( // "ItsExternalFunctionsProvider", // "fx_computePositionUsingDistance", // String.format("%d, %d", p_distance.getInteger(), // p_orientation.getInteger())); - FloatValue v_distance = _tcicdWrapper.getFloat(); - v_distance.setFloat(p_distance.getFloat()); + FloatValue v_distance = _tcicdWrapper.getFloat(); + v_distance.setFloat(p_distance.getFloat()); double angularD = new Double(v_distance.getFloat()) / earthRadius; double radHeading = new Double(_tcicdWrapper.getInteger(p_orientation)) * Math.PI / 180; @@ -247,6 +271,73 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid } // End of method fx_computePositionUsingDistance + /** + * External function to compute a position using a rotation + * + * @param p_iutLongPosVector + * Reference position + * @param p_rotation + * Rotation value (in degrees) + * @param p_latitude + * Computed position's latitude + * @param p_longitude + * Computed position's longitude + * + * TTCN-3 signature: external function + * fx_computePositionFromRotation(in LongPosVector + * p_iutLongPosVector, in Int32 + * p_rotation, out Int32 p_latitude, out Int32 p_longitude); + * @remark See http://www.movable-type.co.uk/scripts/latlong.html + */ + @Override + public synchronized void fx_computePositionFromRotation( + final IntegerValue p_refLatitude, + final IntegerValue p_refLongitude, + final IntegerValue p_cenLatitude, + final IntegerValue p_cenLongitude, + final IntegerValue p_rotation, + IntegerValue p_latitude, + IntegerValue p_longitude) { + //TERFactory.getInstance().logDebug( +// "ItsExternalFunctionsProvider", +// "fx_computePositionFromRotation", +// String.format("%d", p_rotation.getFloat())); + // 1. Compute distance between the 2 points + double lat1 = Math.toRadians((double)_tcicdWrapper.getInteger(p_cenLatitude) / 10000000.0); + double long1 = Math.toRadians((double)_tcicdWrapper.getInteger(p_cenLongitude) / 10000000.0); + double lat2 = Math.toRadians((double)_tcicdWrapper.getInteger(p_refLatitude) / 10000000.0); + double long2 = Math.toRadians((double)_tcicdWrapper.getInteger(p_refLongitude) / 10000000.0); + double dlat = lat2 - lat1; + double dlong = long2 - long1; + double a = Math.sin(dlat / 2) * Math.sin(dlat / 2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dlong / 2) * Math.sin(dlong / 2); + double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); + //double d = earthRadius * c; + //TERFactory.getInstance().logDebug("fx_computePositionFromRotation: Angular distance = " + c); + + // 2. Compute bearing + double y = Math.sin(long2 - long1) * Math.cos(lat2); + double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(long2 - long1); + double brng = Math.atan2(y, x); + //TERFactory.getInstance().logDebug("fx_computePositionFromRotation: Bearing = " + Math.toDegrees(brng)); + + // 3. Compute distance between the 2 points + double rotation = Math.toRadians((double)_tcicdWrapper.getInteger(p_rotation) / 10.0) + brng; + //TERFactory.getInstance().logDebug("fx_computePositionFromRotation = rotation: " + Math.toDegrees(rotation)); + double lat = Math.asin(Math.sin(lat1) * Math.cos(c) + Math.cos(lat1) * Math.sin(c) * Math.cos(rotation)); + double long_ = long1 + Math.atan2(Math.sin(rotation) * Math.sin(c)*Math.cos(lat1), Math.cos(c) - Math.sin(lat1) * Math.sin(lat)); + + // 4. Normalize + // normalise to -180...+180 + long_ = (long_ + 3 * Math.PI) % (2 * Math.PI) - Math.PI; + + // The out parameter needs to be set on the object level + Long rlat = Math.round(Math.toDegrees(lat) * 10000000); + Long rlong = Math.round(Math.toDegrees(long_) * 10000000); + _tcicdWrapper.setInteger(p_latitude, rlat.intValue()); + _tcicdWrapper.setInteger(p_longitude, rlong.intValue()); + //TERFactory.getInstance().logDebug("Lat = " + p_latitude.getInteger() + " - long = " + p_longitude.getInteger()); + } // End of method fx_computePositionFromRotation + @Override public FloatValue fx_computeRadiusFromCircularArea(FloatValue p_squareMeters) { @@ -333,8 +424,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid final OctetstringValue p_destinationAddress, final IntegerValue p_payloadLength, final OctetstringValue p_payload, final IntegerValue p_nextHdr) { - _logger.entering("ItsExternalFunctionsProvider", - "fx_computeIPv6CheckSum"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_computeIPv6CheckSum"); // Build the pseudo header according RFC 2460 - Clause 8.1 ByteArrayOutputStream pseudoheader = new ByteArrayOutputStream(); @@ -378,18 +468,14 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid --length; } sum = (~((sum & 0xFFFF) + (sum >> 16))) & 0xFFFF; - _logger.info(String - .format("ItsExternalFunctionsProvider.fx_computeIPv6CheckSum: finalSum=%d", - sum)); + //TERFactory.getInstance().logDebug(String.format("ItsExternalFunctionsProvider.fx_computeIPv6CheckSum: finalSum=%d",sum)); // Set the return value OctetstringValue checksum = _tcicdWrapper.getOctetstring(); checksum.setLength(2); checksum.setOctet(0, (byte) ((byte) (sum >> 8) & 0xff)); checksum.setOctet(1, (byte) (sum & 0x00ff)); - _logger.exiting("ItsExternalFunctionsProvider", - "fx_computeIPv6CheckSum", checksum); // FIXME Check which method - // to call for logging + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_computeIPv6CheckSum", checksum); // FIXME Check which method to call for logging return checksum; } @@ -421,7 +507,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * @return The hash value */ public OctetstringValue fx_hashWithSha256(final OctetstringValue p_toBeHashedData) { - _logger.entering("ItsExternalFunctionsProvider", "fx_hashWithSha256"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_hashWithSha256"); byte[] toBeHashedData = new byte[p_toBeHashedData.getLength()]; for (int i = 0; i < toBeHashedData.length; i++) { @@ -444,7 +530,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * @return The signature value */ public OctetstringValue fx_signWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeSignedData, final OctetstringValue/*IntegerValue*/ p_privateKey) { - _logger.entering("ItsExternalFunctionsProvider", "fx_signWithEcdsaNistp256WithSha256"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_signWithEcdsaNistp256WithSha256"); byte[] toBeSignedData = new byte[p_toBeSignedData.getLength()]; for (int i = 0; i < toBeSignedData.length; i++) { @@ -456,8 +542,8 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid } // End 'for' statement byte[] signed; try { -// System.out.println("fx_signWithEcdsaNistp256WithSha256: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData) + " - " + toBeSignedData.length); -// System.out.println("fx_signWithEcdsaNistp256WithSha256: ts103097SignatureEncodedAsByteArray=" + new BigInteger(privateKey)); +// TERFactory.getInstance().logDebug("fx_signWithEcdsaNistp256WithSha256: toBeSignedData=" + ByteHelper.byteArrayToString(toBeSignedData) + " - " + toBeSignedData.length); +// TERFactory.getInstance().logDebug("fx_signWithEcdsaNistp256WithSha256: ts103097SignatureEncodedAsByteArray=" + new BigInteger(privateKey)); signed = CryptoLib.signWithEcdsaNistp256WithSha256(toBeSignedData, new BigInteger(privateKey)); } catch (Exception e) { e.printStackTrace(); @@ -481,7 +567,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * @return true on success, false otherwise */ public BooleanValue fx_verifyWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeVerifiedData, final OctetstringValue p_signature, final OctetstringValue p_ecdsaNistp256PublicKeyX, final OctetstringValue p_ecdsaNistp256PublicKeyY) { - _logger.entering("ItsExternalFunctionsProvider", "fx_verifyWithEcdsaNistp256WithSha256"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_verifyWithEcdsaNistp256WithSha256"); BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(false); @@ -503,17 +589,17 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid ecdsaNistp256PublicKeyY[i] = (byte) p_ecdsaNistp256PublicKeyY.getOctet(i); } // End 'for' statement try { -// System.out.println("fx_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData=" + ByteHelper.byteArrayToString(toBeVerifiedData) + " - " + toBeVerifiedData.length); -// System.out.println("fx_verifyWithEcdsaNistp256WithSha256: ts103097SignatureEncodedAsByteArray=" + ByteHelper.byteArrayToString(ts103097SignatureEncodedAsByteArray)); -// System.out.println("fx_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX=" + ByteHelper.byteArrayToString(ecdsaNistp256PublicKeyX)); -// System.out.println("fx_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY=" + ByteHelper.byteArrayToString(ecdsaNistp256PublicKeyY)); +// TERFactory.getInstance().logDebug("fx_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData=" + ByteHelper.byteArrayToString(toBeVerifiedData) + " - " + toBeVerifiedData.length); +// TERFactory.getInstance().logDebug("fx_verifyWithEcdsaNistp256WithSha256: ts103097SignatureEncodedAsByteArray=" + ByteHelper.byteArrayToString(ts103097SignatureEncodedAsByteArray)); +// TERFactory.getInstance().logDebug("fx_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX=" + ByteHelper.byteArrayToString(ecdsaNistp256PublicKeyX)); +// TERFactory.getInstance().logDebug("fx_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY=" + ByteHelper.byteArrayToString(ecdsaNistp256PublicKeyY)); boolean ret = CryptoLib.verifyWithEcdsaNistp256WithSha256(toBeVerifiedData, ts103097SignatureEncodedAsByteArray, ecdsaNistp256PublicKeyX, ecdsaNistp256PublicKeyY); result.setBoolean(ret); } catch (Exception e) { e.printStackTrace(); } - _logger.exiting("ItsExternalFunctionsProvider", "fx_verifyWithEcdsaNistp256WithSha256"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_verifyWithEcdsaNistp256WithSha256"); return result; } @@ -525,7 +611,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * @return true on success, false otherwise */ public BooleanValue fx_generateKeyPair(OctetstringValue/*IntegerValue*/ p_privateKey, OctetstringValue p_publicKeyX, OctetstringValue p_publicKeyY) { - _logger.entering("ItsExternalFunctionsProvider", "fx_generateKeyPair"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_generateKeyPair"); BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(true); @@ -547,7 +633,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid p_publicKeyY.setOctet(i, ref[i]); } // End 'for' statement - _logger.exiting("ItsExternalFunctionsProvider", "fx_generateKeyPair"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_generateKeyPair"); return result; } @@ -557,7 +643,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid * @return true on success, false otherwise */ public BooleanValue fx_isValidPolygonalRegion(final RecordOfValue p_region) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isValidPolygonalRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isValidPolygonalRegion"); // Setup arguments ArrayList polygonalArea = new ArrayList(); @@ -574,13 +660,13 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isValidPolygonArea(polygonalArea)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isValidPolygonalRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isValidPolygonalRegion"); return result; } @Override public BooleanValue fx_isPolygonalRegionInside(final RecordOfValue p_parent, final RecordOfValue p_region) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isPolygonalRegionInside"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isPolygonalRegionInside"); // Setup arguments ArrayList parentArea = new ArrayList(); @@ -606,13 +692,13 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isPolygonalRegionInside(parentArea, regionArea)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isPolygonalRegionInside"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isPolygonalRegionInside"); return result; } @Override public BooleanValue fx_isLocationInsideCircularRegion(final RecordValue p_region, final RecordValue p_location) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isLocationInsideCircularRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideCircularRegion"); // Setup arguments RecordValue rv = (RecordValue)p_region.getField("center"); // Center @@ -630,13 +716,13 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isLocationInsideCircularArea(location, center, radius)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isLocationInsideCircularRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideCircularRegion"); return result; } @Override public BooleanValue fx_isLocationInsideRectangularRegion(final RecordOfValue p_region, final RecordValue p_location) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isLocationInsideRectangularRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideRectangularRegion"); // Setup arguments ArrayList< ArrayList > polygonalAreas = new ArrayList< ArrayList >(); @@ -684,13 +770,13 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isLocationInsidePolygonalAreas(location, polygonalAreas)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isLocationInsideRectangularRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideRectangularRegion"); return result; } @Override public BooleanValue fx_isLocationInsidePolygonalRegion(final RecordOfValue p_region, final RecordValue p_location) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isLocationInsidePolygonalRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsidePolygonalRegion"); // Setup arguments ArrayList polygonalArea = new ArrayList(); @@ -701,25 +787,23 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid (long)_tcicdWrapper.getInteger((IntegerValue)(rv.getField("latitude"))), (long)_tcicdWrapper.getInteger((IntegerValue)(rv.getField("longitude"))) )); -// System.out.println("fx_isLocationInsidePolygonalRegion: add " + polygonalArea.get(polygonalArea.size() - 1)); } // End of 'for' statement WGS84 location = new WGS84( // Location (long)_tcicdWrapper.getInteger((IntegerValue)(p_location.getField("latitude"))), (long)_tcicdWrapper.getInteger((IntegerValue)(p_location.getField("longitude"))) ); -// System.out.println("fx_isLocationInsidePolygonalRegion: location= " + location); // Call Geodesic function BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isLocationInsidePolygonalArea(location, polygonalArea)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isLocationInsidePolygonalRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsidePolygonalRegion"); return result; } @Override public BooleanValue fx_isLocationInsideIdentifiedRegion(final RecordValue p_region, final RecordValue p_location) { - _logger.entering("ItsExternalFunctionsProvider", "fx_isLocationInsideIdentifiedRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideIdentifiedRegion"); // Setup arguments int regionDictionary = ((EnumeratedValue) p_region.getField("region_dictionary")).getInt(); @@ -734,13 +818,13 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid BooleanValue result = _tcicdWrapper.getBoolean(); result.setBoolean(Positioning.getInstance().isLocationInsideIdentifiedRegion(regionDictionary, regionId, localRegion, location)); - _logger.exiting("ItsExternalFunctionsProvider", "fx_isLocationInsideIdentifiedRegion"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_isLocationInsideIdentifiedRegion"); return result; } @Override public FloatValue fx_dms2dd(final IntegerValue p_degrees, final IntegerValue p_minutes, final FloatValue p_seconds, final OctetstringValue p_latlon) { - _logger.entering("ItsExternalFunctionsProvider", "fx_dms2dd"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_dms2dd"); // Call Geodesic function FloatValue result = _tcicdWrapper.getFloat(); @@ -752,7 +836,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid ); result.setFloat((float) location.toDD()); - _logger.exiting("ItsExternalFunctionsProvider", "fx_dms2dd"); + //TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_dms2dd"); return result; } @@ -799,25 +883,25 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid result.setBoolean(b); if(b){ - byte[] value = certificate.toByteArray(); - p_certificate.setLength(value.length); - if (value.length != 0) { - for (int i = 0; i < value.length; i++) { - p_certificate.setOctet(i, value[i]); - } // End 'for' statement - } + byte[] value = certificate.toByteArray(); + p_certificate.setLength(value.length); + if (value.length != 0) { + for (int i = 0; i < value.length; i++) { + p_certificate.setOctet(i, value[i]); + } // End 'for' statement + } }else{ - p_certificate.setLength(0); + p_certificate.setLength(0); } return result; } private static final byte[] ZERO32 = new byte[] { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -835,19 +919,19 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid boolean b = _certCache.readCertificateDigest(p_certificateId.getString(), digest); result.setBoolean(b); - p_digest.setLength(8); - byte[] value; + p_digest.setLength(8); + byte[] value; if(b){ - value = digest.toByteArray(); - if (value.length != 8) { - value = ZERO32; - } + value = digest.toByteArray(); + if (value.length != 8) { + value = ZERO32; + } }else{ - value = ZERO32; - } - for (int i = 0; i < 8; i++) { - p_digest.setOctet(i, value[i]); - } // End 'for' statement + value = ZERO32; + } + for (int i = 0; i < 8; i++) { + p_digest.setOctet(i, value[i]); + } // End 'for' statement return result; } @@ -866,20 +950,20 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid boolean b = _certCache.readSigningKey(p_keysId.getString(), key); result.setBoolean(b); - p_key.setLength(32); + p_key.setLength(32); - byte[] value; - if(b){ + byte[] value; + if(b){ value = key.toByteArray(); - if(value.length != 32) { - value = ZERO32; - } + if(value.length != 32) { + value = ZERO32; + } }else{ - value = ZERO32; + value = ZERO32; } for (int i = 0; i < 32; i++) { - p_key.setOctet(i, value[i]); - } + p_key.setOctet(i, value[i]); + } return result; } @@ -898,22 +982,22 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid boolean b = _certCache.readEncryptingKey(p_keysId.getString(), key); result.setBoolean(b); - p_key.setLength(32); + p_key.setLength(32); - byte[] value; - if(b){ + byte[] value; + if(b){ value = key.toByteArray(); - if(value.length != 32) { - value = ZERO32; - } + if(value.length != 32) { + value = ZERO32; + } }else{ - value = ZERO32; + value = ZERO32; } for (int i = 0; i < 32; i++) { - p_key.setOctet(i, value[i]); - } + p_key.setOctet(i, value[i]); + } return result; } - + } // End of class ExternalFunctions diff --git a/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java b/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java index 6f7d676a8d9c1c4b95df51cb03447215b86fb1ec..dacead1def0abbd51a4950e4e5cf5a5b69dbdd0d 100644 --- a/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java +++ b/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java @@ -16,6 +16,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import org.etsi.adapter.TERFactory; + import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -432,7 +434,7 @@ public class CountriesAreas implements ICountriesAreas { @Override public boolean isLocationInsideIdentifiedRegion(final int p_regionDictionary, final int p_regionId, final long p_localRegion, final WGS84 p_location) { -// System.out.println(">>> CountriesAreas.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location); +// TERFactory.getInstance().logDebug(">>> CountriesAreas.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location); boolean result = false; if (p_regionDictionary == Iso_3166_1) { @@ -449,7 +451,7 @@ public class CountriesAreas implements ICountriesAreas { } public boolean process(final String p_regionId, final long p_localRegion, final WGS84 p_location) { -// System.out.println(">>> CountriesAreas.process: " + p_regionId + ", " + p_localRegion + ", " + p_location); +// TERFactory.getInstance().logDebug(">>> CountriesAreas.process: " + p_regionId + ", " + p_localRegion + ", " + p_location); if (_countriesPolygons.containsKey(p_regionId)) { ArrayList> areas = _countriesPolygons.get(p_regionId); diff --git a/javasrc/geodesic/org/etsi/geodesic/Positioning.java b/javasrc/geodesic/org/etsi/geodesic/Positioning.java index 904cf192255547028552ea128fd5c96cddff3f4a..714c9c0877d2e28638a6bfe9e34a0352341ec2ea 100644 --- a/javasrc/geodesic/org/etsi/geodesic/Positioning.java +++ b/javasrc/geodesic/org/etsi/geodesic/Positioning.java @@ -2,6 +2,8 @@ package org.etsi.geodesic; import java.util.ArrayList; +import org.etsi.adapter.TERFactory; + /** * @desc * @see To validate GPS location: http://www.gps-coordinates.net @@ -35,7 +37,7 @@ public class Positioning implements IPositioning { @Override public boolean isLocationInsideEllipticArea(final WGS84 p_location, final ArrayList p_ellipticArea) { -// System.out.println(">>> Positioning.isLocationInsideEllipticArea: " + p_location); +// TERFactory.getInstance().logDebug(">>> Positioning.isLocationInsideEllipticArea: " + p_location); // TODO: implement it // Do not forget aboout passing throw 0 meridian @@ -44,7 +46,7 @@ public class Positioning implements IPositioning { @Override public boolean isLocationInsidePolygonalArea(final WGS84 p_location, final ArrayList p_polygonalArea) { -// System.out.println(">>> Positioning.isLocationInsidePolygonalArea: " + p_location + ", " + p_polygonalArea); +// TERFactory.getInstance().logDebug(">>> Positioning.isLocationInsidePolygonalArea: " + p_location + ", " + p_polygonalArea); // TODO: Check passing throw 0 meridian and Equador @@ -64,13 +66,13 @@ public class Positioning implements IPositioning { angle += calcAngle(delta1, delta2); } // End of 'for' statement -// System.out.println("<<< Positioning.isLocationInsidePolygonalArea: " + (boolean)((Math.abs(angle) < Math.PI) ? false : true)); +// TERFactory.getInstance().logDebug("<<< Positioning.isLocationInsidePolygonalArea: " + (boolean)((Math.abs(angle) < Math.PI) ? false : true)); return (boolean)((Math.abs(angle) < Math.PI) ? false : true); } @Override public boolean isLocationInsidePolygonalAreas(final WGS84 p_location, final ArrayList< ArrayList > p_polygonalAreas) { -// System.out.println(">>> Positioning.isLocationInsidePolygonalAreas: " + p_location); +// TERFactory.getInstance().logDebug(">>> Positioning.isLocationInsidePolygonalAreas: " + p_location); for (int index = 0; index < p_polygonalAreas.size(); index++) { if (isLocationInsidePolygonalArea(p_location, p_polygonalAreas.get(index))) { @@ -83,7 +85,7 @@ public class Positioning implements IPositioning { @Override public boolean isLocationInsideCircularArea(final WGS84 p_location, final WGS84 p_center, final int p_radius) { -// System.out.println(">>> Positioning.isLocationInsideCircularArea: " + p_location + ", " + p_center + ", " + p_radius); +// TERFactory.getInstance().logDebug(">>> Positioning.isLocationInsideCircularArea: " + p_location + ", " + p_center + ", " + p_radius); // TODO: Check passing throw 0 meridian and Equador @@ -93,15 +95,15 @@ public class Positioning implements IPositioning { Math.cos(dd2rad(p_center.getLatitude())) * Math.cos(dd2rad(p_location.getLatitude())) * Math.cos(dd2rad(theta)); distance = rad2dd(Math.acos(distance)); distance *= 60 * 1.1515 * 1.609344 /*Kilometers*/; -// System.out.println("Positioning.isLocationInsideCircularArea: distance=" + distance); +// TERFactory.getInstance().logDebug("Positioning.isLocationInsideCircularArea: distance=" + distance); -// System.out.println("<<< Positioning.isLocationInsideCircularArea: " + (boolean)(distance <= (p_radius / 1000.0))); +// TERFactory.getInstance().logDebug("<<< Positioning.isLocationInsideCircularArea: " + (boolean)(distance <= (p_radius / 1000.0))); return (boolean)(distance <= (p_radius / 1000.0)); } @Override public boolean isValidPolygonArea(final ArrayList p_polygonalArea) { -// System.out.println(">>> Positioning.isValidPolygonArea"); +// TERFactory.getInstance().logDebug(">>> Positioning.isValidPolygonArea"); // Check if polygon coordinates are valid for (int i = 0; i < p_polygonalArea.size(); i++) { @@ -115,14 +117,14 @@ public class Positioning implements IPositioning { @Override public boolean isLocationInsideIdentifiedRegion(final int p_regionDictionary, final int p_regionId, final long p_localRegion, final WGS84 p_location) { -// System.out.println(">>> Positioning.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location); +// TERFactory.getInstance().logDebug(">>> Positioning.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location); return CountriesAreas.getInstance().isLocationInsideIdentifiedRegion(p_regionDictionary, p_regionId, p_localRegion, p_location); } @Override public boolean isPolygonalRegionInside(final ArrayList p_parentArea, final ArrayList p_regionArea) { -// System.out.println(">>> Positioning.isPolygonalRegionInside: " + p_parentArea + ", " + p_regionArea); +// TERFactory.getInstance().logDebug(">>> Positioning.isPolygonalRegionInside: " + p_parentArea + ", " + p_regionArea); for (int i = 0; i < p_regionArea.size(); i++) { if (!isLocationInsidePolygonalArea(p_regionArea.get(i), p_parentArea)) { @@ -134,13 +136,13 @@ public class Positioning implements IPositioning { } private double calcAngle(final WGS84 p_origin, final WGS84 p_end) { -// System.out.println(">>> calcAngle: " + p_origin.getLatitude() + " - " + p_origin.getLongitude() + " - " + p_end.getLatitude() + " - " + p_end.getLongitude()); +// TERFactory.getInstance().logDebug(">>> calcAngle: " + p_origin.getLatitude() + " - " + p_origin.getLongitude() + " - " + p_end.getLatitude() + " - " + p_end.getLongitude()); double theta1 = Math.atan2(p_origin.getLatitude(), p_origin.getLongitude()); -// System.out.println("Angle2D: theta1=" + theta1); +// TERFactory.getInstance().logDebug("Angle2D: theta1=" + theta1); double theta2 = Math.atan2(p_end.getLatitude(), p_end.getLongitude()); -// System.out.println("Angle2D: theta2=" + theta2); +// TERFactory.getInstance().logDebug("Angle2D: theta2=" + theta2); double dtheta = theta2 - theta1; -// System.out.println("calcAngle: dtheta" + dtheta); +// TERFactory.getInstance().logDebug("calcAngle: dtheta" + dtheta); while (dtheta > Math.PI) { dtheta -= TWOPI; } // End of 'while' statement @@ -148,7 +150,7 @@ public class Positioning implements IPositioning { dtheta += TWOPI; } // End of 'while' statement -// System.out.println("<<< calcAngle: " + dtheta); +// TERFactory.getInstance().logDebug("<<< calcAngle: " + dtheta); return dtheta; } diff --git a/javasrc/tool/org/etsi/its/tool/elvior/BuiltInCodec.java b/javasrc/tool/org/etsi/its/tool/elvior/BuiltInCodec.java index be6fc7c8f3a94e6401e481c0bbf5629dce43f1ff..18fec5262e50b2f8aa4986650a6236d30db6a0e9 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/BuiltInCodec.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/BuiltInCodec.java @@ -37,8 +37,14 @@ public class BuiltInCodec implements TciCDProvided { _encodingName = "DENM_PDU_Descriptions"; } else if (encodingName.equals("LibItsCam_asn1")) { _encodingName = "CAM_PDU_Descriptions"; - } else if (encodingName.equals("LibItsMapSpat_asn1")) { - _encodingName = "MAP_SPAT_ETSI"; + } else if (encodingName.equals("LibItsMapemSpatem_asn1")) { + _encodingName = "MAPEM_SPATEM_ETSI"; + } else if (encodingName.equals("LibItsIvim_asn1")) { + _encodingName = "IVIM_PDU_Descriptions"; + } else if (encodingName.equals("LibItsEvcsn_asn1")) { + _encodingName = "EVCSN_PDU_Descriptions"; + } else if (encodingName.equals("LibItsSremSsem_asn1")) { + _encodingName = "SREM_SSEM_ETSI"; } else if (encodingName.equals("LibItsCALMmsap_asn1")) { _encodingName = "CALMmsap"; } else if (encodingName.equals("LibItsCALMllsap_asn1")) { @@ -49,8 +55,6 @@ public class BuiltInCodec implements TciCDProvided { _encodingName = "CALMfsap"; } else if (encodingName.equals("LibItsIicp_asn1")) { _encodingName = "CALMiitsscu"; - } else if (encodingName.equals("LibItsMapSpat_asn1")) { - _encodingName = "MAP_SPAT_ETSI"; } else { _encodingName = ""; } diff --git a/javasrc/tool/org/etsi/its/tool/elvior/GetValueStructure.java b/javasrc/tool/org/etsi/its/tool/elvior/GetValueStructure.java index ddf96420437d7d321a3b7d9a2b36129ce16a25be..aefb2a9d19f961f1a38b1194fc0b1c796de4714d 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/GetValueStructure.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/GetValueStructure.java @@ -23,7 +23,7 @@ public class GetValueStructure { buffer = new StringBuilder(); indent = ""; LogValueDataStructure(value); -// System.out.println(buffer.toString()); +// TERFactory.getInstance().logDebug(buffer.toString()); } static public String getValueStructure(final Value value) { diff --git a/javasrc/tool/org/etsi/its/tool/elvior/Its_CodecProvider.java b/javasrc/tool/org/etsi/its/tool/elvior/Its_CodecProvider.java index 0c9cb1c27de5a331b49dd0e4527c51a3d31b7841..d3887752024d06874a296d0420e3ee87576744a1 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/Its_CodecProvider.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/Its_CodecProvider.java @@ -33,7 +33,7 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT private CodecFactory _cf; public Its_CodecProvider() { - _logger.entering("Its_CodecProvider", "Its_CodecProvider"); + //_logger.entering("Its_CodecProvider", "Its_CodecProvider"); // Load Codec settings _cdReq = null; @@ -52,11 +52,13 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT } else if (debugLevel.equalsIgnoreCase("SEVERE")) { level = Level.SEVERE; } else if (!debugLevel.equalsIgnoreCase("OFF")) { - System.err.println("Unsupported logging level: " + debugLevel); + // FIXME + //TERFactory.getInstance().logError("Unsupported logging level: " + debugLevel); + level = Level.OFF; } - _logger.addHandler(new ConsoleHandler()); - _logger.setLevel(level); - _logger.getHandlers()[0].setLevel(level); + //_logger.addHandler(new ConsoleHandler()); + //_logger.setLevel(level); + //_logger.getHandlers()[0].setLevel(level); // Register this object as the instance implementing the TCI-CD Provided interface TciProvider.getInstance().setTciCDProvided(this); @@ -85,11 +87,18 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { e.printStackTrace(); } - } // End of 'foreach' loop + } // End of 'for' loop + try { // This comes with 'with encode () "UpperTester"' for all UtxxxTrigger/UtxxxUpdate messages + _cf.setExternalCodec("per-basic-unaligned:1997", LibIts_asn1.class.newInstance()); + } catch (InstantiationException | IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } public void run() { - _logger.entering("Its_CodecProvider", "run"); + //_logger.entering("Its_CodecProvider", "run"); // Attempt to connect to TestCast if (TriTciChannel.getInstance().open()) { @@ -101,12 +110,12 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT } } - _logger.exiting("Its_CodecProvider", "run"); + //_logger.exiting("Its_CodecProvider", "run"); } @Override public void onConnectionClosed() { - _logger.entering("Its_CodecProvider", "onConnectionClosed"); + //_logger.entering("Its_CodecProvider", "onConnectionClosed"); synchronized(this) { notify(); } @@ -114,22 +123,22 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT @Override public void onConnectionEstablished() { - _logger.entering("Its_CodecProvider", "onConnectionEstablished"); + //_logger.entering("Its_CodecProvider", "onConnectionEstablished"); } @Override public void onError(String error) { - _logger.entering("Its_CodecProvider", "onError", error); + //_logger.entering("Its_CodecProvider", "onError", error); } @Override public Value decode(TriMessage message, Type decodingHypothesis) { - _logger.entering( + /*_logger.entering( "decode", String.format("%s - %s - %s", decodingHypothesis.getName(), decodingHypothesis.getTypeEncoding(), - decodingHypothesis.getTypeClass())); + decodingHypothesis.getTypeClass()));*/ String encodingName = decodingHypothesis.getTypeEncoding(); if (encodingName != null) { encodingName = decodingHypothesis.getDefiningModule().getModuleName(); @@ -141,7 +150,7 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT return null; } Value value = codec.decode(message, decodingHypothesis); - _logger.exiting("Its_CodecProvider.decode", (value != null) ? GetValueStructure.getValueStructure(value) : "(null)"); + //_logger.exiting("Its_CodecProvider.decode", (value != null) ? GetValueStructure.getValueStructure(value) : "(null)"); return value; } @@ -162,7 +171,7 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT (value.notPresent() == true) ? "true" : "false" ) );*/ -// System.out.println(">>> encode: " + value.getType().getName()); +// TERFactory.getInstance().logDebug(">>> encode: " + value.getType().getName()); String encodingName = value.getType().getTypeEncoding(); if ((encodingName != null) && !encodingName.startsWith("Lib")) { encodingName = value.getType().getDefiningModule().getModuleName(); @@ -173,9 +182,9 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT if (codec == null) { return null; } - _logger.info("Value to encode: " + GetValueStructure.getValueStructure(value)); + //_logger.info("Value to encode: " + GetValueStructure.getValueStructure(value)); TriMessage res = codec.encode(value); - _logger.exiting("encode", res.toString()); + //_logger.exiting("encode", res.toString()); return res; } @@ -196,7 +205,7 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT @Override public Value decode(TriMessage message, Type decodingHypothesis) { - _logger.entering("Codec", "decode", decodingHypothesis.getName()); + //_logger.entering("Codec", "decode", decodingHypothesis.getName()); org.etsi.ttcn.codec.MainCodec codec = new org.etsi.ttcn.codec.MainCodec(_cdReq); Value v = null; @@ -211,7 +220,7 @@ public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, IT @Override public TriMessage encode(Value value) { - _logger.entering("Codec", "encode"); + //_logger.entering("Codec", "encode"); org.etsi.ttcn.codec.MainCodec codec = new org.etsi.ttcn.codec.MainCodec(_cdReq); TriMessage m = null; diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsContainer_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsContainer_asn1.java index 670243224b723e3fb445d176c39a3c43eb1f3b97..bb6010a250ea408b92eec8635aff078ba477fddb 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/LibItsContainer_asn1.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsContainer_asn1.java @@ -17,13 +17,13 @@ public class LibItsContainer_asn1 extends LibIts_asn1 { * Constructor */ public LibItsContainer_asn1() { - _logger.entering("LibItsContainer_asn1", "LibItsContainer_asn1"); + //_logger.entering("LibItsContainer_asn1", "LibItsContainer_asn1"); _encodingName = "ITS_Container"; } - @Override + @Override public Value decode(final TriMessage message, final Type decodingHypothesis) { - _logger.entering("LibItsContainer_asn1", "decode", decodingHypothesis.getName()); + //_logger.entering("LibItsContainer_asn1", "decode", decodingHypothesis.getName()); Value value = null; if (decodingHypothesis.getName().equals("TimestampIts")) { @@ -32,12 +32,16 @@ public class LibItsContainer_asn1 extends LibIts_asn1 { TriMessage msg = TriProvider.getInstance().getTriFactory().createMessage(); msg.setEncodedMessage(ByteHelper.longToByteArray(lval, 6)); value = super.decode(msg, decodingHypothesis); + } else if (decodingHypothesis.getName().equals("TimeMark")) { + TriMessage msg1 = TriProvider.getInstance().getTriFactory().createMessage(); + msg1.setEncodedMessage(message.getEncodedMessage()); + value = super.decode(msg1, decodingHypothesis); } else { value = super.decode(message, decodingHypothesis); } - _logger.exiting("LibIts_asn1", "decode", value.toString()); + //_logger.exiting("LibIts_asn1", "decode", value.toString()); return value; } -} // End of class BuiltInCodec +} // End of class LibItsContainer_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsDenm_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsDenm_asn1.java index 08ec479c6070d6ff669b6188398da05a3ad50117..d43121b4cd147a66d5108eaf4ebdd271d0552c87 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/LibItsDenm_asn1.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsDenm_asn1.java @@ -31,4 +31,4 @@ public class LibItsDenm_asn1 extends LibIts_asn1 { return super.decode(message, decodingHypothesis); } -} // End of class BuiltInCodec +} // End of class LibItsDenm_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsEvcsn_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsEvcsn_asn1.java new file mode 100644 index 0000000000000000000000000000000000000000..27145b388ddb7f0077c5de94bdc564f791c3f262 --- /dev/null +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsEvcsn_asn1.java @@ -0,0 +1,35 @@ +package org.etsi.its.tool.elvior; + +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; +import org.etsi.ttcn.tri.TriMessage; + + +/** + * + * Note that "Enable Internal Codec" field shall be set to true + * + */ +public class LibItsEvcsn_asn1 extends LibIts_asn1 { + + /** + * Constructor + */ + public LibItsEvcsn_asn1() { + _logger.entering("LibItsEvcsn_asn1", "LibItsEvcsn_asn1"); + _encodingName = "EVCSN_PDU_Descriptions"; + } + + @Override + public Value decode(final TriMessage message, final Type decodingHypothesis) { + _logger.entering("LibItsEvcsn_asn1", "decode", decodingHypothesis.getName()); + + if (decodingHypothesis.getName().endsWith("evcsnPacket")) { + Type type = getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu"); + return super.decode(message, type); + } + + return super.decode(message, decodingHypothesis); + } + +} // End of class LibItsEvcsn_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsIvim_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsIvim_asn1.java new file mode 100644 index 0000000000000000000000000000000000000000..34e6ee75b70e33bb4896ffd4156009b4ac502ccf --- /dev/null +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsIvim_asn1.java @@ -0,0 +1,35 @@ +package org.etsi.its.tool.elvior; + +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; +import org.etsi.ttcn.tri.TriMessage; + + +/** + * + * Note that "Enable Internal Codec" field shall be set to true + * + */ +public class LibItsIvim_asn1 extends LibIts_asn1 { + + /** + * Constructor + */ + public LibItsIvim_asn1() { + _logger.entering("LibItsIvim_asn1", "LibItsIvim_asn1"); + _encodingName = "IVIM_PDU_Descriptions"; + } + + @Override + public Value decode(final TriMessage message, final Type decodingHypothesis) { + _logger.entering("LibItsIvim_asn1", "decode", decodingHypothesis.getName()); + + if (decodingHypothesis.getName().endsWith("ivimPacket")) { + Type type = getTypeForName("IVIM_PDU_Descriptions.IVIM"); + return super.decode(message, type); + } + + return super.decode(message, decodingHypothesis); + } + +} // End of class LibItsIvim_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapSpat_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapSpat_asn1.java deleted file mode 100644 index 37ea7dd90f243631a2cf5387b6f5206320a5949c..0000000000000000000000000000000000000000 --- a/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapSpat_asn1.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.etsi.its.tool.elvior; - -import org.etsi.ttcn.tci.Type; -import org.etsi.ttcn.tci.Value; -import org.etsi.ttcn.tri.TriMessage; - - -/** - * - * Note that "Enable Internal Codec" field shall be set to true - * - */ -public class LibItsMapSpat_asn1 extends LibIts_asn1 { - - /** - * Constructor - */ - public LibItsMapSpat_asn1() { - _logger.entering("LibItsMapSpat_asn1", "LibItsMapSpat_asn1"); - _encodingName = "MAP_SPAT_ETSI"; - } - - @Override - public Value decode(final TriMessage message, final Type decodingHypothesis) { - _logger.entering("LibItsMapSpat_asn1", "decode", decodingHypothesis.getName()); - - if (decodingHypothesis.getName().endsWith("msgMap")) { - Type type = getTypeForName("MAP_SPAT_ETSI.MAP_PDU"); - return super.decode(message, type); - } else if (decodingHypothesis.getName().endsWith("msgSpat")) { - Type type = getTypeForName("MAP_SPAT_ETSI.SPAT_PDU"); - return super.decode(message, type); - } - - return super.decode(message, decodingHypothesis); - } - -} // End of class LibItsMapSpat_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapemSpatem_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapemSpatem_asn1.java new file mode 100644 index 0000000000000000000000000000000000000000..c66b6ae99246c78e52643f2aad5944be82e074e1 --- /dev/null +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsMapemSpatem_asn1.java @@ -0,0 +1,60 @@ +package org.etsi.its.tool.elvior; + +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; +import org.etsi.ttcn.tri.TriMessage; + + +/** + * + * Note that "Enable Internal Codec" field shall be set to true + * + */ +public class LibItsMapemSpatem_asn1 extends LibIts_asn1 { + + /** + * Constructor + */ + public LibItsMapemSpatem_asn1() { + _logger.entering("LibItsMapemSpatem_asn1", "LibItsMapemSpatem_asn1"); + _encodingName = "MAPEM_SPATEM_ETSI"; + } + + @Override + public TriMessage encode(final Value template) { + _logger.entering("LibItsMapemSpatem_asn1", "encode", template.getType().getName()); + + TriMessage result; + String type = String.format("%s.%s", _encodingName, template.getType().getName()); + if (template.getType().getName().endsWith("MAPEM")) { + _encodingName = "MAPEM_PDU_Descriptions"; + result = super.encode(template); + } else { + _encodingName = "SPATEM_PDU_Descriptions"; + result = super.encode(template); + } + _encodingName = "MAPEM_SPATEM_ETSI"; + + return result; + } + + @Override + public Value decode(final TriMessage message, final Type decodingHypothesis) { + _logger.entering("LibItsMapemSpatem_asn1", "decode", decodingHypothesis.getName()); + + Value result; + if (decodingHypothesis.getName().endsWith("MAPEM")) { + Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM"); + _encodingName = "MAPEM_PDU_Descriptions"; + result = super.decode(message, type); + } else { + Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM"); + _encodingName = "SPATEM_PDU_Descriptions"; + result = super.decode(message, type); + } + _encodingName = "MAPEM_SPATEM_ETSI"; + + return result; + } + +} // End of class LibItsMapemSpatem_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibItsSremSsem_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibItsSremSsem_asn1.java new file mode 100644 index 0000000000000000000000000000000000000000..bf78554ad765ffb18e2fd204d05523a8a112d985 --- /dev/null +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibItsSremSsem_asn1.java @@ -0,0 +1,54 @@ +package org.etsi.its.tool.elvior; + +import org.etsi.ttcn.tci.Type; +import org.etsi.ttcn.tci.Value; +import org.etsi.ttcn.tri.TriMessage; + + +/** + * + * Note that "Enable Internal Codec" field shall be set to true + * + */ +public class LibItsSremSsem_asn1 extends LibIts_asn1 { + + /** + * Constructor + */ + public LibItsSremSsem_asn1() { + _logger.entering("LibItsSremSsem_asn1", "LibItsSremSsem_asn1"); + _encodingName = "SREM_SSEM_ETSI"; + } + + @Override + public Value decode(final TriMessage message, final Type decodingHypothesis) { + _logger.entering("LibItsSremSsem_asn1", "decode", decodingHypothesis.getName()); + + if (decodingHypothesis.getName().endsWith("SREM")) { + Type type = getTypeForName("SREM_PDU_Descriptions.SREM"); + return super.decode(message, type); + } else { + Type type = getTypeForName("SSEM_PDU_Descriptions.SSEM"); + return super.decode(message, type); + } + } + + @Override + public TriMessage encode(final Value template) { + _logger.entering("LibItsSremSsem_asn1", "encode", template.getType().getName()); + + TriMessage result; + String type = String.format("%s.%s", _encodingName, template.getType().getName()); + if (template.getType().getName().endsWith("SREM")) { + _encodingName = "SREM_PDU_Descriptions"; + result = super.encode(template); + } else { + _encodingName = "SREM_PDU_Descriptions"; + result = super.encode(template); + } + _encodingName = "SREM_SSEM_ETSI"; + + return result; + } + +} // End of class LibItsSremSsem_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java b/javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java index d9938510b2fce57abca36b017d8ade3497eebb0f..a4f4acf552fcba49419468de7faf183bf81374ae 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java @@ -33,7 +33,7 @@ public class LibIts_asn1 implements TciCDProvided { * Constructor */ public LibIts_asn1() { - _logger.entering("LibIts_asn1", "LibIts_asn1"); + //_logger.entering("LibIts_asn1", "LibIts_asn1"); _encodingName = ""; } @@ -53,28 +53,82 @@ public class LibIts_asn1 implements TciCDProvided { */ @Override public Value decode(final TriMessage message, final Type decodingHypothesis) { - _logger.entering("LibIts_asn1", "decode", decodingHypothesis.getName()); + //_logger.entering("LibIts_asn1", "decode", decodingHypothesis.getName()); TriMessageEx msg = TriProvider.getInstance().getTriFactory().createMessageEx(); msg.setEncodedMessage(message.getEncodedMessage()); - if (_logger.isLoggable(Level.ALL)) ByteHelper.dump("LibIts_asn1.decode: ", msg.getEncodedMessage()); - - String type = String.format("%s.%s", _encodingName, decodingHypothesis.getName()); - _logger.info("Type: " + type); + //if (_logger.isLoggable(Level.ALL)) ByteHelper.dump("LibIts_asn1.decode: ", msg.getEncodedMessage()); + //ByteHelper.dump("LibIts_asn1.decode: ", msg.getEncodedMessage()); + String type = ""; + System.out.println("decode: " + String.format("%s.%s: %02x", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName(), message.getEncodedMessage()[1])); + if (decodingHypothesis.getTypeEncoding().equals("per-basic-unaligned:1997")) { + switch (message.getEncodedMessage()[1]) { // 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) } (0..255), -- Mantis #7209, #7005 + case (byte)0x01: + if (decodingHypothesis.getName().equals("DENM")) { + type = "DENM_PDU_Descriptions.DENM"; + } + break; + case (byte)0x02: + if (decodingHypothesis.getName().equals("CAM")) { + type = "CAM_PDU_Descriptions.CAM"; + } + break; + case (byte)0x05: + if (decodingHypothesis.getName().equals("MAPEM")) { + type = "MAPEM_PDU_Descriptions.MAPEM"; + } + break; + case (byte)0x04: + if (decodingHypothesis.getName().equals("SPATEM")) { + type = "SPATEM_PDU_Descriptions.SPATEM"; + } + break; + case (byte)0x06: + if (decodingHypothesis.getName().equals("IVIM")) { + type = "IVIM_PDU_Descriptions.IVIM"; + } + break; + case (byte)0x07: + if (decodingHypothesis.getName().equals("EvcsnPdu")) { + type = "EVCSN_PDU_Descriptions.EvcsnPdu"; + } + break; + case (byte)0x09: + if (decodingHypothesis.getName().equals("SREM")) { + type = "SREM_PDU_Descriptions.SREM"; + } + break; + case (byte)0x0a: + if (decodingHypothesis.getName().equals("SSEM")) { + type = "SSEM_PDU_Descriptions.SSEM"; + } + break; + default: + // Nothing to do + System.out.println("Default: " + String.format("%s.%s", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName())); + } // End of 'switch' statement + } else { + type = String.format("%s.%s", _encodingName, decodingHypothesis.getName()); + } + //_logger.info("Type: " + type); + //System.out.println("Type: " + type); + if (type.isEmpty()) { + return null; // Abort decoding + } Type asnOriginalType = getTypeForName(type); // Check which type class the decoding hypothesis is of - _logger.info("asnOriginalType: " + asnOriginalType.getName()); + //_logger.info("asnOriginalType: " + asnOriginalType.getName()); Value value = TciProvider.getInstance().getSystemInterface().internalDecode(msg, asnOriginalType); - _logger.exiting("LibIts_asn1", "decode", value.toString()); + //_logger.exiting("LibIts_asn1", "decode", value.toString()); return value; } @Override public TriMessage encode(final Value template) { - _logger.entering("LibIts_asn1", "encode", template.getType().getName()); + //_logger.entering("LibIts_asn1", "encode", template.getType().getName()); String type = String.format("%s.%s", _encodingName, template.getType().getName()); - _logger.info("Type: " + type); + //_logger.info("Type: " + type); Type asnOriginalType = getTypeForName(type); if (asnOriginalType != null) { Value internalASNEncodecValue = null; @@ -83,17 +137,17 @@ public class LibIts_asn1 implements TciCDProvided { internalASNEncodecValue = (RecordValue)asnOriginalType.newInstance(); String[] fields = ((RecordValue)internalASNEncodecValue).getFieldNames(); RecordValue asn1Value = (RecordValue)template; - for(String field: fields) { - _logger.info(String.format("Process field %s", field)); - Value fieldValue = asn1Value.getField(field); - if(fieldValue.notPresent()) { - _logger.info(String.format("Field %s was omitted", field)); - ((RecordValue)internalASNEncodecValue).setFieldOmitted(field); - } else { - _logger.info(String.format("Field %s was added", field)); - ((RecordValue)internalASNEncodecValue).setField(field, fieldValue); - } - } // End of 'for' statement + for(String field: fields) { + //_logger.info(String.format("Process field %s", field)); + Value fieldValue = asn1Value.getField(field); + if(fieldValue.notPresent()) { + //_logger.info(String.format("Field %s was omitted", field)); + ((RecordValue)internalASNEncodecValue).setFieldOmitted(field); + } else { + //_logger.info(String.format("Field %s was added", field)); + ((RecordValue)internalASNEncodecValue).setField(field, fieldValue); + } + } // End of 'for' statement break; case TciTypeClass.INTEGER: internalASNEncodecValue = (IntegerValueEx)asnOriginalType.newInstance(); @@ -102,23 +156,23 @@ public class LibIts_asn1 implements TciCDProvided { default: throw new RuntimeException("Unimplemented type " + template.getType().getTypeClass()); } // End of 'switch' statement - _logger.info("Call internal codec"); + //_logger.info("Call internal codec"); TriMessage msg = TciProvider.getInstance().getSystemInterface().internalEncode(internalASNEncodecValue); - ByteHelper.dump("LibIts_asn1.encode: ", msg.getEncodedMessage()); - _logger.exiting("LibIts_asn1", "encode"); + //ByteHelper.dump("LibIts_asn1.encode: ", msg.getEncodedMessage()); + //_logger.exiting("LibIts_asn1", "encode"); return msg; } - _logger.exiting("LibIts_asn1", "encode", "null"); + //_logger.exiting("LibIts_asn1", "encode", "null"); return null; } protected Type getTypeForName(final String type) { - _logger.entering("LibIts_asn1", "getTypeForName", type); + //_logger.entering("LibIts_asn1", "getTypeForName", type); Type asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type); - _logger.exiting("LibIts_asn1", "getTypeForName", asnOriginalType.getName()); + //_logger.exiting("LibIts_asn1", "getTypeForName", (asnOriginalType != null) ? asnOriginalType.getName() : "(null)"); return asnOriginalType; } // End of method getTypeForName diff --git a/javasrc/tool/org/etsi/its/tool/elvior/PluginAdapter.java b/javasrc/tool/org/etsi/its/tool/elvior/PluginAdapter.java index 3540b22e8d4e4acdbf82e83683a6b433339d1d9e..0c619c43c997a30f6cb074f0de46e41c348c1bed 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/PluginAdapter.java +++ b/javasrc/tool/org/etsi/its/tool/elvior/PluginAdapter.java @@ -82,25 +82,27 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT _logger.entering("PluginAdapter", "Constructor"); // Load TA settings + Level level = Level.ALL; try { _properties.load(MainTA.class.getResourceAsStream("/org/etsi/its/tool/elvior/res/ta.properties")); + String debugLevel = _properties.getProperty("DEBUG_ENABLED", "OFF"); + level = Level.OFF; + if (debugLevel.equalsIgnoreCase("ALL")) { + level = Level.ALL; + } else if (debugLevel.equalsIgnoreCase("INFO")) { + level = Level.INFO; + } else if (debugLevel.equalsIgnoreCase("SEVERE")) { + level = Level.SEVERE; + } else if (!debugLevel.equalsIgnoreCase("OFF")) { + TERFactory.getInstance().logError("Unsupported logging level: " + debugLevel); + } } catch (IOException e) { e.printStackTrace(); } - String debugLevel = _properties.getProperty("DEBUG_ENABLED", "OFF"); - Level level = Level.OFF; - if (debugLevel.equalsIgnoreCase("ALL")) { - level = Level.ALL; - } else if (debugLevel.equalsIgnoreCase("INFO")) { - level = Level.INFO; - } else if (debugLevel.equalsIgnoreCase("SEVERE")) { - level = Level.SEVERE; - } else if (!debugLevel.equalsIgnoreCase("OFF")) { - System.err.println("Unsupported logging level: " + debugLevel); - } _logger.addHandler(new ConsoleHandler()); + _logger.setUseParentHandlers(false); _logger.setLevel(level); - _logger.getHandlers()[0].setLevel(level); +// _logger.getHandlers()[0].setLevel(level); // Register this object as the instance implementing the TRI-SA interface TriProvider.getInstance().setTriCommunicationSA(this); @@ -158,7 +160,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT } public TriStatus triExecuteTestCase(TriTestCaseId testCaseId, TriPortIdList tsiPorts) { -// System.out.println("triExecuteTestCase"); +// TERFactory.getInstance().logDebug("triExecuteTestCase"); // Disable XTRI functionality for all ports, so that existing SA implementation can be reused for(int i = 0; i < tsiPorts.size(); i++) { TriTciChannel.getInstance().enableXTriForPort(tsiPorts.get(i), false); @@ -167,40 +169,40 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT } public TriStatus triMap(TriPortId compPortId, TriPortId tsiPortId) { -// System.out.println("triMap: " + compPortId.getComponent().getComponentName() + " - " + tsiPortId.getPortName()); +// TERFactory.getInstance().logDebug("triMap: " + compPortId.getComponent().getComponentName() + " - " + tsiPortId.getPortName()); return _itsTestAdapter.triMap(compPortId, tsiPortId); } public TriStatus triRaise(TriComponentId componentId, TriPortId tsiPortId, TriAddress sutAddress, TriSignatureId signatureId, TriException exception) { -// System.out.println("triRaise"); +// TERFactory.getInstance().logDebug("triRaise"); return _itsTestAdapter.triRaise(componentId, tsiPortId, sutAddress, signatureId, exception); } public TriStatus triRaiseBC(TriComponentId componentId, TriPortId tsiPortId, TriSignatureId signatureId, TriException exc) { -// System.out.println("triRaiseBC"); +// TERFactory.getInstance().logDebug("triRaiseBC"); return _itsTestAdapter.triRaiseBC(componentId, tsiPortId, signatureId, exc); } public TriStatus triRaiseMC(TriComponentId componentId, TriPortId tsiPortId, TriAddressList sutAddresses, TriSignatureId signatureId, TriException exc) { -// System.out.println("triRaiseMC"); +// TERFactory.getInstance().logDebug("triRaiseMC"); return _itsTestAdapter.triRaiseMC(componentId, tsiPortId, sutAddresses, signatureId, exc); } public TriStatus triReply(TriComponentId componentId, TriPortId tsiPortId, TriAddress sutAddress, TriSignatureId signatureId, TriParameterList parameterList, TriParameter returnValue) { -// System.out.println("triReply"); +// TERFactory.getInstance().logDebug("triReply"); return _itsTestAdapter.triReply(componentId, tsiPortId, sutAddress, signatureId, parameterList, returnValue); } public TriStatus triReplyBC(TriComponentId componentId, TriPortId tsiPortId, TriSignatureId signatureId, TriParameterList parameterList, TriParameter returnValue) { -// System.out.println("triReplyBC"); +// TERFactory.getInstance().logDebug("triReplyBC"); return _itsTestAdapter.triReplyBC(componentId, tsiPortId, signatureId, parameterList, returnValue); } @@ -208,45 +210,45 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT TriPortId tsiPortId, TriAddressList sutAddresses, TriSignatureId signatureId, TriParameterList parameterList, TriParameter returnValue) { -// System.out.println("triReplyMC"); +// TERFactory.getInstance().logDebug("triReplyMC"); return _itsTestAdapter.triReplyMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList, returnValue); } public TriStatus triSAReset() { -// System.out.println("triSAReset"); +// TERFactory.getInstance().logDebug("triSAReset"); return _itsTestAdapter.triSAReset(); } public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId, TriAddress address, TriMessage sendMessage) { -// System.out.println("triSend"); +// TERFactory.getInstance().logDebug("triSend"); return _itsTestAdapter.triSend(componentId, tsiPortId, address, sendMessage); } public TriStatus triSendBC(TriComponentId componentId, TriPortId tsiPortId, TriMessage sendMessage) { -// System.out.println("triSendBC"); +// TERFactory.getInstance().logDebug("triSendBC"); return _itsTestAdapter.triSendBC(componentId, tsiPortId, sendMessage); } public TriStatus triSendMC(TriComponentId componentId, TriPortId tsiPortId, TriAddressList addresses, TriMessage sendMessage) { -// System.out.println("triSendMC"); +// TERFactory.getInstance().logDebug("triSendMC"); return _itsTestAdapter.triSendMC(componentId, tsiPortId, addresses, sendMessage); } public TriStatus triSutActionInformal(String description) { -// System.out.println("triSutActionInformal"); +// TERFactory.getInstance().logDebug("triSutActionInformal"); return _itsTestAdapter.triSutActionInformal(description); } public TriStatus triUnmap(TriPortId compPortId, TriPortId tsiPortId) { -// System.out.println("triUnmap"); +// TERFactory.getInstance().logDebug("triUnmap"); return _itsTestAdapter.triUnmap(compPortId, tsiPortId); } public TriStatus triExternalFunction(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue) { - _logger.entering("PluginAdapter", "triExternalFunction", functionId.getFunctionName()); // + " - " + parameterList + " - " + returnValue.getParameterName() + " - " + returnValue.getParameterPassingMode()); + //TERFactory.getInstance().logDebug(">>> PluginAdapter.triExternalFunction: " + functionId.getFunctionName()); // + " - " + parameterList + " - " + returnValue.getParameterName() + " - " + returnValue.getParameterPassingMode()); TriStatus result = m_triOK; if ( @@ -267,12 +269,27 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT ) { // Compute a position using a reference position, a distance and an orientation exec_computePositionUsingDistance(parameterList, returnValue); + } else if ( + functionId.getFunctionName().endsWith("fx_computePositionFromRotation") && + (parameterList.size() == 7) + ) { + // Compute a reference position rotation + exec_computePositionFromRotation(parameterList, returnValue); } else if (functionId.getFunctionName().endsWith("fx_computeGnTimestamp")) { // Compute timestamp based on current time exec_computeGnTimestamp(returnValue); } else if (functionId.getFunctionName().endsWith("fx_getCurrentTime")) { // Gets the current time exec_getCurrentTime(returnValue); + } else if (functionId.getFunctionName().endsWith("fx_getCurrentTimeMark")) { + // Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time + exec_getCurrentTimeMark(returnValue); + } else if (functionId.getFunctionName().endsWith("fx_getMinuteOfTheYear")) { + // Gets the the minutes of current UTC year + exec_getMinuteOfTheYear(returnValue); + } else if (functionId.getFunctionName().endsWith("fx_getDSecond")) { + // Gets the milliseconds point in the current UTC minute + exec_getDSecond(returnValue); } else if (functionId.getFunctionName().endsWith("xf_parseIpv6Address")) { exec_parseIpv6Address(parameterList, returnValue); } else if (functionId.getFunctionName().endsWith("fx_hashWithSha256") && (parameterList.size() == 1)) { @@ -313,7 +330,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT _logger.severe("Unprocessed external function"); result = m_triKO; } - _logger.exiting("PluginAdapter", "triExternalFunction", ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); + //TERFactory.getInstance().logDebug("<<< PluginAdapter.triExternalFunction: " + ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); return result; } @@ -334,7 +351,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT @Override public TriStatus triPAReset() { -// System.out.println("triPAReset"); +// TERFactory.getInstance().logDebug("triPAReset"); return m_triOK; } @@ -553,14 +570,14 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT longitudeB.setInteger(ByteHelper.byteArrayToInt(value)); // Execute the function - _logger.info(String.format("_extfuncsImpl.fx_computeDistance %d, %d, %d, %d", latitudeA.getInteger(), longitudeA.getInteger(), latitudeB.getInteger(), longitudeB.getInteger())); +// _logger.info(String.format("_extfuncsImpl.fx_computeDistance %d, %d, %d, %d", latitudeA.getInteger(), longitudeA.getInteger(), latitudeB.getInteger(), longitudeB.getInteger())); FloatValue distance = _extfuncsImpl.fx_computeDistance( latitudeA, longitudeA, latitudeB, longitudeB ); - _logger.info(String.format("fx_computeDistance returns %f", distance.getFloat())); +// _logger.info(String.format("fx_computeDistance returns %f", distance.getFloat())); returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); byte[] convert = ByteHelper.floatToByteArray(distance.getFloat()); returnValue.setNumberOfBits(convert.length * Byte.SIZE); @@ -584,8 +601,8 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT _logger.info(String.format("Setting parameter %s", parameterList.get(2).getParameterName())); value = parameterList.get(2).getEncodedParameter(); - IntegerValue distance = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); - distance.setInteger(ByteHelper.byteArrayToInt(value)); + FloatValue distance = (FloatValue)TciProvider.getInstance().getTciCDRequired().getFloat().newInstance(); + distance.setFloat(ByteHelper.byteArrayToInt(value)); // FIXME Should be byteArrayToFloat??? _logger.info(String.format("Setting parameter %s", parameterList.get(3).getParameterName())); value = parameterList.get(3).getEncodedParameter(); @@ -609,6 +626,51 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT _logger.exiting("PluginAdapter", "exec_computePositionUsingDistance"); } // End of method exec_computePositionUsingDistance + private void exec_computePositionFromRotation(TriParameterList parameterList, TriParameter returnValue) { + _logger.entering("PluginAdapter", "exec_computePositionUsingDistance"); + + _logger.info(String.format("Setting parameter %s", parameterList.get(0).getParameterName())); + byte[] value = parameterList.get(0).getEncodedParameter(); + IntegerValue refLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + refLatitude.setInteger(ByteHelper.byteArrayToInt(value)); + + _logger.info(String.format("Setting parameter %s", parameterList.get(1).getParameterName())); + value = parameterList.get(1).getEncodedParameter(); + IntegerValue refLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + refLongitude.setInteger(ByteHelper.byteArrayToInt(value)); + + _logger.info(String.format("Setting parameter %s", parameterList.get(2).getParameterName())); + value = parameterList.get(2).getEncodedParameter(); + IntegerValue cenLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + cenLatitude.setInteger(ByteHelper.byteArrayToInt(value)); + + _logger.info(String.format("Setting parameter %s", parameterList.get(3).getParameterName())); + value = parameterList.get(3).getEncodedParameter(); + IntegerValue cenLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + cenLongitude.setInteger(ByteHelper.byteArrayToInt(value)); + + _logger.info(String.format("Setting parameter %s", parameterList.get(4).getParameterName())); + value = parameterList.get(4).getEncodedParameter(); + IntegerValue rotation = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + rotation.setInteger(ByteHelper.byteArrayToInt(value)); + + IntegerValue latitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + IntegerValue longitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance(); + _extfuncsImpl.fx_computePositionFromRotation(refLatitude, refLongitude, cenLatitude, cenLongitude, rotation, latitude, longitude); + + TriParameter param = parameterList.get(5); + param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); + param.setNumberOfBits(Integer.SIZE); + param.setEncodedParameter(ByteHelper.intToByteArray(latitude.getInteger(), Integer.SIZE / Byte.SIZE)); + + param = parameterList.get(6); + param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); + param.setNumberOfBits(Integer.SIZE); + param.setEncodedParameter(ByteHelper.intToByteArray(longitude.getInteger(), Integer.SIZE / Byte.SIZE)); + + _logger.exiting("PluginAdapter", "exec_computePositionUsingDistance"); + } + private void exec_computeGnTimestamp(TriParameter returnValue) { _logger.entering("PluginAdapter", "exec_computeGnTimestamp"); @@ -636,13 +698,66 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT returnValue.setNumberOfBits(Long.SIZE); returnValue.setEncodedParameter( ByteHelper.longToByteArray( - ((IntegerValueEx)time).getInt64() << 6, // Decoding starts from bit 0, byte 0, so we have to shift the value 6 bits to the left - 6/*Long.SIZE / Byte.SIZE*/ // Encoding on 48 bits +// ((IntegerValueEx)time).getInt64() << 6, // Decoding starts from bit 0, byte 0, so we have to shift the value 6 bits to the left + // 6/*Long.SIZE / Byte.SIZE*/ // Encoding on 48 bits + ((IntegerValueEx)time).getInt64(), + Long.SIZE / Byte.SIZE )); _logger.exiting("PluginAdapter", "exec_getCurrentTime", ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); } // End of method exec_getCurrentTime + private void exec_getCurrentTimeMark(TriParameter returnValue) { + //_logger.entering("PluginAdapter", "exec_getCurrentTimeMark"); + + // Execute the function + IntegerValue time = _extfuncsImpl.fx_getCurrentTimeMark(); + //_logger.info(String.format("exec_getCurrentTimeMark returns %d", ((IntegerValueEx)time).getInt64())); + returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); + returnValue.setNumberOfBits(Long.SIZE); + returnValue.setEncodedParameter( + ByteHelper.longToByteArray( + ((IntegerValueEx)time).getInt64(), + 4/*Integer.SIZE / Byte.SIZE*/ // Encoding on 32 bits + )); + + //_logger.exiting("PluginAdapter", "exec_getCurrentTimeMark: ", ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); + } // End of method exec_getCurrentTimeMark + + private void exec_getMinuteOfTheYear(TriParameter returnValue) { + //_logger.entering("PluginAdapter", "exec_getMinuteOfTheYear"); + + // Execute the function + IntegerValue time = _extfuncsImpl.fx_getMinuteOfTheYear(); + //_logger.info(String.format("exec_getMinuteOfTheYear returns %d", ((IntegerValueEx)time).getInt64())); + returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); + returnValue.setNumberOfBits(Long.SIZE); + returnValue.setEncodedParameter( + ByteHelper.longToByteArray( + ((IntegerValueEx)time).getInt64(), + 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits + )); + + //_logger.exiting("PluginAdapter", "exec_getMinuteOfTheYear: ", ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); + } // End of method exec_getMinuteOfTheYear + + private void exec_getDSecond(TriParameter returnValue) { + //_logger.entering("PluginAdapter", "exec_getDSecond"); + + // Execute the function + IntegerValue time = _extfuncsImpl.fx_getDSecond(); + //_logger.info(String.format("exec_getDSecond returns %d", ((IntegerValueEx)time).getInt64())); + returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); + returnValue.setNumberOfBits(Long.SIZE); + returnValue.setEncodedParameter( + ByteHelper.longToByteArray( + ((IntegerValueEx)time).getInt64(), + 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits + )); + + //_logger.exiting("PluginAdapter", "exec_getDSecond: ", ByteHelper.byteArrayToString(returnValue.getEncodedParameter())); + } // End of method exec_getDSecond + private void exec_generateKeyPair(TriParameterList parameterList, TriParameter returnValue) { _logger.entering("PluginAdapter", "exec_generateKeyPair"); @@ -775,7 +890,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT // Return code returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT); returnValue.setNumberOfBits(result.getLength() * Byte.SIZE); -// System.out.println("Result length = " + result.getLength()); +// TERFactory.getInstance().logDebug("Result length = " + result.getLength()); value = new byte[result.getLength()]; for (int i = 0; i < value.length; i++) { value[i] = (byte) result.getOctet(i); @@ -1161,7 +1276,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT parameterList.get(1).setNumberOfBits(certificate.getLength() * Byte.SIZE); byte[] value = new byte[certificate.getLength()]; for (int i = 0; i < value.length; i++) { - value[i] = (byte) certificate.getOctet(i); + value[i] = (byte) certificate.getOctet(i); }// End of 'for'statement parameterList.get(1).setEncodedParameter(value); @@ -1190,7 +1305,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT parameterList.get(1).setNumberOfBits(digest.getLength() * Byte.SIZE); byte[] value = new byte[digest.getLength()]; for (int i = 0; i < value.length; i++) { - value[i] = (byte) digest.getOctet(i); + value[i] = (byte) digest.getOctet(i); }// End of 'for'statement parameterList.get(1).setEncodedParameter(value); @@ -1219,7 +1334,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE); byte[] value = new byte[privateKey.getLength()]; for (int i = 0; i < value.length; i++) { - value[i] = (byte) privateKey.getOctet(i); + value[i] = (byte) privateKey.getOctet(i); }// End of 'for'statement parameterList.get(1).setEncodedParameter(value); @@ -1248,7 +1363,7 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE); byte[] value = new byte[privateKey.getLength()]; for (int i = 0; i < value.length; i++) { - value[i] = (byte) privateKey.getOctet(i); + value[i] = (byte) privateKey.getOctet(i); }// End of 'for'statement parameterList.get(1).setEncodedParameter(value); diff --git a/javasrc/tool/org/etsi/its/tool/elvior/res/codec.properties b/javasrc/tool/org/etsi/its/tool/elvior/res/codec.properties index d6291527709cc728a830a4221911afcc82c63a12..2e3b585f3c6e59cc5a82baafa5b15434ebef1067 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/res/codec.properties +++ b/javasrc/tool/org/etsi/its/tool/elvior/res/codec.properties @@ -1,8 +1,11 @@ # Debug level - Authorized values: OFF, ALL, INFO, SEVERE -DEBUG_ENABLED=ALL +DEBUG_ENABLED=OFF -ASN.1Codecs=CAM,DENM,CDD,MAP_SPaT +ASN.1Codecs=CAM,DENM,CDD,MAPEM_SPATEM,IVIM,EVSCN,SREM_SSEM CAM=LibItsCam_asn1,org.etsi.its.tool.elvior.LibItsCam_asn1 DENM=LibItsDenm_asn1,org.etsi.its.tool.elvior.LibItsDenm_asn1 CDD=LibItsContainer_asn1,org.etsi.its.tool.elvior.LibItsContainer_asn1 -MAP_SPaT=LibItsMapSpat_asn1,org.etsi.its.tool.elvior.LibItsMapSpat_asn1 +MAPEM_SPATEM=LibItsMapemSpatem_asn1,org.etsi.its.tool.elvior.LibItsMapemSpatem_asn1 +IVIM=LibItsIvim_asn1,org.etsi.its.tool.elvior.LibItsIvim_asn1 +EVSCN=LibItsEvcsn_asn1,org.etsi.its.tool.elvior.LibItsEvcsn_asn1 +SREM_SSEM=LibItsSremSsem_asn1,org.etsi.its.tool.elvior.LibItsSremSsem_asn1 diff --git a/javasrc/tool/org/etsi/its/tool/elvior/res/ta.properties b/javasrc/tool/org/etsi/its/tool/elvior/res/ta.properties index afaa61de6aa0114496375e74fee73c9490de4380..7be70ca76e289da2fa4032df70be69bc9047a575 100644 --- a/javasrc/tool/org/etsi/its/tool/elvior/res/ta.properties +++ b/javasrc/tool/org/etsi/its/tool/elvior/res/ta.properties @@ -1,59 +1,141 @@ # Debug level - Authorized values: OFF, ALL, INFO, SEVERE DEBUG_ENABLED=OFF + # Define the port/layer configuration for CAM camPort=BTP/GN/ETH +#camPort=BTP/GN/UdpIpCSG +#camPort=BTP/GN/CSG +#camPort=BTP/GN/UdpIpMarben + # Define the port/layer configuration for DENM denmPort=BTP/GN/ETH +#denmPort=BTP/GN/UdpIpCSG +#denmPort=BTP/GN/CSG +#denmPort=BTP/GN/UdpIpMarben + +# Define the port/layer configuration for MAPEM-SPATEM +mapemSpatemPort=BTP/GN/ETH +#mapemSpatemPort=BTP/GN/CSG + +# Define the port/layer configuration for IVIM +ivimPort=BTP/GN/ETH +#ivimPort=BTP/GN/CSG + +# Define the port/layer configuration for SREM-SSEM +sremSsemPort=BTP/GN/ETH +#sremSsemPort=BTP/GN/CSG + # Define the port/layer configuration for BTP btpPort=GN/ETH + # Define the port/layer configuration for GeoNetworking -geoNetworkingPort=ETH +#geoNetworkingPort=ETH +#geoNetworkingPort=UdpIpCSG +geoNetworkingPort=CSG +#geoNetworkingPort=UdpIpMarben + # Define the port/layer configuration for GeoNetworking over IPv6 ipv6OverGeoNetworkingPort=Debug + # Define the port/layer configuration for CALM FNTP #fntpPort=FNTP/ETH -fntpPort=FNTP/UdpIp +#fntpPort=FNTP/UdpIp + # Define the port/layer configuration for CALM FSAP -fsapPort=FSAP/UdpIp -fsapPort=FSAP/UdpIp +#fsapPort=FSAP/UdpIp +#fsapPort=FSAP/UdpIp -#UpperTesterSettings=192.168.42.1:12345 -UpperTesterSettings=10.7.6.76:12345 +# Commsignia RSU and OBU Simulator +UpperTesterSettings=10.200.1.101:12345 +# Commsignia Wireless OBU +#UpperTesterSettings=80.98.62.165:18502 +# Savari/VPN +#UpperTesterSettings=192.168.20.153:1999 +# Yogoko/VPN +#UpperTesterSettings=192.168.201.2:12345 +# Home laptop +#UpperTesterSettings=192.168.1.53:12345 +# Marben Jupiter VM32G upper tester +#UpperTesterSettings=192.168.7.182:10005 +# Nordsys upper tester +#UpperTesterSettings=172.23.0.1:1234 + +# RSU simulator +ConfigTesterSettings=10.200.1.102:12346 # Peer ITS station -LinkLayer_Peer=8BADF00D0099 +#LinkLayer_Peer=001C6B0D0099 # Define the MAC address of the Ethernet interface connected to the IUT device # Home laptop VMWare MAC address #LocalEthernetMAC=005056C00008 -# Home laptop MAC address -#LocalEthernetMAC=4C80938EDB27 +# Home laptop MAC address (Wireless) +#LocalEthernetMAC=DC536045AF7E +# Home laptop MAC address (Wired) +LocalEthernetMAC=F8CAB8083918 +# Home laptop/VPN MAC address +#LocalEthernetMAC=00FF6BADBFC2 # ETSI computer MAC address #LocalEthernetMAC=0022191B7FDB # G5 bridge connected on USB3/Ethernet -LocalEthernetMAC=0023545C8218 +#LocalEthernetMAC=00E08F008855 + +# Post-mortem ATS execution mode (G5 raw Ethernet only) +OfflineMode=false +#PcapFile=pcap/vendor/Livorno 20160914-2 DENM Full packet.pcap +PcapFile=F:/FSCOM/ETSI/ITS/STF517_ITS_Valid_Conform_Frmwk.2016/ITS-CMS5 PreQ/Savari/TC_SEC_ITSS_SND_MSG_01_01_BV.pcap +# Start at time in seconds since 1970-01-01, e.g. 1421661427.233361 +OffsetTime=0 + # Define the Ethernet type value used by the IUT IutEthernetTypeValue=0x8947 + # Node Ethernet addresses -LinkLayer_MTC=8BADF00D0000 +LinkLayer_MTC=001C6B0D0000 # Link-Layer address of component NodeA -LinkLayer_NodeA=8BADF00D0001 +LinkLayer_NodeA=001C6B0D0001 # Link-Layer address of component NodeB -LinkLayer_NodeB=8BADF00D0002 +LinkLayer_NodeB=001C6B0D0002 # Link-Layer address of component NodeC -LinkLayer_NodeC=8BADF00D0003 +LinkLayer_NodeC=001C6B0D0003 # Link-Layer address of component NodeD -LinkLayer_NodeD=8BADF00D0004 +LinkLayer_NodeD=001C6B0D0004 +# Link-Layer address of component NodeE +LinkLayer_NodeE=001C6B0D0005 +# Link-Layer address of component NodeF +LinkLayer_NodeF=001C6B0D0006 +# Link-Layer address of component NodeG +LinkLayer_NodeG=001C6B0D0007 +# Link-Layer address of component NodeH +LinkLayer_NodeH=001C6B0D0008 +# Link-Layer address of component NodeI +LinkLayer_NodeI=001C6B0D0009 +# Link-Layer address of component NodeJ +LinkLayer_NodeJ=001C6B0D000A + # Interval between each beacon sent by TS (ms) TsBeaconInterval=1000 + # Latitude of Test System -TsLatitude=514787010 +#Commsignia TsLatitude=435525450 +#Yogoko TsLatitude=481210840 +#Marben TsLatitude=436175790 +#Livorno +TsLatitude=43551050 +# Sofia-antipolis TsLatitude=436175790 + # Longitude of Test System -TsLongitude=56547460 +#Commsignia TsLongitude=103008910 +#Yogoko TsLongitude=-16287930 +#Marben TsLongitude=70546480 +#Livorno +TsLongitude=10298730 +# Sofia-antipolis TsLongitude=70546480 + # Secured mode status -TsSecuredMode=false -# Secured root path to access certificates and private keys -TsSecuredPath="" +UtSecuredMode=false # Secured configuration identifier -TsSecuredConfiId=data/certificates +TsSecuredRootPath=data/certificates +# Secured root path to access certificates and private keys +TsSecuredConfiId= diff --git a/javasrc/tool/org/etsi/its/tool/testingtech/ExternalFunctionsPluginProvider.java b/javasrc/tool/org/etsi/its/tool/testingtech/ExternalFunctionsPluginProvider.java index 0b8684870b4e2b5e199a62e6d7dab8ea19c355c8..c04661cb759f02108d22fe577e2f61e5d3bd15e3 100644 --- a/javasrc/tool/org/etsi/its/tool/testingtech/ExternalFunctionsPluginProvider.java +++ b/javasrc/tool/org/etsi/its/tool/testingtech/ExternalFunctionsPluginProvider.java @@ -97,6 +97,26 @@ public class ExternalFunctionsPluginProvider implements ExternalFunctionsProvide _externalFunctionsPluginProvider.fx_computePositionUsingDistance(p_refLatitude, p_refLongitude, pDistance, pOrientation, pLatitude, pLongitude); } + /** + * External function to compute a position using a reference position, a distance and an orientation + * @param pIutLongPosVector Reference position + * @param pCenLongPosVector Central reference position + * @param p_rotation Rotation value (in degrees) + * @param pLatitude Computed position's latitude + * @param pLongitude Computed position's longitude + * + * TTCN-3 signature: + * external function fx_computePositionFromRotation(in LongPosVector p_iutLongPosVector, in Int32 p_rotation, out Int32 p_latitude, out Int32 p_longitude); + */ + @Override + public void fx_computePositionFromRotation( + IntegerValue p_refLatitude, IntegerValue p_refLongitude, + IntegerValue p_cenLatitude, IntegerValue p_cenLongitude, + IntegerValue pRotation, + IntegerValue pLatitude, IntegerValue pLongitude) { + _externalFunctionsPluginProvider.fx_computePositionFromRotation(p_refLatitude, p_refLongitude, p_cenLatitude, p_cenLongitude, pRotation, pLatitude, pLongitude); + } + @Override public FloatValue fx_computeRadiusFromCircularArea(FloatValue p_squareMeters) { return _externalFunctionsPluginProvider.fx_computeRadiusFromCircularArea(p_squareMeters); @@ -114,6 +134,41 @@ public class ExternalFunctionsPluginProvider implements ExternalFunctionsProvide return _externalFunctionsPluginProvider.fx_getCurrentTime(); } + /** + * This external function gets the current time + * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time + * + * TTCN-3 signature: + * external function fx_getCurrentTimeMark() return TimeMark; + */ + @Override + public IntegerValue fx_getCurrentTimeMark() { + return _externalFunctionsPluginProvider.fx_getCurrentTimeMark(); + } + + /** + * This external function gets the current time + * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time + * + * TTCN-3 signature: + * external function fx_getMinuteOfTheYear() return MinuteOfTheYear; + */ + @Override + public IntegerValue fx_getMinuteOfTheYear() { + return _externalFunctionsPluginProvider.fx_getMinuteOfTheYear(); + } + + /** + * This external function gets the milliseconds point in the current UTC minute + * @return The milliseconds point in the current UTC minute (0..60000) + * + * TTCN-3 signature: + * external function fx_getDSecond() return DSecond; + */ + public IntegerValue fx_getDSecond() { + return _externalFunctionsPluginProvider.fx_getDSecond(); + } + /** * External function to compute timestamp based on current time * @return Unix-Epoch-Time mod 2^32 diff --git a/javasrc/tool/org/etsi/its/tool/testingtech/GnssRemoteControl.java b/javasrc/tool/org/etsi/its/tool/testingtech/GnssRemoteControl.java index 9e6ef0c9c31bdd7697c354387eba15e6ddf5cee0..62f22a4a1e813ff072039b54153cfc14eadb0456 100644 --- a/javasrc/tool/org/etsi/its/tool/testingtech/GnssRemoteControl.java +++ b/javasrc/tool/org/etsi/its/tool/testingtech/GnssRemoteControl.java @@ -46,12 +46,17 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.etsi.adapter.IGnssSupport; +import org.etsi.adapter.ITERequired; import org.etsi.adapter.TERFactory; import org.etsi.common.ByteHelper; import org.etsi.its.adapter.ports.AdapterControlPort; import org.etsi.its.adapter.ports.AdapterPort; import org.etsi.its.adapter.ports.PortEvent; import org.etsi.ttcn.tci.CharstringValue; +import org.etsi.ttcn.tci.Value; +import org.etsi.ttcn.tri.TriAddress; +import org.etsi.ttcn.tri.TriCommunicationTE; +import org.etsi.ttcn.tri.TriMessage; import org.etsi.ttcn.tri.TriStatus; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -90,6 +95,50 @@ public class GnssRemoteControl implements IGnssSupport { } public static void main(String[] args) { + + TERFactory.setImpl(new ITERequired() { + + @Override + public void logError(String errorMessage) { + System.out.println(errorMessage); + } + + @Override + public void logDebug(String debugMessage) { + System.out.println(debugMessage); + } + + @Override + public TriStatus getTriStatus(int statusCode, String message) { + return null; + } + + @Override + public TriStatus getTriStatus(int statusCode) { + return null; + } + + @Override + public TriMessage getTriMessage(byte[] message) { + return null; + } + + @Override + public TriAddress getTriAddress(byte[] message) { + return null; + } + + @Override + public Value getTaParameter(String param) { + return null; + } + + @Override + public TriCommunicationTE getCommunicationTE() { + return null; + } + }); + try { for (int i = 0; i < 1; i++) { GnssRemoteControl grc = GnssRemoteControl.getInstance(); @@ -99,6 +148,7 @@ public class GnssRemoteControl implements IGnssSupport { // grc.getScenarioStatus(); // grc.getScenarioDuration(); grc.startScenario(); + grc.awaitTimeInRunningScenario(new AdapterControlPort("test", "TestComp"), 60000); // grc.awaitDistanceToCover(new AdapterControlPort("test", "TestComp"), 200.0); grc.getGpsTime(); // grc.getScenarioStatus(); @@ -112,9 +162,9 @@ public class GnssRemoteControl implements IGnssSupport { public void dispose() { try { - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++"); - System.out.println("CLOSING"); - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++"); + TERFactory.getInstance().logDebug("+++++++++++++++++++++++++++++++++++++++++++++"); + TERFactory.getInstance().logDebug("CLOSING"); + TERFactory.getInstance().logDebug("+++++++++++++++++++++++++++++++++++++++++++++"); if (soc!=null) { soc.close(); soc = null; @@ -195,7 +245,7 @@ public class GnssRemoteControl implements IGnssSupport { address = ((CharstringValue)TERFactory.getInstance().getTaParameter("TestSystemIpAddress")).getString(); } catch (Throwable th) { - address = "10.73.100.38"; + address = "10.73.100.28"; } } catch (Throwable th) { @@ -241,6 +291,7 @@ public class GnssRemoteControl implements IGnssSupport { } public boolean stopScenario() { + stopReceiver(); return 2==handleCommand("-,EN,1"); } @@ -289,13 +340,13 @@ public class GnssRemoteControl implements IGnssSupport { double curLongitude = Double.longBitsToDouble(tmp.longValue()); if (debug) { - System.out.println("Type : " + type); - System.out.println("Version : " + version); - System.out.println("Time(into run) : " + time_into_run); - System.out.println("Time(validity) : " + time_of_validity); - System.out.println("VehicleNumber : " + vehicleNumber); - System.out.println("Latitude : " + curLatitude); - System.out.println("Longitude : " + curLongitude); + TERFactory.getInstance().logDebug("Type : " + type); + TERFactory.getInstance().logDebug("Version : " + version); + TERFactory.getInstance().logDebug("Time(into run) : " + time_into_run); + TERFactory.getInstance().logDebug("Time(validity) : " + time_of_validity); + TERFactory.getInstance().logDebug("VehicleNumber : " + vehicleNumber); + TERFactory.getInstance().logDebug("Latitude : " + curLatitude); + TERFactory.getInstance().logDebug("Longitude : " + curLongitude); } if (prevLatitude != null && prevLongitude != null) { @@ -305,7 +356,7 @@ public class GnssRemoteControl implements IGnssSupport { prevLongitude = curLongitude; if (debug) { - System.out.println("Distance: " + distanceCovered); + TERFactory.getInstance().logDebug("Distance: " + distanceCovered); } if (distanceCovered>=distance) { @@ -338,6 +389,75 @@ public class GnssRemoteControl implements IGnssSupport { return result; } + public boolean awaitTimeInRunningScenario(final AdapterPort commPort, final int time) { + boolean result = false; + try { + final DatagramSocket udpReceiverSoc = new DatagramSocket(15660); + udpReceiverSoc.setSoTimeout(100); + + synchronized (receiverRunning) { + receiverRunning = true; + } + + Thread receiver = + new Thread(new Runnable() { + + @Override + public void run() { + boolean result = false; + DatagramPacket packet = new DatagramPacket(new byte[1500], 1500); + + while(isReceiverRunning()) { + try { + udpReceiverSoc.receive(packet); + TabularDecoder dec = new TabularDecoder(new BitArrayInputStream(packet.getData(), packet.getLength()<<3)); + try { + int type = dec.decodeInteger(false, 32, Endianness.LITTLE_ENDIAN); + if (type==0) { + int version = dec.decodeInteger(false, 32, Endianness.LITTLE_ENDIAN); + int time_into_run = dec.decodeInteger(false, 32, Endianness.LITTLE_ENDIAN); + + if (debug) { + TERFactory.getInstance().logDebug("Version : " + version); + TERFactory.getInstance().logDebug("Time(into run) : " + time_into_run); + } + + if (time_into_run>=(time*1000)/*in ms*/) { + result = true; + stopReceiver(); + } + } + } catch (TabularException e) { + e.printStackTrace(); + } + } catch (SocketTimeoutException ste) { + //nothing received, ignore + } catch (IOException e) { + e.printStackTrace(); + result = false; + stopReceiver(); + } + } + udpReceiverSoc.close(); + commPort.setChanged(); + byte[] response = {(byte)AdapterControlPort.AcGnssTimeReached, (byte)(result?AdapterControlPort.AcFalse:AdapterControlPort.AcTrue)}; + commPort.notifyObservers(new PortEvent(response, commPort.getPortName(), commPort.getComponentName())); + } + }, "AwaitTimeIntoRun"); + receiver.start(); +// try { +// receiver.join(); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + } catch (SocketException e) { + e.printStackTrace(); + result = false; + } + + return result; + } + public boolean changeSpeed(double speed) { return false; } @@ -375,17 +495,17 @@ public class GnssRemoteControl implements IGnssSupport { ByteHelper.longToByteArray(time - ((java.util.Date)formatter.parse(itsdatestr)).getTime(), Long.SIZE / Byte.SIZE) ); if (debug) { - System.out.println("timeGps : " + time); + TERFactory.getInstance().logDebug("timeGps : " + time); time = System.currentTimeMillis(); - System.out.println("timeSys : " + time); - System.out.println("now : " + now); - System.out.println("ref : " + + TERFactory.getInstance().logDebug("timeSys : " + time); + TERFactory.getInstance().logDebug("now : " + now); + TERFactory.getInstance().logDebug("ref : " + new BigInteger( 1, ByteHelper.longToByteArray(time - ((java.util.Date)formatter.parse(itsdatestr)).getTime(), Long.SIZE / Byte.SIZE) ).longValue() ); - System.out.println("date : " + + TERFactory.getInstance().logDebug("date : " + new BigInteger( 1, ByteHelper.longToByteArray(((java.util.Date)formatter.parse("12/15/2015 00:00:00 +0000")).getTime() - ((java.util.Date)formatter.parse(itsdatestr)).getTime(), Long.SIZE / Byte.SIZE) @@ -422,10 +542,10 @@ public class GnssRemoteControl implements IGnssSupport { } try { command += "\r"; - System.out.println(new Date().toString()); - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++"); - System.out.println(command); - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++"); + TERFactory.getInstance().logDebug(new Date().toString()); + TERFactory.getInstance().logDebug("+++++++++++++++++++++++++++++++++++++++++++++"); + TERFactory.getInstance().logDebug(command); + TERFactory.getInstance().logDebug("+++++++++++++++++++++++++++++++++++++++++++++"); soc.getOutputStream().write(command.getBytes()); soc.getOutputStream().flush(); int read=0; @@ -435,7 +555,7 @@ public class GnssRemoteControl implements IGnssSupport { sb.append(new String(new byte[] {(byte) read})); } while(read!='\r'); String response = sb.toString(); - System.out.println(response); + TERFactory.getInstance().logDebug(response); int statusStart = response.indexOf(STATUS_START); @@ -519,22 +639,22 @@ public class GnssRemoteControl implements IGnssSupport { localName = getLocalName(localName, qName); if (localName.equals("status")) { inStatus=false; - System.out.println("status: " + sb.toString()); + TERFactory.getInstance().logDebug("status: " + sb.toString()); sb.setLength(0); } else if (localName.equals("data")) { inData=false; - System.out.println("data: " + sb.toString()); + TERFactory.getInstance().logDebug("data: " + sb.toString()); sb.setLength(0); } else if (localName.equals("error")) { inError=false; - System.out.println("error: " + sb.toString()); + TERFactory.getInstance().logDebug("error: " + sb.toString()); sb.setLength(0); } else if (localName.equals("fatal")) { inFatal=false; - System.out.println("fatal: " + sb.toString()); + TERFactory.getInstance().logDebug("fatal: " + sb.toString()); sb.setLength(0); } super.endElement(uri, localName, qName); diff --git a/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java b/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java index 8fb1cd4df5d72ef2926e59fc4fa858fa9c714c82..4f89c08ef61a255f24afc6d1bb9eb8de59c1c1f2 100644 --- a/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java +++ b/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java @@ -39,7 +39,10 @@ public class Its_CodecProvider implements CodecProvider { TTWBCodecSupport cs = new TTWBCodecSupport(rb); cf.setExternalCodec("LibItsCam_asn1", cs.getCodec("LibItsCam_asn1")); cf.setExternalCodec("LibItsDenm_asn1", cs.getCodec("LibItsDenm_asn1")); - cf.setExternalCodec("LibItsMapSpat_asn1", cs.getCodec("LibItsMapSpat_asn1")); + cf.setExternalCodec("LibItsMapemSpatem_asn1", cs.getCodec("LibItsMapemSpatem_asn1")); + cf.setExternalCodec("LibItsIvim_asn1", cs.getCodec("LibItsIvim_asn1")); + cf.setExternalCodec("LibItsEvcsn_asn1", cs.getCodec("LibItsEvcsn_asn1")); + cf.setExternalCodec("LibItsSremSsem_asn1", cs.getCodec("LibItsSremSsem_asn1")); //TODO: add V2G external codecs (xsd) //TODO: Yann add CALM external codecs (ASN.1) return new Codec(); diff --git a/javasrc/tool/org/etsi/its/tool/testingtech/PluginAdapter.java b/javasrc/tool/org/etsi/its/tool/testingtech/PluginAdapter.java index 9b927adb4c410e549a0fbe401252ea83d21f3b1b..53c57e5bf945f63a57dac3ff8ca8544877f8495a 100644 --- a/javasrc/tool/org/etsi/its/tool/testingtech/PluginAdapter.java +++ b/javasrc/tool/org/etsi/its/tool/testingtech/PluginAdapter.java @@ -77,6 +77,10 @@ public class PluginAdapter implements ISAPlugin, PortPluginProvider, PluginIdent return new TriStatusImpl(); } + public TriStatus reInit() { + return tearDown(); + } + @Override public TriStatus triCall(TriComponentId componentId, TriPortId tsiPortId, TriAddress sutAddress, TriSignatureId signatureId, diff --git a/javasrc/tool/org/etsi/tool/elvior/TciCDWrapper.java b/javasrc/tool/org/etsi/tool/elvior/TciCDWrapper.java index 3f806cae4945f3690b6c5b1f2f3fa61e8908c243..fc653dbe0f8b15ad802a1c0976aeeb57a99a0749 100644 --- a/javasrc/tool/org/etsi/tool/elvior/TciCDWrapper.java +++ b/javasrc/tool/org/etsi/tool/elvior/TciCDWrapper.java @@ -5,9 +5,11 @@ package org.etsi.tool.elvior; import java.math.BigInteger; +import java.util.logging.Logger; import org.elvior.ttcn.tritci.IntegerValueEx; import org.elvior.ttcn.tritci.TciProvider; +import org.etsi.adapter.TERFactory; import org.etsi.codec.ITciCDWrapper; import org.etsi.ttcn.tci.BooleanValue; import org.etsi.ttcn.tci.CharstringValue; @@ -31,8 +33,10 @@ public class TciCDWrapper implements ITciCDWrapper { private TciCDRequired _tciFactory = TciProvider.getInstance().getTciCDRequired(); + private Logger _logger; + public TciCDWrapper() { - // Nothing to do + _logger = Logger.getLogger("org.etsi.its"); } @Override @@ -49,17 +53,17 @@ public class TciCDWrapper implements ITciCDWrapper { @Override public IntegerValue setInteger(final BigInteger value) { -// System.out.println(">>> getBigInteger: " + value); +// TERFactory.getInstance().logDebug(">>> getBigInteger: " + value); IntegerValueEx bi = (IntegerValueEx) _tciFactory.getInteger().newInstance(); //_tciFactory.getTypeForName("org.elvior.ttcn.tritci.IntegerValueEx"); if (bi != null) { -// System.out.println("getBigInteger: then"); +// TERFactory.getInstance().logDebug("getBigInteger: then"); bi.setInt64(value.longValue()); -// System.out.println("getBigInteger: bi=" + bi.getInt64()); +// TERFactory.getInstance().logDebug("getBigInteger: bi=" + bi.getInt64()); return (IntegerValue)bi; } else { -// System.out.println("getBigInteger: else"); +// TERFactory.getInstance().logDebug("getBigInteger: else"); IntegerValue i = (IntegerValue) _tciFactory.getInteger().newInstance(); -// System.out.println("getBigInteger: i=" + i); +// TERFactory.getInstance().logDebug("getBigInteger: i=" + i); i.setInteger(value.intValue()); return i; } @@ -96,30 +100,52 @@ public class TciCDWrapper implements ITciCDWrapper { @Override public Value getUnionValue(final Type decodingHypothesis, final String variantName) { -// System.out.println(">>> getUnionValue: " + decodingHypothesis.getName() + ", " + variantName); +// TERFactory.getInstance().logDebug(">>> getUnionValue: " + decodingHypothesis.getName() + ", " + variantName); String variantTypeName = decodingHypothesis.getDefiningModule().getModuleName() + "." + decodingHypothesis.getName() + "." + variantName; -// System.out.println("variantTypeName is " + variantTypeName); - Type variantType = _tciFactory.getTypeForName(variantTypeName); +// TERFactory.getInstance().logDebug("variantTypeName is " + variantTypeName); + Type variantType = getTypeForName(variantTypeName); if(variantType != null) { Value testVal = variantType.newInstance(); if(testVal != null) { -// System.out.println("Variant value has been created."); +// TERFactory.getInstance().logDebug("Variant value has been created."); return testVal; } } - System.err.println("variantType is null"); +// TERFactory.getInstance().logError("variantType is null"); - System.out.println("Variant value hasn't been created."); +// TERFactory.getInstance().logDebug("Variant value hasn't been created."); return null; } @Override public Type getTypeForName(final String type) { -// return TciProvider.getInstance().getTciCDRequired().getTypeForName(type); -// System.out.println("TciCDWrapper.getTypeForName" + type); - Type originalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type); -// System.out.println("TciCDWrapper.getTypeForName" + originalType.getName()); +// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName: " + type); + Type originalType; + if (type.indexOf("DecodedBtpPayload") != -1) { + if (type.endsWith("camPacket")) { + originalType = _tciFactory.getTypeForName("CAM_PDU_Descriptions.CAM"); + } else if (type.endsWith("denmPacket")) { + originalType = _tciFactory.getTypeForName("DENM_PDU_Descriptions.DENM"); + } else if (type.endsWith("mapemPacket")) { + originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.MAPEM"); + } else if (type.endsWith("spatemPacket")) { + originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.SPATEM"); + } else if (type.endsWith("ivimPacket")) { + originalType = _tciFactory.getTypeForName("IVIM_PDU_Descriptions.IVIM"); + } else if (type.endsWith("evcsnPacket")) { + originalType = _tciFactory.getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu"); + } else if (type.endsWith("sremPacket")) { + originalType = _tciFactory.getTypeForName("SREM_PDU_Descriptions.SREM"); + } else if (type.endsWith("ssemPacket")) { + originalType = _tciFactory.getTypeForName("SSEM_PDU_Descriptions.SSEM"); + } else { + originalType = _tciFactory.getTypeForName(type); + } + } else { + originalType = _tciFactory.getTypeForName(type); + } +// TERFactory.getInstance().logDebug("TciCDWrapper.getTypeForName: " + originalType.getName()); return originalType; } // End of method getTypeForName @@ -148,4 +174,14 @@ public class TciCDWrapper implements ITciCDWrapper { intValue.setInteger(value); } +// @Override +// public void logDebug(String debugMessage) { +// _logger.info(debugMessage); +// } +// +// @Override +// public void logError(String errorMessage) { +// _logger.severe(errorMessage); +// } +// } // End of class TciCDWrapper diff --git a/javasrc/tool/org/etsi/tool/elvior/TeRequiredImpl.java b/javasrc/tool/org/etsi/tool/elvior/TeRequiredImpl.java index 1f82d3b375634be5f4eeb749f5fec7b930f9d4f2..edc72feec080e689efdca4d7c27cbbcefff104b5 100644 --- a/javasrc/tool/org/etsi/tool/elvior/TeRequiredImpl.java +++ b/javasrc/tool/org/etsi/tool/elvior/TeRequiredImpl.java @@ -6,6 +6,7 @@ package org.etsi.tool.elvior; import java.io.IOException; import java.util.Properties; +import java.util.logging.Logger; import org.elvior.ttcn.tritci.TriFactory; import org.elvior.ttcn.tritci.TriProvider; @@ -30,6 +31,8 @@ public class TeRequiredImpl implements ITERequired { private static Properties _properties = new Properties(); + protected final static Logger _logger = Logger.getLogger("org.etsi.its"); + public TeRequiredImpl(PluginAdapter ta) { _ta = ta; // Load TA settings @@ -133,4 +136,14 @@ public class TeRequiredImpl implements ITERequired { return getTriStatus(statusCode); } + @Override + public void logDebug(String debugMessage) { + _logger.info(debugMessage); + } + + @Override + public void logError(String errorMessage) { + _logger.severe(errorMessage); + } + } // End of class TeRequiredImpl diff --git a/javasrc/tool/org/etsi/tool/testingtech/TciCDWrapper.java b/javasrc/tool/org/etsi/tool/testingtech/TciCDWrapper.java index 55d1a83ae8eb89c666e86d806d94c63f98a73c6e..4d22c69d6dbd428e1a6e86a1ae8bdb8b87bf5f69 100644 --- a/javasrc/tool/org/etsi/tool/testingtech/TciCDWrapper.java +++ b/javasrc/tool/org/etsi/tool/testingtech/TciCDWrapper.java @@ -32,7 +32,7 @@ public class TciCDWrapper implements ITciCDWrapper { * RuntimeBehavior instance reference */ private RB _rb; - + /** * Specialized ctor * @param rb TTCN-3 runtime reference diff --git a/javasrc/tool/org/etsi/tool/testingtech/TeRequiredImpl.java b/javasrc/tool/org/etsi/tool/testingtech/TeRequiredImpl.java index f9dba71372f66759a938ec7a7c0bc4ec63844922..7c870f2e3a0abf262c3beb800b67c4046cba85a9 100644 --- a/javasrc/tool/org/etsi/tool/testingtech/TeRequiredImpl.java +++ b/javasrc/tool/org/etsi/tool/testingtech/TeRequiredImpl.java @@ -1,6 +1,12 @@ package org.etsi.tool.testingtech; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + import org.etsi.adapter.ITERequired; +import org.etsi.ttcn.tci.CharstringValue; import org.etsi.ttcn.tci.Value; import org.etsi.ttcn.tri.TriAddress; import org.etsi.ttcn.tri.TriCommunicationTE; @@ -21,10 +27,46 @@ public class TeRequiredImpl implements ITERequired { private RB RB; private final PluginIdentifier pluginId; + private Logger _logger; public TeRequiredImpl(RB rB, PluginIdentifier pluginId) { RB = rB; this.pluginId = pluginId; + + Value debugLevelValue = getTaParameter("DEBUG_ENABLED"); + String debugLevel = "OFF"; + if (debugLevelValue!=null) { + debugLevel = ((CharstringValue)debugLevelValue).getString(); + } + Level level = Level.OFF; + if (debugLevel.equalsIgnoreCase("ALL")) { + level = Level.ALL; + } else if (debugLevel.equalsIgnoreCase("INFO")) { + level = Level.INFO; + } else if (!debugLevel.equalsIgnoreCase("OFF")) { + RB.getTciTLProvided_Latest().tliInfo("", + de.tu_berlin.cs.uebb.muttcn.runtime.RB.currentTimeNanos(), "", + -1, RB.self(), RTLoggingConstants.RT_LOG_ERROR, "Unsupported logging level: " + debugLevel); + } + _logger = Logger.getLogger("org.etsi.its"); //$NON-NLS-1$ + _logger.addHandler(new ConsoleHandler() { + /* (non-Javadoc) + * @see java.util.logging.ConsoleHandler#publish(java.util.logging.LogRecord) + */ + @Override + public void publish(LogRecord logRecord) { + int level = RTLoggingConstants.RT_LOG_DEBUG; + if (logRecord.getLevel().intValue() == Level.SEVERE.intValue()) { + level = RTLoggingConstants.RT_LOG_ERROR; + } + RB.getTciTLProvided_Latest().tliInfo("", + de.tu_berlin.cs.uebb.muttcn.runtime.RB.currentTimeNanos(), "", + -1, RB.self(), level, logRecord.getMessage()); + } + + }); + _logger.setUseParentHandlers(false); + _logger.setLevel(level); } @Override @@ -49,7 +91,7 @@ public class TeRequiredImpl implements ITERequired { @Override public TriMessage getTriMessage(byte[] message) { - return new TriMessageImpl(message); + return TriMessageImpl.valueOf(message); } @Override @@ -57,16 +99,26 @@ public class TeRequiredImpl implements ITERequired { return new TriStatusImpl(statusCode); } - @SuppressWarnings("deprecation") @Override public TriStatus getTriStatus(int statusCode, String message) { switch(statusCode) { case TriStatus.TRI_OK: - RB.getTciTLProvidedV321TT().tliRT("", System.nanoTime(), "", -1, null, RTLoggingConstants.RT_LOG_INFO, message); + RB.getTciTLProvided_Latest().tliInfo("", de.tu_berlin.cs.uebb.muttcn.runtime.RB.currentTimeNanos(), "", -1, null, RTLoggingConstants.RT_LOG_INFO, message); return new TriStatusImpl(); default: return new TriStatusImpl(message); } } + + @Override + public void logDebug(String debugMessage) { + _logger.log(Level.ALL, debugMessage); + } + + @Override + public void logError(String errorMessage) { + _logger.log(Level.SEVERE, errorMessage); + } + } diff --git a/patches/ElviorCodec.jardesc b/patches/ElviorCodec.jardesc new file mode 100644 index 0000000000000000000000000000000000000000..be3d5ee942f5505283c1bd48ec06494328b92962 --- /dev/null +++ b/patches/ElviorCodec.jardesc @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/patches/ElviorSUT.jardesc b/patches/ElviorSUT.jardesc new file mode 100644 index 0000000000000000000000000000000000000000..f213d4fa24c1f641e9e83d6bf804325f212f134e --- /dev/null +++ b/patches/ElviorSUT.jardesc @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/patches/tct3_asn1_IS.patch b/patches/tct3_asn1_IS.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b76c4804130e1bf9b47d736d0b57965da30aeda --- /dev/null +++ b/patches/tct3_asn1_IS.patch @@ -0,0 +1,2303 @@ +Index: ETSI_TS_103301_IVIM_PDU_Descriptions.asn +=================================================================== +--- ETSI_TS_103301_IVIM_PDU_Descriptions.asn (nonexistent) ++++ ETSI_TS_103301_IVIM_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,34 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ETSI TS 103 301 ++-- ++-- This ASN.1 was generated: 30.08.2016 ++-- ++-- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message ++-- as defined in ETSI TS 103 301 ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: IVI-MESSAGE-PDU-Descriptions ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++IVIM-PDU-Descriptions { ++ itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ivim (2) version1 (1) ++} ++ ++DEFINITIONS AUTOMATIC TAGS ::= ++ ++BEGIN ++ ++IMPORTS ++IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} ++ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; ++ ++ ++IVIM ::= SEQUENCE { ++ header ItsPduHeader, ++ ivi IviStructure ++} ++ ++END +Index: ETSI_TS_103301_MAPEM_PDU_Descriptions.asn +=================================================================== +--- ETSI_TS_103301_MAPEM_PDU_Descriptions.asn (nonexistent) ++++ ETSI_TS_103301_MAPEM_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,34 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ETSI TS 103 301 ++-- ++-- This ASN.1 was generated: 30.08.2016 ++-- ++-- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message ++-- as defined in ETSI TS 103 301 ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: MAP-MESSAGE-PDU-Descriptions ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++MAPEM-PDU-Descriptions { ++ itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) mapem (1) version1 (1) ++} ++ ++DEFINITIONS AUTOMATIC TAGS ::= ++ ++BEGIN ++ ++IMPORTS ++MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; ++ ++ ++MAPEM ::= SEQUENCE { ++ header ItsPduHeader, ++ map MapData ++} ++ ++END +\ No newline at end of file +Index: ETSI_TS_103301_SPATEM_PDU_Descriptions.asn +=================================================================== +--- ETSI_TS_103301_SPATEM_PDU_Descriptions.asn (nonexistent) ++++ ETSI_TS_103301_SPATEM_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,39 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ETSI TS 103 301 ++-- ++-- This ASN.1 was generated: 30.08.2016 ++-- ++-- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message ++-- as defined in ETSI TS 103 301 ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: SPAT-MESSAGE-PDU-Descriptions ++-- ++-- This ASN.1 was created: 30.08.2016 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++SPATEM-PDU-Descriptions { ++ itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) spatem (0) version1 (1) ++} ++ ++DEFINITIONS AUTOMATIC TAGS ::= ++ ++BEGIN ++ ++IMPORTS ++SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; ++ ++ ++SPATEM ::= SEQUENCE { ++ header ItsPduHeader, ++ spat SPAT ++} ++ ++END ++ +Index: ETSI_TS_103301_SREM_PDU_Descriptions.asn +=================================================================== +--- ETSI_TS_103301_SREM_PDU_Descriptions.asn (nonexistent) ++++ ETSI_TS_103301_SREM_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,28 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ETSI TS 103 301 ++-- ++-- This ASN.1 was generated: 30.08.2016 ++-- ++-- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message ++-- as defined in ETSI TS 103 301 ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++SREM-PDU-Descriptions { ++ itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) srem (3) version1 (1) ++} ++ ++DEFINITIONS AUTOMATIC TAGS ::= ++ ++BEGIN ++ ++IMPORTS ++SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; ++ ++SREM ::= SEQUENCE { ++ header ItsPduHeader, ++ srm SignalRequestMessage ++} ++ ++END +Index: ETSI_TS_103301_SSEM_PDU_Descriptions.asn +=================================================================== +--- ETSI_TS_103301_SSEM_PDU_Descriptions.asn (nonexistent) ++++ ETSI_TS_103301_SSEM_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,29 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ETSI TS 103 301 ++-- ++-- This ASN.1 was generated: 30.08.2016 ++-- ++-- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message ++-- as defined in ETSI TS 103 301 ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++SSEM-PDU-Descriptions { ++ itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ssem (4) version1 (1) ++} ++ ++DEFINITIONS AUTOMATIC TAGS ::= ++ ++BEGIN ++ ++IMPORTS ++SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; ++ ++ ++SSEM ::= SEQUENCE { ++ header ItsPduHeader, ++ ssm SignalStatusMessage ++} ++ ++END +\ No newline at end of file +Index: ISO_TS_19091_AddGrpC.asn +=================================================================== +--- ISO_TS_19091_AddGrpC.asn (nonexistent) ++++ ISO_TS_19091_AddGrpC.asn (working copy) +@@ -0,0 +1,120 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- 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 ++-- ++-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: AddGrpC ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++ ++AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } ++ ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC ++Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; ++ ++ ++ConnectionManeuverAssist-addGrpC ::= SEQUENCE { ++ itsStationPositions ItsStationPositionList OPTIONAL, ++ rsuGNSSOffset NodeOffsetPointXY OPTIONAL, ++ ... ++} ++ ++ConnectionTrajectory-addGrpC ::= SEQUENCE { ++ nodes NodeSetXY, ++ ... ++} ++ ++Control-addGrpC ::= SEQUENCE { ++ ptvRequest PtvRequestType, ++ ... ++} ++ ++IntersectionState-addGrpC ::= SEQUENCE { ++ activePrioritizations PrioritizationResponseList OPTIONAL, ++ ... ++} ++ ++MapData-addGrpC ::= SEQUENCE { ++ signalHeadLocations SignalHeadLocationList OPTIONAL, ++ ... ++} ++ ++Position3D-addGrpC ::= SEQUENCE { ++ altitude Altitude, ++ ... ++} ++ ++PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse ++ ++PrioritizationResponse ::= SEQUENCE { ++ stationID StationID, ++ priorState PrioritizationResponseStatus, ++ signalGroup SignalGroupID, ++ ... ++} ++ ++RestrictionUserType-addGrpC ::= SEQUENCE { ++ emission EmissionType OPTIONAL, ++ ... ++} ++ ++SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation ++ ++SignalHeadLocation ::= SEQUENCE { ++ nodeXY NodeOffsetPointXY, ++ nodeZ DeltaAltitude, ++ signalGroupID SignalGroupID, ++ ... ++} ++ ++SignalStatusPackage-addGrpC ::= SEQUENCE { ++ synchToSchedule DeltaTime OPTIONAL, ++ ... ++} ++ ++ ++ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition ++ ++ItsStationPosition ::= SEQUENCE { ++ stationID StationID, ++ laneID LaneID OPTIONAL, ++ nodeXY NodeOffsetPointXY OPTIONAL, ++ timeReference TimeReference OPTIONAL, ++ ... ++} ++EmissionType ::= ENUMERATED { ++ euro1, ++ euro2, ++ euro3, ++ euro4, ++ euro5, ++ euro6, ++ ... ++} ++ ++PtvRequestType ::= ENUMERATED { ++ preRequest, ++ mainRequest, ++ doorCloseRequest, ++ cancelRequest, ++ emergencyRequest, ++ ... ++} ++ ++TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) ++ ++END +Index: ISO_TS_19091_DSRC.asn +=================================================================== +--- ISO_TS_19091_DSRC.asn (nonexistent) ++++ ISO_TS_19091_DSRC.asn (working copy) +@@ -0,0 +1,1869 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- 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 ++-- ++-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: DSRC ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } ++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 FROM REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} ++Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1) }; ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- 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 ++ } ++ ++ ++-- 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} ) ++ } ++ ++SPAT ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ name DescriptiveName OPTIONAL, ++ -- human readable name for this collection ++ -- to be used only in debug mode ++ ++ intersections IntersectionStateList, ++ -- sets of SPAT data (one per intersection) ++ ++ -- If PrioritizationResponse data is required, it is found ++ -- in the RegionalSPAT entry below ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SPAT}} OPTIONAL, ++ ... ++ } ++ ++SignalRequestMessage ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ second DSecond, ++ sequenceNumber MsgCount OPTIONAL, ++ ++ requests SignalRequestList OPTIONAL, ++ -- Request Data for one or more signalized ++ -- intersections that support SRM dialogs ++ ++ requestor RequestorDescription, ++ -- Requesting Device and other User Data ++ -- contains vehicle ID (if from a vehicle) ++ -- as well as type data and current position ++ -- and may contain additional transit data ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, ++ ... ++} ++ ++SignalStatusMessage ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ second DSecond, ++ sequenceNumber MsgCount OPTIONAL, ++ ++ -- Status Data for one of more signalized intersections ++ status SignalStatusList, ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, ++ ... ++} ++ ++MapData ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ msgIssueRevision MsgCount, ++ layerType LayerType OPTIONAL, ++ layerID LayerID OPTIONAL, ++ intersections IntersectionGeometryList OPTIONAL, ++ -- All Intersection definitions ++ roadSegments RoadSegmentList OPTIONAL, ++ -- All roadway descriptions ++ ++ dataParameters DataParameters OPTIONAL, ++ -- Any meta data regarding the map contents ++ ++ restrictionList RestrictionClassList OPTIONAL, ++ -- Any restriction ID tables which have ++ -- established for these map entries ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-MapData}} OPTIONAL, ++ ++ -- NOTE: ++ -- Other map data will be added here as it is defined ++ -- Examples of the type of content to be added include ++ -- curve warnings, construction routes, etc. ++ ... ++} ++ ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- Start of entries from table Data_Frames... ++-- This table typicaly contains data frame entries. ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++ ++AdvisorySpeed ::= SEQUENCE { ++ type AdvisorySpeedType, ++ -- the type of advisory which this is. ++ speed SpeedAdvice OPTIONAL, ++ -- See Section 11 for converting and translating speed ++ -- expressed in mph into units of m/s ++ -- This element is optional ONLY when superceded ++ -- by the presence of a regional speed element found in ++ -- Reg-AdvisorySpeed entry ++ confidence SpeedConfidence OPTIONAL, ++ -- A confidence value for the above speed ++ distance ZoneLength OPTIONAL, ++ -- Unit = 1 meter, ++ -- The distance indicates the region for which the advised speed ++ -- is recommended, it is specified upstream from the stop bar ++ -- along the connected egressing lane ++ class RestrictionClassID OPTIONAL, ++ -- the vehicle types to which it applies ++ -- when absent, the AdvisorySpeed applies to ++ -- all motor vehicle types ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, ++ ... ++ } ++ ++AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed ++ ++ComputedLane ::= SEQUENCE { ++ -- Data needed to created a computed lane ++ referenceLaneId LaneID, ++ -- the lane ID upon which this ++ -- computed lane will be based ++ -- Lane Offset in X and Y direction ++ offsetXaxis CHOICE { ++ small DrivenLineOffsetSm, ++ large DrivenLineOffsetLg ++ }, ++ offsetYaxis CHOICE { ++ small DrivenLineOffsetSm, ++ large DrivenLineOffsetLg ++ }, ++ -- A path X offset value for translations of the ++ -- path's points when creating translated lanes. ++ -- The values found in the reference lane are ++ -- all offset based on the X and Y values from ++ -- the coordinates of the reference lane's ++ -- initial path point. ++ -- Lane Rotation ++ rotateXY Angle OPTIONAL, ++ -- A path rotation value for the entire lane ++ -- Observe that this rotates the existing orientation ++ -- of the referenced lane, it does not replace it. ++ -- Rotation occurs about the initial path point. ++ -- Lane Path Scale (zooming) ++ scaleXaxis Scale-B12 OPTIONAL, ++ scaleYaxis Scale-B12 OPTIONAL, ++ -- value for translations or zooming of the path's ++ -- points. The values found in the reference lane ++ -- are all expanded or contracted based on the X ++ -- and Y and width values from the coordinates of ++ -- the reference lane's initial path point. ++ -- The Z axis remains untouched. ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-ComputedLane}} OPTIONAL, ++ ... ++ } ++ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection ++ ++ConnectingLane ::= SEQUENCE { ++ lane LaneID, -- Index of the connecting lane ++ maneuver AllowedManeuvers OPTIONAL ++ -- The Maneuver between ++ -- the enclosing lane and this lane ++ -- at the stop line to connect them ++ } ++ ++ ++Connection ::= SEQUENCE { ++ -- The subject lane connecting to this lane is: ++ connectingLane ConnectingLane, ++ -- The index of the connecting lane and also ++ -- the maneuver from the current lane to it ++ remoteIntersection IntersectionReferenceID OPTIONAL, ++ -- This entry is only used when the ++ -- indicated connecting lane belongs ++ -- to another intersection layout. This ++ -- provides a means to create meshes of lanes ++ ++ -- SPAT mapping details at the stop line are: ++ signalGroup SignalGroupID OPTIONAL, ++ -- The matching signal group send by ++ -- the SPAT message for this lane/maneuver. ++ -- Shall be present unless the connectingLane ++ -- has no signal group (is un-signalized) ++ userClass RestrictionClassID OPTIONAL, ++ -- The Restriction Class of users this applies to ++ -- The use of some lane/maneuver and SignalGroupID ++ -- pairings are restricted to selected users. ++ -- When absent, the SignalGroupID applies to all ++ ++ -- Movement assist details are given by: ++ connectionID LaneConnectionID OPTIONAL ++ -- An optional connection index used to ++ -- relate this lane connection to any dynamic ++ -- clearance data in the SPAT. Note that ++ -- the index may be shared with other ++ -- connections if the clearance data is common ++ } ++ ++ ++ConnectionManeuverAssist ::= SEQUENCE { ++ connectionID LaneConnectionID, ++ -- the common connectionID used by all lanes to which ++ -- this data applies ++ -- (this value traces to ConnectsTo entries in lanes) ++ -- Expected Clearance Information ++ queueLength ZoneLength OPTIONAL, ++ -- Unit = 1 meter, 0 = no queue ++ -- The distance from the stop line to the back ++ -- edge of the last vehicle in the queue, ++ -- as measured along the lane center line. ++ availableStorageLength ZoneLength OPTIONAL, ++ -- Unit = 1 meter, 0 = no space remains ++ -- Distance (e.g. beginning from the downstream ++ -- stop-line up to a given distance) with a high ++ -- probability for successfully executing the ++ -- connecting maneuver between the two lanes ++ -- during the current cycle. ++ -- Used for enhancing the awareness of vehicles ++ -- to anticipate if they can pass the stop line ++ -- of the lane. Used for optimizing the green wave, ++ -- due to knowledge of vehicles waiting in front ++ -- of a red light (downstream). ++ -- The element nextTime in TimeChangeDetails ++ -- in the containing data frame contains the next ++ -- timemark at which an active phase is expected, ++ -- a form of storage flush interval. ++ waitOnStop WaitOnStopline OPTIONAL, ++ -- If "true", the vehicles on this specific connecting ++ -- maneuver have to stop on the stop-line and not ++ -- to enter the collision area ++ pedBicycleDetect PedestrianBicycleDetect OPTIONAL, ++ -- true if ANY ped or bicycles are detected crossing ++ -- the above lanes. Set to false ONLY if there is a ++ -- high certainty that there are none present, ++ -- otherwise element is not sent. ++ 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, ++ ... ++ } ++ ++EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID ++ -- The unique ID numbers for each ++ -- lane object which is 'active' ++ -- as part of the dynamic map contents. ++ ++GenericLane ::= SEQUENCE { ++ laneID LaneID, ++ -- The unique ID number assigned ++ -- to this lane object ++ name DescriptiveName OPTIONAL, ++ -- often for debug use only ++ -- but at times used to name ped crossings ++ ingressApproach ApproachID OPTIONAL, -- inbound ++ egressApproach ApproachID OPTIONAL, -- outbound ++ -- Approach IDs to which this lane belongs ++ laneAttributes LaneAttributes, ++ -- All Attribute information about ++ -- the basic selected lane type ++ -- Directions of use, Geometric co-sharing ++ -- and Type Specific Attributes ++ -- These Attributes are 'lane - global' that is, ++ -- they are true for the entire length of the lane ++ maneuvers AllowedManeuvers OPTIONAL, ++ -- the permitted maneuvers for this lane ++ nodeList NodeListXY, ++ -- Lane spatial path information as well as ++ -- various Attribute information along the node path ++ -- Attributes found here are more general and may ++ -- come and go over the length of the lane. ++ connectsTo ConnectsToList OPTIONAL, ++ -- a list of other lanes and their signal group IDs ++ -- each connecting lane and its signal group ID ++ -- is given, therefore this element provides the ++ -- information formerly in "signalGroups" in prior ++ -- editions. ++ overlays OverlayLaneList OPTIONAL, ++ -- A list of any lanes which have spatial paths that ++ -- overlay (run on top of, and not simply cross) ++ -- the path of this lane when used ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-GenericLane}} OPTIONAL, ++ ... ++ } ++ ++IntersectionAccessPoint ::= CHOICE { ++ lane LaneID, ++ approach ApproachID, ++ connection LaneConnectionID, ++ ... ++ } ++ ++IntersectionGeometry ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ -- For debug use only ++ id IntersectionReferenceID, ++ -- A globally unique value set, ++ -- consisting of a regionID and ++ -- intersection ID assignment ++ revision MsgCount, ++ ++ -- Required default values about lane descriptions follow ++ refPoint Position3D, -- The reference from which subsequent ++ -- data points are offset until a new ++ -- point is used. ++ laneWidth LaneWidth OPTIONAL, ++ -- Reference width used by all subsequent ++ -- lanes unless a new width is given ++ speedLimits SpeedLimitList OPTIONAL, ++ -- Reference regulatory speed limits ++ -- used by all subsequent ++ -- lanes unless a new speed is given ++ -- See Section 11 for converting and ++ -- translating speed expressed in mph ++ -- into units of m/s ++ -- Complete details regarding each lane type in this intersection ++ laneSet LaneList, -- Data about one or more lanes ++ -- (all lane data is found here) ++ ++ -- Data describing how to use and request preemption and ++ -- priority services from this intersection (if supported) ++ -- NOTE Additonal data may be added in the next release of the ++ -- standard at this point to handle this concept ++ preemptPriorityData PreemptPriorityList OPTIONAL, ++ -- data about one or more regional ++ -- preempt or priority zones ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, ++ ... ++ } ++ ++IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry ++ ++IntersectionReferenceID ::= SEQUENCE { ++ region RoadRegulatorID OPTIONAL, ++ -- a globally unique regional assignment value ++ -- typical assigned to a regional DOT authority ++ -- the value zero shall be used for testing needs ++ id IntersectionID ++ -- a unique mapping to the intersection ++ -- in question within the above region of use ++ } ++ ++IntersectionState ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ -- human readable name for intersection ++ -- to be used only in debug mode ++ id IntersectionReferenceID, ++ -- A globally unique value set, consisting of a ++ -- regionID and intersection ID assignment ++ -- provides a unique mapping to the ++ -- intersection MAP in question ++ -- which provides complete location ++ -- and approach/move/lane data ++ revision MsgCount, ++ status IntersectionStatusObject, ++ -- general status of the controller(s) ++ moy MinuteOfTheYear OPTIONAL, ++ -- Minute of current UTC year ++ -- used only with messages to be archived ++ timeStamp DSecond OPTIONAL, ++ -- the mSec point in the current UTC minute that ++ -- this message was constructed ++ enabledLanes EnabledLaneList OPTIONAL, ++ -- a list of lanes where the RevocableLane bit ++ -- has been set which are now active and ++ -- therefore part of the current intersection ++ states MovementList, ++ -- Each Movement is given in turn ++ -- and contains its signal phase state, ++ -- mapping to the lanes it applies to, and ++ -- point in time it will end, and it ++ -- may contain both active and future states ++ maneuverAssistList ManeuverAssistList OPTIONAL, ++ -- Assist data ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-IntersectionState}} OPTIONAL, ++ ... ++ } ++ ++IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState ++ ++LaneAttributes ::= SEQUENCE { ++ directionalUse LaneDirection, -- directions of lane use ++ sharedWith LaneSharing, -- co-users of the lane path ++ laneType LaneTypeAttributes, -- specific lane type data ++ regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL ++ } ++ ++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 ++ ++LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane ++ ++LaneSharing ::= BIT STRING { ++ -- With bits as defined: ++ overlappingLaneDescriptionProvided (0), ++ -- Assert when another lane object is present to describe the ++ -- path of the overlapping shared lane ++ -- this construct is not used for lane objects which simply cross ++ multipleLanesTreatedAsOneLane (1), ++ -- Assert if the lane object path and width details represents ++ -- multiple lanes within it that are not further described ++ ++ -- Various modes and type of traffic that may share this lane: ++ otherNonMotorizedTrafficTypes (2), -- horse drawn etc. ++ individualMotorizedVehicleTraffic (3), ++ busVehicleTraffic (4), ++ taxiVehicleTraffic (5), ++ pedestriansTraffic (6), ++ cyclistVehicleTraffic (7), ++ trackedVehicleTraffic (8), ++ pedestrianTraffic (9) ++ } (SIZE (10)) ++ -- All zeros would indicate 'not shared' and 'not overlapping' ++ ++LaneTypeAttributes ::= CHOICE { ++ vehicle LaneAttributes-Vehicle, -- motor vehicle lanes ++ crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks ++ bikeLane LaneAttributes-Bike, -- bike lanes ++ sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths ++ median LaneAttributes-Barrier, -- medians & channelization ++ striping LaneAttributes-Striping, -- roadway markings ++ trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys ++ parking LaneAttributes-Parking, -- parking and stopping lanes ++ ... ++ } ++ ++ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist ++ ++MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent ++ ++MovementEvent ::= SEQUENCE { ++ eventState MovementPhaseState, ++ -- Consisting of: ++ -- Phase state (the basic 11 states) ++ -- Directional, protected, or permissive state ++ ++ timing TimeChangeDetails OPTIONAL, ++ -- Timing Data in UTC time stamps for event ++ -- includes start and min/max end times of phase ++ -- confidence and estimated next occurrence ++ ++ speeds AdvisorySpeedList OPTIONAL, ++ -- various speed advisories for use by ++ -- general and specific types of vehicles ++ -- supporting green-wave and other flow needs ++ -- See Section 11 for converting and translating ++ -- speed expressed in mph into units of m/s ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-MovementEvent}} OPTIONAL, ++ ... ++ } ++ ++MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState ++ ++MovementState ::= SEQUENCE { ++ movementName DescriptiveName OPTIONAL, ++ -- uniquely defines movement by name ++ -- human readable name for intersection ++ -- to be used only in debug mode ++ signalGroup SignalGroupID, ++ -- the group id is used to map to lists ++ -- of lanes (and their descriptions) ++ -- which this MovementState data applies to ++ -- see comments in the Remarks for usage details ++ state-time-speed MovementEventList, ++ -- Consisting of sets of movement data with: ++ -- a) SignalPhaseState ++ -- b) TimeChangeDetails, and ++ -- c) AdvisorySpeeds (optional ) ++ -- Note one or more of the movement events may be for ++ -- a future time and that this allows conveying multiple ++ -- predictive phase and movement timing for various uses ++ -- for the current signal group ++ maneuverAssistList ManeuverAssistList OPTIONAL, ++ -- This information may also be placed in the ++ -- IntersectionState when common information applies to ++ -- different lanes in the same way ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-MovementState}} OPTIONAL, ++ ... ++ } ++ ++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 ++ ... ++ } ++ ++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, ++ -- a lane made up of two or more ++ -- XY node points and any attributes ++ -- defined in those nodes ++ computed ComputedLane, ++ -- a lane path computed by translating ++ -- the data defined by another lane ++ ... ++ } ++ ++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 ++ } ++ ++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 ++ ... ++} ++ ++OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID ++ -- The unique ID numbers for any lane object which have ++ -- spatial paths that overlay (run on top of, and not ++ -- simply cross with) the current lane. ++ -- Such as a train path that overlays a motor vehicle ++ -- lane object for a roadway segment. ++ ++Position3D ::= SEQUENCE { ++ lat Latitude, -- in 1/10th micro degrees ++ long Longitude, -- in 1/10th micro degrees ++ elevation Elevation OPTIONAL, -- in 10 cm units ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-Position3D}} OPTIONAL, ++ ... ++ } ++ ++PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone ++ ++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 ++ } ++ ++RequestorDescription ::= SEQUENCE { ++ id VehicleID, ++ -- The ID used in the BSM or CAM of the requestor ++ -- This ID is presumed not to change ++ -- during the exchange ++ type RequestorType OPTIONAL, ++ -- Information regarding all type and class data ++ -- about the requesting vehicle ++ position RequestorPositionVector OPTIONAL, ++ -- The location of the requesting vehicle ++ name DescriptiveName OPTIONAL, ++ -- A human readable name for debugging use ++ -- Support for Transit requests ++ routeName DescriptiveName OPTIONAL, ++ -- A string for transit operations use ++ transitStatus TransitVehicleStatus OPTIONAL, ++ -- current vehicle state (loading, etc.) ++ transitOccupancy TransitVehicleOccupancy OPTIONAL, ++ -- current vehicle occupancy ++ transitSchedule DeltaTime OPTIONAL, ++ -- current vehicle schedule adherence ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, ++ ... ++ } ++ ++RequestorPositionVector ::= SEQUENCE { ++ position Position3D, ++ heading Angle OPTIONAL, ++ speed TransmissionAndSpeed OPTIONAL, ++ ... ++ } ++ ++RequestorType ::= SEQUENCE { ++ -- Defines who is requesting ++ role BasicVehicleRole, -- Basic role of this user at this time ++ subrole RequestSubRole OPTIONAL, -- A local list with role based items ++ ++ -- Defines what kind of request (a level of importance in the Priority Scheme) ++ request RequestImportanceLevel OPTIONAL, -- A local list with request items ++ ++ -- Additional classification details ++ iso3883 Iso3833VehicleType OPTIONAL, ++ hpmsType VehicleType OPTIONAL, -- HPMS classification types ++ ++ regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, ++ ... ++ } ++ ++RestrictionClassAssignment ::= SEQUENCE { ++ id RestrictionClassID, ++ -- the unique value (within an intersection or local region) ++ -- that is assigned to this group of users ++ users RestrictionUserTypeList ++ -- The list of user types/classes ++ -- to which this restriction ID applies ++ } ++ ++RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment ++ ++RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType ++ ++RestrictionUserType ::= CHOICE { ++ basicType RestrictionAppliesTo, ++ -- a set of the most commonly used types ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RestrictionUserType}}, ++ ... ++ } ++ ++RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane ++ ++RoadSegmentReferenceID ::= SEQUENCE { ++ region RoadRegulatorID OPTIONAL, ++ -- a globally unique regional assignment value ++ -- typically assigned to a regional DOT authority ++ -- the value zero shall be used for testing needs ++ id RoadSegmentID ++ -- a unique mapping to the road segment ++ -- in question within the above region of use ++ -- during its period of assignment and use ++ -- note that unlike intersectionID values, ++ -- this value can be reused by the region ++ } ++ ++RoadSegment ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ id RoadSegmentReferenceID, ++ -- a globally unique value for the segment ++ revision MsgCount, ++ -- Required default values about the descriptions to follow ++ refPoint Position3D, -- the reference from which subsequent ++ -- data points are offset until a new ++ -- point is used. ++ laneWidth LaneWidth OPTIONAL, ++ -- Reference width used by all subsequent ++ -- lanes unless a new width is given ++ speedLimits SpeedLimitList OPTIONAL, ++ -- Reference regulatory speed limits ++ -- used by all subsequent ++ -- lanes unless a new speed is given ++ -- See Section 11 for converting and ++ -- translating speed expressed in mph ++ -- into units of m/s ++ ++ -- Data describing disruptions in the RoadSegment ++ -- such as work zones etc will be added here; ++ -- in the US the SAE ITIS codes would be used here ++ -- The details regarding each lane type in the RoadSegment ++ roadLaneSet RoadLaneSetList, ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RoadSegment}} OPTIONAL, ++ ... ++ } ++ ++RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment ++ ++SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY ++ ++SignalControlZone ::= SEQUENCE { ++ zone RegionalExtension {{Reg-SignalControlZone}}, ++ ... ++ } ++ ++SignalRequesterInfo ::= SEQUENCE { ++ -- These three items serve to uniquely identify the requester ++ -- and the specific request to all parties ++ id VehicleID, ++ request RequestID, ++ sequenceNumber MsgCount, ++ role BasicVehicleRole OPTIONAL, ++ ++ typeData RequestorType OPTIONAL, ++ -- Used when addition data besides the role ++ -- is needed, at which point the role entry ++ -- above is not sent. ++ ... ++ } ++ ++SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage ++ ++SignalRequestPackage ::= SEQUENCE { ++ request SignalRequest, ++ -- The specific request to the intersection ++ -- contains IntersectionID, request type, ++ -- requested action (approach/lane request) ++ ++ -- The Estimated Time of Arrival (ETA) when the service is requested ++ minute MinuteOfTheYear OPTIONAL, ++ second DSecond OPTIONAL, ++ duration DSecond OPTIONAL, ++ -- The duration value is used to provide a short interval that ++ -- extends the ETA so that the requesting vehicle can arrive at ++ -- the point of service with uncertainty or with some desired ++ -- duration of service. This concept can be used to avoid needing ++ -- to frequently update the request. ++ -- The requester must update the ETA and duration values if the ++ -- period of services extends beyond the duration time. ++ -- It should be assumed that if the vehicle does not clear the ++ -- intersection when the duration is reached, the request will ++ -- be cancelled and the intersection will revert to ++ -- normal operation. ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, ++ ... ++ } ++ ++SignalRequest ::= SEQUENCE { ++ -- the unique ID of the target intersection ++ id IntersectionReferenceID, ++ ++ -- The unique requestID used by the requestor ++ requestID RequestID, ++ ++ -- The type of request or cancel for priority or preempt use ++ -- when a prior request is canceled, only the requestID is needed ++ requestType PriorityRequestType, ++ ++ -- In typical use either an approach or a lane number would ++ -- be given, this indicates the requested ++ -- path through the intersection to the degree it is known. ++ inBoundLane IntersectionAccessPoint, ++ -- desired entry approach or lane ++ outBoundLane IntersectionAccessPoint OPTIONAL, ++ -- desired exit approach or lane ++ -- the values zero is used to indicate ++ -- intent to stop within the intersection ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequest}} OPTIONAL, ++ ... ++ } ++ ++SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus ++ ++SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage ++ ++SignalStatusPackage ::= SEQUENCE { ++ -- The party that made the initial SRM request ++ requester SignalRequesterInfo OPTIONAL, ++ -- The lanes or approaches used in the request ++ inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle ++ outboundOn IntersectionAccessPoint OPTIONAL, ++ ++ -- The Estimated Time of Arrival (ETA) when the service is requested ++ -- This data echos the data of the request ++ minute MinuteOfTheYear OPTIONAL, ++ second DSecond OPTIONAL, ++ duration DSecond OPTIONAL, ++ ++ -- the SRM status for this request ++ status PrioritizationResponseStatus, ++ -- Status of request, this may include rejection ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, ++ ... ++ } ++ ++SignalStatus ::= SEQUENCE { ++ sequenceNumber MsgCount, ++ -- changed whenever the below contents have change ++ id IntersectionReferenceID, ++ -- this provides a unique mapping to the ++ -- intersection map in question ++ -- which provides complete location ++ -- and approach/movement/lane data ++ -- as well as zones for priority/preemption ++ sigStatus SignalStatusPackageList, ++ -- a list of detailed status containing all ++ -- priority or preemption state data, both ++ -- active and pending, and who requested it ++ -- requests which are denied are also listed ++ -- here for a short period of time ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatus}} OPTIONAL, ++ ... ++ } ++ ++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, ++ ... ++ } ++ ++TimeChangeDetails ::= SEQUENCE { ++ startTime TimeMark OPTIONAL, ++ -- When this phase 1st started ++ minEndTime TimeMark, ++ -- Expected shortest end time ++ maxEndTime TimeMark OPTIONAL, ++ -- Expected longest end time ++ ++ likelyTime TimeMark OPTIONAL, ++ -- Best predicted value based on other data ++ confidence TimeIntervalConfidence OPTIONAL, ++ -- Applies to above time element only ++ ++ nextTime TimeMark OPTIONAL ++ -- A rough estimate of time when ++ -- this phase may next occur again ++ -- used to support various ECO driving power ++ -- management needs. ++ } ++ ++TimeMark ::= INTEGER (0..36001) ++ -- Tenths of a second in the current or next hour ++ -- In units of 1/10th second from UTC time ++ -- A range of 0~36000 covers one hour ++ -- The values 35991..36000 are used when a leap second occurs ++ -- The value 36001 is used to indicate time >3600 seconds ++ -- 36002 is to be used when value undefined or unknown ++ -- Note that this is NOT expressed in GPS time ++ -- or in local time ++ ++TransmissionAndSpeed ::= SEQUENCE { ++ transmisson TransmissionState, ++ speed Velocity ++ } ++ ++VehicleID ::= CHOICE { ++ entityID TemporaryID, ++ stationID StationID ++ } ++ ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- Start of entries from table Data_Elements... ++-- This table typicaly contains data element entries. ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++ ++AdvisorySpeedType ::= ENUMERATED { ++ none (0), ++ greenwave (1), ++ ecoDrive (2), ++ transit (3), ++ ... ++ } -- Note: subject to further growth ++ ++AllowedManeuvers ::= BIT STRING { ++ -- With bits as defined: ++ -- Allowed maneuvers at path end (stop line) ++ -- All maneuvers with bits not set are therefore prohibited ! ++ -- A value of zero shall be used for unknown, indicating no Maneuver ++ maneuverStraightAllowed (0), ++ -- a Straight movement is allowed in this lane ++ maneuverLeftAllowed (1), ++ -- a Left Turn movement is allowed in this lane ++ maneuverRightAllowed (2), ++ -- a Right Turn movement is allowed in this lane ++ maneuverUTurnAllowed (3), ++ -- a U turn movement is allowed in this lane ++ maneuverLeftTurnOnRedAllowed (4), ++ -- a Stop, and then proceed when safe movement ++ -- is allowed in this lane ++ maneuverRightTurnOnRedAllowed (5), ++ -- a Stop, and then proceed when safe movement ++ -- is allowed in this lane ++ maneuverLaneChangeAllowed (6), ++ -- a movement which changes to an outer lane ++ -- on the egress side is allowed in this lane ++ -- (example: left into either outbound lane) ++ maneuverNoStoppingAllowed (7), ++ -- the vehicle should not stop at the stop line ++ -- (example: a flashing green arrow) ++ yieldAllwaysRequired (8), ++ -- the allowed movements above are not protected ++ -- (example: an permanent yellow condition) ++ goWithHalt (9), ++ -- after making a full stop, may proceed ++ caution (10), ++ -- proceed past stop line with caution ++ reserved1 (11) ++ -- used to align to 12 Bit Field ++ ++ } (SIZE(12)) ++ ++Angle ::= INTEGER (0..28800) ++ -- LSB of 0.0125 degrees ++ -- A range of 0 to 359.9875 degrees ++ ++ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown ++ ++BasicVehicleRole ::= ENUMERATED { ++ -- Values used in the EU and in the US ++ basicVehicle (0), -- Light duty passenger vehicle type ++ publicTransport (1), -- Used in EU for Transit us ++ specialTransport (2), -- Used in EU (e.g. heavy load) ++ dangerousGoods (3), -- Used in EU for any HAZMAT ++ roadWork (4), -- Used in EU for State and Local DOT uses ++ roadRescue (5), -- Used in EU and in the US to include tow trucks. ++ emergency (6), -- Used in EU for Police, Fire and Ambulance units ++ safetyCar (7), -- Used in EU for Escort vehicles ++ -- Begin US unique numbering ++ none-unknown (8), -- added to follow current SAE style guidelines ++ truck (9), -- Heavy trucks with additional BSM rights and obligations ++ motorcycle (10), -- ++ roadSideSource (11), -- For infrastructure generated calls such as ++ -- fire house, rail infrastructure, roadwork site, etc. ++ police (12), -- ++ fire (13), -- ++ ambulance (14), -- (does not include private para-transit etc.) ++ dot (15), -- all roadwork vehicles ++ transit (16), -- all transit vehicles ++ slowMoving (17), -- to also include oversize etc. ++ stopNgo (18), -- to include trash trucks, school buses and others ++ -- that routinely disturb the free flow of traffic ++ cyclist (19), -- ++ pedestrian (20), -- also includes those with mobility limitations ++ nonMotorized (21), -- other, horse drawn, etc. ++ military (22), -- ++ ... ++ } ++ ++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 ++ ++DescriptiveName ::= IA5String (SIZE(1..63)) ++ ++DrivenLineOffsetLg ::= INTEGER (-32767..32767) ++ -- LSB units are 1 cm. ++ ++DrivenLineOffsetSm ::= INTEGER (-2047..2047) ++ -- LSB units are 1 cm. ++ ++DSecond ::= INTEGER (0..65535) -- units of milliseconds ++ ++DSRCmsgID ::= INTEGER (0..32767) ++ mapData DSRCmsgID ::= 18 -- MAP, intersections ++ signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT ++ signalRequestMessage DSRCmsgID ::= 29 -- SRM ++ signalStatusMessage DSRCmsgID ::= 30 -- SSM ++ ++Elevation ::= INTEGER (-4096..61439) ++ -- In units of 10 cm steps above or below the reference ellipsoid ++ -- Providing a range of -409.5 to + 6143.9 meters ++ -- The value -4096 shall be used when Unknown is to be sent ++ ++IntersectionID ::= INTEGER (0..65535) ++ -- The values zero through 255 are allocated for testing purposes ++ -- Note that the value assigned to an intersection will be ++ -- unique within a given regional ID only ++ ++IntersectionStatusObject ::= BIT STRING { ++ manualControlIsEnabled (0), ++ -- Timing reported is per programmed values, etc. but person ++ -- at cabinet can manually request that certain intervals are ++ -- terminated early (e.g. green). ++ stopTimeIsActivated (1), ++ -- And all counting/timing has stopped. ++ failureFlash (2), ++ -- Above to be used for any detected hardware failures, ++ -- e.g. conflict monitor as well as for police flash ++ preemptIsActive (3), ++ signalPriorityIsActive (4), ++ ++ -- Additional states ++ fixedTimeOperation (5), ++ -- Schedule of signals is based on time only ++ -- (i.e. the state can be calculated) ++ trafficDependentOperation (6), ++ -- Operation is based on different levels of traffic parameters ++ -- (requests, duration of gaps or more complex parameters) ++ standbyOperation (7), ++ -- Controller: partially switched off or partially amber flashing ++ failureMode (8), ++ -- Controller has a problem or failure in operation ++ off (9), ++ -- Controller is switched off ++ ++ -- Related to MAP and SPAT bindings ++ recentMAPmessageUpdate (10), ++ -- Map revision with content changes ++ recentChangeInMAPassignedLanesIDsUsed (11), ++ -- Change in MAP's assigned lanes used (lane changes) ++ -- Changes in the active lane list description ++ noValidMAPisAvailableAtThisTime (12), ++ -- MAP (and various lanes indexes) not available ++ noValidSPATisAvailableAtThisTime (13) ++ -- SPAT system is not working at this time ++ ++ -- Bits 14,15 reserved at this time and shall be zero ++ } (SIZE(16)) ++ ++ ++LaneAttributes-Barrier ::= BIT STRING { ++ -- With bits as defined: ++ median-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ median (1), ++ whiteLineHashing (2), ++ stripedLines (3), ++ doubleStripedLines (4), ++ trafficCones (5), ++ constructionBarrier (6), ++ trafficChannels (7), ++ lowCurbs (8), ++ highCurbs (9) ++ -- Bits 10~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Bike ::= BIT STRING { ++ -- With bits as defined: ++ bikeRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ pedestrianUseAllowed (1), ++ -- The path allows pedestrian traffic, ++ -- if not set, this mode is prohibited ++ isBikeFlyOverLane (2), ++ -- path of lane is not at grade ++ fixedCycleTime (3), ++ -- the phases use preset times ++ -- i.e. there is not a 'push to cross' button ++ biDirectionalCycleTimes (4), ++ -- ped walk phases use different SignalGroupID ++ -- for each direction. The first SignalGroupID ++ -- in the first Connection represents 'inbound' ++ -- flow (the direction of travel towards the first ++ -- node point) while second SignalGroupID in the ++ -- next Connection entry represents the 'outbound' ++ -- flow. And use of RestrictionClassID entries ++ -- in the Connect follow this same pattern in pairs. ++ isolatedByBarrier (5), ++ unsignalizedSegmentsPresent (6) ++ -- The lane path consists of one of more segments ++ -- which are not part of a signal group ID ++ ++ -- Bits 7~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Crosswalk ::= BIT STRING { ++ -- With bits as defined: ++ -- MUTCD provides no suitable "types" to use here ++ crosswalkRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ bicyleUseAllowed (1), ++ -- The path allows bicycle traffic, ++ -- if not set, this mode is prohibited ++ isXwalkFlyOverLane (2), ++ -- path of lane is not at grade ++ fixedCycleTime (3), ++ -- ped walk phases use preset times ++ -- i.e. there is not a 'push to cross' button ++ biDirectionalCycleTimes (4), ++ -- ped walk phases use different SignalGroupID ++ -- for each direction. The first SignalGroupID ++ -- in the first Connection represents 'inbound' ++ -- flow (the direction of travel towards the first ++ -- node point) while second SignalGroupID in the ++ -- next Connection entry represents the 'outbound' ++ -- flow. And use of RestrictionClassID entries ++ -- in the Connect follow this same pattern in pairs. ++ hasPushToWalkButton (5), ++ -- Has a demand input ++ audioSupport (6), ++ -- audio crossing cues present ++ rfSignalRequestPresent (7), ++ -- Supports RF push to walk technologies ++ unsignalizedSegmentsPresent (8) ++ -- The lane path consists of one of more segments ++ -- which are not part of a signal group ID ++ -- Bits 9~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Parking ::= BIT STRING { ++ -- With bits as defined: ++ -- Parking use details, note that detailed restrictions such as ++ -- allowed hours are sent by way of ITIS codes in the TIM message ++ parkingRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ parallelParkingInUse (1), ++ headInParkingInUse (2), ++ doNotParkZone (3), ++ -- used to denote fire hydrants as well as ++ -- short disruptions in a parking zone ++ parkingForBusUse (4), ++ parkingForTaxiUse (5), ++ noPublicParkingUse (6) ++ -- private parking, as in front of ++ -- private property ++ -- Bits 7~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Sidewalk ::= BIT STRING { ++ -- With bits as defined: ++ sidewalk-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ bicyleUseAllowed (1), ++ -- The path allows bicycle traffic, ++ -- if not set, this mode is prohibited ++ isSidewalkFlyOverLane (2), ++ -- path of lane is not at grade ++ walkBikes (3) ++ -- bike traffic must dismount and walk ++ -- Bits 4~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-Striping ::= BIT STRING { ++ -- With bits as defined: ++ stripeToConnectingLanesRevocableLane (0), ++ -- this lane may be activated or not activated based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ stripeDrawOnLeft (1), ++ stripeDrawOnRight (2), ++ -- which side of lane to mark ++ stripeToConnectingLanesLeft (3), ++ stripeToConnectingLanesRight (4), ++ stripeToConnectingLanesAhead (5) ++ -- the stripe type should be ++ -- presented to the user visually ++ -- to reflect stripes in the ++ -- intersection for the type of ++ -- movement indicated ++ -- Bits 6~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-TrackedVehicle ::= BIT STRING { ++ -- With bits as defined: ++ spec-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ spec-commuterRailRoadTrack (1), ++ spec-lightRailRoadTrack (2), ++ spec-heavyRailRoadTrack (3), ++ spec-otherRailType (4) ++ -- Bits 5~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-Vehicle ::= BIT STRING { ++ -- With bits as defined: ++ isVehicleRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ isVehicleFlyOverLane (1), ++ -- path of lane is not at grade ++ hovLaneUseOnly (2), ++ restrictedToBusUse (3), ++ restrictedToTaxiUse (4), ++ restrictedFromPublicUse (5), ++ hasIRbeaconCoverage (6), ++ permissionOnRequest (7) -- e.g. to inform about a lane for e-cars ++ ++ } (SIZE (8,...)) ++ ++LaneConnectionID ::= INTEGER (0..255) ++ ++LaneDirection ::= BIT STRING { ++ -- With bits as defined: ++ -- Allowed directions of travel in the lane object ++ -- All lanes are described from the stop line outwards ++ ingressPath (0), ++ -- travel from rear of path to front ++ -- is allowed ++ egressPath (1) ++ -- travel from front of path to rear ++ -- is allowed ++ -- Notes: No Travel, i.e. the lane object type does not support ++ -- travel (medians, curbs, etc.) is indicated by not ++ -- asserting any bit value ++ -- Bi-Directional Travel (such as a ped crosswalk) is ++ -- indicated by asserting both of the bits ++ } (SIZE (2)) ++ ++LaneID ::= INTEGER (0..255) ++ -- the value 0 shall be used when the lane ID is ++ -- not available or not known ++ -- the value 255 is reserved for future use ++ ++LayerID ::= INTEGER (0..100) ++ ++LayerType ::= ENUMERATED { ++ none, ++ mixedContent, -- two or more of the below types ++ generalMapData, ++ intersectionData, ++ curveData, ++ roadwaySectionData, ++ parkingAreaData, ++ sharedLaneData, ++ ... ++ } ++ ++LaneWidth ::= INTEGER (0..32767) -- units of 1 cm ++ ++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 ++ ++MinuteOfTheYear ::= INTEGER (0..527040) ++ -- the value 527040 shall be used for invalid ++ ++MovementPhaseState ::= ENUMERATED { ++ -- Note that based on the regions and the operating mode not every ++ -- phase will be used in all transportation modes and that not ++ -- every phase will be used in all transportation modes ++ ++ unavailable (0), ++ -- This state is used for unknown or error ++ dark (1), ++ -- The signal head is dark (unlit) ++ ++ -- Reds ++ stop-Then-Proceed (2), ++ -- Often called 'flashing red' in US ++ -- Driver Action: ++ -- Stop vehicle at stop line. ++ -- Do not proceed unless it is safe. ++ -- Note that the right to proceed either right or left when ++ -- it is safe may be contained in the lane description to ++ -- handle what is called a 'right on red' ++ stop-And-Remain (3), ++ -- e.g. called 'red light' in US ++ -- Driver Action: ++ -- Stop vehicle at stop line. ++ -- Do not proceed. ++ -- Note that the right to proceed either right or left when ++ -- it is safe may be contained in the lane description to ++ -- handle what is called a 'right on red' ++ ++ -- Greens ++ pre-Movement (4), ++ -- Not used in the US, red+yellow partly in EU ++ -- Driver Action: ++ -- Stop vehicle. ++ -- Prepare to proceed (pending green) ++ -- (Prepare for transition to green/go) ++ permissive-Movement-Allowed (5), ++ -- Often called 'permissive green' in US ++ -- Driver Action: ++ -- Proceed with caution, ++ -- must yield to all conflicting traffic ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ protected-Movement-Allowed (6), ++ -- Often called 'protected green' in US ++ -- Driver Action: ++ -- Proceed, tossing caution to the wind, ++ -- in indicated (allowed) direction. ++ ++ -- Yellows / Ambers ++ -- The vehicle is not allowed to cross the stop bar if it is possible ++ -- to stop without danger. ++ permissive-clearance (7), ++ -- Often called 'permissive yellow' in US ++ -- Driver Action: ++ -- Prepare to stop. ++ -- Proceed if unable to stop, ++ -- Clear Intersection. ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ protected-clearance (8), ++ -- Often called 'protected yellow' in US ++ -- Driver Action: ++ -- Prepare to stop. ++ -- Proceed if unable to stop, ++ -- in indicated direction (to connected lane) ++ -- Clear Intersection. ++ ++ caution-Conflicting-Traffic (9) ++ -- Often called 'flashing yellow' in US ++ -- Often used for extended periods of time ++ -- Driver Action: ++ -- Proceed with caution, ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ } ++ -- The above number assignments are not used with UPER encoding ++ -- and are only to be used with DER or implicit encoding ++ ++MsgCount ::= INTEGER (0..127) ++ ++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 ++ ++PedestrianBicycleDetect ::= BOOLEAN ++ -- true if ANY Pedestrians or Bicyclists are ++ -- detected crossing the target lane or lanes ++ ++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 ++ ... ++} ++ ++PriorityRequestType ::= ENUMERATED { ++ priorityRequestTypeReserved (0), ++ priorityRequest (1), ++ priorityRequestUpdate (2), ++ priorityCancellation (3), ++ ... ++ } ++ ++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 ++ ++RequestID ::= INTEGER (0..255) ++ ++RequestImportanceLevel ::= ENUMERATED { ++ requestImportanceLevelUnKnown (0), ++ requestImportanceLevel1 (1), -- The least important request ++ requestImportanceLevel2 (2), -- The values here shall be assigned ++ requestImportanceLevel3 (3), -- Meanings based on regional needs ++ requestImportanceLevel4 (4), -- for each of the basic roles which ++ requestImportanceLevel5 (5), -- are defined elsewhere ++ requestImportanceLevel6 (6), ++ requestImportanceLevel7 (7), ++ requestImportanceLevel8 (8), ++ requestImportanceLevel9 (9), ++ requestImportanceLevel10 (10), ++ requestImportanceLevel11 (11), ++ requestImportanceLevel12 (12), ++ requestImportanceLevel13 (13), ++ requestImportanceLevel14 (14), -- The most important request ++ requestImportanceReserved (15) -- Reserved for future use ++ } ++ ++RequestSubRole ::= ENUMERATED { ++ requestSubRoleUnKnown (0), ++ requestSubRole1 (1), -- The first type of sub role ++ requestSubRole2 (2), -- The values here shall be assigned ++ requestSubRole3 (3), -- Meanings based on regional needs ++ requestSubRole4 (4), -- to refine and expand the basic ++ requestSubRole5 (5), -- roles which are defined elsewhere ++ requestSubRole6 (6), ++ requestSubRole7 (7), ++ requestSubRole8 (8), ++ requestSubRole9 (9), ++ requestSubRole10 (10), ++ requestSubRole11 (11), ++ requestSubRole12 (12), ++ requestSubRole13 (13), ++ requestSubRole14 (14), -- The last type of sub role ++ requestSubRoleReserved (15) -- Reserved for future use ++ } ++ ++RestrictionAppliesTo ::= ENUMERATED { ++ none, -- applies to nothing ++ equippedTransit, -- buses etc. ++ equippedTaxis, ++ equippedOther, -- other vehicle types with ++ -- necessary signal phase state ++ -- reception equipment ++ emissionCompliant, -- regional variants with more ++ -- definitive items also exist ++ equippedBicycle, ++ weightCompliant, ++ heightCompliant, ++ -- Items dealing with traveler needs serviced by the infrastructure ++ -- These end users (which are not vehicles) are presumed to be suitably equipped ++ pedestrians, ++ slowMovingPersons, ++ wheelchairUsers, ++ visualDisabilities, ++ audioDisabilities, -- hearing ++ otherUnknownDisabilities, ++ ... ++ } ++ ++RestrictionClassID ::= INTEGER (0..255) ++ -- An index value to identify data about classes of users ++ -- the value used varies with each intersection's ++ -- needs and is defined in the map to the assigned ++ -- classes of supported users. ++ ++RoadRegulatorID ::= INTEGER (0..65535) ++ -- The value zero shall be used for testing only ++ ++RoadSegmentID ::= INTEGER (0..65535) ++ -- The values zero to 255 shall be used for testing only ++ -- Note that the value assigned to an RoadSegment will be ++ -- unique within a given regional ID only during its use ++ ++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 ++ ++Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent ++ ++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 ++ ++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 ++ ... ++ } ++ ++SpeedAdvice ::= INTEGER (0..500) ++ -- LSB units are 0.1 m/s^2 ++ -- the value 499 shall be used for values at or greater than 49.9 m/s ++ -- the value 500 shall be used to indicate that speed is unavailable ++ ++ ++TemporaryID ::= OCTET STRING (SIZE(4)) ++ ++TimeIntervalConfidence ::= INTEGER (0..15) ++ -- Value Probability ++ -- 0 21% ++ -- 1 36% ++ -- 2 47% ++ -- 3 56% ++ -- 4 62% ++ -- 5 68% ++ -- 6 73% ++ -- 7 77% ++ -- 8 81% ++ -- 9 85% ++ -- 10 88% ++ -- 11 91% ++ -- 12 94% ++ -- 13 96% ++ -- 14 98% ++ -- 15 100% ++ ++TransitVehicleOccupancy ::= ENUMERATED { ++ occupancyUnknown (0), ++ occupancyEmpty (1), ++ occupancyVeryLow (2), ++ occupancyLow (3), ++ occupancyMed (4), ++ occupancyHigh (5), ++ occupancyNearlyFull (6), ++ occupancyFull (7) ++ } ++ ++TransitVehicleStatus ::= BIT STRING { ++ loading (0), -- parking and unable to move at this time ++ anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) ++ aBikeLoad (2), -- loading of a bicycle is in progress ++ doorOpen (3), -- a vehicle door is open for passenger access ++ charging (4), -- a vehicle is connected to charging point ++ atStopLine (5) -- a vehicle is at the stop line for the lane it is in ++ } (SIZE(8)) ++ ++TransmissionState ::= ENUMERATED { ++ neutral (0), -- Neutral ++ park (1), -- Park ++ forwardGears (2), -- Forward gears ++ reverseGears (3), -- Reverse gears ++ reserved1 (4), ++ reserved2 (5), ++ reserved3 (6), ++ unavailable (7) -- not-equipped or unavailable value, ++ -- Any related speed is relative to the vehicle reference frame used ++ } ++ ++VehicleType ::= ENUMERATED { ++ none (0), -- Not Equipped, Not known or unavailable ++ unknown (1), -- Does not fit any other category ++ special (2), -- Special use ++ moto (3), -- Motorcycle ++ car (4), -- Passenger car ++ carOther (5), -- Four tire single units ++ bus (6), -- Buses ++ axleCnt2 (7), -- Two axle, six tire single units ++ axleCnt3 (8), -- Three axle, single units ++ axleCnt4 (9), -- Four or more axle, single unit ++ axleCnt4Trailer (10), -- Four or less axle, single trailer ++ axleCnt5Trailer (11), -- Five or less axle, single trailer ++ axleCnt6Trailer (12), -- Six or more axle, single trailer ++ axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer ++ axleCnt6MultiTrailer (14), -- Six axle, multi-trailer ++ axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer ++ ... ++ } ++ ++Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s ++ -- The value 8191 indicates that ++ -- velocity is unavailable ++ ++WaitOnStopline ::= BOOLEAN -- ++ -- True or False ++ -- If "true", the vehicles on this specific connecting ++ -- maneuver have to stop on the stop-line ++ -- and not to enter the collision area ++ ++ZoneLength ::= INTEGER (0..10000) ++ -- Unit = 1 meter, 0 = unknown, ++ -- The value 10000 to be used for Distances >=10000 m ++ -- (e.g. from known point to another point along a ++ -- known path, often against traffic flow direction ++ -- when used for measuring queues) ++ ++END ++ +Index: ISO_TS_19091_REGION.asn +=================================================================== +--- ISO_TS_19091_REGION.asn (nonexistent) ++++ ISO_TS_19091_REGION.asn (working copy) +@@ -0,0 +1,108 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- 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 ++-- ++-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) ++-- ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: REGION ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC ++ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, Control-addGrpC, Position3D-addGrpC, RestrictionUserType-addGrpC, ++SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; ++ ++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 ::= { ... } ++ ++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 ::= { ... } ++ ++Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } ++ ++Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } ++ ++Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { ++ {Control-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 ::= { ... } ++ ++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-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/patches/tct3_javasrc.patch b/patches/tct3_javasrc.patch new file mode 100644 index 0000000000000000000000000000000000000000..50eaa4b1df489fa0c155310d0201a867fc5c7f1b --- /dev/null +++ b/patches/tct3_javasrc.patch @@ -0,0 +1,178 @@ +Index: adapter/org/etsi/its/adapter/TestAdapter.java +=================================================================== +--- adapter/org/etsi/its/adapter/TestAdapter.java (revision 2612) ++++ adapter/org/etsi/its/adapter/TestAdapter.java (working copy) +@@ -20,7 +20,6 @@ + import org.etsi.its.adapter.ports.ProtocolPortFactory; + import org.etsi.its.adapter.ports.UpperTesterPort; + import org.etsi.ttcn.tci.CharstringValue; +-import org.etsi.ttcn.tri.TriActionTemplate; + import org.etsi.ttcn.tri.TriAddress; + import org.etsi.ttcn.tri.TriAddressList; + import org.etsi.ttcn.tri.TriCommunicationSA; +@@ -74,7 +73,6 @@ + /* (non-Javadoc) + * @see org.etsi.ttcn.tri.TriCommunicationSA#triExecuteTestcase(org.etsi.ttcn.tri.TriTestCaseId, org.etsi.ttcn.tri.TriPortIdList) + */ +- @Override + public TriStatus triExecuteTestcase(final TriTestCaseId tcId, final TriPortIdList portList) { + return required.getTriStatus(TriStatus.TRI_OK); + } +@@ -303,15 +301,6 @@ + } + + /** +- * triSutActionTemplate not implemented +- * @see org.etsi.ttcn.tri.TriCommunicationSA#triSutActionTemplate(org.etsi.ttcn.tri.TriActionTemplate) +- */ +- @Override +- public TriStatus triSutActionTemplate(TriActionTemplate templateValue) { +- return required.getTriStatus(TriStatus.TRI_ERROR, "triSutActionTemplate not implemented"); +- } +- +- /** + * triMapParam not implemented + * @see org.etsi.ttcn.tri.TriCommunicationSA#triMapParam(org.etsi.ttcn.tri.TriPortId, org.etsi.ttcn.tri.TriPortId, org.etsi.ttcn.tri.TriParameterList) + */ +@@ -328,4 +317,28 @@ + public TriStatus triUnmapParam(TriPortId compPortId, TriPortId tsiPortId, TriParameterList paramList) { + return required.getTriStatus(TriStatus.TRI_ERROR, "triUnmapParam not implemented"); + } ++ ++ @Override ++ public TriStatus triExecuteTestCase(TriTestCaseId arg0, TriPortIdList arg1) { ++ // TODO Auto-generated method stub ++ return triExecuteTestcase(arg0, arg1); ++ } ++ ++ @Override ++ public TriStatus triGetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) { ++ // TODO Auto-generated method stub ++ return null; ++ } ++ ++ @Override ++ public TriStatus triSetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) { ++ // TODO Auto-generated method stub ++ return null; ++ } ++ ++ @Override ++ public TriStatus triStaticMap(TriPortId arg0, TriPortId arg1) { ++ // TODO Auto-generated method stub ++ return null; ++ } + } +Index: certificatesio/org/etsi/certificates/io/CertificatesIO.java +=================================================================== +--- certificatesio/org/etsi/certificates/io/CertificatesIO.java (revision 2612) ++++ certificatesio/org/etsi/certificates/io/CertificatesIO.java (working copy) +@@ -149,7 +149,7 @@ + */ + @Override + public boolean readCertificate(final String key, final ByteArrayOutputStream certificate) { +-// TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificate: " + key); ++ TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificate: " + key); + + String certKey; + if (_cachedReverseCertificatesDigest.containsKey(key)) { +@@ -173,7 +173,7 @@ + + @Override + public boolean readCertificateDigest(final String certificateId, final ByteArrayOutputStream digest) { +-// TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificateDigest: " + certificateId); ++ TERFactory.getInstance().logDebug(">>> CertificatesIO.readCertificateDigest: " + certificateId); + + // Sanity check + if (!_cachedCertificatesDigest.containsKey(certificateId)) { +@@ -199,7 +199,7 @@ + */ + @Override + public boolean readSigningKey(final String keyName, final ByteArrayOutputStream key) { +-// TERFactory.getInstance().logDebug(">>> CertificatesIO.readSigningKey: " + keyName); ++ TERFactory.getInstance().logDebug(">>> CertificatesIO.readSigningKey: " + keyName); + + try { + String certKey; +@@ -305,11 +305,11 @@ + return; + } + _cachedCertificatesDigest.put(certName, bytes); +-// TERFactory.getInstance().logDebug("CertificatesIO.addDigestItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); ++ TERFactory.getInstance().logDebug("CertificatesIO.addDigestItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); + } + + private void addCertItem(final File p_certFile) throws FileNotFoundException, IOException { +-// TERFactory.getInstance().logDebug(">>> CertificatesIO.addItem: " + p_certFile); ++ TERFactory.getInstance().logDebug(">>> CertificatesIO.addCertItem: " + p_certFile); + + // Load the keys file name + String filename = p_certFile.getName(); +@@ -322,14 +322,14 @@ + fsKeys.close(); + bytes = ByteHelper.hexStringToByteArray(new String(bytes)); + _cachedCertificates.put(certName, bytes); +-// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store cert " + certName + " - " + ByteHelper.byteArrayToString(bytes)); ++ TERFactory.getInstance().logDebug("CertificatesIO.addCertItem: Store cert " + certName + " - " + ByteHelper.byteArrayToString(bytes)); + + // calculate digest + bytes = calculateDigestFromCertificate(bytes); + _cachedCertificatesDigest.put(certName, bytes); +-// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); ++ TERFactory.getInstance().logDebug("CertificatesIO.addCertItem: Store digest: " + ByteHelper.byteArrayToString(bytes) + " - " + certName); + _cachedReverseCertificatesDigest.put(ByteHelper.byteArrayToString(bytes), certName); +-// TERFactory.getInstance().logDebug("CertificatesIO.addItem: Store reverse digest " + ByteHelper.byteArrayToString(bytes) + " - " + certName); ++ TERFactory.getInstance().logDebug("CertificatesIO.addCertItem: Store reverse digest " + ByteHelper.byteArrayToString(bytes) + " - " + certName); + + // Load Private Keys + filename = p_certFile.getPath(); +Index: codec/org/etsi/ttcn/codec/CodecFactory.java +=================================================================== +--- codec/org/etsi/ttcn/codec/CodecFactory.java (revision 2612) ++++ codec/org/etsi/ttcn/codec/CodecFactory.java (working copy) +@@ -83,7 +83,7 @@ + if(codec != null) { + //TERFactory.getInstance().logDebug(String.format("%50s", encoding)); + //TERFactory.getInstance().logDebug(" ==> " + codec.getClass().getName()); +- System.out.println(String.format("%50s", encoding) + " ==> " + codec.getClass().getName()); ++ //System.out.println(String.format("%50s", encoding) + " ==> " + codec.getClass().getName()); + return codec; + } + return null; +@@ -92,12 +92,12 @@ + public ICodec getCodec(MainCodec mainCodec, int classType, String encoding, String typeName) { + + //TERFactory.getInstance().logDebug(String.format("%50s", typeName + "(" + encoding + ")")); +- System.out.println(String.format("%50s", typeName + "(" + encoding + ")")); ++// System.out.println(String.format("%50s", typeName + "(" + encoding + ")")); + Class cls = null; + Class[] ctorParams = {MainCodec.class}; + + //TERFactory.getInstance().logDebug("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName); +- System.out.println("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName); ++// System.out.println("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName); + cls = codecs.get(classType + '/' + encoding + '/' + typeName); + if(cls == null) { + cls = codecs.get(classType + '/' + encoding + '/'); +@@ -108,7 +108,7 @@ + + if(cls != null) { + //TERFactory.getInstance().logDebug(" ==> " + cls.getName()); +- System.out.println(" ==> " + cls.getName()); ++ //System.out.println(" ==> " + cls.getName()); + try { + Constructor ctor = cls.getConstructor(ctorParams); + return ctor.newInstance(mainCodec); +Index: codec/org/etsi/ttcn/codec/MainCodec.java +=================================================================== +--- codec/org/etsi/ttcn/codec/MainCodec.java (revision 2612) ++++ codec/org/etsi/ttcn/codec/MainCodec.java (working copy) +@@ -67,6 +67,8 @@ + + @Override + public CodecBuffer encode(Value value) { ++ //TERFactory.getInstance().logDebug(">>> MainCodec.encode: " + value); ++ //System.out.println(">>> MainCodec.encode: " + value); + + CodecFactory cf = CodecFactory.getInstance(); + TciCDProvided extCodec = cf.getExternalCodec(value.getValueEncoding()); diff --git a/patches/titanization_asn1_IS.patch b/patches/titanization_asn1_IS.patch new file mode 100644 index 0000000000000000000000000000000000000000..3fb0726f261851ce7b3d90f752890982c0d7a808 --- /dev/null +++ b/patches/titanization_asn1_IS.patch @@ -0,0 +1,6318 @@ +Index: EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn +=================================================================== +--- EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn (nonexistent) ++++ EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,157 @@ ++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 +\ No newline at end of file +Index: EVCSN/EVCSN_PDU_Descriptions.asn +=================================================================== +--- EVCSN/EVCSN_PDU_Descriptions.asn (nonexistent) ++++ EVCSN/EVCSN_PDU_Descriptions.asn (working copy) +@@ -0,0 +1,102 @@ ++-- 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 +\ No newline at end of file +Index: IS/AddGrpC.asn +=================================================================== +--- IS/AddGrpC.asn (nonexistent) ++++ IS/AddGrpC.asn (working copy) +@@ -0,0 +1,111 @@ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: AddGrpC ++-- ISO TS 19091 Oct 2015 v0910 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } ++ ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++--FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop ++--NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC ++NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM IS-DSRC-REGION-noCircular ++Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; ++ ++ ++ConnectionManeuverAssist-addGrpC ::= SEQUENCE { ++ vehicleToLanePositions VehicleToLanePositionList OPTIONAL, ++ rsuGNSSOffset NodeOffsetPointXY OPTIONAL ++} ++ ++ConnectionTrajectory-addGrpC ::= SEQUENCE { ++ nodes NodeSetXY, ++ ... ++} ++ ++/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop ++Control-addGrpC ::= SEQUENCE { ++ ptvRequest PtvRequestType, ++ ... ++} ++*/ ++ ++IntersectionState-addGrpC ::= SEQUENCE { ++ activePrioritizations PrioritizationResponseList OPTIONAL, ++ ... ++} ++ ++MapData-addGrpC ::= SEQUENCE { ++ signalHeadLocations SignalHeadLocationList OPTIONAL, ++ ... ++} ++ ++Position3D-addGrpC ::= SEQUENCE { ++ altitude Altitude, ++ ... ++} ++ ++PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse ++ ++PrioritizationResponse ::= SEQUENCE { ++ stationed StationID, ++ priorState PrioritizationResponseStatus, ++ signalGroup SignalGroupID, ++ ... ++} ++ ++RestrictionUserType-addGrpC ::= SEQUENCE { ++ emission EmissionType OPTIONAL, ++ ... ++} ++ ++SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation ++ ++SignalHeadLocation ::= SEQUENCE { ++ nodeXY NodeOffsetPointXY, ++ nodeZ DeltaAltitude, ++ signalGroupID SignalGroupID, ++ ... ++} ++ ++SignalStatusPackage-addGrpC ::= SEQUENCE { ++ synchToSchedule DeltaTime OPTIONAL, ++ ... ++} ++ ++ ++VehicleToLanePositionList ::= SEQUENCE SIZE(1..5) OF VehicleToLanePosition ++ ++VehicleToLanePosition ::= SEQUENCE { ++ stationID StationID, ++ laneID LaneID, ++ timeReference TimeReference OPTIONAL, ++ ... ++} ++EmissionType ::= ENUMERATED { ++ euro1, ++ euro2, ++ euro3, ++ euro4, ++ euro5, ++ euro6, ++ ... ++} ++ ++/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop ++PtvRequestType ::= ENUMERATED { ++ preRequest, ++ mainRequest, ++ doorCloseRequest, ++ cancelRequest, ++ emergencyRequest, ++ ... ++} ++*/ ++ ++TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) ++ ++END + +Property changes on: IS/AddGrpC.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/AddGrpC_noCircular.asn +=================================================================== +--- IS/AddGrpC_noCircular.asn (nonexistent) ++++ IS/AddGrpC_noCircular.asn (working copy) +@@ -0,0 +1,30 @@ ++--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: AddGrpC ++-- ISO TS 19091 Oct 2015 v0910 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++--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 (0) version (1) } ++ ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++ ++Control-addGrpC ::= SEQUENCE { ++ ptvRequest PtvRequestType, ++ ... ++} ++ ++PtvRequestType ::= ENUMERATED { ++ preRequest, ++ mainRequest, ++ doorCloseRequest, ++ cancelRequest, ++ emergencyRequest, ++ ... ++} ++ ++END + +Property changes on: IS/AddGrpC_noCircular.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/EfcModule.asn +=================================================================== +--- IS/EfcModule.asn (nonexistent) ++++ IS/EfcModule.asn (working copy) +@@ -0,0 +1,139 @@ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-- ISO TS 14906 ++-- ++-- ++-- ++-- 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/14906/old/ ++-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++EfcModule {iso standard 14906 modules(0) efc(0) version(1)} DEFINITIONS ++ ++AUTOMATIC TAGS ++::= BEGIN ++--EXPORTS ALL; ++-- IMPORTS CountryCode, CS5, IssuerIdentifier FROM AVIAEINumberingAndDataStructures{iso(1) standard(0) 14816 } ++IMPORTS CountryCode, IssuerIdentifier FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)}; ++-- defined in ISO 14816 -- ++-- Container, AttributeIdList, Attributes, AttributeList FROM DSRCData{iso standard 14906 modules (0) dsrc (1) version (1)}; ++-- NOTE: The following are the definitions of the action and response ++-- parameters ++ ++AxleWeightLimits ::= SEQUENCE{ ++ maxLadenweightOnAxle1 Int2, ++ maxLadenweightOnAxle2 Int2, ++ maxLadenweightOnAxle3 Int2, ++ maxLadenweightOnAxle4 Int2, ++ maxLadenweightOnAxle5 Int2 ++} ++ ++-- Fritz include ++DieselEmissionValues::= SEQUENCE { ++ particulate SEQUENCE { ++ unitType UnitType, ++ value INTEGER (0..32767) ++ }, ++ absorptionCoeff Int2 ++} ++ ++-- Fritz include ++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), ++ reservedForUse9 (15) ++} -- 4 bits, EURO-Clases as defined in EC directive 88/77/EEC, annex 1 ++-- and in 91/542/EEC, 96/1/EC, 1999/96/EC, 2001/27/EC ++ ++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' ++ ++-- Fritz include ++EngineCharacteristics::= INTEGER { ++ noEntry (0), ++ noEngine (1), ++ petrolUnleaded (2), ++ petrolLeaded (3), ++ diesel (4), ++ lPG (5), ++ battery (6), ++ solar (7) ++ -- (8-255) are reserved for future CEN use ++} (0..255) ++ ++-- Fritz include ++ExhaustEmissionValues ::= SEQUENCE { ++ unitType UnitType, ++ emissionCO INTEGER (0.. 32767), ++ emissionHC Int2, ++ emissionNOX Int2, ++ emissionHCNOX Int2 ++} ++ ++Int1 ::= INTEGER(0..255) ++ ++Int2 ::= INTEGER(0..65535) ++ ++-- Fritz include ++PassengerCapacity ::= SEQUENCE{ ++ numberOfSeats Int1, ++ numberOfStandingPlaces Int1 ++} ++ ++Provider ::= SEQUENCE { -- Fritz include ++countryCode CountryCode, ++providerIdentifier IssuerIdentifier ++} ++ ++SoundLevel ::= SEQUENCE{ -- fritz include ++soundstationary Int1, ++sounddriveby Int1 ++} ++ ++UnitType ::=ENUMERATED { ++ mg-km (0), ++ mg-kWh (1) ++} ++ ++VehicleDimensions ::= SEQUENCE { -- Fritz include ++vehicleLengthOverall Int1, ++vehicleHeigthOverall Int1, ++vehicleWidthOverall Int1 ++} ++ ++VehicleWeightLimits ::= SEQUENCE { -- fritz include ++vehicleMaxLadenWeight Int2, ++vehicleTrainMaximumWeight Int2, ++vehicleWeightUnladen Int2 ++} ++END + +Property changes on: IS/EfcModule.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/ETSI_TS_103301.asn +=================================================================== +--- IS/ETSI_TS_103301.asn (revision 1297) ++++ IS/ETSI_TS_103301.asn (nonexistent) +@@ -1,146 +0,0 @@ +--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--- ETSI TS 103 301 +--- +--- This ASN.1 was generated: 30.08.2016 +--- +--- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message +--- as defined in ETSI TS 103 301 +--- +--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: SPAT-MESSAGE-PDU-Descriptions +--- +--- This ASN.1 was created: 30.08.2016 +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-SPATEM-PDU-Descriptions { +- itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) spatem (0) version1 (1) +-} +- +-DEFINITIONS AUTOMATIC TAGS ::= +- +-BEGIN +- +-IMPORTS +-SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +-ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +- +- +-SPATEM ::= SEQUENCE { +- header ItsPduHeader, +- spat SPAT +-} +- +-END +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: MAP-MESSAGE-PDU-Descriptions +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-MAPEM-PDU-Descriptions { +- itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) mapem (1) version1 (1) +-} +- +-DEFINITIONS AUTOMATIC TAGS ::= +- +-BEGIN +- +-IMPORTS +-MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +-ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; +- +- +-MAPEM ::= SEQUENCE { +- header ItsPduHeader, +- map MapData +-} +- +-END +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: IVI-MESSAGE-PDU-Descriptions +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-IVIM-PDU-Descriptions { +- itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ivim (2) version1 (1) +-} +- +-DEFINITIONS AUTOMATIC TAGS ::= +- +-BEGIN +- +-IMPORTS +-IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} +-ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; +- +- +-IVIM ::= SEQUENCE { +- header ItsPduHeader, +- ivi IviStructure +-} +- +-END +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: SRM-MESSAGE-PDU-Descriptions +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-SREM-PDU-Descriptions { +- itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) srem (3) version1 (1) +-} +- +-DEFINITIONS AUTOMATIC TAGS ::= +- +-BEGIN +- +-IMPORTS +-SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +-ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +- +-SREM ::= SEQUENCE { +- header ItsPduHeader, +- srm SignalRequestMessage +-} +- +-END +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: SSM-MESSAGE-PDU-Descriptions +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-SSEM-PDU-Descriptions { +- itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ssem (4) version1 (1) +-} +- +-DEFINITIONS AUTOMATIC TAGS ::= +- +-BEGIN +- +-IMPORTS +-SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +-ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +- +- +-SSEM ::= SEQUENCE { +- header ItsPduHeader, +- ssm SignalStatusMessage +-} +- +-END +- + +Property changes on: IS/ETSI_TS_103301.asn +___________________________________________________________________ +Deleted: svn:eol-style +## -1 +0,0 ## +-native +\ No newline at end of property +Deleted: svn:keywords +## -1 +0,0 ## +-URL Id +\ No newline at end of property +Deleted: svn:mime-type +## -1 +0,0 ## +-text/plain +\ No newline at end of property +Index: IS/IS_DSRC.asn +=================================================================== +--- IS/IS_DSRC.asn (nonexistent) ++++ IS/IS_DSRC.asn (working copy) +@@ -0,0 +1,1906 @@ ++--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: DSRC ++-- ISO TS 19091 Oct 2015 v0909 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++--FIXME RGY renamed from DSRC, as module DSRC already exists in MAP-SPAT ++IS-DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++--FIXME RGY definitions moved to module IS-DSRC-REGION-noCircular are commented our below ++StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } ++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, ++--FIXME RGY module name changed to IS-REGION as REGION already used in MAP_SPAT ++--Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)}; ++Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM IS-REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} ++ ++--FIXME RGY definitions moved to IS-DSRC-REGION-noCircular but also refernced here are re-imported ++DeltaAngle, DeltaTime, LaneID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, Velocity, ++Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY FROM IS-DSRC-REGION-noCircular ++Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1)} ++; ++ ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- 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} ) ++ } ++*/ ++ ++SPAT ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ name DescriptiveName OPTIONAL, ++ -- human readable name for this collection ++ -- to be used only in debug mode ++ ++ intersections IntersectionStateList, ++ -- sets of SPAT data (one per intersection) ++ ++ -- If PrioritizationResponse data is required, it is found ++ -- in the RegionalSPAT entry below ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SPAT}} OPTIONAL, ++ ... ++ } ++ ++SignalRequestMessage ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ second DSecond, ++ sequenceNumber MsgCount OPTIONAL, ++ ++ requests SignalRequestList OPTIONAL, ++ -- Request Data for one or more signalized ++ -- intersections that support SRM dialogs ++ ++ requestor RequestorDescription, ++ -- Requesting Device and other User Data ++ -- contains vehicle ID (if from a vehicle) ++ -- as well as type data and current position ++ -- and may contain additional transit data ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, ++ ... ++} ++ ++SignalStatusMessage ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ second DSecond, ++ sequenceNumber MsgCount OPTIONAL, ++ ++ -- Status Data for one of more signalized intersections ++ status SignalStatusList, ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, ++ ... ++} ++ ++MapData ::= SEQUENCE { ++ timeStamp MinuteOfTheYear OPTIONAL, ++ msgIssueRevision MsgCount, ++ layerType LayerType OPTIONAL, ++ layerID LayerID OPTIONAL, ++ intersections IntersectionGeometryList OPTIONAL, ++ -- All Intersection definitions ++ roadSegments RoadSegmentList OPTIONAL, ++ -- All roadway descriptions ++ ++ dataParameters DataParameters OPTIONAL, ++ -- Any meta data regarding the map contents ++ ++ restrictionList RestrictionClassList OPTIONAL, ++ -- Any restriction ID tables which have ++ -- established for these map entries ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-MapData}} OPTIONAL, ++ ++ -- NOTE: ++ -- Other map data will be added here as it is defined ++ -- Examples of the type of content to be added include ++ -- curve warnings, construction routes, etc. ++ ... ++} ++ ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- Start of entries from table Data_Frames... ++-- This table typicaly contains data frame entries. ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++ ++AdvisorySpeed ::= SEQUENCE { ++ type AdvisorySpeedType, ++ -- the type of advisory which this is. ++ speed SpeedAdvice OPTIONAL, ++ -- See Section 11 for converting and translating speed ++ -- expressed in mph into units of m/s ++ -- This element is optional ONLY when superceded ++ -- by the presence of a regional speed element found in ++ -- Reg-AdvisorySpeed entry ++ confidence SpeedConfidence OPTIONAL, ++ -- A confidence value for the above speed ++ distance ZoneLength OPTIONAL, ++ -- Unit = 1 meter, ++ -- The distance indicates the region for which the advised speed ++ -- is recommended, it is specified upstream from the stop bar ++ -- along the connected egressing lane ++ class RestrictionClassID OPTIONAL, ++ -- the vehicle types to which it applies ++ -- when absent, the AdvisorySpeed applies to ++ -- all motor vehicle types ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, ++ ... ++ } ++ ++AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed ++ ++ComputedLane ::= SEQUENCE { ++ -- Data needed to created a computed lane ++ referenceLaneId LaneID, ++ -- the lane ID upon which this ++ -- computed lane will be based ++ -- Lane Offset in X and Y direction ++ offsetXaxis CHOICE { ++ small DrivenLineOffsetSm, ++ large DrivenLineOffsetLg ++ }, ++ offsetYaxis CHOICE { ++ small DrivenLineOffsetSm, ++ large DrivenLineOffsetLg ++ }, ++ -- A path X offset value for translations of the ++ -- path's points when creating translated lanes. ++ -- The values found in the reference lane are ++ -- all offset based on the X and Y values from ++ -- the coordinates of the reference lane's ++ -- initial path point. ++ -- Lane Rotation ++ rotateXY Angle OPTIONAL, ++ -- A path rotation value for the entire lane ++ -- Observe that this rotates the existing orientation ++ -- of the referenced lane, it does not replace it. ++ -- Rotation occurs about the initial path point. ++ -- Lane Path Scale (zooming) ++ scaleXaxis Scale-B12 OPTIONAL, ++ scaleYaxis Scale-B12 OPTIONAL, ++ -- value for translations or zooming of the path's ++ -- points. The values found in the reference lane ++ -- are all expanded or contracted based on the X ++ -- and Y and width values from the coordinates of ++ -- the reference lane's initial path point. ++ -- The Z axis remains untouched. ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-ComputedLane}} OPTIONAL, ++ ... ++ } ++ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection ++ ++ConnectingLane ::= SEQUENCE { ++ lane LaneID, -- Index of the connecting lane ++ maneuver AllowedManeuvers OPTIONAL ++ -- The Maneuver between ++ -- the enclosing lane and this lane ++ -- at the stop line to connect them ++ } ++ ++ ++Connection ::= SEQUENCE { ++ -- The subject lane connecting to this lane is: ++ connectingLane ConnectingLane, ++ -- The index of the connecting lane and also ++ -- the maneuver from the current lane to it ++ remoteIntersection IntersectionReferenceID OPTIONAL, ++ -- This entry is only used when the ++ -- indicated connecting lane belongs ++ -- to another intersection layout. This ++ -- provides a means to create meshes of lanes ++ ++ -- SPAT mapping details at the stop line are: ++ signalGroup SignalGroupID OPTIONAL, ++ -- The matching signal group send by ++ -- the SPAT message for this lane/maneuver. ++ -- Shall be present unless the connectingLane ++ -- has no signal group (is un-signalized) ++ userClass RestrictionClassID OPTIONAL, ++ -- The Restriction Class of users this applies to ++ -- The use of some lane/maneuver and SignalGroupID ++ -- pairings are restricted to selected users. ++ -- When absent, the SignalGroupID applies to all ++ ++ -- Movement assist details are given by: ++ connectionID LaneConnectionID OPTIONAL ++ -- An optional connection index used to ++ -- relate this lane connection to any dynamic ++ -- clearance data in the SPAT. Note that ++ -- the index may be shared with other ++ -- connections if the clearance data is common ++ } ++ ++ ++ConnectionManeuverAssist ::= SEQUENCE { ++ connectionID LaneConnectionID, ++ -- the common connectionID used by all lanes to which ++ -- this data applies ++ -- (this value traces to ConnectsTo entries in lanes) ++ -- Expected Clearance Information ++ queueLength ZoneLength OPTIONAL, ++ -- Unit = 1 meter, 0 = no queue ++ -- The distance from the stop line to the back ++ -- edge of the last vehicle in the queue, ++ -- as measured along the lane center line. ++ availableStorageLength ZoneLength OPTIONAL, ++ -- Unit = 1 meter, 0 = no space remains ++ -- Distance (e.g. beginning from the downstream ++ -- stop-line up to a given distance) with a high ++ -- probability for successfully executing the ++ -- connecting maneuver between the two lanes ++ -- during the current cycle. ++ -- Used for enhancing the awareness of vehicles ++ -- to anticipate if they can pass the stop line ++ -- of the lane. Used for optimizing the green wave, ++ -- due to knowledge of vehicles waiting in front ++ -- of a red light (downstream). ++ -- The element nextTime in TimeChangeDetails ++ -- in the containing data frame contains the next ++ -- timemark at which an active phase is expected, ++ -- a form of storage flush interval. ++ waitOnStop WaitOnStopline OPTIONAL, ++ -- If "true", the vehicles on this specific connecting ++ -- maneuver have to stop on the stop-line and not ++ -- to enter the collision area ++ pedBicycleDetect PedestrianBicycleDetect OPTIONAL, ++ -- true if ANY ped or bicycles are detected crossing ++ -- the above lanes. Set to false ONLY if there is a ++ -- high certainty that there are none present, ++ -- otherwise element is not sent. ++ 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, ++ ... ++ } ++ ++EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID ++ -- The unique ID numbers for each ++ -- lane object which is 'active' ++ -- as part of the dynamic map contents. ++ ++GenericLane ::= SEQUENCE { ++ laneID LaneID, ++ -- The unique ID number assigned ++ -- to this lane object ++ name DescriptiveName OPTIONAL, ++ -- often for debug use only ++ -- but at times used to name ped crossings ++ ingressApproach ApproachID OPTIONAL, -- inbound ++ egressApproach ApproachID OPTIONAL, -- outbound ++ -- Approach IDs to which this lane belongs ++ laneAttributes LaneAttributes, ++ -- All Attribute information about ++ -- the basic selected lane type ++ -- Directions of use, Geometric co-sharing ++ -- and Type Specific Attributes ++ -- These Attributes are 'lane - global' that is, ++ -- they are true for the entire length of the lane ++ maneuvers AllowedManeuvers OPTIONAL, ++ -- the permitted maneuvers for this lane ++ nodeList NodeListXY, ++ -- Lane spatial path information as well as ++ -- various Attribute information along the node path ++ -- Attributes found here are more general and may ++ -- come and go over the length of the lane. ++ connectsTo ConnectsToList OPTIONAL, ++ -- a list of other lanes and their signal group IDs ++ -- each connecting lane and its signal group ID ++ -- is given, therefore this element provides the ++ -- information formerly in "signalGroups" in prior ++ -- editions. ++ overlays OverlayLaneList OPTIONAL, ++ -- A list of any lanes which have spatial paths that ++ -- overlay (run on top of, and not simply cross) ++ -- the path of this lane when used ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-GenericLane}} OPTIONAL, ++ ... ++ } ++ ++IntersectionAccessPoint ::= CHOICE { ++ lane LaneID, ++ approach ApproachID, ++ connection LaneConnectionID, ++ ... ++ } ++ ++IntersectionGeometry ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ -- For debug use only ++ id IntersectionReferenceID, ++ -- A globally unique value set, ++ -- consisting of a regionID and ++ -- intersection ID assignment ++ revision MsgCount, ++ ++ -- Required default values about lane descriptions follow ++ refPoint Position3D, -- The reference from which subsequent ++ -- data points are offset until a new ++ -- point is used. ++ laneWidth LaneWidth OPTIONAL, ++ -- Reference width used by all subsequent ++ -- lanes unless a new width is given ++ speedLimits SpeedLimitList OPTIONAL, ++ -- Reference regulatory speed limits ++ -- used by all subsequent ++ -- lanes unless a new speed is given ++ -- See Section 11 for converting and ++ -- translating speed expressed in mph ++ -- into units of m/s ++ -- Complete details regarding each lane type in this intersection ++ laneSet LaneList, -- Data about one or more lanes ++ -- (all lane data is found here) ++ ++ -- Data describing how to use and request preemption and ++ -- priority services from this intersection (if supported) ++ -- NOTE Additonal data may be added in the next release of the ++ -- standard at this point to handle this concept ++ preemptPriorityData PreemptPriorityList OPTIONAL, ++ -- data about one or more regional ++ -- preempt or priority zones ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, ++ ... ++ } ++ ++IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry ++ ++IntersectionReferenceID ::= SEQUENCE { ++ region RoadRegulatorID OPTIONAL, ++ -- a globally unique regional assignment value ++ -- typical assigned to a regional DOT authority ++ -- the value zero shall be used for testing needs ++ id IntersectionID ++ -- a unique mapping to the intersection ++ -- in question within the above region of use ++ } ++ ++IntersectionState ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ -- human readable name for intersection ++ -- to be used only in debug mode ++ id IntersectionReferenceID, ++ -- A globally unique value set, consisting of a ++ -- regionID and intersection ID assignment ++ -- provides a unique mapping to the ++ -- intersection MAP in question ++ -- which provides complete location ++ -- and approach/move/lane data ++ revision MsgCount, ++ status IntersectionStatusObject, ++ -- general status of the controller(s) ++ moy MinuteOfTheYear OPTIONAL, ++ -- Minute of current UTC year ++ -- used only with messages to be archived ++ timeStamp DSecond OPTIONAL, ++ -- the mSec point in the current UTC minute that ++ -- this message was constructed ++ enabledLanes EnabledLaneList OPTIONAL, ++ -- a list of lanes where the RevocableLane bit ++ -- has been set which are now active and ++ -- therefore part of the current intersection ++ states MovementList, ++ -- Each Movement is given in turn ++ -- and contains its signal phase state, ++ -- mapping to the lanes it applies to, and ++ -- point in time it will end, and it ++ -- may contain both active and future states ++ maneuverAssistList ManeuverAssistList OPTIONAL, ++ -- Assist data ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-IntersectionState}} OPTIONAL, ++ ... ++ } ++ ++IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState ++ ++LaneAttributes ::= SEQUENCE { ++ directionalUse LaneDirection, -- directions of lane use ++ sharedWith LaneSharing, -- co-users of the lane path ++ laneType LaneTypeAttributes, -- specific lane type data ++ regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL ++ } ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane ++ ++LaneSharing ::= BIT STRING { ++ -- With bits as defined: ++ overlappingLaneDescriptionProvided (0), ++ -- Assert when another lane object is present to describe the ++ -- path of the overlapping shared lane ++ -- this construct is not used for lane objects which simply cross ++ multipleLanesTreatedAsOneLane (1), ++ -- Assert if the lane object path and width details represents ++ -- multiple lanes within it that are not further described ++ ++ -- Various modes and type of traffic that may share this lane: ++ otherNonMotorizedTrafficTypes (2), -- horse drawn etc. ++ individualMotorizedVehicleTraffic (3), ++ busVehicleTraffic (4), ++ taxiVehicleTraffic (5), ++ pedestriansTraffic (6), ++ cyclistVehicleTraffic (7), ++ trackedVehicleTraffic (8), ++ pedestrianTraffic (9) ++ } (SIZE (10)) ++ -- All zeros would indicate 'not shared' and 'not overlapping' ++ ++LaneTypeAttributes ::= CHOICE { ++ vehicle LaneAttributes-Vehicle, -- motor vehicle lanes ++ crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks ++ bikeLane LaneAttributes-Bike, -- bike lanes ++ sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths ++ median LaneAttributes-Barrier, -- medians & channelization ++ striping LaneAttributes-Striping, -- roadway markings ++ trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys ++ parking LaneAttributes-Parking, -- parking and stopping lanes ++ ... ++ } ++ ++ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist ++ ++MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent ++ ++MovementEvent ::= SEQUENCE { ++ eventState MovementPhaseState, ++ -- Consisting of: ++ -- Phase state (the basic 11 states) ++ -- Directional, protected, or permissive state ++ ++ timing TimeChangeDetails OPTIONAL, ++ -- Timing Data in UTC time stamps for event ++ -- includes start and min/max end times of phase ++ -- confidence and estimated next occurrence ++ ++ speeds AdvisorySpeedList OPTIONAL, ++ -- various speed advisories for use by ++ -- general and specific types of vehicles ++ -- supporting green-wave and other flow needs ++ -- See Section 11 for converting and translating ++ -- speed expressed in mph into units of m/s ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-MovementEvent}} OPTIONAL, ++ ... ++ } ++ ++MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState ++ ++MovementState ::= SEQUENCE { ++ movementName DescriptiveName OPTIONAL, ++ -- uniquely defines movement by name ++ -- human readable name for intersection ++ -- to be used only in debug mode ++ signalGroup SignalGroupID, ++ -- the group id is used to map to lists ++ -- of lanes (and their descriptions) ++ -- which this MovementState data applies to ++ -- see comments in the Remarks for usage details ++ state-time-speed MovementEventList, ++ -- Consisting of sets of movement data with: ++ -- a) SignalPhaseState ++ -- b) TimeChangeDetails, and ++ -- c) AdvisorySpeeds (optional ) ++ -- Note one or more of the movement events may be for ++ -- a future time and that this allows conveying multiple ++ -- predictive phase and movement timing for various uses ++ -- for the current signal group ++ maneuverAssistList ManeuverAssistList OPTIONAL, ++ -- This information may also be placed in the ++ -- IntersectionState when common information applies to ++ -- different lanes in the same way ++ 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, ++ -- 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 ++ ... ++ } ++*/ ++ ++Node-LLmD-64b ::= SEQUENCE { ++ lon Longitude, ++ lat Latitude ++ } ++ ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++ 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, ++ -- a lane made up of two or more ++ -- XY node points and any attributes ++ -- defined in those nodes ++ computed ComputedLane, ++ -- a lane path computed by translating ++ -- the data defined by another lane ++ ... ++ } ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++ } ++ ++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 ++ ... ++} ++*/ ++ ++OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID ++ -- The unique ID numbers for any lane object which have ++ -- spatial paths that overlay (run on top of, and not ++ -- simply cross with) the current lane. ++ -- Such as a train path that overlays a motor vehicle ++ -- lane object for a roadway segment. ++ ++Position3D ::= SEQUENCE { ++ lat Latitude, -- in 1/10th micro degrees ++ long Longitude, -- in 1/10th micro degrees ++ elevation Elevation OPTIONAL, -- in 10 cm units ++ 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, ++ -- 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 ++ } ++*/ ++ ++RequestorDescription ::= SEQUENCE { ++ id VehicleID, ++ -- The ID used in the BSM or CAM of the requestor ++ -- This ID is presumed not to change ++ -- during the exchange ++ type RequestorType OPTIONAL, ++ -- Information regarding all type and class data ++ -- about the requesting vehicle ++ position RequestorPositionVector OPTIONAL, ++ -- The location of the requesting vehicle ++ name DescriptiveName OPTIONAL, ++ -- A human readable name for debugging use ++ -- Support for Transit requests ++ routeName DescriptiveName OPTIONAL, ++ -- A string for transit operations use ++ transitStatus TransitVehicleStatus OPTIONAL, ++ -- current vehicle state (loading, etc.) ++ transitOccupancy TransitVehicleOccupancy OPTIONAL, ++ -- current vehicle occupancy ++ transitSchedule DeltaTime OPTIONAL, ++ -- current vehicle schedule adherence ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, ++ ... ++ } ++ ++RequestorPositionVector ::= SEQUENCE { ++ position Position3D, ++ heading Angle OPTIONAL, ++ speed TransmissionAndSpeed OPTIONAL, ++ ... ++ } ++ ++RequestorType ::= SEQUENCE { ++ -- Defines who is requesting ++ role BasicVehicleRole, -- Basic role of this user at this time ++ subrole RequestSubRole OPTIONAL, -- A local list with role based items ++ ++ -- Defines what kind of request (a level of importance in the Priority Scheme) ++ request RequestImportanceLevel OPTIONAL, -- A local list with request items ++ ++ -- Additional classification details ++ iso3883 Iso3833VehicleType OPTIONAL, ++ hpmsType VehicleType OPTIONAL, -- HPMS classification types ++ ++ regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, ++ ... ++ } ++ ++RestrictionClassAssignment ::= SEQUENCE { ++ id RestrictionClassID, ++ -- the unique value (within an intersection or local region) ++ -- that is assigned to this group of users ++ users RestrictionUserTypeList ++ -- The list of user types/classes ++ -- to which this restriction ID applies ++ } ++ ++RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment ++ ++RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType ++ ++RestrictionUserType ::= CHOICE { ++ basicType RestrictionAppliesTo, ++ -- a set of the most commonly used types ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RestrictionUserType}}, ++ ... ++ } ++ ++RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane ++ ++RoadSegmentReferenceID ::= SEQUENCE { ++ region RoadRegulatorID OPTIONAL, ++ -- a globally unique regional assignment value ++ -- typically assigned to a regional DOT authority ++ -- the value zero shall be used for testing needs ++ id RoadSegmentID ++ -- a unique mapping to the road segment ++ -- in question within the above region of use ++ -- during its period of assignment and use ++ -- note that unlike intersectionID values, ++ -- this value can be reused by the region ++ } ++ ++RoadSegment ::= SEQUENCE { ++ name DescriptiveName OPTIONAL, ++ id RoadSegmentReferenceID, ++ -- a globally unique value for the segment ++ revision MsgCount, ++ -- Required default values about the descriptions to follow ++ refPoint Position3D, -- the reference from which subsequent ++ -- data points are offset until a new ++ -- point is used. ++ laneWidth LaneWidth OPTIONAL, ++ -- Reference width used by all subsequent ++ -- lanes unless a new width is given ++ speedLimits SpeedLimitList OPTIONAL, ++ -- Reference regulatory speed limits ++ -- used by all subsequent ++ -- lanes unless a new speed is given ++ -- See Section 11 for converting and ++ -- translating speed expressed in mph ++ -- into units of m/s ++ ++ -- Data describing disruptions in the RoadSegment ++ -- such as work zones etc will be added here; ++ -- in the US the SAE ITIS codes would be used here ++ -- The details regarding each lane type in the RoadSegment ++ roadLaneSet RoadLaneSetList, ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-RoadSegment}} OPTIONAL, ++ ... ++ } ++ ++RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment ++ ++/*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 { ++ -- These three items serve to uniquely identify the requester ++ -- and the specific request to all parties ++ id VehicleID, ++ request RequestID, ++ sequenceNumber MsgCount, ++ role BasicVehicleRole OPTIONAL, ++ ++ typeData RequestorType OPTIONAL, ++ -- Used when addition data besides the role ++ -- is needed, at which point the role entry ++ -- above is not sent. ++ ... ++ } ++ ++SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage ++ ++SignalRequestPackage ::= SEQUENCE { ++ request SignalRequest, ++ -- The specific request to the intersection ++ -- contains IntersectionID, request type, ++ -- requested action (approach/lane request) ++ ++ -- The Estimated Time of Arrival (ETA) when the service is requested ++ minute MinuteOfTheYear OPTIONAL, ++ second DSecond OPTIONAL, ++ duration DSecond OPTIONAL, ++ -- The duration value is used to provide a short interval that ++ -- extends the ETA so that the requesting vehicle can arrive at ++ -- the point of service with uncertainty or with some desired ++ -- duration of service. This concept can be used to avoid needing ++ -- to frequently update the request. ++ -- The requester must update the ETA and duration values if the ++ -- period of services extends beyond the duration time. ++ -- It should be assumed that if the vehicle does not clear the ++ -- intersection when the duration is reached, the request will ++ -- be cancelled and the intersection will revert to ++ -- normal operation. ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, ++ ... ++ } ++ ++SignalRequest ::= SEQUENCE { ++ -- the unique ID of the target intersection ++ id IntersectionReferenceID, ++ ++ -- The unique requestID used by the requestor ++ requestID RequestID, ++ ++ -- The type of request or cancel for priority or preempt use ++ -- when a prior request is canceled, only the requestID is needed ++ requestType PriorityRequestType, ++ ++ -- In typical use either an approach or a lane number would ++ -- be given, this indicates the requested ++ -- path through the intersection to the degree it is known. ++ inBoundLane IntersectionAccessPoint, ++ -- desired entry approach or lane ++ outBoundLane IntersectionAccessPoint OPTIONAL, ++ -- desired exit approach or lane ++ -- the values zero is used to indicate ++ -- intent to stop within the intersection ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalRequest}} OPTIONAL, ++ ... ++ } ++ ++SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus ++ ++SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage ++ ++SignalStatusPackage ::= SEQUENCE { ++ -- The party that made the initial SRM request ++ requester SignalRequesterInfo OPTIONAL, ++ -- The lanes or approaches used in the request ++ inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle ++ outboundOn IntersectionAccessPoint OPTIONAL, ++ ++ -- The Estimated Time of Arrival (ETA) when the service is requested ++ -- This data echos the data of the request ++ minute MinuteOfTheYear OPTIONAL, ++ second DSecond OPTIONAL, ++ duration DSecond OPTIONAL, ++ ++ -- the SRM status for this request ++ status PrioritizationResponseStatus, ++ -- Status of request, this may include rejection ++ ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, ++ ... ++ } ++ ++SignalStatus ::= SEQUENCE { ++ sequenceNumber MsgCount, ++ -- changed whenever the below contents have change ++ id IntersectionReferenceID, ++ -- this provides a unique mapping to the ++ -- intersection map in question ++ -- which provides complete location ++ -- and approach/movement/lane data ++ -- as well as zones for priority/preemption ++ sigStatus SignalStatusPackageList, ++ -- a list of detailed status containing all ++ -- priority or preemption state data, both ++ -- active and pending, and who requested it ++ -- requests which are denied are also listed ++ -- here for a short period of time ++ regional SEQUENCE (SIZE(1..4)) OF ++ RegionalExtension {{Reg-SignalStatus}} OPTIONAL, ++ ... ++ } ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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, ++ ... ++ } ++*/ ++ ++TimeChangeDetails ::= SEQUENCE { ++ startTime TimeMark OPTIONAL, ++ -- When this phase 1st started ++ minEndTime TimeMark, ++ -- Expected shortest end time ++ maxEndTime TimeMark OPTIONAL, ++ -- Expected longest end time ++ ++ likelyTime TimeMark OPTIONAL, ++ -- Best predicted value based on other data ++ confidence TimeIntervalConfidence OPTIONAL, ++ -- Applies to above time element only ++ ++ nextTime TimeMark OPTIONAL ++ -- A rough estimate of time when ++ -- this phase may next occur again ++ -- used to support various ECO driving power ++ -- management needs. ++ } ++ ++TimeMark ::= INTEGER (0..36001) ++ -- Tenths of a second in the current or next hour ++ -- In units of 1/10th second from UTC time ++ -- A range of 0~36000 covers one hour ++ -- The values 35991..36000 are used when a leap second occurs ++ -- The value 36001 is used to indicate time >3600 seconds ++ -- 36002 is to be used when value undefined or unknown ++ -- Note that this is NOT expressed in GPS time ++ -- or in local time ++ ++TransmissionAndSpeed ::= SEQUENCE { ++ transmisson TransmissionState, ++ speed Velocity ++ } ++ ++VehicleID ::= CHOICE { ++ entityID TemporaryID, ++ stationID StationID ++ } ++ ++ ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++-- Start of entries from table Data_Elements... ++-- This table typicaly contains data element entries. ++-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ++-- ++ ++AdvisorySpeedType ::= ENUMERATED { ++ none (0), ++ greenwave (1), ++ ecoDrive (2), ++ transit (3), ++ ... ++ } -- Note: subject to further growth ++ ++AllowedManeuvers ::= BIT STRING { ++ -- With bits as defined: ++ -- Allowed maneuvers at path end (stop line) ++ -- All maneuvers with bits not set are therefore prohibited ! ++ -- A value of zero shall be used for unknown, indicating no Maneuver ++ maneuverStraightAllowed (0), ++ -- a Straight movement is allowed in this lane ++ maneuverLeftAllowed (1), ++ -- a Left Turn movement is allowed in this lane ++ maneuverRightAllowed (2), ++ -- a Right Turn movement is allowed in this lane ++ maneuverUTurnAllowed (3), ++ -- a U turn movement is allowed in this lane ++ maneuverLeftTurnOnRedAllowed (4), ++ -- a Stop, and then proceed when safe movement ++ -- is allowed in this lane ++ maneuverRightTurnOnRedAllowed (5), ++ -- a Stop, and then proceed when safe movement ++ -- is allowed in this lane ++ maneuverLaneChangeAllowed (6), ++ -- a movement which changes to an outer lane ++ -- on the egress side is allowed in this lane ++ -- (example: left into either outbound lane) ++ maneuverNoStoppingAllowed (7), ++ -- the vehicle should not stop at the stop line ++ -- (example: a flashing green arrow) ++ yieldAllwaysRequired (8), ++ -- the allowed movements above are not protected ++ -- (example: an permanent yellow condition) ++ goWithHalt (9), ++ -- after making a full stop, may proceed ++ caution (10), ++ -- proceed past stop line with caution ++ reserved1 (11) ++ -- used to align to 12 Bit Field ++ ++ } (SIZE(12)) ++ ++Angle ::= INTEGER (0..28800) ++ -- LSB of 0.0125 degrees ++ -- A range of 0 to 359.9875 degrees ++ ++ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown ++ ++BasicVehicleRole ::= ENUMERATED { ++ -- Values used in the EU and in the US ++ basicVehicle (0), -- Light duty passenger vehicle type ++ publicTransport (1), -- Used in EU for Transit us ++ specialTransport (2), -- Used in EU (e.g. heavy load) ++ dangerousGoods (3), -- Used in EU for any HAZMAT ++ roadWork (4), -- Used in EU for State and Local DOT uses ++ roadRescue (5), -- Used in EU and in the US to include tow trucks. ++ emergency (6), -- Used in EU for Police, Fire and Ambulance units ++ safetyCar (7), -- Used in EU for Escort vehicles ++ -- Begin US unique numbering ++ none-unknown (8), -- added to follow current SAE style guidelines ++ truck (9), -- Heavy trucks with additional BSM rights and obligations ++ motorcycle (10), -- ++ roadSideSource (11), -- For infrastructure generated calls such as ++ -- fire house, rail infrastructure, roadwork site, etc. ++ police (12), -- ++ fire (13), -- ++ ambulance (14), -- (does not include private para-transit etc.) ++ dot (15), -- all roadwork vehicles ++ transit (16), -- all transit vehicles ++ slowMoving (17), -- to also include oversize etc. ++ stopNgo (18), -- to include trash trucks, school buses and others ++ -- that routinely disturb the free flow of traffic ++ cyclist (19), -- ++ pedestrian (20), -- also includes those with mobility limitations ++ nonMotorized (21), -- other, horse drawn, etc. ++ military (22), -- ++ ... ++ } ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++DescriptiveName ::= IA5String (SIZE(1..63)) ++ ++DrivenLineOffsetLg ::= INTEGER (-32767..32767) ++ -- LSB units are 1 cm. ++ ++DrivenLineOffsetSm ::= INTEGER (-2047..2047) ++ -- LSB units are 1 cm. ++ ++DSecond ::= INTEGER (0..65535) -- units of milliseconds ++ ++DSRCmsgID ::= INTEGER (0..32767) ++ mapData DSRCmsgID ::= 18 -- MAP, intersections ++ signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT ++ signalRequestMessage DSRCmsgID ::= 29 -- SRM ++ signalStatusMessage DSRCmsgID ::= 30 -- SSM ++ ++Elevation ::= INTEGER (-4096..61439) ++ -- In units of 10 cm steps above or below the reference ellipsoid ++ -- Providing a range of -409.5 to + 6143.9 meters ++ -- The value -4096 shall be used when Unknown is to be sent ++ ++IntersectionID ::= INTEGER (0..65535) ++ -- The values zero through 255 are allocated for testing purposes ++ -- Note that the value assigned to an intersection will be ++ -- unique within a given regional ID only ++ ++IntersectionStatusObject ::= BIT STRING { ++ manualControlIsEnabled (0), ++ -- Timing reported is per programmed values, etc. but person ++ -- at cabinet can manually request that certain intervals are ++ -- terminated early (e.g. green). ++ stopTimeIsActivated (1), ++ -- And all counting/timing has stopped. ++ failureFlash (2), ++ -- Above to be used for any detected hardware failures, ++ -- e.g. conflict monitor as well as for police flash ++ preemptIsActive (3), ++ signalPriorityIsActive (4), ++ ++ -- Additional states ++ fixedTimeOperation (5), ++ -- Schedule of signals is based on time only ++ -- (i.e. the state can be calculated) ++ trafficDependentOperation (6), ++ -- Operation is based on different levels of traffic parameters ++ -- (requests, duration of gaps or more complex parameters) ++ standbyOperation (7), ++ -- Controller: partially switched off or partially amber flashing ++ failureMode (8), ++ -- Controller has a problem or failure in operation ++ off (9), ++ -- Controller is switched off ++ ++ -- Related to MAP and SPAT bindings ++ recentMAPmessageUpdate (10), ++ -- Map revision with content changes ++ recentChangeInMAPassignedLanesIDsUsed (11), ++ -- Change in MAP's assigned lanes used (lane changes) ++ -- Changes in the active lane list description ++ noValidMAPisAvailableAtThisTime (12), ++ -- MAP (and various lanes indexes) not available ++ noValidSPATisAvailableAtThisTime (13) ++ -- SPAT system is not working at this time ++ ++ -- Bits 14,15 reserved at this time and shall be zero ++ } (SIZE(16)) ++ ++ ++LaneAttributes-Barrier ::= BIT STRING { ++ -- With bits as defined: ++ median-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ median (1), ++ whiteLineHashing (2), ++ stripedLines (3), ++ doubleStripedLines (4), ++ trafficCones (5), ++ constructionBarrier (6), ++ trafficChannels (7), ++ lowCurbs (8), ++ highCurbs (9) ++ -- Bits 10~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Bike ::= BIT STRING { ++ -- With bits as defined: ++ bikeRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ pedestrianUseAllowed (1), ++ -- The path allows pedestrian traffic, ++ -- if not set, this mode is prohibited ++ isBikeFlyOverLane (2), ++ -- path of lane is not at grade ++ fixedCycleTime (3), ++ -- the phases use preset times ++ -- i.e. there is not a 'push to cross' button ++ biDirectionalCycleTimes (4), ++ -- ped walk phases use different SignalGroupID ++ -- for each direction. The first SignalGroupID ++ -- in the first Connection represents 'inbound' ++ -- flow (the direction of travel towards the first ++ -- node point) while second SignalGroupID in the ++ -- next Connection entry represents the 'outbound' ++ -- flow. And use of RestrictionClassID entries ++ -- in the Connect follow this same pattern in pairs. ++ isolatedByBarrier (5), ++ unsignalizedSegmentsPresent (6) ++ -- The lane path consists of one of more segments ++ -- which are not part of a signal group ID ++ ++ -- Bits 7~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Crosswalk ::= BIT STRING { ++ -- With bits as defined: ++ -- MUTCD provides no suitable "types" to use here ++ crosswalkRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ bicyleUseAllowed (1), ++ -- The path allows bicycle traffic, ++ -- if not set, this mode is prohibited ++ isXwalkFlyOverLane (2), ++ -- path of lane is not at grade ++ fixedCycleTime (3), ++ -- ped walk phases use preset times ++ -- i.e. there is not a 'push to cross' button ++ biDirectionalCycleTimes (4), ++ -- ped walk phases use different SignalGroupID ++ -- for each direction. The first SignalGroupID ++ -- in the first Connection represents 'inbound' ++ -- flow (the direction of travel towards the first ++ -- node point) while second SignalGroupID in the ++ -- next Connection entry represents the 'outbound' ++ -- flow. And use of RestrictionClassID entries ++ -- in the Connect follow this same pattern in pairs. ++ hasPushToWalkButton (5), ++ -- Has a demand input ++ audioSupport (6), ++ -- audio crossing cues present ++ rfSignalRequestPresent (7), ++ -- Supports RF push to walk technologies ++ unsignalizedSegmentsPresent (8) ++ -- The lane path consists of one of more segments ++ -- which are not part of a signal group ID ++ -- Bits 9~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Parking ::= BIT STRING { ++ -- With bits as defined: ++ -- Parking use details, note that detailed restrictions such as ++ -- allowed hours are sent by way of ITIS codes in the TIM message ++ parkingRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ parallelParkingInUse (1), ++ headInParkingInUse (2), ++ doNotParkZone (3), ++ -- used to denote fire hydrants as well as ++ -- short disruptions in a parking zone ++ parkingForBusUse (4), ++ parkingForTaxiUse (5), ++ noPublicParkingUse (6) ++ -- private parking, as in front of ++ -- private property ++ -- Bits 7~15 reserved and set to zero ++ } (SIZE (16)) ++ ++LaneAttributes-Sidewalk ::= BIT STRING { ++ -- With bits as defined: ++ sidewalk-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ bicyleUseAllowed (1), ++ -- The path allows bicycle traffic, ++ -- if not set, this mode is prohibited ++ isSidewalkFlyOverLane (2), ++ -- path of lane is not at grade ++ walkBikes (3) ++ -- bike traffic must dismount and walk ++ -- Bits 4~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-Striping ::= BIT STRING { ++ -- With bits as defined: ++ stripeToConnectingLanesRevocableLane (0), ++ -- this lane may be activated or not activated based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ stripeDrawOnLeft (1), ++ stripeDrawOnRight (2), ++ -- which side of lane to mark ++ stripeToConnectingLanesLeft (3), ++ stripeToConnectingLanesRight (4), ++ stripeToConnectingLanesAhead (5) ++ -- the stripe type should be ++ -- presented to the user visually ++ -- to reflect stripes in the ++ -- intersection for the type of ++ -- movement indicated ++ -- Bits 6~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-TrackedVehicle ::= BIT STRING { ++ -- With bits as defined: ++ spec-RevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ spec-commuterRailRoadTrack (1), ++ spec-lightRailRoadTrack (2), ++ spec-heavyRailRoadTrack (3), ++ spec-otherRailType (4) ++ -- Bits 5~15 reserved and set to zero ++ } (SIZE (16)) ++ ++ ++LaneAttributes-Vehicle ::= BIT STRING { ++ -- With bits as defined: ++ isVehicleRevocableLane (0), ++ -- this lane may be activated or not based ++ -- on the current SPAT message contents ++ -- if not asserted, the lane is ALWAYS present ++ isVehicleFlyOverLane (1), ++ -- path of lane is not at grade ++ hovLaneUseOnly (2), ++ restrictedToBusUse (3), ++ restrictedToTaxiUse (4), ++ restrictedFromPublicUse (5), ++ hasIRbeaconCoverage (6), ++ permissionOnRequest (7) -- e.g. to inform about a lane for e-cars ++ ++ } (SIZE (8,...)) ++ ++LaneConnectionID ::= INTEGER (0..255) ++ ++LaneDirection ::= BIT STRING { ++ -- With bits as defined: ++ -- Allowed directions of travel in the lane object ++ -- All lanes are described from the stop line outwards ++ ingressPath (0), ++ -- travel from rear of path to front ++ -- is allowed ++ egressPath (1) ++ -- travel from front of path to rear ++ -- is allowed ++ -- Notes: No Travel, i.e. the lane object type does not support ++ -- travel (medians, curbs, etc.) is indicated by not ++ -- asserting any bit value ++ -- Bi-Directional Travel (such as a ped crosswalk) is ++ -- indicated by asserting both of the bits ++ } (SIZE (2)) ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++LaneID ::= INTEGER (0..255) ++ -- the value 0 shall be used when the lane ID is ++ -- not available or not known ++ -- the value 255 is reserved for future use ++*/ ++ ++LayerID ::= INTEGER (0..100) ++ ++LayerType ::= ENUMERATED { ++ none, ++ mixedContent, -- two or more of the below types ++ generalMapData, ++ intersectionData, ++ curveData, ++ roadwaySectionData, ++ parkingAreaData, ++ sharedLaneData, ++ ... ++ } ++ ++LaneWidth ::= INTEGER (0..32767) -- units of 1 cm ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++MinuteOfTheYear ::= INTEGER (0..527040) ++ -- the value 527040 shall be used for invalid ++ ++MovementPhaseState ::= ENUMERATED { ++ -- Note that based on the regions and the operating mode not every ++ -- phase will be used in all transportation modes and that not ++ -- every phase will be used in all transportation modes ++ ++ unavailable (0), ++ -- This state is used for unknown or error ++ dark (1), ++ -- The signal head is dark (unlit) ++ ++ -- Reds ++ stop-Then-Proceed (2), ++ -- Often called 'flashing red' in US ++ -- Driver Action: ++ -- Stop vehicle at stop line. ++ -- Do not proceed unless it is safe. ++ -- Note that the right to proceed either right or left when ++ -- it is safe may be contained in the lane description to ++ -- handle what is called a 'right on red' ++ stop-And-Remain (3), ++ -- e.g. called 'red light' in US ++ -- Driver Action: ++ -- Stop vehicle at stop line. ++ -- Do not proceed. ++ -- Note that the right to proceed either right or left when ++ -- it is safe may be contained in the lane description to ++ -- handle what is called a 'right on red' ++ ++ -- Greens ++ pre-Movement (4), ++ -- Not used in the US, red+yellow partly in EU ++ -- Driver Action: ++ -- Stop vehicle. ++ -- Prepare to proceed (pending green) ++ -- (Prepare for transition to green/go) ++ permissive-Movement-Allowed (5), ++ -- Often called 'permissive green' in US ++ -- Driver Action: ++ -- Proceed with caution, ++ -- must yield to all conflicting traffic ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ protected-Movement-Allowed (6), ++ -- Often called 'protected green' in US ++ -- Driver Action: ++ -- Proceed, tossing caution to the wind, ++ -- in indicated (allowed) direction. ++ ++ -- Yellows / Ambers ++ -- The vehicle is not allowed to cross the stop bar if it is possible ++ -- to stop without danger. ++ permissive-clearance (7), ++ -- Often called 'permissive yellow' in US ++ -- Driver Action: ++ -- Prepare to stop. ++ -- Proceed if unable to stop, ++ -- Clear Intersection. ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ protected-clearance (8), ++ -- Often called 'protected yellow' in US ++ -- Driver Action: ++ -- Prepare to stop. ++ -- Proceed if unable to stop, ++ -- in indicated direction (to connected lane) ++ -- Clear Intersection. ++ ++ caution-Conflicting-Traffic (9) ++ -- Often called 'flashing yellow' in US ++ -- Often used for extended periods of time ++ -- Driver Action: ++ -- Proceed with caution, ++ -- Conflicting traffic may be present ++ -- in the intersection conflict area ++ } ++ -- The above number assignments are not used with UPER encoding ++ -- and are only to be used with DER or implicit encoding ++ ++MsgCount ::= INTEGER (0..127) ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++PedestrianBicycleDetect ::= BOOLEAN ++ -- true if ANY Pedestrians or Bicyclists are ++ -- detected crossing the target lane or lanes ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++ ... ++} ++*/ ++ ++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 -- 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 ++*/ ++ ++RequestID ::= INTEGER (0..255) ++ ++RequestImportanceLevel ::= ENUMERATED { ++ requestImportanceLevelUnKnown (0), ++ requestImportanceLevel1 (1), -- The least important request ++ requestImportanceLevel2 (2), -- The values here shall be assigned ++ requestImportanceLevel3 (3), -- Meanings based on regional needs ++ requestImportanceLevel4 (4), -- for each of the basic roles which ++ requestImportanceLevel5 (5), -- are defined elsewhere ++ requestImportanceLevel6 (6), ++ requestImportanceLevel7 (7), ++ requestImportanceLevel8 (8), ++ requestImportanceLevel9 (9), ++ requestImportanceLevel10 (10), ++ requestImportanceLevel11 (11), ++ requestImportanceLevel12 (12), ++ requestImportanceLevel13 (13), ++ requestImportanceLevel14 (14), -- The most important request ++ requestImportanceReserved (15) -- Reserved for future use ++ } ++ ++RequestSubRole ::= ENUMERATED { ++ requestSubRoleUnKnown (0), ++ requestSubRole1 (1), -- The first type of sub role ++ requestSubRole2 (2), -- The values here shall be assigned ++ requestSubRole3 (3), -- Meanings based on regional needs ++ requestSubRole4 (4), -- to refine and expand the basic ++ requestSubRole5 (5), -- roles which are defined elsewhere ++ requestSubRole6 (6), ++ requestSubRole7 (7), ++ requestSubRole8 (8), ++ requestSubRole9 (9), ++ requestSubRole10 (10), ++ requestSubRole11 (11), ++ requestSubRole12 (12), ++ requestSubRole13 (13), ++ requestSubRole14 (14), -- The last type of sub role ++ requestSubRoleReserved (15) -- Reserved for future use ++ } ++ ++RestrictionAppliesTo ::= ENUMERATED { ++ none, -- applies to nothing ++ equippedTransit, -- buses etc. ++ equippedTaxis, ++ equippedOther, -- other vehicle types with ++ -- necessary signal phase state ++ -- reception equipment ++ emissionCompliant, -- regional variants with more ++ -- definitive items also exist ++ equippedBicycle, ++ weightCompliant, ++ heightCompliant, ++ -- Items dealing with traveler needs serviced by the infrastructure ++ -- These end users (which are not vehicles) are presumed to be suitably equipped ++ pedestrians, ++ slowMovingPersons, ++ wheelchairUsers, ++ visualDisabilities, ++ audioDisabilities, -- hearing ++ otherUnknownDisabilities, ++ ... ++ } ++ ++RestrictionClassID ::= INTEGER (0..255) ++ -- An index value to identify data about classes of users ++ -- the value used varies with each intersection's ++ -- needs and is defined in the map to the assigned ++ -- classes of supported users. ++ ++RoadRegulatorID ::= INTEGER (0..65535) ++ -- The value zero shall be used for testing only ++ ++RoadSegmentID ::= INTEGER (0..65535) ++ -- The values zero to 255 shall be used for testing only ++ -- Note that the value assigned to an RoadSegment will be ++ -- unique within a given regional ID only during its use ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++*/ ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++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 ++ ... ++ } ++*/ ++ ++SpeedAdvice ::= INTEGER (0..500) ++ -- LSB units are 0.1 m/s^2 ++ -- the value 499 shall be used for values at or greater than 49.9 m/s ++ -- the value 500 shall be used to indicate that speed is unavailable ++ ++TemporaryID ::= OCTET STRING (SIZE(4)) ++ ++TimeIntervalConfidence ::= INTEGER (0..15) ++ -- Value Probability ++ -- 0 21% ++ -- 1 36% ++ -- 2 47% ++ -- 3 56% ++ -- 4 62% ++ -- 5 68% ++ -- 6 73% ++ -- 7 77% ++ -- 8 81% ++ -- 9 85% ++ -- 10 88% ++ -- 11 91% ++ -- 12 94% ++ -- 13 96% ++ -- 14 98% ++ -- 15 100% ++ ++TransitVehicleOccupancy ::= ENUMERATED { ++ occupancyUnknown (0), ++ occupancyEmpty (1), ++ occupancyVeryLow (2), ++ occupancyLow (3), ++ occupancyMed (4), ++ occupancyHigh (5), ++ occupancyNearlyFull (6), ++ occupancyFull (7) ++ } ++ ++TransitVehicleStatus ::= BIT STRING { ++ loading (0), -- parking and unable to move at this time ++ anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) ++ aBikeLoad (2), -- loading of a bicycle is in progress ++ doorOpen (3), -- a vehicle door is open for passenger access ++ charging (4), -- a vehicle is connected to charging point ++ atStopLine (5) -- a vehicle is at the stop line for the lane it is in ++ } (SIZE(8)) ++ ++TransmissionState ::= ENUMERATED { ++ neutral (0), -- Neutral ++ park (1), -- Park ++ forwardGears (2), -- Forward gears ++ reverseGears (3), -- Reverse gears ++ reserved1 (4), ++ reserved2 (5), ++ reserved3 (6), ++ unavailable (7) -- not-equipped or unavailable value, ++ -- Any related speed is relative to the vehicle reference frame used ++ } ++ ++VehicleType ::= ENUMERATED { ++ none (0), -- Not Equipped, Not known or unavailable ++ unknown (1), -- Does not fit any other category ++ special (2), -- Special use ++ moto (3), -- Motorcycle ++ car (4), -- Passenger car ++ carOther (5), -- Four tire single units ++ bus (6), -- Buses ++ axleCnt2 (7), -- Two axle, six tire single units ++ axleCnt3 (8), -- Three axle, single units ++ axleCnt4 (9), -- Four or more axle, single unit ++ axleCnt4Trailer (10), -- Four or less axle, single trailer ++ axleCnt5Trailer (11), -- Five or less axle, single trailer ++ axleCnt6Trailer (12), -- Six or more axle, single trailer ++ axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer ++ axleCnt6MultiTrailer (14), -- Six axle, multi-trailer ++ axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer ++ ... ++ } ++ ++/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop ++Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s ++ -- The value 8191 indicates that ++ -- velocity is unavailable ++*/ ++ ++WaitOnStopline ::= BOOLEAN -- ++ -- True or False ++ -- If "true", the vehicles on this specific connecting ++ -- maneuver have to stop on the stop-line ++ -- and not to enter the collision area ++ ++ZoneLength ::= INTEGER (0..10000) ++ -- Unit = 1 meter, 0 = unknown, ++ -- The value 10000 to be used for Distances >=10000 m ++ -- (e.g. from known point to another point along a ++ -- known path, often against traffic flow direction ++ -- when used for measuring queues) ++ ++END + +Property changes on: IS/IS_DSRC.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/IS_DSRC_REGION_noCircular.asn +=================================================================== +--- IS/IS_DSRC_REGION_noCircular.asn (nonexistent) ++++ IS/IS_DSRC_REGION_noCircular.asn (working copy) +@@ -0,0 +1,419 @@ ++--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: DSRC ++-- ISO TS 19091 Oct 2015 v0909 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++--FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files ++IS-DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } ++ ++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 (1) } ++ ++Control-addGrpC FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) }; ++ ++------------------------------------------------------ ++--FIXME RGY BELOW ARE DEFINITIONS MOVED FROM IS-DSRC ++------------------------------------------------------ ++ ++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 ++ ++LaneID ::= INTEGER (0..255) ++ -- the value 0 shall be used when the lane ID is ++ -- not available or not known ++ -- the value 255 is reserved for future use ++ ++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-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 ::= { ++ {Control-addGrpC IDENTIFIED BY addGrpC} , ++ ... ++} ++END + +Property changes on: IS/IS_DSRC_REGION_noCircular.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/IS_REGION.asn +=================================================================== +--- IS/IS_REGION.asn (nonexistent) ++++ IS/IS_REGION.asn (working copy) +@@ -0,0 +1,110 @@ ++--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn ++ ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++-- ++-- module: REGION ++-- TS 19091 Oct 2015 v0909 ++-- ++-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ++--FIXME RGY renamed from REGION, as module REGION already exists in MAP-SPAT ++IS-REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } ++ ++DEFINITIONS AUTOMATIC TAGS::= BEGIN ++ ++IMPORTS ++--FIXME RGY definitions moved to non-circularity module ++--addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC ++addGrpC, REG-EXT-ID-AND-TYPE FROM IS-DSRC-REGION-noCircular ++--FIXME RGY Control-addGrpC has been moced to a non-circularity module ++Control-addGrpC FROM AddGrpC-noCircular ++ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*Control-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, ++SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; ++ ++ ++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 ::= { ... } ++ ++/*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 ::= { ... } ++ ++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 ::= { ++ {Control-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 ::= { ... } ++ ++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-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 + +Property changes on: IS/IS_REGION.asn +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property +Added: svn:keywords +## -0,0 +1 ## ++URL Id +\ No newline at end of property +Added: svn:mime-type +## -0,0 +1 ## ++text/plain +\ No newline at end of property +Index: IS/ISO_TS_19091.asn +=================================================================== +--- IS/ISO_TS_19091.asn (revision 1297) ++++ IS/ISO_TS_19091.asn (nonexistent) +@@ -1,2077 +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 +--- +--- It includes the addendunm extensions for Addgrp-C (e.g. Europe) +--- +--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: AddGrpC +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } +- +- +-DEFINITIONS AUTOMATIC TAGS::= BEGIN +- +-IMPORTS +-NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC +-Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +- +- +-ConnectionManeuverAssist-addGrpC ::= SEQUENCE { +- itsStationPositions ItsStationPositionList OPTIONAL, +- rsuGNSSOffset NodeOffsetPointXY OPTIONAL, +- ... +-} +- +-ConnectionTrajectory-addGrpC ::= SEQUENCE { +- nodes NodeSetXY, +- ... +-} +- +-Control-addGrpC ::= SEQUENCE { +- ptvRequest PtvRequestType, +- ... +-} +- +-IntersectionState-addGrpC ::= SEQUENCE { +- activePrioritizations PrioritizationResponseList OPTIONAL, +- ... +-} +- +-MapData-addGrpC ::= SEQUENCE { +- signalHeadLocations SignalHeadLocationList OPTIONAL, +- ... +-} +- +-Position3D-addGrpC ::= SEQUENCE { +- altitude Altitude, +- ... +-} +- +-PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse +- +-PrioritizationResponse ::= SEQUENCE { +- stationID StationID, +- priorState PrioritizationResponseStatus, +- signalGroup SignalGroupID, +- ... +-} +- +-RestrictionUserType-addGrpC ::= SEQUENCE { +- emission EmissionType OPTIONAL, +- ... +-} +- +-SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation +- +-SignalHeadLocation ::= SEQUENCE { +- nodeXY NodeOffsetPointXY, +- nodeZ DeltaAltitude, +- signalGroupID SignalGroupID, +- ... +-} +- +-SignalStatusPackage-addGrpC ::= SEQUENCE { +- synchToSchedule DeltaTime OPTIONAL, +- ... +-} +- +- +-ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition +- +-ItsStationPosition ::= SEQUENCE { +- stationID StationID, +- laneID LaneID OPTIONAL, +- nodeXY NodeOffsetPointXY OPTIONAL, +- timeReference TimeReference OPTIONAL, +- ... +-} +-EmissionType ::= ENUMERATED { +- euro1, +- euro2, +- euro3, +- euro4, +- euro5, +- euro6, +- ... +-} +- +-PtvRequestType ::= ENUMERATED { +- preRequest, +- mainRequest, +- doorCloseRequest, +- cancelRequest, +- emergencyRequest, +- ... +-} +- +-TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) +- +-END +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: REGION +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } +- +-DEFINITIONS AUTOMATIC TAGS::= BEGIN +- +-IMPORTS +-addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC +-ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, Control-addGrpC, Position3D-addGrpC, RestrictionUserType-addGrpC, +-SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; +- +-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 ::= { ... } +- +-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 ::= { ... } +- +-Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } +- +-Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } +- +-Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { +- {Control-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 ::= { ... } +- +-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-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 +- +- +- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--- +--- module: DSRC +--- +--- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +- +-DEFINITIONS AUTOMATIC TAGS::= BEGIN +- +-IMPORTS +-StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +-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 FROM REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} +-Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1) }; +- +--- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +--- +--- 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 +- } +- +- +--- 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} ) +- } +- +-SPAT ::= SEQUENCE { +- timeStamp MinuteOfTheYear OPTIONAL, +- name DescriptiveName OPTIONAL, +- -- human readable name for this collection +- -- to be used only in debug mode +- +- intersections IntersectionStateList, +- -- sets of SPAT data (one per intersection) +- +- -- If PrioritizationResponse data is required, it is found +- -- in the RegionalSPAT entry below +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SPAT}} OPTIONAL, +- ... +- } +- +-SignalRequestMessage ::= SEQUENCE { +- timeStamp MinuteOfTheYear OPTIONAL, +- second DSecond, +- sequenceNumber MsgCount OPTIONAL, +- +- requests SignalRequestList OPTIONAL, +- -- Request Data for one or more signalized +- -- intersections that support SRM dialogs +- +- requestor RequestorDescription, +- -- Requesting Device and other User Data +- -- contains vehicle ID (if from a vehicle) +- -- as well as type data and current position +- -- and may contain additional transit data +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, +- ... +-} +- +-SignalStatusMessage ::= SEQUENCE { +- timeStamp MinuteOfTheYear OPTIONAL, +- second DSecond, +- sequenceNumber MsgCount OPTIONAL, +- +- -- Status Data for one of more signalized intersections +- status SignalStatusList, +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, +- ... +-} +- +-MapData ::= SEQUENCE { +- timeStamp MinuteOfTheYear OPTIONAL, +- msgIssueRevision MsgCount, +- layerType LayerType OPTIONAL, +- layerID LayerID OPTIONAL, +- intersections IntersectionGeometryList OPTIONAL, +- -- All Intersection definitions +- roadSegments RoadSegmentList OPTIONAL, +- -- All roadway descriptions +- +- dataParameters DataParameters OPTIONAL, +- -- Any meta data regarding the map contents +- +- restrictionList RestrictionClassList OPTIONAL, +- -- Any restriction ID tables which have +- -- established for these map entries +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-MapData}} OPTIONAL, +- +- -- NOTE: +- -- Other map data will be added here as it is defined +- -- Examples of the type of content to be added include +- -- curve warnings, construction routes, etc. +- ... +-} +- +- +--- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +--- +--- Start of entries from table Data_Frames... +--- This table typicaly contains data frame entries. +--- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +--- +- +-AdvisorySpeed ::= SEQUENCE { +- type AdvisorySpeedType, +- -- the type of advisory which this is. +- speed SpeedAdvice OPTIONAL, +- -- See Section 11 for converting and translating speed +- -- expressed in mph into units of m/s +- -- This element is optional ONLY when superceded +- -- by the presence of a regional speed element found in +- -- Reg-AdvisorySpeed entry +- confidence SpeedConfidence OPTIONAL, +- -- A confidence value for the above speed +- distance ZoneLength OPTIONAL, +- -- Unit = 1 meter, +- -- The distance indicates the region for which the advised speed +- -- is recommended, it is specified upstream from the stop bar +- -- along the connected egressing lane +- class RestrictionClassID OPTIONAL, +- -- the vehicle types to which it applies +- -- when absent, the AdvisorySpeed applies to +- -- all motor vehicle types +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, +- ... +- } +- +-AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed +- +-ComputedLane ::= SEQUENCE { +- -- Data needed to created a computed lane +- referenceLaneId LaneID, +- -- the lane ID upon which this +- -- computed lane will be based +- -- Lane Offset in X and Y direction +- offsetXaxis CHOICE { +- small DrivenLineOffsetSm, +- large DrivenLineOffsetLg +- }, +- offsetYaxis CHOICE { +- small DrivenLineOffsetSm, +- large DrivenLineOffsetLg +- }, +- -- A path X offset value for translations of the +- -- path's points when creating translated lanes. +- -- The values found in the reference lane are +- -- all offset based on the X and Y values from +- -- the coordinates of the reference lane's +- -- initial path point. +- -- Lane Rotation +- rotateXY Angle OPTIONAL, +- -- A path rotation value for the entire lane +- -- Observe that this rotates the existing orientation +- -- of the referenced lane, it does not replace it. +- -- Rotation occurs about the initial path point. +- -- Lane Path Scale (zooming) +- scaleXaxis Scale-B12 OPTIONAL, +- scaleYaxis Scale-B12 OPTIONAL, +- -- value for translations or zooming of the path's +- -- points. The values found in the reference lane +- -- are all expanded or contracted based on the X +- -- and Y and width values from the coordinates of +- -- the reference lane's initial path point. +- -- The Z axis remains untouched. +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-ComputedLane}} OPTIONAL, +- ... +- } +-ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection +- +-ConnectingLane ::= SEQUENCE { +- lane LaneID, -- Index of the connecting lane +- maneuver AllowedManeuvers OPTIONAL +- -- The Maneuver between +- -- the enclosing lane and this lane +- -- at the stop line to connect them +- } +- +- +-Connection ::= SEQUENCE { +- -- The subject lane connecting to this lane is: +- connectingLane ConnectingLane, +- -- The index of the connecting lane and also +- -- the maneuver from the current lane to it +- remoteIntersection IntersectionReferenceID OPTIONAL, +- -- This entry is only used when the +- -- indicated connecting lane belongs +- -- to another intersection layout. This +- -- provides a means to create meshes of lanes +- +- -- SPAT mapping details at the stop line are: +- signalGroup SignalGroupID OPTIONAL, +- -- The matching signal group send by +- -- the SPAT message for this lane/maneuver. +- -- Shall be present unless the connectingLane +- -- has no signal group (is un-signalized) +- userClass RestrictionClassID OPTIONAL, +- -- The Restriction Class of users this applies to +- -- The use of some lane/maneuver and SignalGroupID +- -- pairings are restricted to selected users. +- -- When absent, the SignalGroupID applies to all +- +- -- Movement assist details are given by: +- connectionID LaneConnectionID OPTIONAL +- -- An optional connection index used to +- -- relate this lane connection to any dynamic +- -- clearance data in the SPAT. Note that +- -- the index may be shared with other +- -- connections if the clearance data is common +- } +- +- +-ConnectionManeuverAssist ::= SEQUENCE { +- connectionID LaneConnectionID, +- -- the common connectionID used by all lanes to which +- -- this data applies +- -- (this value traces to ConnectsTo entries in lanes) +- -- Expected Clearance Information +- queueLength ZoneLength OPTIONAL, +- -- Unit = 1 meter, 0 = no queue +- -- The distance from the stop line to the back +- -- edge of the last vehicle in the queue, +- -- as measured along the lane center line. +- availableStorageLength ZoneLength OPTIONAL, +- -- Unit = 1 meter, 0 = no space remains +- -- Distance (e.g. beginning from the downstream +- -- stop-line up to a given distance) with a high +- -- probability for successfully executing the +- -- connecting maneuver between the two lanes +- -- during the current cycle. +- -- Used for enhancing the awareness of vehicles +- -- to anticipate if they can pass the stop line +- -- of the lane. Used for optimizing the green wave, +- -- due to knowledge of vehicles waiting in front +- -- of a red light (downstream). +- -- The element nextTime in TimeChangeDetails +- -- in the containing data frame contains the next +- -- timemark at which an active phase is expected, +- -- a form of storage flush interval. +- waitOnStop WaitOnStopline OPTIONAL, +- -- If "true", the vehicles on this specific connecting +- -- maneuver have to stop on the stop-line and not +- -- to enter the collision area +- pedBicycleDetect PedestrianBicycleDetect OPTIONAL, +- -- true if ANY ped or bicycles are detected crossing +- -- the above lanes. Set to false ONLY if there is a +- -- high certainty that there are none present, +- -- otherwise element is not sent. +- 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, +- ... +- } +- +-EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID +- -- The unique ID numbers for each +- -- lane object which is 'active' +- -- as part of the dynamic map contents. +- +-GenericLane ::= SEQUENCE { +- laneID LaneID, +- -- The unique ID number assigned +- -- to this lane object +- name DescriptiveName OPTIONAL, +- -- often for debug use only +- -- but at times used to name ped crossings +- ingressApproach ApproachID OPTIONAL, -- inbound +- egressApproach ApproachID OPTIONAL, -- outbound +- -- Approach IDs to which this lane belongs +- laneAttributes LaneAttributes, +- -- All Attribute information about +- -- the basic selected lane type +- -- Directions of use, Geometric co-sharing +- -- and Type Specific Attributes +- -- These Attributes are 'lane - global' that is, +- -- they are true for the entire length of the lane +- maneuvers AllowedManeuvers OPTIONAL, +- -- the permitted maneuvers for this lane +- nodeList NodeListXY, +- -- Lane spatial path information as well as +- -- various Attribute information along the node path +- -- Attributes found here are more general and may +- -- come and go over the length of the lane. +- connectsTo ConnectsToList OPTIONAL, +- -- a list of other lanes and their signal group IDs +- -- each connecting lane and its signal group ID +- -- is given, therefore this element provides the +- -- information formerly in "signalGroups" in prior +- -- editions. +- overlays OverlayLaneList OPTIONAL, +- -- A list of any lanes which have spatial paths that +- -- overlay (run on top of, and not simply cross) +- -- the path of this lane when used +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-GenericLane}} OPTIONAL, +- ... +- } +- +-IntersectionAccessPoint ::= CHOICE { +- lane LaneID, +- approach ApproachID, +- connection LaneConnectionID, +- ... +- } +- +-IntersectionGeometry ::= SEQUENCE { +- name DescriptiveName OPTIONAL, +- -- For debug use only +- id IntersectionReferenceID, +- -- A globally unique value set, +- -- consisting of a regionID and +- -- intersection ID assignment +- revision MsgCount, +- +- -- Required default values about lane descriptions follow +- refPoint Position3D, -- The reference from which subsequent +- -- data points are offset until a new +- -- point is used. +- laneWidth LaneWidth OPTIONAL, +- -- Reference width used by all subsequent +- -- lanes unless a new width is given +- speedLimits SpeedLimitList OPTIONAL, +- -- Reference regulatory speed limits +- -- used by all subsequent +- -- lanes unless a new speed is given +- -- See Section 11 for converting and +- -- translating speed expressed in mph +- -- into units of m/s +- -- Complete details regarding each lane type in this intersection +- laneSet LaneList, -- Data about one or more lanes +- -- (all lane data is found here) +- +- -- Data describing how to use and request preemption and +- -- priority services from this intersection (if supported) +- -- NOTE Additonal data may be added in the next release of the +- -- standard at this point to handle this concept +- preemptPriorityData PreemptPriorityList OPTIONAL, +- -- data about one or more regional +- -- preempt or priority zones +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, +- ... +- } +- +-IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry +- +-IntersectionReferenceID ::= SEQUENCE { +- region RoadRegulatorID OPTIONAL, +- -- a globally unique regional assignment value +- -- typical assigned to a regional DOT authority +- -- the value zero shall be used for testing needs +- id IntersectionID +- -- a unique mapping to the intersection +- -- in question within the above region of use +- } +- +-IntersectionState ::= SEQUENCE { +- name DescriptiveName OPTIONAL, +- -- human readable name for intersection +- -- to be used only in debug mode +- id IntersectionReferenceID, +- -- A globally unique value set, consisting of a +- -- regionID and intersection ID assignment +- -- provides a unique mapping to the +- -- intersection MAP in question +- -- which provides complete location +- -- and approach/move/lane data +- revision MsgCount, +- status IntersectionStatusObject, +- -- general status of the controller(s) +- moy MinuteOfTheYear OPTIONAL, +- -- Minute of current UTC year +- -- used only with messages to be archived +- timeStamp DSecond OPTIONAL, +- -- the mSec point in the current UTC minute that +- -- this message was constructed +- enabledLanes EnabledLaneList OPTIONAL, +- -- a list of lanes where the RevocableLane bit +- -- has been set which are now active and +- -- therefore part of the current intersection +- states MovementList, +- -- Each Movement is given in turn +- -- and contains its signal phase state, +- -- mapping to the lanes it applies to, and +- -- point in time it will end, and it +- -- may contain both active and future states +- maneuverAssistList ManeuverAssistList OPTIONAL, +- -- Assist data +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-IntersectionState}} OPTIONAL, +- ... +- } +- +-IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState +- +-LaneAttributes ::= SEQUENCE { +- directionalUse LaneDirection, -- directions of lane use +- sharedWith LaneSharing, -- co-users of the lane path +- laneType LaneTypeAttributes, -- specific lane type data +- regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL +- } +- +-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 +- +-LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane +- +-LaneSharing ::= BIT STRING { +- -- With bits as defined: +- overlappingLaneDescriptionProvided (0), +- -- Assert when another lane object is present to describe the +- -- path of the overlapping shared lane +- -- this construct is not used for lane objects which simply cross +- multipleLanesTreatedAsOneLane (1), +- -- Assert if the lane object path and width details represents +- -- multiple lanes within it that are not further described +- +- -- Various modes and type of traffic that may share this lane: +- otherNonMotorizedTrafficTypes (2), -- horse drawn etc. +- individualMotorizedVehicleTraffic (3), +- busVehicleTraffic (4), +- taxiVehicleTraffic (5), +- pedestriansTraffic (6), +- cyclistVehicleTraffic (7), +- trackedVehicleTraffic (8), +- pedestrianTraffic (9) +- } (SIZE (10)) +- -- All zeros would indicate 'not shared' and 'not overlapping' +- +-LaneTypeAttributes ::= CHOICE { +- vehicle LaneAttributes-Vehicle, -- motor vehicle lanes +- crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks +- bikeLane LaneAttributes-Bike, -- bike lanes +- sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths +- median LaneAttributes-Barrier, -- medians & channelization +- striping LaneAttributes-Striping, -- roadway markings +- trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys +- parking LaneAttributes-Parking, -- parking and stopping lanes +- ... +- } +- +-ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist +- +-MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent +- +-MovementEvent ::= SEQUENCE { +- eventState MovementPhaseState, +- -- Consisting of: +- -- Phase state (the basic 11 states) +- -- Directional, protected, or permissive state +- +- timing TimeChangeDetails OPTIONAL, +- -- Timing Data in UTC time stamps for event +- -- includes start and min/max end times of phase +- -- confidence and estimated next occurrence +- +- speeds AdvisorySpeedList OPTIONAL, +- -- various speed advisories for use by +- -- general and specific types of vehicles +- -- supporting green-wave and other flow needs +- -- See Section 11 for converting and translating +- -- speed expressed in mph into units of m/s +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-MovementEvent}} OPTIONAL, +- ... +- } +- +-MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState +- +-MovementState ::= SEQUENCE { +- movementName DescriptiveName OPTIONAL, +- -- uniquely defines movement by name +- -- human readable name for intersection +- -- to be used only in debug mode +- signalGroup SignalGroupID, +- -- the group id is used to map to lists +- -- of lanes (and their descriptions) +- -- which this MovementState data applies to +- -- see comments in the Remarks for usage details +- state-time-speed MovementEventList, +- -- Consisting of sets of movement data with: +- -- a) SignalPhaseState +- -- b) TimeChangeDetails, and +- -- c) AdvisorySpeeds (optional ) +- -- Note one or more of the movement events may be for +- -- a future time and that this allows conveying multiple +- -- predictive phase and movement timing for various uses +- -- for the current signal group +- maneuverAssistList ManeuverAssistList OPTIONAL, +- -- This information may also be placed in the +- -- IntersectionState when common information applies to +- -- different lanes in the same way +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-MovementState}} OPTIONAL, +- ... +- } +- +-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 +- ... +- } +- +-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, +- -- a lane made up of two or more +- -- XY node points and any attributes +- -- defined in those nodes +- computed ComputedLane, +- -- a lane path computed by translating +- -- the data defined by another lane +- ... +- } +- +-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 +- } +- +-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 +- ... +-} +- +-OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID +- -- The unique ID numbers for any lane object which have +- -- spatial paths that overlay (run on top of, and not +- -- simply cross with) the current lane. +- -- Such as a train path that overlays a motor vehicle +- -- lane object for a roadway segment. +- +-Position3D ::= SEQUENCE { +- lat Latitude, -- in 1/10th micro degrees +- long Longitude, -- in 1/10th micro degrees +- elevation Elevation OPTIONAL, -- in 10 cm units +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-Position3D}} OPTIONAL, +- ... +- } +- +-PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone +- +-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 +- } +- +-RequestorDescription ::= SEQUENCE { +- id VehicleID, +- -- The ID used in the BSM or CAM of the requestor +- -- This ID is presumed not to change +- -- during the exchange +- type RequestorType OPTIONAL, +- -- Information regarding all type and class data +- -- about the requesting vehicle +- position RequestorPositionVector OPTIONAL, +- -- The location of the requesting vehicle +- name DescriptiveName OPTIONAL, +- -- A human readable name for debugging use +- -- Support for Transit requests +- routeName DescriptiveName OPTIONAL, +- -- A string for transit operations use +- transitStatus TransitVehicleStatus OPTIONAL, +- -- current vehicle state (loading, etc.) +- transitOccupancy TransitVehicleOccupancy OPTIONAL, +- -- current vehicle occupancy +- transitSchedule DeltaTime OPTIONAL, +- -- current vehicle schedule adherence +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, +- ... +- } +- +-RequestorPositionVector ::= SEQUENCE { +- position Position3D, +- heading Angle OPTIONAL, +- speed TransmissionAndSpeed OPTIONAL, +- ... +- } +- +-RequestorType ::= SEQUENCE { +- -- Defines who is requesting +- role BasicVehicleRole, -- Basic role of this user at this time +- subrole RequestSubRole OPTIONAL, -- A local list with role based items +- +- -- Defines what kind of request (a level of importance in the Priority Scheme) +- request RequestImportanceLevel OPTIONAL, -- A local list with request items +- +- -- Additional classification details +- iso3883 Iso3833VehicleType OPTIONAL, +- hpmsType VehicleType OPTIONAL, -- HPMS classification types +- +- regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, +- ... +- } +- +-RestrictionClassAssignment ::= SEQUENCE { +- id RestrictionClassID, +- -- the unique value (within an intersection or local region) +- -- that is assigned to this group of users +- users RestrictionUserTypeList +- -- The list of user types/classes +- -- to which this restriction ID applies +- } +- +-RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment +- +-RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType +- +-RestrictionUserType ::= CHOICE { +- basicType RestrictionAppliesTo, +- -- a set of the most commonly used types +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-RestrictionUserType}}, +- ... +- } +- +-RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane +- +-RoadSegmentReferenceID ::= SEQUENCE { +- region RoadRegulatorID OPTIONAL, +- -- a globally unique regional assignment value +- -- typically assigned to a regional DOT authority +- -- the value zero shall be used for testing needs +- id RoadSegmentID +- -- a unique mapping to the road segment +- -- in question within the above region of use +- -- during its period of assignment and use +- -- note that unlike intersectionID values, +- -- this value can be reused by the region +- } +- +-RoadSegment ::= SEQUENCE { +- name DescriptiveName OPTIONAL, +- id RoadSegmentReferenceID, +- -- a globally unique value for the segment +- revision MsgCount, +- -- Required default values about the descriptions to follow +- refPoint Position3D, -- the reference from which subsequent +- -- data points are offset until a new +- -- point is used. +- laneWidth LaneWidth OPTIONAL, +- -- Reference width used by all subsequent +- -- lanes unless a new width is given +- speedLimits SpeedLimitList OPTIONAL, +- -- Reference regulatory speed limits +- -- used by all subsequent +- -- lanes unless a new speed is given +- -- See Section 11 for converting and +- -- translating speed expressed in mph +- -- into units of m/s +- +- -- Data describing disruptions in the RoadSegment +- -- such as work zones etc will be added here; +- -- in the US the SAE ITIS codes would be used here +- -- The details regarding each lane type in the RoadSegment +- roadLaneSet RoadLaneSetList, +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-RoadSegment}} OPTIONAL, +- ... +- } +- +-RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment +- +-SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY +- +-SignalControlZone ::= SEQUENCE { +- zone RegionalExtension {{Reg-SignalControlZone}}, +- ... +- } +- +-SignalRequesterInfo ::= SEQUENCE { +- -- These three items serve to uniquely identify the requester +- -- and the specific request to all parties +- id VehicleID, +- request RequestID, +- sequenceNumber MsgCount, +- role BasicVehicleRole OPTIONAL, +- +- typeData RequestorType OPTIONAL, +- -- Used when addition data besides the role +- -- is needed, at which point the role entry +- -- above is not sent. +- ... +- } +- +-SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage +- +-SignalRequestPackage ::= SEQUENCE { +- request SignalRequest, +- -- The specific request to the intersection +- -- contains IntersectionID, request type, +- -- requested action (approach/lane request) +- +- -- The Estimated Time of Arrival (ETA) when the service is requested +- minute MinuteOfTheYear OPTIONAL, +- second DSecond OPTIONAL, +- duration DSecond OPTIONAL, +- -- The duration value is used to provide a short interval that +- -- extends the ETA so that the requesting vehicle can arrive at +- -- the point of service with uncertainty or with some desired +- -- duration of service. This concept can be used to avoid needing +- -- to frequently update the request. +- -- The requester must update the ETA and duration values if the +- -- period of services extends beyond the duration time. +- -- It should be assumed that if the vehicle does not clear the +- -- intersection when the duration is reached, the request will +- -- be cancelled and the intersection will revert to +- -- normal operation. +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, +- ... +- } +- +-SignalRequest ::= SEQUENCE { +- -- the unique ID of the target intersection +- id IntersectionReferenceID, +- +- -- The unique requestID used by the requestor +- requestID RequestID, +- +- -- The type of request or cancel for priority or preempt use +- -- when a prior request is canceled, only the requestID is needed +- requestType PriorityRequestType, +- +- -- In typical use either an approach or a lane number would +- -- be given, this indicates the requested +- -- path through the intersection to the degree it is known. +- inBoundLane IntersectionAccessPoint, +- -- desired entry approach or lane +- outBoundLane IntersectionAccessPoint OPTIONAL, +- -- desired exit approach or lane +- -- the values zero is used to indicate +- -- intent to stop within the intersection +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalRequest}} OPTIONAL, +- ... +- } +- +-SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus +- +-SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage +- +-SignalStatusPackage ::= SEQUENCE { +- -- The party that made the initial SRM request +- requester SignalRequesterInfo OPTIONAL, +- -- The lanes or approaches used in the request +- inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle +- outboundOn IntersectionAccessPoint OPTIONAL, +- +- -- The Estimated Time of Arrival (ETA) when the service is requested +- -- This data echos the data of the request +- minute MinuteOfTheYear OPTIONAL, +- second DSecond OPTIONAL, +- duration DSecond OPTIONAL, +- +- -- the SRM status for this request +- status PrioritizationResponseStatus, +- -- Status of request, this may include rejection +- +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, +- ... +- } +- +-SignalStatus ::= SEQUENCE { +- sequenceNumber MsgCount, +- -- changed whenever the below contents have change +- id IntersectionReferenceID, +- -- this provides a unique mapping to the +- -- intersection map in question +- -- which provides complete location +- -- and approach/movement/lane data +- -- as well as zones for priority/preemption +- sigStatus SignalStatusPackageList, +- -- a list of detailed status containing all +- -- priority or preemption state data, both +- -- active and pending, and who requested it +- -- requests which are denied are also listed +- -- here for a short period of time +- regional SEQUENCE (SIZE(1..4)) OF +- RegionalExtension {{Reg-SignalStatus}} OPTIONAL, +- ... +- } +- +-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, +- ... +- } +- +-TimeChangeDetails ::= SEQUENCE { +- startTime TimeMark OPTIONAL, +- -- When this phase 1st started +- minEndTime TimeMark, +- -- Expected shortest end time +- maxEndTime TimeMark OPTIONAL, +- -- Expected longest end time +- +- likelyTime TimeMark OPTIONAL, +- -- Best predicted value based on other data +- confidence TimeIntervalConfidence OPTIONAL, +- -- Applies to above time element only +- +- nextTime TimeMark OPTIONAL +- -- A rough estimate of time when +- -- this phase may next occur again +- -- used to support various ECO driving power +- -- management needs. +- } +- +-TimeMark ::= INTEGER (0..36001) +- -- Tenths of a second in the current or next hour +- -- In units of 1/10th second from UTC time +- -- A range of 0~36000 covers one hour +- -- The values 35991..36000 are used when a leap second occurs +- -- The value 36001 is used to indicate time >3600 seconds +- -- 36002 is to be used when value undefined or unknown +- -- Note that this is NOT expressed in GPS time +- -- or in local time +- +-TransmissionAndSpeed ::= SEQUENCE { +- transmisson TransmissionState, +- speed Velocity +- } +- +-VehicleID ::= CHOICE { +- entityID TemporaryID, +- stationID StationID +- } +- +- +--- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +--- +--- Start of entries from table Data_Elements... +--- This table typicaly contains data element entries. +--- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +--- +- +-AdvisorySpeedType ::= ENUMERATED { +- none (0), +- greenwave (1), +- ecoDrive (2), +- transit (3), +- ... +- } -- Note: subject to further growth +- +-AllowedManeuvers ::= BIT STRING { +- -- With bits as defined: +- -- Allowed maneuvers at path end (stop line) +- -- All maneuvers with bits not set are therefore prohibited ! +- -- A value of zero shall be used for unknown, indicating no Maneuver +- maneuverStraightAllowed (0), +- -- a Straight movement is allowed in this lane +- maneuverLeftAllowed (1), +- -- a Left Turn movement is allowed in this lane +- maneuverRightAllowed (2), +- -- a Right Turn movement is allowed in this lane +- maneuverUTurnAllowed (3), +- -- a U turn movement is allowed in this lane +- maneuverLeftTurnOnRedAllowed (4), +- -- a Stop, and then proceed when safe movement +- -- is allowed in this lane +- maneuverRightTurnOnRedAllowed (5), +- -- a Stop, and then proceed when safe movement +- -- is allowed in this lane +- maneuverLaneChangeAllowed (6), +- -- a movement which changes to an outer lane +- -- on the egress side is allowed in this lane +- -- (example: left into either outbound lane) +- maneuverNoStoppingAllowed (7), +- -- the vehicle should not stop at the stop line +- -- (example: a flashing green arrow) +- yieldAllwaysRequired (8), +- -- the allowed movements above are not protected +- -- (example: an permanent yellow condition) +- goWithHalt (9), +- -- after making a full stop, may proceed +- caution (10), +- -- proceed past stop line with caution +- reserved1 (11) +- -- used to align to 12 Bit Field +- +- } (SIZE(12)) +- +-Angle ::= INTEGER (0..28800) +- -- LSB of 0.0125 degrees +- -- A range of 0 to 359.9875 degrees +- +-ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown +- +-BasicVehicleRole ::= ENUMERATED { +- -- Values used in the EU and in the US +- basicVehicle (0), -- Light duty passenger vehicle type +- publicTransport (1), -- Used in EU for Transit us +- specialTransport (2), -- Used in EU (e.g. heavy load) +- dangerousGoods (3), -- Used in EU for any HAZMAT +- roadWork (4), -- Used in EU for State and Local DOT uses +- roadRescue (5), -- Used in EU and in the US to include tow trucks. +- emergency (6), -- Used in EU for Police, Fire and Ambulance units +- safetyCar (7), -- Used in EU for Escort vehicles +- -- Begin US unique numbering +- none-unknown (8), -- added to follow current SAE style guidelines +- truck (9), -- Heavy trucks with additional BSM rights and obligations +- motorcycle (10), -- +- roadSideSource (11), -- For infrastructure generated calls such as +- -- fire house, rail infrastructure, roadwork site, etc. +- police (12), -- +- fire (13), -- +- ambulance (14), -- (does not include private para-transit etc.) +- dot (15), -- all roadwork vehicles +- transit (16), -- all transit vehicles +- slowMoving (17), -- to also include oversize etc. +- stopNgo (18), -- to include trash trucks, school buses and others +- -- that routinely disturb the free flow of traffic +- cyclist (19), -- +- pedestrian (20), -- also includes those with mobility limitations +- nonMotorized (21), -- other, horse drawn, etc. +- military (22), -- +- ... +- } +- +-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 +- +-DescriptiveName ::= IA5String (SIZE(1..63)) +- +-DrivenLineOffsetLg ::= INTEGER (-32767..32767) +- -- LSB units are 1 cm. +- +-DrivenLineOffsetSm ::= INTEGER (-2047..2047) +- -- LSB units are 1 cm. +- +-DSecond ::= INTEGER (0..65535) -- units of milliseconds +- +-DSRCmsgID ::= INTEGER (0..32767) +- mapData DSRCmsgID ::= 18 -- MAP, intersections +- signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT +- signalRequestMessage DSRCmsgID ::= 29 -- SRM +- signalStatusMessage DSRCmsgID ::= 30 -- SSM +- +-Elevation ::= INTEGER (-4096..61439) +- -- In units of 10 cm steps above or below the reference ellipsoid +- -- Providing a range of -409.5 to + 6143.9 meters +- -- The value -4096 shall be used when Unknown is to be sent +- +-IntersectionID ::= INTEGER (0..65535) +- -- The values zero through 255 are allocated for testing purposes +- -- Note that the value assigned to an intersection will be +- -- unique within a given regional ID only +- +-IntersectionStatusObject ::= BIT STRING { +- manualControlIsEnabled (0), +- -- Timing reported is per programmed values, etc. but person +- -- at cabinet can manually request that certain intervals are +- -- terminated early (e.g. green). +- stopTimeIsActivated (1), +- -- And all counting/timing has stopped. +- failureFlash (2), +- -- Above to be used for any detected hardware failures, +- -- e.g. conflict monitor as well as for police flash +- preemptIsActive (3), +- signalPriorityIsActive (4), +- +- -- Additional states +- fixedTimeOperation (5), +- -- Schedule of signals is based on time only +- -- (i.e. the state can be calculated) +- trafficDependentOperation (6), +- -- Operation is based on different levels of traffic parameters +- -- (requests, duration of gaps or more complex parameters) +- standbyOperation (7), +- -- Controller: partially switched off or partially amber flashing +- failureMode (8), +- -- Controller has a problem or failure in operation +- off (9), +- -- Controller is switched off +- +- -- Related to MAP and SPAT bindings +- recentMAPmessageUpdate (10), +- -- Map revision with content changes +- recentChangeInMAPassignedLanesIDsUsed (11), +- -- Change in MAP's assigned lanes used (lane changes) +- -- Changes in the active lane list description +- noValidMAPisAvailableAtThisTime (12), +- -- MAP (and various lanes indexes) not available +- noValidSPATisAvailableAtThisTime (13) +- -- SPAT system is not working at this time +- +- -- Bits 14,15 reserved at this time and shall be zero +- } (SIZE(16)) +- +- +-LaneAttributes-Barrier ::= BIT STRING { +- -- With bits as defined: +- median-RevocableLane (0), +- -- this lane may be activated or not based +- -- on the current SPAT message contents +- -- if not asserted, the lane is ALWAYS present +- median (1), +- whiteLineHashing (2), +- stripedLines (3), +- doubleStripedLines (4), +- trafficCones (5), +- constructionBarrier (6), +- trafficChannels (7), +- lowCurbs (8), +- highCurbs (9) +- -- Bits 10~15 reserved and set to zero +- } (SIZE (16)) +- +-LaneAttributes-Bike ::= BIT STRING { +- -- With bits as defined: +- bikeRevocableLane (0), +- -- this lane may be activated or not based +- -- on the current SPAT message contents +- -- if not asserted, the lane is ALWAYS present +- pedestrianUseAllowed (1), +- -- The path allows pedestrian traffic, +- -- if not set, this mode is prohibited +- isBikeFlyOverLane (2), +- -- path of lane is not at grade +- fixedCycleTime (3), +- -- the phases use preset times +- -- i.e. there is not a 'push to cross' button +- biDirectionalCycleTimes (4), +- -- ped walk phases use different SignalGroupID +- -- for each direction. The first SignalGroupID +- -- in the first Connection represents 'inbound' +- -- flow (the direction of travel towards the first +- -- node point) while second SignalGroupID in the +- -- next Connection entry represents the 'outbound' +- -- flow. And use of RestrictionClassID entries +- -- in the Connect follow this same pattern in pairs. +- isolatedByBarrier (5), +- unsignalizedSegmentsPresent (6) +- -- The lane path consists of one of more segments +- -- which are not part of a signal group ID +- +- -- Bits 7~15 reserved and set to zero +- } (SIZE (16)) +- +-LaneAttributes-Crosswalk ::= BIT STRING { +- -- With bits as defined: +- -- MUTCD provides no suitable "types" to use here +- crosswalkRevocableLane (0), +- -- this lane may be activated or not based +- -- on the current SPAT message contents +- -- if not asserted, the lane is ALWAYS present +- bicyleUseAllowed (1), +- -- The path allows bicycle traffic, +- -- if not set, this mode is prohibited +- isXwalkFlyOverLane (2), +- -- path of lane is not at grade +- fixedCycleTime (3), +- -- ped walk phases use preset times +- -- i.e. there is not a 'push to cross' button +- biDirectionalCycleTimes (4), +- -- ped walk phases use different SignalGroupID +- -- for each direction. The first SignalGroupID +- -- in the first Connection represents 'inbound' +- -- flow (the direction of travel towards the first +- -- node point) while second SignalGroupID in the +- -- next Connection entry represents the 'outbound' +- -- flow. And use of RestrictionClassID entries +- -- in the Connect follow this same pattern in pairs. +- hasPushToWalkButton (5), +- -- Has a demand input +- audioSupport (6), +- -- audio crossing cues present +- rfSignalRequestPresent (7), +- -- Supports RF push to walk technologies +- unsignalizedSegmentsPresent (8) +- -- The lane path consists of one of more segments +- -- which are not part of a signal group ID +- -- Bits 9~15 reserved and set to zero +- } (SIZE (16)) +- +-LaneAttributes-Parking ::= BIT STRING { +- -- With bits as defined: +- -- Parking use details, note that detailed restrictions such as +- -- allowed hours are sent by way of ITIS codes in the TIM message +- parkingRevocableLane (0), +- -- this lane may be activated or not based +- -- on the current SPAT message contents +- -- if not asserted, the lane is ALWAYS present +- parallelParkingInUse (1), +- headInParkingInUse (2), +- doNotParkZone (3), +- -- used to denote fire hydrants as well as +- -- short disruptions in a parking zone +- parkingForBusUse (4), +- parkingForTaxiUse (5), +- noPublicParkingUse (6) +- -- private parking, as in front of +- -