diff --git a/ttcn/LibHelpers/ttcn/LibHelpers_Functions.ttcn b/ttcn/LibHelpers/ttcn/LibHelpers_Functions.ttcn index 32711d842fa9dbe5948f052f8d24fd0a8817dc32..b5c6bd5f6c21a4cd4206ee5176f6c42ff75be37c 100644 --- a/ttcn/LibHelpers/ttcn/LibHelpers_Functions.ttcn +++ b/ttcn/LibHelpers/ttcn/LibHelpers_Functions.ttcn @@ -9,14 +9,14 @@ * All rights reserved. * */ - + module LibHelpers_Functions { // LibCommon import from LibCommon_BasicTypesAndValues all; - + group math { - + /** * @desc function to generate integer random values * @see ttcn-3 - rnd() @@ -32,10 +32,10 @@ module LibHelpers_Functions { //Variables var integer v_random := 0; v_random := float2int(int2float(p_upperbound - p_lowerbound + 1) * rnd()) + p_lowerbound; - + log("*** f_random: INFO: OK - random value = " & int2str(v_random) & " ***"); return v_random; - + } // End of function f_random /** @@ -45,7 +45,7 @@ module LibHelpers_Functions { */ function f_abs(in integer p_number) return integer { - + if(p_number < 0) { return 0 - p_number; } @@ -59,7 +59,7 @@ module LibHelpers_Functions { */ function ff_abs(in float p_number) return float { - + if(p_number < 0.0) { return 0.0 - p_number; } @@ -74,7 +74,7 @@ module LibHelpers_Functions { */ function f_min(in integer p_a, in integer p_b) return integer { - + if(p_a < p_b) { return p_a; } @@ -91,7 +91,7 @@ module LibHelpers_Functions { function f_removeUnsignificantBits(in bitstring p_bitstring) return bitstring { var integer i, len; - + len := lengthof(p_bitstring); for(i:=len-1; i >=0 and p_bitstring[i] == '0'B; i:=i-1) {} return substr(p_bitstring, 0, i + 1); @@ -106,61 +106,61 @@ module LibHelpers_Functions { */ function f_getCurrentTimeUtc() return UInt64 { var UInt64 v_time := 0; - + // log("*** f_getCurrentTimeUtc: INFO: calling fx_getCurrentTimeUtc() ***"); v_time := fx_getCurrentTimeUtc(); - + return v_time; } - + /** * @desc Gets the Minute of current UTC year * @return MinuteOfTheYear - tenths of a second in the current or next hour in units of 1/10th second from UTC time */ function f_getMinuteOfTheYear() return UInt16 { var UInt16 v_minuteOfTheYear := 0; - + // log("*** f_getMinuteOfTheYear: INFO: calling fx_getMinuteOfTheYear() ***"); v_minuteOfTheYear := fx_getMinuteOfTheYear(); - + return v_minuteOfTheYear; } - + /** * @desc Gets the milliseconds point in the current UTC minute * @return DSecond - The milliseconds point in the current UTC minute (0..60000) */ function f_getDSecond() return UInt16 { var UInt16 v_dSecond := 0; - + // log("*** f_getDSecond: INFO: calling fx_getDSecond() ***"); v_dSecond := fx_getDSecond(); - + return v_dSecond; } - + } // End of group datetime - + group externals { - + /** * @desc Gets the current time since 01/01/1970 in UTC format * @return The current time since 01/01/1970 in UTC format */ external function fx_getCurrentTimeUtc() return UInt64; - + /** * @desc Gets the minutes of current UTC year * @return MinuteOfTheYear - minutes of current UTC year */ external function fx_getMinuteOfTheYear() return UInt16; - + /** * @desc Gets the milliseconds point in the current UTC minute * @return DSecond - the milliseconds point in the current UTC minute */ external function fx_getDSecond() return UInt16; - + /** * @desc Encode into Base64 * @return p_to_encode - The buffer to be encoded diff --git a/ttcn/LibHttp/ttcn/LibHttp_BinaryMessageBodyTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_BinaryMessageBodyTypes.ttcn index 76a8b86351c0530da11b2b131dc7bb514891012f..a8dd96a16522b539d4432743d0ace39b4e2292c1 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_BinaryMessageBodyTypes.ttcn @@ -22,7 +22,7 @@ module LibHttp_BinaryMessageBodyTypes { } with { variant "" } - + } with { variant "" } // End of LibHttp_BinaryMessageBodyTypes diff --git a/ttcn/LibHttp/ttcn/LibHttp_BinaryTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_BinaryTypes.ttcn index 2606857d40c3b09600e1282c90f35bb9023fa213..761a9b1956c6e8e5ddd7c62457d57b0b3e42c82d 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_BinaryTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_BinaryTypes.ttcn @@ -1,9 +1,9 @@ module LibHttp_BinaryTypes { // FIXME To be removed - + /** * This file is volontary empry. You have to declare all XSD files required by your project * In addition, the TTCN-3 module LibHttp_XmlMessageBodyTypes have to be updated too. */ // TODO Add here your custom binary import - + } // End of module LibHttp_BinaryTypes diff --git a/ttcn/LibHttp/ttcn/LibHttp_EncdecDeclarations.ttcn b/ttcn/LibHttp/ttcn/LibHttp_EncdecDeclarations.ttcn index e7eb077242973b7d058950f47d9b18d86dc905a8..23ea56a393b09994edc59c5c4d58ac3f37f54500 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_EncdecDeclarations.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_EncdecDeclarations.ttcn @@ -1,11 +1,11 @@ module LibHttp_EncdecDeclarations { // LibHttp import from LibHttp_TypesAndValues all; - + external function fx_enc_http_message (HttpMessage p) return bitstring with {extension "prototype(convert) encode(HttpCodec)"} - + external function fx_dec_http_message (inout bitstring b, out HttpMessage p) return integer with {extension "prototype(sliding) decode(HttpCodec)"} - + } // End of module LibHttp_EncdecDeclarations diff --git a/ttcn/LibHttp/ttcn/LibHttp_Functions.ttcn b/ttcn/LibHttp/ttcn/LibHttp_Functions.ttcn index 73b9791e1fee3d791ffa3e771583fc37229a6e90..b329dca8cd2eb256ab57984f247ed1ff2c838cb3 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_Functions.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_Functions.ttcn @@ -1,87 +1,87 @@ module LibHttp_Functions { - + // LibCommon import from LibCommon_Time all; import from LibCommon_VerdictControl all; import from LibCommon_Sync all; - + // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Templates all; import from LibHttp_Pics all; import from LibHttp_Pixits all; import from LibHttp_TestSystem all; - + group preambles { - + /** * @desc Setup HTTP pprotocol port */ function f_cf_01_http_up() runs on HttpComponent { - + // Map ports map(self:httpPort, system:httpPort); - + // Connect f_connect4SelfOrClientSync(); - + activate(a_cf_01_http_down()); activate(a_default_requests()); activate(a_default_responses()); - + } // End of function f_cf_01_http_up - + /** * @desc Setup HTTP pprotocol port */ function f_cf_01_http_notif_up() runs on HttpComponent { - + // Map ports map(self:httpPort, system:httpPort); map(self:httpPort_notif, system:httpPort_notif); - + // Connect f_connect4SelfOrClientSync(); - + activate(a_cf_01_http_notif_down()); activate(a_default_requests()); activate(a_default_responses()); - + } // End of function f_cf_01_http_notif_up - + } // End of group preambles - + group postambles { - + /** * @desc Shutdown HTTP pprotocol port */ function f_cf_01_http_down() runs on HttpComponent { - + // Unmap ports unmap(self:httpPort, system:httpPort); - + // Disconnect ports f_disconnect4SelfOrClientSync(); - + deactivate; } // End of function f_cf_01_http_down - + /** * @desc Shutdown HTTP pprotocol port */ function f_cf_01_http_notif_down() runs on HttpComponent { - + // Unmap ports unmap(self:httpPort, system:httpPort); unmap(self:httpPort_notif, system:httpPort_notif); - + // Disconnect ports f_disconnect4SelfOrClientSync(); - + deactivate; } // End of function f_cf_01_http_notif_down - + /** * @desc Default handling cf01 de-initialisation. */ @@ -92,7 +92,7 @@ module LibHttp_Functions { stop; } } // End of altstep a_cf_01_http_down - + /** * @desc Default handling cf01 de-initialisation. */ @@ -103,18 +103,18 @@ module LibHttp_Functions { stop; } } // End of altstep a_cf_01_http_notif_down - + } // End of group postambles - + group http_headers { - + function f_init_default_headers_list( in charstring p_header_content_type := PICS_HEADER_CONTENT_TYPE, in charstring p_header_content_text := "", out Headers p_headers ) { var integer v_i := 0; - + p_headers[v_i] := { c_header_host, { PICS_HEADER_HOST } }; v_i := v_i + 1; p_headers[v_i] := { c_header_content_type, { p_header_content_type } }; @@ -140,7 +140,7 @@ module LibHttp_Functions { f_set_headers_list(PX_ADDITIONAL_HTTP_HEADERS_KEYS, PX_ADDITIONAL_HTTP_HEADERS_VALUES, p_headers); } } // End of function f_init_default_headers_list - + function f_set_headers_list( in charstring_list p_headers_to_set, in charstring_list p_headers_value, @@ -152,7 +152,7 @@ module LibHttp_Functions { } else if (lengthof(p_headers) == 0) { return; } - + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_set); v_idx := v_idx + 1) { var integer v_jdx; for (v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { @@ -167,7 +167,7 @@ module LibHttp_Functions { } } // End of 'for' statement } // End of function f_set_headers_list - + function f_remove_headers_list( in charstring_list p_headers_to_remove, inout Headers p_headers @@ -178,7 +178,7 @@ module LibHttp_Functions { } else if (lengthof(p_headers) == 0) { return; } - + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { @@ -188,7 +188,7 @@ module LibHttp_Functions { } // End of 'for' statement } // End of 'for' statement } // End of function f_remove_headers_list - + function f_get_header( in Headers p_headers, in charstring p_header_name := c_header_content_text, @@ -200,7 +200,7 @@ module LibHttp_Functions { } else if (lengthof(p_headers) == 0) { return; } - + for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { if (p_headers[v_jdx].header_name == p_header_name) { p_header_value := p_headers[v_jdx].header_value; // NOTE Codec won't encode it @@ -208,7 +208,7 @@ module LibHttp_Functions { } } // End of 'for' statement } // End of function f_get_header - + /** * @desc Check HTTP response headers * @param p_headers The HTTP headers @@ -222,7 +222,7 @@ module LibHttp_Functions { ) 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) { @@ -231,12 +231,12 @@ module LibHttp_Functions { break; } } // End of 'for' statement - + return v_header_matched; } // End of function f_check_headers } // End of group http_headers - + group altsteps { altstep a_default_requests() runs on HttpComponent { @@ -251,10 +251,10 @@ module LibHttp_Functions { f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); } } // End of altstep a_default_requests - + altstep a_default_responses() runs on HttpComponent { var HttpMessage v_response; - + [] httpPort.receive( mw_http_response( mw_http_response_ok( @@ -320,7 +320,7 @@ module LibHttp_Functions { f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); } } // End of altstep a_default_responses - + } // end of group altsteps - + } // End of module LibHttp_Functions diff --git a/ttcn/LibHttp/ttcn/LibHttp_JSONTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_JSONTypes.ttcn index e4a7ec30910f16f44030f4c39593c0e78f5dcfc2..ad0dacef3870880e08b96b530db84ae2ff658f06 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_JSONTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_JSONTypes.ttcn @@ -1,9 +1,9 @@ module LibHttp_JSONTypes { // FIXME To be removed - + /** * This file is volontary empry. You have to declare all XSD files required by your project * In addition, the TTCN-3 module LibHttp_XmlMessageBodyTypes have to be updated too. */ // TODO Add here your custom RFCs import - + } // End of module LibHttp_JSONTypes diff --git a/ttcn/LibHttp/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index ef31c51abda465536e3671c9765bf2f8666c3c6e..7c6be9271beea3f32e293e8d7ae321557040bc00 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -1,18 +1,18 @@ module LibHttp_JsonMessageBodyTypes { - + /** * This file volontary contains a trivial declaration of the type JsonBody. * In accordance with your TTCN-3 module LibHttp_JSONTypes, you have to change the JsonBody typing. */ // TODO Add here your custom RFCs import - + type union JsonBody { // TODO Add here your custom variants universal charstring raw } with { variant "" } - + } with { encode "JSON"; variant "" diff --git a/ttcn/LibHttp/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/LibHttp/ttcn/LibHttp_JsonTemplates.ttcn index a7aa7f0160dbd366155fe4bd9237ab433859b65d..b3907587a306f52fce3fde90102a32a8426df7e5 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_JsonTemplates.ttcn @@ -9,13 +9,13 @@ * All rights reserved. */ module LibHttp_JsonTemplates { - + // TODO Add here your custom RFCs import - + // LibHttp import from LibHttp_JsonMessageBodyTypes all; import from LibHttp_XMLTypes all; - + template (value) JsonBody m_json_body_raw( in template (value) charstring p_raw ) := { @@ -27,5 +27,5 @@ module LibHttp_JsonTemplates { ) := { raw := p_raw } // End of template mw_json_body_raw - + } // End of module LibHttp_JsonTemplates diff --git a/ttcn/LibHttp/ttcn/LibHttp_MessageBodyTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_MessageBodyTypes.ttcn index ed1d5498d780a375db2fe97caaec853e7ef42d7b..cfba5cbbee3eb02ce90b5e7e757aa1fac7408e63 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_MessageBodyTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_MessageBodyTypes.ttcn @@ -1,14 +1,14 @@ module LibHttp_MessageBodyTypes { - + // LibHttp import from LibHttp_XmlMessageBodyTypes all; import from LibHttp_JsonMessageBodyTypes all; import from LibHttp_BinaryMessageBodyTypes all; - + type charstring HtmlBody; - + type charstring TextBody; - + type union HttpMessageBody { BinaryBody binary_body, HtmlBody html_body, @@ -18,7 +18,7 @@ module LibHttp_MessageBodyTypes { } with { variant "" } // End of type HttpMessageBody - + } with { encode "HttpCodec" }// End of module LibHttp_MessageBodyTypes diff --git a/ttcn/LibHttp/ttcn/LibHttp_Pics.ttcn b/ttcn/LibHttp/ttcn/LibHttp_Pics.ttcn index c4c7b8a2424e0f2e7f049e52c55270c987efd030..9a759e1ec1e378f1d289736bdcb1391dc4f673a4 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_Pics.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_Pics.ttcn @@ -4,33 +4,33 @@ module LibHttp_Pics { * @desc HTTP major version */ modulepar integer PICS_HTTP_VERSION_MAJOR := 1; - + /** * @desc HTTP minor version */ modulepar integer PICS_HTTP_VERSION_MINOR := 1; - + /** * @desc */ modulepar charstring PICS_HEADER_HOST := "www.lisp.com"; - + /** * @desc */ modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; modulepar charstring PICS_HEADER_CTL_CONTENT_TYPE := "application/x-its-ctl"; modulepar charstring PICS_HEADER_CRL_CONTENT_TYPE := "application/x-its-crl"; - + /** * @desc Set to false in TOKEN header shall not be used */ modulepar boolean PICS_USE_TOKEN_HEADER := true; - + /** * @desc HTTP TOKEN value * "YWxhZGRpbjpvcGVuc2VzYW1l==" is the base64 encoding of the login:password "aladdin:opensesame" */ modulepar charstring PICS_TOKEN_HEADER := "Basic " & "YWxhZGRpbjpvcGVuc2VzYW1l==" ; // aladdin:opensesame - + } // End of module LibHttp_Pics diff --git a/ttcn/LibHttp/ttcn/LibHttp_Templates.ttcn b/ttcn/LibHttp/ttcn/LibHttp_Templates.ttcn index 9a9d42ae6ef57ebcc71c03f87c8808b39461351f..452e56dad2c64d3e637e577a25fc0d670c33e616 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_Templates.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_Templates.ttcn @@ -10,44 +10,44 @@ * @see ETSI TS 103 478 */ module LibHttp_Templates { - + // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_MessageBodyTypes all; import from LibHttp_XmlMessageBodyTypes all; import from LibHttp_JsonMessageBodyTypes all; import from LibHttp_BinaryMessageBodyTypes all; - + group http_messages { - + template (value) HttpMessage m_http_request( in template (value) Request p_request ) := { request := p_request } // End of template m_http_request - + template (present) HttpMessage mw_http_request( template (present) Request p_request := ? ) := { request := p_request } // End of template mw_http_request - + template (value) HttpMessage m_http_response( in template (value) Response p_response ) := { response := p_response } // End of template m_http_response - + template (present) HttpMessage mw_http_response( template (present) Response p_response := ? ) := { response := p_response } // End of template mw_http_response - + } // End of group http_messages - + group http_headers { - + template (value) Header m_header_line( in template (value) charstring p_header_name, in template (value) charstring_list p_header_value @@ -55,11 +55,11 @@ module LibHttp_Templates { header_name := p_header_name, header_value := p_header_value } // End of template m_header_line - + } // End of group http_headers - + group http_requests { - + template (omit) Request m_http_request_get( in charstring p_uri, in template (value) Headers p_headers, @@ -72,7 +72,7 @@ module LibHttp_Templates { header := p_headers, body := p_body } // End of template m_http_request_get - + template Request mw_http_request_get( template (present) charstring p_uri := ?, template (present) Headers p_headers := ?, @@ -85,7 +85,7 @@ module LibHttp_Templates { header := p_headers, body := p_body } // End of template mw_http_request_get - + template (omit) Request m_http_request_post( in charstring p_uri, in template (value) Headers p_headers, @@ -93,7 +93,7 @@ module LibHttp_Templates { ) modifies m_http_request_get := { method := "POST" } // End of template m_http_request_post - + template Request mw_http_request_post( template (present) charstring p_uri := ?, template (present) Headers p_headers := ?, @@ -101,7 +101,7 @@ module LibHttp_Templates { ) modifies mw_http_request_get := { method := "POST" } // End of template mw_http_request_post - + template (omit) Request m_http_request_patch( in charstring p_uri, in template (value) Headers p_headers, @@ -109,7 +109,7 @@ module LibHttp_Templates { ) modifies m_http_request_get := { method := "PATCH" } // End of template m_http_request_patch - + template Request mw_http_request_patch( template (present) charstring p_uri := ?, template (present) Headers p_headers := ?, @@ -117,7 +117,7 @@ module LibHttp_Templates { ) modifies mw_http_request_get := { method := "PATCH" } // End of template mw_http_request_patch - + template (omit) Request m_http_request_put( in charstring p_uri, in template (value) Headers p_headers, @@ -125,7 +125,7 @@ module LibHttp_Templates { ) modifies m_http_request_get := { method := "PUT" } // End of template m_http_request_put - + template Request mw_http_request_put( template (present) charstring p_uri := ?, template (present) Headers p_headers := ?, @@ -133,7 +133,7 @@ module LibHttp_Templates { ) modifies mw_http_request_get := { method := "PUT" } // End of template mw_http_request_put - + template (omit) Request m_http_request_delete( in charstring p_uri, in template (value) Headers p_headers, @@ -141,7 +141,7 @@ module LibHttp_Templates { ) modifies m_http_request_get := { method := "DELETE" } // End of template m_http_request_delete - + template Request mw_http_request_delete( template (present) charstring p_uri := ?, template (present) Headers p_headers := ?, @@ -149,11 +149,11 @@ module LibHttp_Templates { ) modifies mw_http_request_get := { method := "DELETE" } // End of template mw_http_request_post - + } // End of group http_requests - + group http_responses { - + template (value) Response m_http_response_ok( in template (value) HttpMessageBody p_body, in template (value) Headers p_header @@ -167,7 +167,7 @@ module LibHttp_Templates { tls := omit, mutual_tls := omit } // End of template m_http_response_ok - + template (value) Response m_http_response_ok_no_body( in template (value) Headers p_header ) := { @@ -180,7 +180,7 @@ module LibHttp_Templates { tls := omit, mutual_tls := omit } // End of template m_http_response_ok_no_body - + template (present) Response mw_http_response_ok_no_body( template (present) Headers p_header := ? ) := { @@ -193,14 +193,14 @@ module LibHttp_Templates { tls := *, mutual_tls := * } // End of template mw_http_response_ok_no_body - + template (value) Response m_http_response_204_no_content( in template (value) Headers p_header ) modifies m_http_response_ok_no_body := { statuscode := 204, statustext := "No Content" } // End of template m_http_response_204_no_content - + template (present) Response mw_http_response_ok( template (present) HttpMessageBody p_body := ?, template (present) Headers p_header := ? @@ -214,7 +214,7 @@ module LibHttp_Templates { tls := *, mutual_tls := * } // End of template mw_http_response_ok - + template (present) Response mw_http_response_201_created( template (present) HttpMessageBody p_body := ?, template (present) Headers p_header := ? @@ -222,7 +222,7 @@ module LibHttp_Templates { statuscode := 201, statustext := "Created" } // End of template mw_http_response_201_created - + template (present) Response mw_http_response_201_created_no_status_text( template (present) HttpMessageBody p_body := ?, template (present) Headers p_header := ? @@ -230,7 +230,7 @@ module LibHttp_Templates { statuscode := 201, statustext := ? } // End of template mw_http_response_201_created_no_status_text - + template (present) Response mw_http_response_202_accepted( template (present) HttpMessageBody p_body := ?, template (present) Headers p_header := ? @@ -238,14 +238,14 @@ module LibHttp_Templates { statuscode := 202, statustext := "Accepted" } // End of template mw_http_response_202_accepted - + template (present) Response mw_http_response_204_no_content( template (present) Headers p_header := ? ) modifies mw_http_response_ok_no_body := { statuscode := 204, statustext := "No Content" } // End of template mw_http_response_204_no_content - + template (value) Response m_http_response_ko( in template (value) HttpMessageBody p_body, in template (value) Headers p_header, @@ -261,7 +261,7 @@ module LibHttp_Templates { tls := omit, mutual_tls := omit } // End of template m_http_response_ko - + template (value) Response m_http_response_ko_no_body( in template (value) Headers p_header, in template (value) integer p_statuscode := 404, @@ -276,14 +276,14 @@ module LibHttp_Templates { tls := omit, mutual_tls := 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, @@ -298,7 +298,7 @@ module LibHttp_Templates { tls := omit, mutual_tls := omit } // End of template mw_http_response_ko_no_body - + template Response mw_http_response_ko( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -312,7 +312,7 @@ module LibHttp_Templates { tls := omit, mutual_tls := omit } // End of template mw_http_response_ko - + template (value) Response m_http_response_400_bad_request( in template (value) HttpMessageBody p_body, in template (value) Headers p_header, @@ -320,7 +320,7 @@ module LibHttp_Templates { in template (value) charstring p_statustext := "Bad Request" ) modifies m_http_response_ko := { } // End of template m_http_response_400_bad_request - + template Response mw_http_response_400_bad_request( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -328,7 +328,7 @@ module LibHttp_Templates { statuscode := 400, statustext := "Bad Request" } // End of template mw_http_response_400_bad_request - + template Response mw_http_response_401_unauthorized( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -336,7 +336,7 @@ module LibHttp_Templates { statuscode := 401, statustext := "Unauthorized" } // End of template mw_http_response_401_unauthorized - + template Response mw_http_response_403_forbidden( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -344,7 +344,7 @@ module LibHttp_Templates { statuscode := 403, statustext := "Forbidden" } // End of template mw_http_response_403_forbidden - + template Response mw_http_response_404_not_found( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -352,7 +352,7 @@ module LibHttp_Templates { statuscode := 404, statustext := "Not Found" } // End of template mw_http_response_404_not_found - + template Response mw_http_response_405_not_applicable( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -360,7 +360,7 @@ module LibHttp_Templates { statuscode := 405, statustext := "Not Applicable" } // End of template mw_http_response_405_not_applicable - + template Response mw_http_response_412_precondition_failed( template HttpMessageBody p_body := *, template (present) Headers p_header := ? @@ -368,71 +368,71 @@ module LibHttp_Templates { statuscode := 412, statustext := "Precondition Failed" } // End of template mw_http_response_412_not_found - + } // End of group http_responses - + group http_html_body { - + template (value) HttpMessageBody m_http_message_body_html( in template (value) HtmlBody p_html_body ) := { html_body := p_html_body } // End of template m_http_message_body_html - + template (present) HttpMessageBody mw_http_message_body_html( template (present) HtmlBody p_html_body := ? ) := { html_body := p_html_body } // End of template mw_http_message_body_html - + } // End of group http_html_body - + group http_xml_body { - + template (value) HttpMessageBody m_http_message_body_xml( in template (value) XmlBody p_xml_body ) := { xml_body := p_xml_body } // End of template m_http_message_body_xml - + template (present) HttpMessageBody mw_http_message_body_xml( template (present) XmlBody p_xml_body := ? ) := { xml_body := p_xml_body } // End of template mw_http_message_body_xml - + } // End of group http_xml_body - + group http_json_body { - + template (value) HttpMessageBody m_http_message_body_json( in template (value) JsonBody p_json_body ) := { json_body := p_json_body } // End of template m_http_message_body_json - + template (present) HttpMessageBody mw_http_message_body_json( template (present) JsonBody p_json_body := ? ) := { json_body := p_json_body } // End of template mw_http_message_body_json - + } // End of group http_json_body - + group http_binary_body { - + template (value) HttpMessageBody m_http_message_body_binary( in template (value) BinaryBody p_binary_body ) := { binary_body := p_binary_body } // End of template m_http_message_body_binary - + template (present) HttpMessageBody mw_http_message_body_binary( template (present) BinaryBody p_binary_body := ? ) := { binary_body := p_binary_body } // End of template mw_http_message_body_binary - + } // End of group http_binary_body - + } // End of module LibHttp_Templates diff --git a/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn b/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn index 9d0271ce2f0e121fb0888da37a9e8c7d31442b27..945a87e3937e4fe82ae57d5348e496c9523a0e0c 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_TestSystem.ttcn @@ -10,18 +10,18 @@ * @see ETSI TS 103 478 */ module LibHttp_TestSystem { - + // LibCommon import from LibCommon_Sync all; import from LibCommon_Time all; - + // LibHttp import from LibHttp_TypesAndValues all; - + type port HttpPort message { inout HttpMessage; } - + type component HttpComponent extends SelfSyncComp { port HttpPort httpPort; port HttpPort httpPort_notif; @@ -30,10 +30,10 @@ module LibHttp_TestSystem { timer tc_ac := PX_TAC; timer tc_noac := PX_TNOAC; } // End of component HttpComponent - + type component HttpTestAdapter { port HttpPort httpPort; port HttpPort httpPort_notif; } // End of component HttpTestAdapter - + } // End of module LibHttp_TestSystem diff --git a/ttcn/LibHttp/ttcn/LibHttp_TypesAndValues.ttcn b/ttcn/LibHttp/ttcn/LibHttp_TypesAndValues.ttcn index 77ca51b06eb999d229eaef52196c4abb043e187a..0d37019f9f53fdb59ef696f779f6e2474e712962 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_TypesAndValues.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_TypesAndValues.ttcn @@ -10,11 +10,11 @@ * @see ETSI TS 103 478 */ module LibHttp_TypesAndValues { - + // LibHttp import from LibHttp_MessageBodyTypes all; import from LibHttp_Pics all; - + const charstring c_header_host := "Host"; const charstring c_header_content_type := "Content-Type"; const charstring c_header_content_text := "Content-Text"; @@ -24,10 +24,10 @@ module LibHttp_TypesAndValues { const charstring c_header_pragma := "Pragma"; const charstring c_header_cache_control := "Cache-Control"; const charstring c_header_authorization := "Authorization"; - + const integer c_http_version_major := PICS_HTTP_VERSION_MAJOR; const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR; - + type record of charstring charstring_list; type record Header { charstring header_name, @@ -35,9 +35,9 @@ module LibHttp_TypesAndValues { } with { variant "FIELDORDER(msb)" } - + type record of Header Headers; - + type record Request { charstring method, charstring uri, @@ -48,7 +48,7 @@ module LibHttp_TypesAndValues { } with { variant "FIELDORDER(msb)" } - + type record Response { integer version_major, integer version_minor, @@ -61,14 +61,14 @@ module LibHttp_TypesAndValues { } with { variant "FIELDORDER(msb)" } - + type union HttpMessage { Response response, Request request } with { variant "" } - + } with { variant "" encode "HttpCodec" diff --git a/ttcn/LibHttp/ttcn/LibHttp_XMLTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_XMLTypes.ttcn index bdb9f7712c4ddeed6c24ea7db6eeb71241d0a284..a6c7f96c3ce1d85baa32bc2f585b8cd2fc4abd21 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_XMLTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_XMLTypes.ttcn @@ -1,11 +1,11 @@ module LibHttp_XMLTypes { // FIXME To be removed - + /** * This file is volontary empry. You have to declare all XSD files required by your project * In addition, the TTCN-3 module LibHttp_XmlMessageBodyTypes have to be updated too. */ // TODO Add here your custom RFCs import - + //import from XSD all; - + } // End of module LibHttp_XMLTypes diff --git a/ttcn/LibHttp/ttcn/LibHttp_XmlMessageBodyTypes.ttcn b/ttcn/LibHttp/ttcn/LibHttp_XmlMessageBodyTypes.ttcn index 96cfb2f44087a1dd1b5b08643c684627b8797aba..b57854c648cfafdd246305cd9e9451ad01c648dd 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_XmlMessageBodyTypes.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_XmlMessageBodyTypes.ttcn @@ -1,23 +1,23 @@ module LibHttp_XmlMessageBodyTypes { - + /** * This file volontary contains a trivial declaration of the type XmlBody. * In accordance with your TTCN-3 module LibHttp_XMLTypes, you have to change the XmlBody typing. */ // TODO Add here your custom RFCs import - + type union XmlBodyMsg { // TODO Add here your custom variants charstring raw } with { variant "" } - + type record XmlBody { XmlBodyMsg msg, charstring raw optional } - + } with { encode "XML"; variant "" diff --git a/ttcn/LibHttp/ttcn/LibHttp_XmlTemplates.ttcn b/ttcn/LibHttp/ttcn/LibHttp_XmlTemplates.ttcn index 343300c36779cd46cf38ba7f35db1027fbfb4833..1c28c2624c24eed98eccefacd9b772ca1a018b4d 100644 --- a/ttcn/LibHttp/ttcn/LibHttp_XmlTemplates.ttcn +++ b/ttcn/LibHttp/ttcn/LibHttp_XmlTemplates.ttcn @@ -9,15 +9,15 @@ * All rights reserved. */ module LibHttp_XmlTemplates { - + // import from XSD all; - + // TODO Add here your custom RFCs import - + // LibHttp import from LibHttp_XmlMessageBodyTypes all; import from LibHttp_XMLTypes all; - + template (value) XmlBody m_xml_body_raw( in template (value) charstring p_raw ) := { @@ -31,5 +31,5 @@ module LibHttp_XmlTemplates { msg := { raw := p_raw }, raw := p_raw } // End of template mw_xml_body_raw - + } // End of module LibHttp_XmlTemplates diff --git a/ttcn/LibJson/ttcn/Json.ttcn b/ttcn/LibJson/ttcn/Json.ttcn index ff45ceb51d25e142f2511e093036f04fef153ac1..cb7a8f56861b1d3b83043d0fa4d8aba6dd58ede4 100644 --- a/ttcn/LibJson/ttcn/Json.ttcn +++ b/ttcn/LibJson/ttcn/Json.ttcn @@ -1,5 +1,5 @@ module Json { - + // These constants are used in the Json date/time type definitions const charstring dash := "-", @@ -156,13 +156,13 @@ module Json { } with { variant "asValue" }*/ - + //Json literals //When only the true and false literals are allowed type boolean Bool; /*with { variant "Json:literal" }*/ //When only the null literal is allowed type enumerated Null { null_ }; /*with { variant "Json:literal" }*/ - + } with { encode "Json" } // End of module Json diff --git a/ttcn/LibXsd/ttcn/http_www_w3_org_XML_1998_namespace.ttcn b/ttcn/LibXsd/ttcn/http_www_w3_org_XML_1998_namespace.ttcn index dd35e71343e577b6b722dbeab43c380182108500..e595c61e3f851de4ef8920ee199748c161f93adb 100644 --- a/ttcn/LibXsd/ttcn/http_www_w3_org_XML_1998_namespace.ttcn +++ b/ttcn/LibXsd/ttcn/http_www_w3_org_XML_1998_namespace.ttcn @@ -64,7 +64,7 @@ import from XSD all; is a language code for the natural language of the content of any element; its value is inherited. This name is reserved by virtue of its definition in the XML specification. - + space (as an attribute name): denotes an attribute whose value is a keyword indicating what whitespace processing discipline is intended for the content of the element; its @@ -100,7 +100,7 @@ import from XSD all; <type . . .> . . . <attributeGroup ref="xml:specialAttrs"/> - + will define a type which will schema-validate an instance element with any of those attributes */