Commit 87d844cc authored by Yann Garcia's avatar Yann Garcia
Browse files

Unify STF525 TTCN-3 code

parent 0be31c6d
......@@ -28,10 +28,11 @@ module LibItsBtp_TypesAndValues {
type record BtpPacket {
BtpHeader header,
BtpRawPayload payload optional
}
}
with {
encode "LibIts_Interface"
variant "FIELDORDER(msb)"
}
}
} // end btpPdus
......
......@@ -46,7 +46,7 @@ module LibItsHttp_Functions {
function f_init_default_headers_list(
in charstring p_header_content_type := PICS_HEADER_CONTENT_TYPE,
in charstring p_header_content_text := "",
out HeaderLines p_headers
out Headers p_headers
) {
var integer v_i := 0;
......@@ -76,7 +76,7 @@ module LibItsHttp_Functions {
function f_set_headers_list(
in charstring_list p_headers_to_set,
in charstring_list p_headers_value,
inout HeaderLines p_headers
inout Headers p_headers
) {
// Sanity checks
if (lengthof(p_headers_to_set) == 0) {
......@@ -101,7 +101,7 @@ module LibItsHttp_Functions {
function f_remove_headers_list(
in charstring_list p_headers_to_remove,
inout HeaderLines p_headers
inout Headers p_headers
) {
// Sanity checks
if (lengthof(p_headers_to_remove) == 0) {
......@@ -121,7 +121,7 @@ module LibItsHttp_Functions {
} // End of function f_remove_headers_list
function f_get_header(
in HeaderLines p_headers,
in Headers p_headers,
in charstring p_header_name := c_header_content_text,
out charstring_list p_header_value
) {
......
......@@ -48,7 +48,7 @@ module LibItsHttp_Templates {
group http_headers {
template (value) HeaderLine m_header_line(
template (value) Header m_header_line(
in template (value) charstring p_header_name,
in template (value) charstring_list p_header_value
) := {
......@@ -62,7 +62,7 @@ module LibItsHttp_Templates {
template (omit) Request m_http_request_get(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (value) Headers p_headers,
in template (omit) HttpMessageBody p_body := omit
) := {
method := "GET",
......@@ -75,7 +75,7 @@ module LibItsHttp_Templates {
template Request mw_http_request_get(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template (present) Headers p_headers := ?,
template HttpMessageBody p_body := *
) := {
method := "GET",
......@@ -88,7 +88,7 @@ module LibItsHttp_Templates {
template (omit) Request m_http_request_post(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (value) Headers p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "POST"
......@@ -96,7 +96,7 @@ module LibItsHttp_Templates {
template Request mw_http_request_post(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template (present) Headers p_headers := ?,
template HttpMessageBody p_body := *
) modifies mw_http_request_get := {
method := "POST"
......@@ -104,7 +104,7 @@ module LibItsHttp_Templates {
template (omit) Request m_http_request_patch(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (value) Headers p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "PATCH"
......@@ -112,7 +112,7 @@ module LibItsHttp_Templates {
template Request mw_http_request_patch(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template (present) Headers p_headers := ?,
template HttpMessageBody p_body := *
) modifies mw_http_request_get := {
method := "PATCH"
......@@ -120,7 +120,7 @@ module LibItsHttp_Templates {
template (omit) Request m_http_request_put(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (value) Headers p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "PUT"
......@@ -128,7 +128,7 @@ module LibItsHttp_Templates {
template Request mw_http_request_put(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template (present) Headers p_headers := ?,
template HttpMessageBody p_body := *
) modifies mw_http_request_get := {
method := "PUT"
......@@ -136,7 +136,7 @@ module LibItsHttp_Templates {
template (omit) Request m_http_request_delete(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (value) Headers p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "DELETE"
......@@ -144,7 +144,7 @@ module LibItsHttp_Templates {
template Request mw_http_request_delete(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template (present) Headers p_headers := ?,
template HttpMessageBody p_body := *
) modifies mw_http_request_get := {
method := "DELETE"
......@@ -156,7 +156,7 @@ module LibItsHttp_Templates {
template (value) Response m_http_response_ok(
in template (value) HttpMessageBody p_body,
in template (value) HeaderLines p_header
in template (value) Headers p_header
) := {
version_major := 1,
version_minor := 1,
......@@ -167,7 +167,7 @@ module LibItsHttp_Templates {
} // End of template m_http_response_ok
template (value) Response m_http_response_ok_no_body(
in template (value) HeaderLines p_header
in template (value) Headers p_header
) := {
version_major := 1,
version_minor := 1,
......@@ -178,7 +178,7 @@ module LibItsHttp_Templates {
} // End of template m_http_response_ok_no_body
template (value) Response m_http_response_204_no_content(
in template (value) HeaderLines p_header
in template (value) Headers p_header
) modifies m_http_response_ok_no_body := {
statuscode := 204,
statustext := "No Content"
......@@ -186,7 +186,7 @@ module LibItsHttp_Templates {
template (present) Response mw_http_response_ok(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) := {
version_major := 1,
version_minor := 1,
......@@ -198,7 +198,7 @@ module LibItsHttp_Templates {
template (present) Response mw_http_response_201_created(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ok := {
statuscode := 201,
statustext := "Created"
......@@ -206,7 +206,7 @@ module LibItsHttp_Templates {
template (present) Response mw_http_response_202_accepted(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ok := {
statuscode := 202,
statustext := "Accepted"
......@@ -214,7 +214,7 @@ module LibItsHttp_Templates {
template (present) Response mw_http_response_204_no_content(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ok := {
statuscode := 204,
statustext := "No Content"
......@@ -222,7 +222,7 @@ module LibItsHttp_Templates {
template (value) Response m_http_response_ko(
in template (value) HttpMessageBody p_body,
in template (value) HeaderLines p_header,
in template (value) Headers p_header,
in template (value) integer p_statuscode := 404,
in template (value) charstring p_statustext := "Not found"
) := {
......@@ -235,7 +235,7 @@ module LibItsHttp_Templates {
} // End of template m_http_response_ko
template (value) Response m_http_response_ko_no_body(
in template (value) HeaderLines p_header,
in template (value) Headers p_header,
in template (value) integer p_statuscode := 404,
in template (value) charstring p_statustext := "Not found"
) := {
......@@ -249,7 +249,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_ko(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) := {
version_major := 1,
version_minor := 1,
......@@ -261,7 +261,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_400_bad_request(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ko := {
statuscode := 400,
statustext := "Bad Request"
......@@ -269,7 +269,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_401_unauthorized(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ko := {
statuscode := 401,
statustext := "Unauthorized"
......@@ -277,7 +277,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_403_forbidden(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ko := {
statuscode := 403,
statustext := "Forbidden"
......@@ -285,7 +285,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_404_not_found(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ko := {
statuscode := 404,
statustext := "Not Found"
......@@ -293,7 +293,7 @@ module LibItsHttp_Templates {
template Response mw_http_response_412_precondition_failed(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
template (present) Headers p_header := ?
) modifies mw_http_response_ko := {
statuscode := 412,
statustext := "Precondition Failed"
......
......@@ -29,21 +29,21 @@ module LibItsHttp_TypesAndValues {
const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR;
type record of charstring charstring_list;
type record HeaderLine {
type record Header {
charstring header_name,
charstring_list header_value optional
} with {
variant "FIELDORDER(msb)"
}
type record of HeaderLine HeaderLines;
type record of Header Headers;
type record Request {
charstring method,
charstring uri,
integer version_major,
integer version_minor,
HeaderLines header,
Headers header,
HttpMessageBody body optional
} with {
variant "FIELDORDER(msb)"
......@@ -54,7 +54,7 @@ module LibItsHttp_TypesAndValues {
integer version_minor,
integer statuscode,
charstring statustext,
HeaderLines header,
Headers header,
HttpMessageBody body optional
} with {
variant "FIELDORDER(msb)"
......
......@@ -112,6 +112,7 @@ module LibItsIvim_TestSystem {
var UtIvimEventIndList vc_utEvents := {};
var boolean vc_ivimDefaultActive := true;
} // End of component ItsIvim
group facilityPrimitives {
......
......@@ -670,7 +670,7 @@ module LibItsPki_Functions {
} // End of function f_verifyEcdsa
function f_http_send(
in HeaderLines p_headers,
in Headers p_headers,
in template (value) HttpMessage p_http_message
) runs on ItsPkiHttp {
log(">>> f_http_send: ", p_http_message);
......@@ -1025,7 +1025,7 @@ module LibItsPki_Functions {
p_result := true;
} else {
// Generate the certificate
if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, p_private_key, p_digest, v_ec_certificate) == false) {
if (f_generate_ec_certificate_for_inner_ec_response(valueof(p_inner_ec_request), p_private_key, p_digest, v_ec_certificate) == false) {
log("f_http_build_inner_ec_response: Failed to generate the certificate");
p_inner_ec_response := valueof(
m_innerEcResponse_ko(
......@@ -3178,7 +3178,7 @@ module LibItsPki_Functions {
out InnerEcResponse p_inner_ec_response,
in boolean p_strict_checks := true
) runs on ItsPkiHttp return boolean {
var HeaderLines v_headers;
var Headers v_headers;
var Oct32 v_request_hash;
var Oct16 v_encrypted_sym_key;
var Oct16 v_aes_sym_key;
......@@ -3289,7 +3289,7 @@ module LibItsPki_Functions {
var Oct16 v_aes_enc_key;
var InnerEcRequest v_inner_ec_request;
var template (value) HttpMessage v_response;
var HeaderLines v_headers;
var Headers v_headers;
tc_ac.stop;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment