diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index 9df9cb57ee436be305218181bf0c11bf96d142c2..7424c4847b006953133f2e3845087a81ace2933b 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -119,7 +119,7 @@ module LibItsCommon_Functions { /** * @desc Gets the current time since 01/01/1970 in UTC format - * @return The current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format in milliseconds */ function f_getCurrentTimeUtc() return UInt64 { var UInt64 v_time := 0; diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 4bf65e4999aa09ce18a3789d5cf1882a3d112acc..33179129feeec36599e3b6640956ea6c3acc521f 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -203,7 +203,9 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_TLC := 140; const integer c_its_aid_TLS := 140; const integer c_its_aid_GN := 141; + const integer c_its_aid_CRL := 622; // ETSI TS 102 941 Clause 6.4 Generation and distribution of TLM / RCA Link Certificates const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html + const integer c_its_aid_CPOC := 624; // ETSI TS 102 941 Clause 6.4 Generation and distribution of TLM / RCA Link Certificates } } with { diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 8b2b26d00003317a831978acd914d19a6ab734e8..fc2f78beadec96b04d259e82923dd1e1f72c2dcb 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -26,6 +26,7 @@ module LibItsHttp_BinaryMessageBodyTypes { type union BinaryBody { // TODO Add here your custom variants Ieee1609Dot2Data ieee1609dot2_data, + Certificate ieee1609dot2_certificate, octetstring raw } with { variant "" diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index d988cfade942008ea7a2846c966e8e0d37c17213..a50f50b81c7cc24191d94330bba98a9728f0b129 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -47,4 +47,16 @@ module LibItsHttp_BinaryTemplates { ieee1609dot2_data := p_ieee1609dot2_data } // End of template mw_binary_body_ieee1609dot2_data + template (value) BinaryBody m_binary_body_ieee1609dot2_certificate( + in template (value) CertificateBase p_ieee1609dot2_certificate + ) := { + ieee1609dot2_certificate := p_ieee1609dot2_certificate + } // End of template m_binary_body_ieee1609dot2_certificate + + template (present) BinaryBody mw_binary_body_ieee1609dot2_certificate( + template (present) CertificateBase p_ieee1609dot2_certificate := ? + ) := { + ieee1609dot2_certificate := p_ieee1609dot2_certificate + } // End of template mw_binary_body_ieee1609dot2_certificate + } // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index c1abcf329ea0822a42836a3b8e6271238d2e0d88..dbe069dbf60de7c8be141a63386411e8fd8f074c 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -145,6 +145,32 @@ module LibItsHttp_Functions { } // End of 'for' statement } // End of function f_get_header + /** + * @desc Check HTTP response headers + * @param p_headers The HTTP headers + * @param p_value the expected va;ue + * @return true on success, false otherwise + */ + function f_check_headers( + in Headers p_headers, + in charstring p_header_name := "Location", + in template (present) charstring p_value := ? + ) return boolean { + // Local variables + var boolean v_header_matched := false; + + for (var integer v_idx := 0; v_idx < lengthof(p_headers); v_idx := v_idx + 1) { + if (p_headers[v_idx].header_name == p_header_name) { + if (match(p_headers[v_idx].header_value[0], p_value) == true) { + v_header_matched := true; + } // else, nothing to do + break; + } + } // End of 'for' statement + + return v_header_matched; + } // End of function f_check_headers + } // End of group http_headers } // End of module LibItsHttp_Functions diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index a8c27d76a6b8dd54bc7bf41a5fc1c1284ae3bc8d..cfd589ddd359461598c54a5e82be1612951f7af9 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -257,6 +257,13 @@ module LibItsHttp_Templates { body := omit } // End of template m_http_response_ko_no_body + template (value) Response m_http_response_500_internal_error( + in template (value) Headers p_header, + in template (value) integer p_statuscode := 500, + in template (value) charstring p_statustext := "Internal Error" + ) modifies m_http_response_ko_no_body := { + } // End of template m_http_response_ko + template (present) Response mw_http_response_ko_no_body( template (present) Headers p_header := ?, template (present) integer p_statuscode := 404,