// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 11.1.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2025 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "HTTP_Adapter.hh"

namespace HTTP__Adapter {

/* Literal string constants */

extern const OCTETSTRING os_0(0, NULL);
extern const CHARSTRING cs_4(0, NULL),
cs_7(':'),
cs_3(14, "Content-Length"),
cs_2(12, "Content-Type"),
cs_5(3, "GET"),
cs_1(4, "Host"),
cs_6(16, "application/json"),
cs_0(4, "omit");
const unsigned char module_checksum[] = { 0x99, 0xae, 0x67, 0x4a, 0x36, 0x34, 0x83, 0xd2, 0x8a, 0x3c, 0xd2, 0x90, 0xc3, 0x7b, 0x0e, 0x72 };

/* Global variable definitions */

const TTCN_Typedescriptor_t& http__CT_descr_ = COMPONENT_descr_;
HTTPmsg__PortType::HTTPmsg__PT http__CT_component_HTTP("HTTP");
const XERdescriptor_t       HTTP__Adapter__Params_http__host_xer_ = { {"http_host>\n", "http_host>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTP__Adapter__Params_http__host_descr_ = { "@HTTP_Adapter.HTTP_Adapter_Params.http_host", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &HTTP__Adapter__Params_http__host_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTP__Adapter__Params_http__port_xer_ = { {"http_port>\n", "http_port>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t HTTP__Adapter__Params_http__port_descr_ = { "@HTTP_Adapter.HTTP_Adapter_Params.http_port", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HTTP__Adapter__Params_http__port_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       HTTP__Adapter__Params_use__ssl_xer_ = { {"use_ssl>\n", "use_ssl>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int HTTP__Adapter__Params_use__ssl_oer_ext_arr_[0] = {};
const int HTTP__Adapter__Params_use__ssl_oer_p_[0] = {};
const TTCN_OERdescriptor_t HTTP__Adapter__Params_use__ssl_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HTTP__Adapter__Params_use__ssl_oer_ext_arr_, 0, HTTP__Adapter__Params_use__ssl_oer_p_};
const TTCN_Typedescriptor_t HTTP__Adapter__Params_use__ssl_descr_ = { "@HTTP_Adapter.HTTP_Adapter_Params.use_ssl", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &HTTP__Adapter__Params_use__ssl_xer_, &BOOLEAN_json_, &HTTP__Adapter__Params_use__ssl_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for HTTP__Adapter__Params
const TTCN_Typedescriptor_t HTTP__Adapter__Params_descr_ = { "@HTTP_Adapter.HTTP_Adapter_Params", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
HTTP__Adapter__Params_template http__CT_component_g__http__pars;
HTTP__Adapter__Params_template template_f__http__init_http__pars_defval;
const HTTP__Adapter__Params_template& f__http__init_http__pars_defval = template_f__http__init_http__pars_defval;
INTEGER_template template_ts__HTTP__Connect_http__port_defval;
const INTEGER_template& ts__HTTP__Connect_http__port_defval = template_ts__HTTP__Connect_http__port_defval;
BOOLEAN_template template_ts__HTTP__Connect_use__ssl_defval;
const BOOLEAN_template& ts__HTTP__Connect_use__ssl_defval = template_ts__HTTP__Connect_use__ssl_defval;
INTEGER_template template_ts__HTTP__Close_client__id_defval;
const INTEGER_template& ts__HTTP__Close_client__id_defval = template_ts__HTTP__Close_client__id_defval;
CHARSTRING_template template_f__ts__HTTP__Header_body_defval;
const CHARSTRING_template& f__ts__HTTP__Header_body_defval = template_f__ts__HTTP__Header_body_defval;
OCTETSTRING_template template_f__ts__HTTP__Header_binary__body_defval;
const OCTETSTRING_template& f__ts__HTTP__Header_binary__body_defval = template_f__ts__HTTP__Header_binary__body_defval;
CHARSTRING_template template_f__ts__HTTP__Header_content__type_defval;
const CHARSTRING_template& f__ts__HTTP__Header_content__type_defval = template_f__ts__HTTP__Header_content__type_defval;
CHARSTRING_template template_f__ts__HTTP__Header_host_defval;
const CHARSTRING_template& f__ts__HTTP__Header_host_defval = template_f__ts__HTTP__Header_host_defval;
HTTPmsg__Types::HeaderLines const_f__ts__HTTP__Header_custom__hdr_defval;
const HTTPmsg__Types::HeaderLines& f__ts__HTTP__Header_custom__hdr_defval = const_f__ts__HTTP__Header_custom__hdr_defval;
CHARSTRING const_ts__HTTP__Req_method_defval;
const CHARSTRING& ts__HTTP__Req_method_defval = const_ts__HTTP__Req_method_defval;
CHARSTRING_template template_ts__HTTP__Req_body_defval;
const CHARSTRING_template& ts__HTTP__Req_body_defval = template_ts__HTTP__Req_body_defval;
CHARSTRING_template template_ts__HTTP__Req_content__type_defval;
const CHARSTRING_template& ts__HTTP__Req_content__type_defval = template_ts__HTTP__Req_content__type_defval;
INTEGER const_ts__HTTP__Req_v__maj_defval;
const INTEGER& ts__HTTP__Req_v__maj_defval = const_ts__HTTP__Req_v__maj_defval;
INTEGER const_ts__HTTP__Req_v__min_defval;
const INTEGER& ts__HTTP__Req_v__min_defval = const_ts__HTTP__Req_v__min_defval;
HTTPmsg__Types::HeaderLines const_ts__HTTP__Req_custom__hdr_defval;
const HTTPmsg__Types::HeaderLines& ts__HTTP__Req_custom__hdr_defval = const_ts__HTTP__Req_custom__hdr_defval;
INTEGER_template template_ts__HTTP__Req_client__id_defval;
const INTEGER_template& ts__HTTP__Req_client__id_defval = template_ts__HTTP__Req_client__id_defval;
CHARSTRING const_ts__HTTP__Req__Bin_method_defval;
const CHARSTRING& ts__HTTP__Req__Bin_method_defval = const_ts__HTTP__Req__Bin_method_defval;
OCTETSTRING_template template_ts__HTTP__Req__Bin_body_defval;
const OCTETSTRING_template& ts__HTTP__Req__Bin_body_defval = template_ts__HTTP__Req__Bin_body_defval;
CHARSTRING_template template_ts__HTTP__Req__Bin_content__type_defval;
const CHARSTRING_template& ts__HTTP__Req__Bin_content__type_defval = template_ts__HTTP__Req__Bin_content__type_defval;
INTEGER const_ts__HTTP__Req__Bin_v__maj_defval;
const INTEGER& ts__HTTP__Req__Bin_v__maj_defval = const_ts__HTTP__Req__Bin_v__maj_defval;
INTEGER const_ts__HTTP__Req__Bin_v__min_defval;
const INTEGER& ts__HTTP__Req__Bin_v__min_defval = const_ts__HTTP__Req__Bin_v__min_defval;
HTTPmsg__Types::HeaderLines const_ts__HTTP__Req__Bin_custom__hdr_defval;
const HTTPmsg__Types::HeaderLines& ts__HTTP__Req__Bin_custom__hdr_defval = const_ts__HTTP__Req__Bin_custom__hdr_defval;
INTEGER_template template_ts__HTTP__Req__Bin_client__id_defval;
const INTEGER_template& ts__HTTP__Req__Bin_client__id_defval = template_ts__HTTP__Req__Bin_client__id_defval;
INTEGER_template template_tr__HTTP__Resp_sts_defval;
const INTEGER_template& tr__HTTP__Resp_sts_defval = template_tr__HTTP__Resp_sts_defval;
INTEGER_template template_tr__HTTP__Resp__Bin_sts_defval;
const INTEGER_template& tr__HTTP__Resp__Bin_sts_defval = template_tr__HTTP__Resp__Bin_sts_defval;
HTTPmsg__Types::HTTPMessage_template template_tr__HTTP__Resp2xx;
const HTTPmsg__Types::HTTPMessage_template& tr__HTTP__Resp2xx = template_tr__HTTP__Resp2xx;
CHARSTRING const_f__http__tx__request_method_defval;
const CHARSTRING& f__http__tx__request_method_defval = const_f__http__tx__request_method_defval;
CHARSTRING_template template_f__http__tx__request_body_defval;
const CHARSTRING_template& f__http__tx__request_body_defval = template_f__http__tx__request_body_defval;
OCTETSTRING_template template_f__http__tx__request_binary__body_defval;
const OCTETSTRING_template& f__http__tx__request_binary__body_defval = template_f__http__tx__request_binary__body_defval;
CHARSTRING const_f__http__tx__request_content__type_defval;
const CHARSTRING& f__http__tx__request_content__type_defval = const_f__http__tx__request_content__type_defval;
HTTPmsg__Types::HeaderLines const_f__http__tx__request_custom__hdr_defval;
const HTTPmsg__Types::HeaderLines& f__http__tx__request_custom__hdr_defval = const_f__http__tx__request_custom__hdr_defval;
FLOAT const_f__http__tx__request_tout_defval;
const FLOAT& f__http__tx__request_tout_defval = const_f__http__tx__request_tout_defval;
INTEGER_template template_f__http__tx__request_client__id_defval;
const INTEGER_template& f__http__tx__request_client__id_defval = template_f__http__tx__request_client__id_defval;
HTTP__Adapter__Params_template template_f__http__tx__request_http__pars_defval;
const HTTP__Adapter__Params_template& f__http__tx__request_http__pars_defval = template_f__http__tx__request_http__pars_defval;
HTTPmsg__Types::HTTPMessage_template template_f__http__rx__response_exp_defval;
const HTTPmsg__Types::HTTPMessage_template& f__http__rx__response_exp_defval = template_f__http__rx__response_exp_defval;
FLOAT const_f__http__rx__response_tout_defval;
const FLOAT& f__http__rx__response_tout_defval = const_f__http__rx__response_tout_defval;
INTEGER_template template_f__http__rx__response_client__id_defval;
const INTEGER_template& f__http__rx__response_client__id_defval = template_f__http__rx__response_client__id_defval;
BOOLEAN const_f__http__rx__response_keep__connection_defval;
const BOOLEAN& f__http__rx__response_keep__connection_defval = const_f__http__rx__response_keep__connection_defval;
CHARSTRING const_f__http__transact_method_defval;
const CHARSTRING& f__http__transact_method_defval = const_f__http__transact_method_defval;
CHARSTRING_template template_f__http__transact_body_defval;
const CHARSTRING_template& f__http__transact_body_defval = template_f__http__transact_body_defval;
OCTETSTRING_template template_f__http__transact_binary__body_defval;
const OCTETSTRING_template& f__http__transact_binary__body_defval = template_f__http__transact_binary__body_defval;
CHARSTRING const_f__http__transact_content__type_defval;
const CHARSTRING& f__http__transact_content__type_defval = const_f__http__transact_content__type_defval;
HTTPmsg__Types::HTTPMessage_template template_f__http__transact_exp_defval;
const HTTPmsg__Types::HTTPMessage_template& f__http__transact_exp_defval = template_f__http__transact_exp_defval;
FLOAT const_f__http__transact_tout_defval;
const FLOAT& f__http__transact_tout_defval = const_f__http__transact_tout_defval;
HTTPmsg__Types::HeaderLines const_f__http__transact_custom__hdr_defval;
const HTTPmsg__Types::HeaderLines& f__http__transact_custom__hdr_defval = const_f__http__transact_custom__hdr_defval;
INTEGER_template template_f__http__transact_client__id_defval;
const INTEGER_template& f__http__transact_client__id_defval = template_f__http__transact_client__id_defval;
BOOLEAN const_f__http__transact_keep__connection_defval;
const BOOLEAN& f__http__transact_keep__connection_defval = const_f__http__transact_keep__connection_defval;
HTTP__Adapter__Params_template template_f__http__transact_http__pars_defval;
const HTTP__Adapter__Params_template& f__http__transact_http__pars_defval = template_f__http__transact_http__pars_defval;
TTCN_Module module_object("HTTP_Adapter", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_11,
  current_runtime_version.requires_minor_version_1,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

HTTP__Adapter__Params::HTTP__Adapter__Params()
{
}

HTTP__Adapter__Params::HTTP__Adapter__Params(const CHARSTRING& par_http__host,
    const INTEGER& par_http__port,
    const BOOLEAN& par_use__ssl)
  :   field_http__host(par_http__host),
  field_http__port(par_http__port),
  field_use__ssl(par_use__ssl)
{
}

HTTP__Adapter__Params::HTTP__Adapter__Params(const HTTP__Adapter__Params& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HTTP_Adapter.HTTP_Adapter_Params.");
if (other_value.http__host().is_bound()) field_http__host = other_value.http__host();
else field_http__host.clean_up();
if (other_value.http__port().is_bound()) field_http__port = other_value.http__port();
else field_http__port.clean_up();
if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
else field_use__ssl.clean_up();
}

void HTTP__Adapter__Params::clean_up()
{
field_http__host.clean_up();
field_http__port.clean_up();
field_use__ssl.clean_up();
}

const TTCN_Typedescriptor_t* HTTP__Adapter__Params::get_descriptor() const { return &HTTP__Adapter__Params_descr_; }
HTTP__Adapter__Params& HTTP__Adapter__Params::operator=(const HTTP__Adapter__Params& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HTTP_Adapter.HTTP_Adapter_Params.");
  if (other_value.http__host().is_bound()) field_http__host = other_value.http__host();
  else field_http__host.clean_up();
  if (other_value.http__port().is_bound()) field_http__port = other_value.http__port();
  else field_http__port.clean_up();
  if (other_value.use__ssl().is_bound()) field_use__ssl = other_value.use__ssl();
  else field_use__ssl.clean_up();
}
return *this;
}

boolean HTTP__Adapter__Params::operator==(const HTTP__Adapter__Params& other_value) const
{
return field_http__host==other_value.field_http__host
  && field_http__port==other_value.field_http__port
  && field_use__ssl==other_value.field_use__ssl;
}

boolean HTTP__Adapter__Params::is_bound() const
{
return (field_http__host.is_bound())
  || (field_http__port.is_bound())
  || (field_use__ssl.is_bound());
}
boolean HTTP__Adapter__Params::is_value() const
{
return field_http__host.is_value()
  && field_http__port.is_value()
  && field_use__ssl.is_value();
}
void HTTP__Adapter__Params::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ http_host := ");
field_http__host.log();
TTCN_Logger::log_event_str(", http_port := ");
field_http__port.log();
TTCN_Logger::log_event_str(", use_ssl := ");
field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
}

void HTTP__Adapter__Params::set_implicit_omit()
{
if (http__host().is_bound()) http__host().set_implicit_omit();
if (http__port().is_bound()) http__port().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void HTTP__Adapter__Params::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @HTTP_Adapter.HTTP_Adapter_Params has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) http__host().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) http__port().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "http_host")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          http__host().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "http_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          http__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTP_Adapter.HTTP_Adapter_Params: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@HTTP_Adapter.HTTP_Adapter_Params");
  }
}

void HTTP__Adapter__Params::encode_text(Text_Buf& text_buf) const
{
field_http__host.encode_text(text_buf);
field_http__port.encode_text(text_buf);
field_use__ssl.encode_text(text_buf);
}

void HTTP__Adapter__Params::decode_text(Text_Buf& text_buf)
{
field_http__host.decode_text(text_buf);
field_http__port.decode_text(text_buf);
field_use__ssl.decode_text(text_buf);
}

struct HTTP__Adapter__Params_template::single_value_struct {
CHARSTRING_template field_http__host;
INTEGER_template field_http__port;
BOOLEAN_template field_use__ssl;
};

void HTTP__Adapter__Params_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_http__host = ANY_VALUE;
single_value->field_http__port = ANY_VALUE;
single_value->field_use__ssl = ANY_VALUE;
}
}
}

void HTTP__Adapter__Params_template::copy_value(const HTTP__Adapter__Params& other_value)
{
single_value = new single_value_struct;
if (other_value.http__host().is_bound()) {
  single_value->field_http__host = other_value.http__host();
} else {
  single_value->field_http__host.clean_up();
}
if (other_value.http__port().is_bound()) {
  single_value->field_http__port = other_value.http__port();
} else {
  single_value->field_http__port.clean_up();
}
if (other_value.use__ssl().is_bound()) {
  single_value->field_use__ssl = other_value.use__ssl();
} else {
  single_value->field_use__ssl.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void HTTP__Adapter__Params_template::copy_template(const HTTP__Adapter__Params_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.http__host().get_selection()) {
single_value->field_http__host = other_value.http__host();
} else {
single_value->field_http__host.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.http__port().get_selection()) {
single_value->field_http__port = other_value.http__port();
} else {
single_value->field_http__port.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.use__ssl().get_selection()) {
single_value->field_use__ssl = other_value.use__ssl();
} else {
single_value->field_use__ssl.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new HTTP__Adapter__Params_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new HTTP__Adapter__Params_template(*other_value.implication_.precondition);
implication_.implied_template = new HTTP__Adapter__Params_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @HTTP_Adapter.HTTP_Adapter_Params.");
break;
}
set_selection(other_value);
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template()
{
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(const HTTP__Adapter__Params& other_value)
{
copy_value(other_value);
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(const OPTIONAL<HTTP__Adapter__Params>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTP__Adapter__Params&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @HTTP_Adapter.HTTP_Adapter_Params from an unbound optional field.");
}
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(HTTP__Adapter__Params_template* p_precondition, HTTP__Adapter__Params_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(Dynamic_Match_Interface<HTTP__Adapter__Params>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<HTTP__Adapter__Params>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

HTTP__Adapter__Params_template::HTTP__Adapter__Params_template(const HTTP__Adapter__Params_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

HTTP__Adapter__Params_template::~HTTP__Adapter__Params_template()
{
clean_up();
}

HTTP__Adapter__Params_template& HTTP__Adapter__Params_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

HTTP__Adapter__Params_template& HTTP__Adapter__Params_template::operator=(const HTTP__Adapter__Params& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

HTTP__Adapter__Params_template& HTTP__Adapter__Params_template::operator=(const OPTIONAL<HTTP__Adapter__Params>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const HTTP__Adapter__Params&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @HTTP_Adapter.HTTP_Adapter_Params.");
}
return *this;
}

HTTP__Adapter__Params_template& HTTP__Adapter__Params_template::operator=(const HTTP__Adapter__Params_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean HTTP__Adapter__Params_template::match(const HTTP__Adapter__Params& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.http__host().is_bound()) return FALSE;
if(!single_value->field_http__host.match(other_value.http__host(), legacy))return FALSE;
if(!other_value.http__port().is_bound()) return FALSE;
if(!single_value->field_http__port.match(other_value.http__port(), legacy))return FALSE;
if(!other_value.use__ssl().is_bound()) return FALSE;
if(!single_value->field_use__ssl.match(other_value.use__ssl(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @HTTP_Adapter.HTTP_Adapter_Params.");
}
return FALSE;
}

boolean HTTP__Adapter__Params_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_http__host.is_bound()
 || single_value->field_http__port.is_bound()
 || single_value->field_use__ssl.is_bound();
}

boolean HTTP__Adapter__Params_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_http__host.is_value()
 && single_value->field_http__port.is_value()
 && single_value->field_use__ssl.is_value();
}

void HTTP__Adapter__Params_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

HTTP__Adapter__Params HTTP__Adapter__Params_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @HTTP_Adapter.HTTP_Adapter_Params.");
HTTP__Adapter__Params ret_val;
if (single_value->field_http__host.is_bound()) {
ret_val.http__host() = single_value->field_http__host.valueof();
}
if (single_value->field_http__port.is_bound()) {
ret_val.http__port() = single_value->field_http__port.valueof();
}
if (single_value->field_use__ssl.is_bound()) {
ret_val.use__ssl() = single_value->field_use__ssl.valueof();
}
return ret_val;
}

void HTTP__Adapter__Params_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @HTTP_Adapter.HTTP_Adapter_Params.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new HTTP__Adapter__Params_template[list_length];
}

HTTP__Adapter__Params_template& HTTP__Adapter__Params_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @HTTP_Adapter.HTTP_Adapter_Params.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @HTTP_Adapter.HTTP_Adapter_Params.");
return value_list.list_value[list_index];
}

CHARSTRING_template& HTTP__Adapter__Params_template::http__host()
{
set_specific();
return single_value->field_http__host;
}

const CHARSTRING_template& HTTP__Adapter__Params_template::http__host() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field http_host of a non-specific template of type @HTTP_Adapter.HTTP_Adapter_Params.");
return single_value->field_http__host;
}

INTEGER_template& HTTP__Adapter__Params_template::http__port()
{
set_specific();
return single_value->field_http__port;
}

const INTEGER_template& HTTP__Adapter__Params_template::http__port() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field http_port of a non-specific template of type @HTTP_Adapter.HTTP_Adapter_Params.");
return single_value->field_http__port;
}

BOOLEAN_template& HTTP__Adapter__Params_template::use__ssl()
{
set_specific();
return single_value->field_use__ssl;
}

const BOOLEAN_template& HTTP__Adapter__Params_template::use__ssl() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field use_ssl of a non-specific template of type @HTTP_Adapter.HTTP_Adapter_Params.");
return single_value->field_use__ssl;
}

int HTTP__Adapter__Params_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @HTTP_Adapter.HTTP_Adapter_Params containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HTTP_Adapter.HTTP_Adapter_Params.");
  }
  return 0;
}

void HTTP__Adapter__Params_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ http_host := ");
single_value->field_http__host.log();
TTCN_Logger::log_event_str(", http_port := ");
single_value->field_http__port.log();
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void HTTP__Adapter__Params_template::log_match(const HTTP__Adapter__Params& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_http__host.match(match_value.http__host(), legacy)){
TTCN_Logger::log_logmatch_info(".http_host");
single_value->field_http__host.log_match(match_value.http__host(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_http__port.match(match_value.http__port(), legacy)){
TTCN_Logger::log_logmatch_info(".http_port");
single_value->field_http__port.log_match(match_value.http__port(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_use__ssl.match(match_value.use__ssl(), legacy)){
TTCN_Logger::log_logmatch_info(".use_ssl");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ http_host := ");
single_value->field_http__host.log_match(match_value.http__host(), legacy);
TTCN_Logger::log_event_str(", http_port := ");
single_value->field_http__port.log_match(match_value.http__port(), legacy);
TTCN_Logger::log_event_str(", use_ssl := ");
single_value->field_use__ssl.log_match(match_value.use__ssl(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void HTTP__Adapter__Params_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (http__host().is_bound()) http__host().set_implicit_omit();
if (http__port().is_bound()) http__port().set_implicit_omit();
if (use__ssl().is_bound()) use__ssl().set_implicit_omit();
}

void HTTP__Adapter__Params_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_http__host.encode_text(text_buf);
single_value->field_http__port.encode_text(text_buf);
single_value->field_use__ssl.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @HTTP_Adapter.HTTP_Adapter_Params.");
}
}

void HTTP__Adapter__Params_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_http__host.decode_text(text_buf);
single_value->field_http__port.decode_text(text_buf);
single_value->field_use__ssl.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new HTTP__Adapter__Params_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @HTTP_Adapter.HTTP_Adapter_Params.");
}
}

void HTTP__Adapter__Params_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    HTTP__Adapter__Params_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @HTTP_Adapter.HTTP_Adapter_Params has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) http__host().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) http__port().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) use__ssl().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "http_host")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          http__host().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "http_port")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          http__port().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_ssl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__ssl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @HTTP_Adapter.HTTP_Adapter_Params: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    HTTP__Adapter__Params_template* precondition = new HTTP__Adapter__Params_template;
    precondition->set_param(*param.get_elem(0));
    HTTP__Adapter__Params_template* implied_template = new HTTP__Adapter__Params_template;
    implied_template->set_param(*param.get_elem(1));
    *this = HTTP__Adapter__Params_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@HTTP_Adapter.HTTP_Adapter_Params");
  }
  is_ifpresent = param.get_ifpresent();
}

void HTTP__Adapter__Params_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_http__host.check_restriction(t_res, t_name ? t_name : "@HTTP_Adapter.HTTP_Adapter_Params");
single_value->field_http__port.check_restriction(t_res, t_name ? t_name : "@HTTP_Adapter.HTTP_Adapter_Params");
single_value->field_use__ssl.check_restriction(t_res, t_name ? t_name : "@HTTP_Adapter.HTTP_Adapter_Params");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@HTTP_Adapter.HTTP_Adapter_Params");
}

boolean HTTP__Adapter__Params_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean HTTP__Adapter__Params_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


/* Bodies of functions, altsteps and testcases */

void f__http__init(const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 32, TTCN_Location::LOCATION_FUNCTION, "f_http_init");
current_location.update_lineno(33);
/* HTTP_Adapter.ttcn, line 33 */
{
Map_Params tmp_0(0);
TTCN_Runtime::map_port(self, http__CT_component_HTTP.get_name(), SYSTEM_COMPREF, "HTTP", tmp_0);
}
current_location.update_lineno(34);
/* HTTP_Adapter.ttcn, line 34 */
http__CT_component_g__http__pars = http__pars;
}

void start_f__http__init(const COMPONENT& component_reference, const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_init(");
http__pars.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "HTTP_Adapter", "f_http_init", text_buf);
http__pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

HTTPmsg__Types::Connect_template ts__HTTP__Connect(const CHARSTRING_template& hostname, const INTEGER_template& http__port, const BOOLEAN_template& use__ssl)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 37, TTCN_Location::LOCATION_TEMPLATE, "ts_HTTP_Connect");
HTTPmsg__Types::Connect_template ret_val;
ret_val.hostname() = hostname;
ret_val.portnumber() = http__port;
ret_val.use__ssl() = use__ssl;
return ret_val;
}

HTTPmsg__Types::Close_template ts__HTTP__Close(const INTEGER_template& client__id)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 44, TTCN_Location::LOCATION_TEMPLATE, "ts_HTTP_Close");
HTTPmsg__Types::Close_template ret_val;
ret_val.client__id() = client__id;
return ret_val;
}

HTTPmsg__Types::HeaderLines_template f__overlay__HTTP__Header(const HTTPmsg__Types::HeaderLines& hdr, const HTTPmsg__Types::HeaderLines& additional__hdr)
{
HTTPmsg__Types::HeaderLines hdr_shadow(hdr);
TTCN_Location current_location("HTTP_Adapter.ttcn", 47, TTCN_Location::LOCATION_FUNCTION, "f_overlay_HTTP_Header");
current_location.update_lineno(49);
/* HTTP_Adapter.ttcn, line 49 */
INTEGER i;
current_location.update_lineno(50);
/* HTTP_Adapter.ttcn, line 50 */
INTEGER k;
current_location.update_lineno(51);
/* HTTP_Adapter.ttcn, line 51 */
BOOLEAN updated;
current_location.update_lineno(53);
/* HTTP_Adapter.ttcn, line 53 */
i = 0;
current_location.update_lineno(53);
/* HTTP_Adapter.ttcn, line 53 */
for ( ; ; ) {
current_location.update_lineno(53);
/* HTTP_Adapter.ttcn, line 53 */
if (!(i < additional__hdr.lengthof())) break;
current_location.update_lineno(54);
/* HTTP_Adapter.ttcn, line 54 */
updated = FALSE;
current_location.update_lineno(55);
/* HTTP_Adapter.ttcn, line 55 */
k = 0;
current_location.update_lineno(55);
/* HTTP_Adapter.ttcn, line 55 */
for ( ; ; ) {
current_location.update_lineno(55);
/* HTTP_Adapter.ttcn, line 55 */
if (!(k < hdr_shadow.lengthof())) break;
current_location.update_lineno(56);
/* HTTP_Adapter.ttcn, line 56 */
if ((Native__Functions::f__str__tolower(const_cast< const HTTPmsg__Types::HeaderLines&>(hdr_shadow)[k].header__name()) == Native__Functions::f__str__tolower(const_cast< const HTTPmsg__Types::HeaderLines&>(additional__hdr)[i].header__name()))) {
current_location.update_lineno(57);
/* HTTP_Adapter.ttcn, line 57 */
hdr_shadow[k] = const_cast< const HTTPmsg__Types::HeaderLines&>(additional__hdr)[i];
current_location.update_lineno(58);
/* HTTP_Adapter.ttcn, line 58 */
updated = TRUE;
}
current_location.update_lineno(55);
/* HTTP_Adapter.ttcn, line 55 */
{
INTEGER tmp_7;
++k;
}
}
current_location.update_lineno(61);
/* HTTP_Adapter.ttcn, line 61 */
if ((updated == FALSE)) {
current_location.update_lineno(62);
/* HTTP_Adapter.ttcn, line 62 */
{
HTTPmsg__Types::HeaderLines tmp_8;
{
HTTPmsg__Types::HeaderLines tmp_9;
tmp_9.set_size(1);
tmp_9[0] = const_cast< const HTTPmsg__Types::HeaderLines&>(additional__hdr)[i];
tmp_8 = (hdr_shadow + tmp_9);
}
hdr_shadow = tmp_8;
}
}
current_location.update_lineno(53);
/* HTTP_Adapter.ttcn, line 53 */
{
INTEGER tmp_10;
++i;
}
}
current_location.update_lineno(66);
/* HTTP_Adapter.ttcn, line 66 */
return HTTPmsg__Types::HeaderLines_template(hdr_shadow);
}

HTTPmsg__Types::HeaderLine_template ts__HeaderLine(const CHARSTRING& header__name, const CHARSTRING& header__value)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 69, TTCN_Location::LOCATION_TEMPLATE, "ts_HeaderLine");
HTTPmsg__Types::HeaderLine_template ret_val;
ret_val.header__name() = header__name;
ret_val.header__value() = header__value;
return ret_val;
}

HTTPmsg__Types::HeaderLines_template f__ts__HTTP__Header(const CHARSTRING_template& body, const OCTETSTRING_template& binary__body, const CHARSTRING_template& content__type, const CHARSTRING_template& host, const HTTPmsg__Types::HeaderLines& custom__hdr)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 74, TTCN_Location::LOCATION_FUNCTION, "f_ts_HTTP_Header");
current_location.update_lineno(80);
/* HTTP_Adapter.ttcn, line 80 */
HTTPmsg__Types::HeaderLines hdr(NULL_VALUE);
current_location.update_lineno(83);
/* HTTP_Adapter.ttcn, line 83 */
{
boolean tmp_11;
tmp_11 = (!(body.get_istemplate_kind((const char*)cs_0)));
if (tmp_11) tmp_11 = (!(binary__body.get_istemplate_kind((const char*)cs_0)));
if (tmp_11) {
current_location.update_lineno(84);
/* HTTP_Adapter.ttcn, line 84 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("use wither (ascii) body or binary_body"),TTCN_Logger::end_event_log2str()));
}
}
current_location.update_lineno(88);
/* HTTP_Adapter.ttcn, line 88 */
if ((!(host.get_istemplate_kind((const char*)cs_0)))) {
current_location.update_lineno(89);
/* HTTP_Adapter.ttcn, line 89 */
{
HTTPmsg__Types::HeaderLines tmp_12;
{
HTTPmsg__Types::HeaderLines tmp_13;
tmp_13.set_size(1);
tmp_13[0] = ts__HeaderLine(cs_1, host.valueof()).valueof();
tmp_12 = (hdr + tmp_13);
}
hdr = tmp_12;
}
}
current_location.update_lineno(91);
/* HTTP_Adapter.ttcn, line 91 */
if ((!(content__type.get_istemplate_kind((const char*)cs_0)))) {
current_location.update_lineno(92);
/* HTTP_Adapter.ttcn, line 92 */
{
HTTPmsg__Types::HeaderLines tmp_14;
{
HTTPmsg__Types::HeaderLines tmp_15;
tmp_15.set_size(1);
tmp_15[0] = ts__HeaderLine(cs_2, content__type.valueof()).valueof();
tmp_14 = (hdr + tmp_15);
}
hdr = tmp_14;
}
}
current_location.update_lineno(94);
/* HTTP_Adapter.ttcn, line 94 */
if ((!(body.get_istemplate_kind((const char*)cs_0)))) {
current_location.update_lineno(95);
/* HTTP_Adapter.ttcn, line 95 */
{
HTTPmsg__Types::HeaderLines tmp_16;
{
HTTPmsg__Types::HeaderLines tmp_17;
tmp_17.set_size(1);
tmp_17[0] = ts__HeaderLine(cs_3, int2str(body.lengthof())).valueof();
tmp_16 = (hdr + tmp_17);
}
hdr = tmp_16;
}
}
else {
current_location.update_lineno(97);
/* HTTP_Adapter.ttcn, line 97 */
if ((!(binary__body.get_istemplate_kind((const char*)cs_0)))) {
current_location.update_lineno(98);
/* HTTP_Adapter.ttcn, line 98 */
{
HTTPmsg__Types::HeaderLines tmp_18;
{
HTTPmsg__Types::HeaderLines tmp_19;
tmp_19.set_size(1);
tmp_19[0] = ts__HeaderLine(cs_3, int2str(binary__body.lengthof())).valueof();
tmp_18 = (hdr + tmp_19);
}
hdr = tmp_18;
}
}
}
current_location.update_lineno(101);
/* HTTP_Adapter.ttcn, line 101 */
return f__overlay__HTTP__Header(hdr, custom__hdr);
}

CHARSTRING_template f__ts__body__or__empty(const CHARSTRING_template& body)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 104, TTCN_Location::LOCATION_FUNCTION, "f_ts_body_or_empty");
current_location.update_lineno(105);
/* HTTP_Adapter.ttcn, line 105 */
if (body.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(106);
/* HTTP_Adapter.ttcn, line 106 */
return CHARSTRING_template(cs_4);
}
current_location.update_lineno(108);
/* HTTP_Adapter.ttcn, line 108 */
CHARSTRING_template tmp_20;
tmp_20 = body;
tmp_20.check_restriction(TR_VALUE);
return tmp_20;
}

HTTPmsg__Types::HTTPMessage_template ts__HTTP__Req(const CHARSTRING& url, const CHARSTRING& method, const CHARSTRING_template& body, const CHARSTRING_template& content__type, const INTEGER& v__maj, const INTEGER& v__min, const CHARSTRING& host, const HTTPmsg__Types::HeaderLines& custom__hdr, const INTEGER_template& client__id)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 111, TTCN_Location::LOCATION_TEMPLATE, "ts_HTTP_Req");
HTTPmsg__Types::HTTPMessage_template ret_val;
{
HTTPmsg__Types::HTTPRequest_template& tmp_21 = ret_val.request();
tmp_21.client__id() = client__id;
tmp_21.method() = method;
tmp_21.uri() = url;
tmp_21.version__major() = v__maj;
tmp_21.version__minor() = v__min;
tmp_21.header() = f__ts__HTTP__Header(body, OCTETSTRING_template(OMIT_VALUE), content__type, CHARSTRING_template(host), custom__hdr);
tmp_21.body() = f__ts__body__or__empty(body);
}
return ret_val;
}

OCTETSTRING_template f__ts__body__or__empty__bin(const OCTETSTRING_template& body)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 130, TTCN_Location::LOCATION_FUNCTION, "f_ts_body_or_empty_bin");
current_location.update_lineno(131);
/* HTTP_Adapter.ttcn, line 131 */
if (body.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(132);
/* HTTP_Adapter.ttcn, line 132 */
return OCTETSTRING_template(os_0);
}
current_location.update_lineno(134);
/* HTTP_Adapter.ttcn, line 134 */
OCTETSTRING_template tmp_22;
tmp_22 = body;
tmp_22.check_restriction(TR_VALUE);
return tmp_22;
}

HTTPmsg__Types::HTTPMessage_template ts__HTTP__Req__Bin(const CHARSTRING& url, const CHARSTRING& method, const OCTETSTRING_template& body, const CHARSTRING_template& content__type, const INTEGER& v__maj, const INTEGER& v__min, const CHARSTRING& host, const HTTPmsg__Types::HeaderLines& custom__hdr, const INTEGER_template& client__id)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 137, TTCN_Location::LOCATION_TEMPLATE, "ts_HTTP_Req_Bin");
HTTPmsg__Types::HTTPMessage_template ret_val;
{
HTTPmsg__Types::HTTPRequest__binary__body_template& tmp_23 = ret_val.request__binary();
tmp_23.client__id() = client__id;
tmp_23.method() = method;
tmp_23.uri() = url;
tmp_23.version__major() = v__maj;
tmp_23.version__minor() = v__min;
tmp_23.header() = f__ts__HTTP__Header(CHARSTRING_template(OMIT_VALUE), body, content__type, CHARSTRING_template(host), custom__hdr);
tmp_23.body() = f__ts__body__or__empty__bin(body);
}
return ret_val;
}

HTTPmsg__Types::HTTPMessage_template tr__HTTP__Resp(const INTEGER_template& sts)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 156, TTCN_Location::LOCATION_TEMPLATE, "tr_HTTP_Resp");
HTTPmsg__Types::HTTPMessage_template ret_val;
{
HTTPmsg__Types::HTTPResponse_template& tmp_24 = ret_val.response();
tmp_24.client__id() = ANY_VALUE;
tmp_24.version__major() = ANY_VALUE;
tmp_24.version__minor() = ANY_VALUE;
tmp_24.statuscode() = sts;
tmp_24.statustext() = ANY_VALUE;
tmp_24.header() = ANY_VALUE;
tmp_24.body() = ANY_VALUE;
}
return ret_val;
}

HTTPmsg__Types::HTTPMessage_template tr__HTTP__Resp__Bin(const INTEGER_template& sts)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 168, TTCN_Location::LOCATION_TEMPLATE, "tr_HTTP_Resp_Bin");
HTTPmsg__Types::HTTPMessage_template ret_val;
{
HTTPmsg__Types::HTTPResponse__binary__body_template& tmp_25 = ret_val.response__binary();
tmp_25.client__id() = ANY_VALUE;
tmp_25.version__major() = ANY_VALUE;
tmp_25.version__minor() = ANY_VALUE;
tmp_25.statuscode() = sts;
tmp_25.statustext() = ANY_VALUE;
tmp_25.header() = ANY_VALUE;
tmp_25.body() = ANY_VALUE;
}
return ret_val;
}

void f__http__tx__request(const CHARSTRING& url, const CHARSTRING& method, const CHARSTRING_template& body, const OCTETSTRING_template& binary__body, const CHARSTRING& content__type, const HTTPmsg__Types::HeaderLines& custom__hdr, const FLOAT& tout, const INTEGER_template& client__id, const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 182, TTCN_Location::LOCATION_FUNCTION, "f_http_tx_request");
current_location.update_lineno(191);
/* HTTP_Adapter.ttcn, line 191 */
HTTPmsg__Types::Connect__result rc;
current_location.update_lineno(192);
/* HTTP_Adapter.ttcn, line 192 */
TIMER T("T", tout);
current_location.update_lineno(193);
/* HTTP_Adapter.ttcn, line 193 */
INTEGER_template use__client__id(OMIT_VALUE);
current_location.update_lineno(194);
/* HTTP_Adapter.ttcn, line 194 */
HTTP__Adapter__Params use__http__pars;
current_location.update_lineno(196);
/* HTTP_Adapter.ttcn, line 196 */
if (http__pars.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(197);
/* HTTP_Adapter.ttcn, line 197 */
if (http__CT_component_g__http__pars.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(200);
/* HTTP_Adapter.ttcn, line 200 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("no HTTP parameters set"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(201);
/* HTTP_Adapter.ttcn, line 201 */
TTCN_Runtime::stop_execution();
}
current_location.update_lineno(204);
/* HTTP_Adapter.ttcn, line 204 */
use__http__pars = http__CT_component_g__http__pars.valueof();
}
else {
current_location.update_lineno(207);
/* HTTP_Adapter.ttcn, line 207 */
use__http__pars = http__pars.valueof();
}
current_location.update_lineno(211);
/* HTTP_Adapter.ttcn, line 211 */
if (client__id.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(212);
/* HTTP_Adapter.ttcn, line 212 */
http__CT_component_HTTP.send(ts__HTTP__Connect(CHARSTRING_template(const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__host()), INTEGER_template(const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__port()), BOOLEAN_template(const_cast< const HTTP__Adapter__Params&>(use__http__pars).use__ssl())), FALSE, NULL);
current_location.update_lineno(213);
/* HTTP_Adapter.ttcn, line 213 */
T.start();
current_location.update_lineno(214);
/* HTTP_Adapter.ttcn, line 214 */
{
tmp_29:
alt_status tmp_29_alt_flag_0 = ALT_MAYBE;
alt_status tmp_29_alt_flag_1 = ALT_MAYBE;
alt_status tmp_29_alt_flag_2 = ALT_MAYBE;
alt_status tmp_29_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_29_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(215);
/* HTTP_Adapter.ttcn, line 215 */
tmp_29_alt_flag_0 = http__CT_component_HTTP.receive(HTTPmsg__Types::Connect__result_template(ANY_VALUE), &(rc), any_compref, NULL, NULL, NULL);
if (tmp_29_alt_flag_0 == ALT_YES) break;
}
if (tmp_29_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(216);
/* HTTP_Adapter.ttcn, line 216 */
tmp_29_alt_flag_1 = http__CT_component_HTTP.receive(any_compref, NULL, NULL, NULL);
if (tmp_29_alt_flag_1 == ALT_YES) {
current_location.update_lineno(217);
/* HTTP_Adapter.ttcn, line 217 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("HTTP connection to client failed"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(218);
/* HTTP_Adapter.ttcn, line 218 */
TTCN_Runtime::stop_execution();
}
}
if (tmp_29_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(220);
/* HTTP_Adapter.ttcn, line 220 */
tmp_29_alt_flag_2 = T.timeout(NULL);
if (tmp_29_alt_flag_2 == ALT_YES) {
current_location.update_lineno(221);
/* HTTP_Adapter.ttcn, line 221 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for completion of HTTP connection"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(222);
/* HTTP_Adapter.ttcn, line 222 */
TTCN_Runtime::stop_execution();
}
}
if (tmp_29_default_flag == ALT_MAYBE) {
tmp_29_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_29_default_flag == ALT_YES || tmp_29_default_flag == ALT_BREAK) break;
else if (tmp_29_default_flag == ALT_REPEAT) goto tmp_29;
}
current_location.update_lineno(214);
/* HTTP_Adapter.ttcn, line 214 */
if (tmp_29_alt_flag_0 == ALT_NO && tmp_29_alt_flag_1 == ALT_NO && tmp_29_alt_flag_2 == ALT_NO && tmp_29_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file HTTP_Adapter.ttcn between lines 214 and 224.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(225);
/* HTTP_Adapter.ttcn, line 225 */
use__client__id = const_cast< const HTTPmsg__Types::Connect__result&>(rc).client__id();
}
else {
current_location.update_lineno(227);
/* HTTP_Adapter.ttcn, line 227 */
use__client__id = client__id;
}
current_location.update_lineno(230);
/* HTTP_Adapter.ttcn, line 230 */
{
boolean tmp_32;
tmp_32 = (!(body.get_istemplate_kind((const char*)cs_0)));
if (tmp_32) tmp_32 = binary__body.get_istemplate_kind((const char*)cs_0);
if (tmp_32) {
current_location.update_lineno(232);
/* HTTP_Adapter.ttcn, line 232 */
{
INTEGER_template tmp_33;
tmp_33 = use__client__id;
tmp_33.check_restriction(TR_OMIT);
http__CT_component_HTTP.send(ts__HTTP__Req(url, method, body, CHARSTRING_template(content__type), ts__HTTP__Req_v__maj_defval, ts__HTTP__Req_v__min_defval, ((const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__host() + cs_7) + int2str(const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__port())), custom__hdr, tmp_33), FALSE, NULL);
}
}
else {
current_location.update_lineno(235);
/* HTTP_Adapter.ttcn, line 235 */
boolean tmp_34;
tmp_34 = (!(binary__body.get_istemplate_kind((const char*)cs_0)));
if (tmp_34) tmp_34 = body.get_istemplate_kind((const char*)cs_0);
if (tmp_34) {
current_location.update_lineno(237);
/* HTTP_Adapter.ttcn, line 237 */
{
INTEGER_template tmp_35;
tmp_35 = use__client__id;
tmp_35.check_restriction(TR_OMIT);
http__CT_component_HTTP.send(ts__HTTP__Req__Bin(url, method, binary__body, CHARSTRING_template(content__type), ts__HTTP__Req__Bin_v__maj_defval, ts__HTTP__Req__Bin_v__min_defval, ((const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__host() + cs_7) + int2str(const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__port())), custom__hdr, tmp_35), FALSE, NULL);
}
}
else {
current_location.update_lineno(240);
/* HTTP_Adapter.ttcn, line 240 */
boolean tmp_36;
tmp_36 = binary__body.get_istemplate_kind((const char*)cs_0);
if (tmp_36) tmp_36 = body.get_istemplate_kind((const char*)cs_0);
if (tmp_36) {
current_location.update_lineno(242);
/* HTTP_Adapter.ttcn, line 242 */
{
INTEGER_template tmp_37;
tmp_37 = use__client__id;
tmp_37.check_restriction(TR_OMIT);
http__CT_component_HTTP.send(ts__HTTP__Req(url, method, ts__HTTP__Req_body_defval, ts__HTTP__Req_content__type_defval, ts__HTTP__Req_v__maj_defval, ts__HTTP__Req_v__min_defval, ((const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__host() + cs_7) + int2str(const_cast< const HTTP__Adapter__Params&>(use__http__pars).http__port())), custom__hdr, tmp_37), FALSE, NULL);
}
}
else {
current_location.update_lineno(245);
/* HTTP_Adapter.ttcn, line 245 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("either binary_body or body must be used (a request can contain either ASCII data or binary data, not both!"),TTCN_Logger::end_event_log2str()));
}
}
}
}
}

void start_f__http__tx__request(const COMPONENT& component_reference, const CHARSTRING& url, const CHARSTRING& method, const CHARSTRING_template& body, const OCTETSTRING_template& binary__body, const CHARSTRING& content__type, const HTTPmsg__Types::HeaderLines& custom__hdr, const FLOAT& tout, const INTEGER_template& client__id, const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_tx_request(");
url.log();
TTCN_Logger::log_event_str(", ");
method.log();
TTCN_Logger::log_event_str(", ");
body.log();
TTCN_Logger::log_event_str(", ");
binary__body.log();
TTCN_Logger::log_event_str(", ");
content__type.log();
TTCN_Logger::log_event_str(", ");
custom__hdr.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
http__pars.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "HTTP_Adapter", "f_http_tx_request", text_buf);
url.encode_text(text_buf);
method.encode_text(text_buf);
body.encode_text(text_buf);
binary__body.encode_text(text_buf);
content__type.encode_text(text_buf);
custom__hdr.encode_text(text_buf);
tout.encode_text(text_buf);
client__id.encode_text(text_buf);
http__pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

HTTPmsg__Types::HTTPMessage f__http__rx__response(const HTTPmsg__Types::HTTPMessage_template& exp, const FLOAT& tout, const INTEGER_template& client__id, const BOOLEAN& keep__connection)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 249, TTCN_Location::LOCATION_FUNCTION, "f_http_rx_response");
current_location.update_lineno(254);
/* HTTP_Adapter.ttcn, line 254 */
HTTPmsg__Types::HTTPMessage resp;
current_location.update_lineno(255);
/* HTTP_Adapter.ttcn, line 255 */
TIMER T("T", tout);
current_location.update_lineno(256);
/* HTTP_Adapter.ttcn, line 256 */
T.start();
current_location.update_lineno(257);
/* HTTP_Adapter.ttcn, line 257 */
{
tmp_38:
alt_status tmp_38_alt_flag_0 = ALT_MAYBE;
alt_status tmp_38_alt_flag_1 = ALT_MAYBE;
alt_status tmp_38_alt_flag_2 = ALT_MAYBE;
alt_status tmp_38_alt_flag_3 = ALT_MAYBE;
alt_status tmp_38_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_38_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(258);
/* HTTP_Adapter.ttcn, line 258 */
tmp_38_alt_flag_0 = http__CT_component_HTTP.receive(exp, &(resp), any_compref, NULL, NULL, NULL);
if (tmp_38_alt_flag_0 == ALT_YES) {
current_location.update_lineno(259);
/* HTTP_Adapter.ttcn, line 259 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_38_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(261);
/* HTTP_Adapter.ttcn, line 261 */
tmp_38_alt_flag_1 = http__CT_component_HTTP.receive(tr__HTTP__Resp(tr__HTTP__Resp_sts_defval), &(resp), any_compref, NULL, NULL, NULL);
if (tmp_38_alt_flag_1 == ALT_YES) {
current_location.update_lineno(262);
/* HTTP_Adapter.ttcn, line 262 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected HTTP response "),resp.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_38_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(264);
/* HTTP_Adapter.ttcn, line 264 */
tmp_38_alt_flag_2 = http__CT_component_HTTP.receive(tr__HTTP__Resp__Bin(tr__HTTP__Resp__Bin_sts_defval), &(resp), any_compref, NULL, NULL, NULL);
if (tmp_38_alt_flag_2 == ALT_YES) {
current_location.update_lineno(265);
/* HTTP_Adapter.ttcn, line 265 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected (binary) HTTP response "),resp.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_38_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(267);
/* HTTP_Adapter.ttcn, line 267 */
tmp_38_alt_flag_3 = T.timeout(NULL);
if (tmp_38_alt_flag_3 == ALT_YES) {
current_location.update_lineno(268);
/* HTTP_Adapter.ttcn, line 268 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for HTTP response"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(269);
/* HTTP_Adapter.ttcn, line 269 */
TTCN_Runtime::stop_execution();
}
}
if (tmp_38_default_flag == ALT_MAYBE) {
tmp_38_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_38_default_flag == ALT_YES || tmp_38_default_flag == ALT_BREAK) break;
else if (tmp_38_default_flag == ALT_REPEAT) goto tmp_38;
}
current_location.update_lineno(257);
/* HTTP_Adapter.ttcn, line 257 */
if (tmp_38_alt_flag_0 == ALT_NO && tmp_38_alt_flag_1 == ALT_NO && tmp_38_alt_flag_2 == ALT_NO && tmp_38_alt_flag_3 == ALT_NO && tmp_38_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file HTTP_Adapter.ttcn between lines 257 and 271.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(273);
/* HTTP_Adapter.ttcn, line 273 */
if ((!(keep__connection))) {
current_location.update_lineno(274);
/* HTTP_Adapter.ttcn, line 274 */
http__CT_component_HTTP.send(ts__HTTP__Close(client__id), FALSE, NULL);
}
current_location.update_lineno(277);
/* HTTP_Adapter.ttcn, line 277 */
return resp;
}

void start_f__http__rx__response(const COMPONENT& component_reference, const HTTPmsg__Types::HTTPMessage_template& exp, const FLOAT& tout, const INTEGER_template& client__id, const BOOLEAN& keep__connection)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_rx_response(");
exp.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
keep__connection.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "HTTP_Adapter", "f_http_rx_response", text_buf);
exp.encode_text(text_buf);
tout.encode_text(text_buf);
client__id.encode_text(text_buf);
keep__connection.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

HTTPmsg__Types::HTTPMessage f__http__transact(const CHARSTRING& url, const CHARSTRING& method, const CHARSTRING_template& body, const OCTETSTRING_template& binary__body, const CHARSTRING& content__type, const HTTPmsg__Types::HTTPMessage_template& exp, const FLOAT& tout, const HTTPmsg__Types::HeaderLines& custom__hdr, const INTEGER_template& client__id, const BOOLEAN& keep__connection, const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 281, TTCN_Location::LOCATION_FUNCTION, "f_http_transact");
current_location.update_lineno(291);
/* HTTP_Adapter.ttcn, line 291 */
f__http__tx__request(url, method, body, binary__body, content__type, custom__hdr, tout, client__id, http__pars);
current_location.update_lineno(292);
/* HTTP_Adapter.ttcn, line 292 */
return f__http__rx__response(exp, tout, client__id, keep__connection);
}

void start_f__http__transact(const COMPONENT& component_reference, const CHARSTRING& url, const CHARSTRING& method, const CHARSTRING_template& body, const OCTETSTRING_template& binary__body, const CHARSTRING& content__type, const HTTPmsg__Types::HTTPMessage_template& exp, const FLOAT& tout, const HTTPmsg__Types::HeaderLines& custom__hdr, const INTEGER_template& client__id, const BOOLEAN& keep__connection, const HTTP__Adapter__Params_template& http__pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_transact(");
url.log();
TTCN_Logger::log_event_str(", ");
method.log();
TTCN_Logger::log_event_str(", ");
body.log();
TTCN_Logger::log_event_str(", ");
binary__body.log();
TTCN_Logger::log_event_str(", ");
content__type.log();
TTCN_Logger::log_event_str(", ");
exp.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
custom__hdr.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
keep__connection.log();
TTCN_Logger::log_event_str(", ");
http__pars.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "HTTP_Adapter", "f_http_transact", text_buf);
url.encode_text(text_buf);
method.encode_text(text_buf);
body.encode_text(text_buf);
binary__body.encode_text(text_buf);
content__type.encode_text(text_buf);
exp.encode_text(text_buf);
tout.encode_text(text_buf);
custom__hdr.encode_text(text_buf);
client__id.encode_text(text_buf);
keep__connection.encode_text(text_buf);
http__pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

INTEGER_template f__http__client__id__from__http__response(const HTTPmsg__Types::HTTPMessage_template& response__http)
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 295, TTCN_Location::LOCATION_FUNCTION, "f_http_client_id_from_http_response");
current_location.update_lineno(296);
/* HTTP_Adapter.ttcn, line 296 */
{
boolean tmp_42;
{
boolean tmp_39 = response__http.is_bound();
if(tmp_39) {
switch (response__http.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_39 = FALSE;
break;
case ANY_VALUE:
tmp_39 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_39) {
tmp_39 = response__http.ischosen(HTTPmsg__Types::HTTPMessage::ALT_response__binary);
}
if(tmp_39) {
const HTTPmsg__Types::HTTPMessage_template& tmp_40 = response__http;
const HTTPmsg__Types::HTTPResponse__binary__body_template& tmp_41 = tmp_40.response__binary();
tmp_39 = tmp_41.is_present();
}
break;}
default:
tmp_39 = FALSE;
break;
}
}
tmp_42 = tmp_39;
}
if (tmp_42) {
current_location.update_lineno(297);
/* HTTP_Adapter.ttcn, line 297 */
return const_cast< const HTTPmsg__Types::HTTPMessage_template&>(response__http).response__binary().client__id();
}
else {
current_location.update_lineno(298);
/* HTTP_Adapter.ttcn, line 298 */
boolean tmp_46;
{
boolean tmp_43 = response__http.is_bound();
if(tmp_43) {
switch (response__http.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_43 = FALSE;
break;
case ANY_VALUE:
tmp_43 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_43) {
tmp_43 = response__http.ischosen(HTTPmsg__Types::HTTPMessage::ALT_response);
}
if(tmp_43) {
const HTTPmsg__Types::HTTPMessage_template& tmp_44 = response__http;
const HTTPmsg__Types::HTTPResponse_template& tmp_45 = tmp_44.response();
tmp_43 = tmp_45.is_present();
}
break;}
default:
tmp_43 = FALSE;
break;
}
}
tmp_46 = tmp_43;
}
if (tmp_46) {
current_location.update_lineno(299);
/* HTTP_Adapter.ttcn, line 299 */
return const_cast< const HTTPmsg__Types::HTTPMessage_template&>(response__http).response().client__id();
}
}
}
current_location.update_lineno(302);
/* HTTP_Adapter.ttcn, line 302 */
return INTEGER_template(OMIT_VALUE);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HTTP_Adapter");
HTTPmsg__PortType::module_object.pre_init_module();
Native__Functions::module_object.pre_init_module();
module_object.add_function("f_http_init", (genericfunc_t)&f__http__init, (genericfunc_t)&start_f__http__init);
module_object.add_function("f_overlay_HTTP_Header", (genericfunc_t)&f__overlay__HTTP__Header, NULL);
module_object.add_function("f_ts_HTTP_Header", (genericfunc_t)&f__ts__HTTP__Header, NULL);
module_object.add_function("f_ts_body_or_empty", (genericfunc_t)&f__ts__body__or__empty, NULL);
module_object.add_function("f_ts_body_or_empty_bin", (genericfunc_t)&f__ts__body__or__empty__bin, NULL);
module_object.add_function("f_http_tx_request", (genericfunc_t)&f__http__tx__request, (genericfunc_t)&start_f__http__tx__request);
module_object.add_function("f_http_rx_response", (genericfunc_t)&f__http__rx__response, (genericfunc_t)&start_f__http__rx__response);
module_object.add_function("f_http_transact", (genericfunc_t)&f__http__transact, (genericfunc_t)&start_f__http__transact);
module_object.add_function("f_http_client_id_from_http_response", (genericfunc_t)&f__http__client__id__from__http__response, NULL);
}

void post_init_module()
{
TTCN_Location current_location("HTTP_Adapter.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HTTP_Adapter");
HTTPmsg__PortType::module_object.post_init_module();
Native__Functions::module_object.post_init_module();
current_location.update_lineno(32);
/* HTTP_Adapter.ttcn, line 32 */
template_f__http__init_http__pars_defval = OMIT_VALUE;
current_location.update_lineno(38);
/* HTTP_Adapter.ttcn, line 38 */
template_ts__HTTP__Connect_http__port_defval = 80;
current_location.update_lineno(39);
/* HTTP_Adapter.ttcn, line 39 */
template_ts__HTTP__Connect_use__ssl_defval = FALSE;
current_location.update_lineno(44);
/* HTTP_Adapter.ttcn, line 44 */
template_ts__HTTP__Close_client__id_defval = OMIT_VALUE;
current_location.update_lineno(74);
/* HTTP_Adapter.ttcn, line 74 */
template_f__ts__HTTP__Header_body_defval = OMIT_VALUE;
current_location.update_lineno(75);
/* HTTP_Adapter.ttcn, line 75 */
template_f__ts__HTTP__Header_binary__body_defval = OMIT_VALUE;
current_location.update_lineno(76);
/* HTTP_Adapter.ttcn, line 76 */
template_f__ts__HTTP__Header_content__type_defval = OMIT_VALUE;
current_location.update_lineno(77);
/* HTTP_Adapter.ttcn, line 77 */
template_f__ts__HTTP__Header_host_defval = OMIT_VALUE;
current_location.update_lineno(78);
/* HTTP_Adapter.ttcn, line 78 */
const_f__ts__HTTP__Header_custom__hdr_defval = NULL_VALUE;
current_location.update_lineno(112);
/* HTTP_Adapter.ttcn, line 112 */
const_ts__HTTP__Req_method_defval = cs_5;
current_location.update_lineno(113);
/* HTTP_Adapter.ttcn, line 113 */
template_ts__HTTP__Req_body_defval = OMIT_VALUE;
current_location.update_lineno(114);
/* HTTP_Adapter.ttcn, line 114 */
template_ts__HTTP__Req_content__type_defval = OMIT_VALUE;
current_location.update_lineno(115);
/* HTTP_Adapter.ttcn, line 115 */
const_ts__HTTP__Req_v__maj_defval = 1;
current_location.update_lineno(115);
/* HTTP_Adapter.ttcn, line 115 */
const_ts__HTTP__Req_v__min_defval = 1;
current_location.update_lineno(117);
/* HTTP_Adapter.ttcn, line 117 */
const_ts__HTTP__Req_custom__hdr_defval = NULL_VALUE;
current_location.update_lineno(118);
/* HTTP_Adapter.ttcn, line 118 */
template_ts__HTTP__Req_client__id_defval = OMIT_VALUE;
current_location.update_lineno(138);
/* HTTP_Adapter.ttcn, line 138 */
const_ts__HTTP__Req__Bin_method_defval = cs_5;
current_location.update_lineno(139);
/* HTTP_Adapter.ttcn, line 139 */
template_ts__HTTP__Req__Bin_body_defval = OMIT_VALUE;
current_location.update_lineno(140);
/* HTTP_Adapter.ttcn, line 140 */
template_ts__HTTP__Req__Bin_content__type_defval = OMIT_VALUE;
current_location.update_lineno(141);
/* HTTP_Adapter.ttcn, line 141 */
const_ts__HTTP__Req__Bin_v__maj_defval = 1;
current_location.update_lineno(141);
/* HTTP_Adapter.ttcn, line 141 */
const_ts__HTTP__Req__Bin_v__min_defval = 1;
current_location.update_lineno(143);
/* HTTP_Adapter.ttcn, line 143 */
const_ts__HTTP__Req__Bin_custom__hdr_defval = NULL_VALUE;
current_location.update_lineno(144);
/* HTTP_Adapter.ttcn, line 144 */
template_ts__HTTP__Req__Bin_client__id_defval = OMIT_VALUE;
current_location.update_lineno(156);
/* HTTP_Adapter.ttcn, line 156 */
template_tr__HTTP__Resp_sts_defval = ANY_VALUE;
current_location.update_lineno(168);
/* HTTP_Adapter.ttcn, line 168 */
template_tr__HTTP__Resp__Bin_sts_defval = ANY_VALUE;
current_location.update_lineno(180);
/* HTTP_Adapter.ttcn, line 180 */
{
INTEGER_template tmp_26;
tmp_26.set_type(VALUE_RANGE);
tmp_26.set_min(200);
tmp_26.set_max(299);
template_tr__HTTP__Resp2xx = tr__HTTP__Resp(tmp_26);
}
current_location.update_lineno(182);
/* HTTP_Adapter.ttcn, line 182 */
const_f__http__tx__request_method_defval = cs_5;
current_location.update_lineno(183);
/* HTTP_Adapter.ttcn, line 183 */
template_f__http__tx__request_body_defval = OMIT_VALUE;
current_location.update_lineno(184);
/* HTTP_Adapter.ttcn, line 184 */
template_f__http__tx__request_binary__body_defval = OMIT_VALUE;
current_location.update_lineno(185);
/* HTTP_Adapter.ttcn, line 185 */
const_f__http__tx__request_content__type_defval = cs_6;
current_location.update_lineno(186);
/* HTTP_Adapter.ttcn, line 186 */
const_f__http__tx__request_custom__hdr_defval = NULL_VALUE;
current_location.update_lineno(187);
/* HTTP_Adapter.ttcn, line 187 */
const_f__http__tx__request_tout_defval = 2.0;
current_location.update_lineno(188);
/* HTTP_Adapter.ttcn, line 188 */
template_f__http__tx__request_client__id_defval = OMIT_VALUE;
current_location.update_lineno(189);
/* HTTP_Adapter.ttcn, line 189 */
template_f__http__tx__request_http__pars_defval = OMIT_VALUE;
current_location.update_lineno(249);
/* HTTP_Adapter.ttcn, line 249 */
template_f__http__rx__response_exp_defval = tr__HTTP__Resp2xx;
current_location.update_lineno(250);
/* HTTP_Adapter.ttcn, line 250 */
const_f__http__rx__response_tout_defval = 2.0;
current_location.update_lineno(251);
/* HTTP_Adapter.ttcn, line 251 */
template_f__http__rx__response_client__id_defval = OMIT_VALUE;
current_location.update_lineno(252);
/* HTTP_Adapter.ttcn, line 252 */
const_f__http__rx__response_keep__connection_defval = FALSE;
current_location.update_lineno(281);
/* HTTP_Adapter.ttcn, line 281 */
const_f__http__transact_method_defval = cs_5;
current_location.update_lineno(282);
/* HTTP_Adapter.ttcn, line 282 */
template_f__http__transact_body_defval = OMIT_VALUE;
current_location.update_lineno(283);
/* HTTP_Adapter.ttcn, line 283 */
template_f__http__transact_binary__body_defval = OMIT_VALUE;
current_location.update_lineno(284);
/* HTTP_Adapter.ttcn, line 284 */
const_f__http__transact_content__type_defval = cs_6;
current_location.update_lineno(285);
/* HTTP_Adapter.ttcn, line 285 */
template_f__http__transact_exp_defval = tr__HTTP__Resp2xx;
current_location.update_lineno(286);
/* HTTP_Adapter.ttcn, line 286 */
const_f__http__transact_tout_defval = 2.0;
current_location.update_lineno(286);
/* HTTP_Adapter.ttcn, line 286 */
const_f__http__transact_custom__hdr_defval = NULL_VALUE;
current_location.update_lineno(287);
/* HTTP_Adapter.ttcn, line 287 */
template_f__http__transact_client__id_defval = OMIT_VALUE;
current_location.update_lineno(288);
/* HTTP_Adapter.ttcn, line 288 */
const_f__http__transact_keep__connection_defval = FALSE;
current_location.update_lineno(289);
/* HTTP_Adapter.ttcn, line 289 */
template_f__http__transact_http__pars_defval = OMIT_VALUE;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "http_CT")) {
http__CT_component_HTTP.activate_port();
http__CT_component_g__http__pars.clean_up();
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "http_CT")) {
if (!strcmp(port_name, "HTTP")) {
http__CT_component_HTTP.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_http_init")) {
HTTP__Adapter__Params_template http__pars;
http__pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_init(");
http__pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__http__init(http__pars);
TTCN_Runtime::function_finished("f_http_init");
return TRUE;
} else if (!strcmp(function_name, "f_http_tx_request")) {
CHARSTRING url;
CHARSTRING method;
CHARSTRING_template body;
OCTETSTRING_template binary__body;
CHARSTRING content__type;
HTTPmsg__Types::HeaderLines custom__hdr;
FLOAT tout;
INTEGER_template client__id;
HTTP__Adapter__Params_template http__pars;
url.decode_text(function_arguments);
method.decode_text(function_arguments);
body.decode_text(function_arguments);
binary__body.decode_text(function_arguments);
content__type.decode_text(function_arguments);
custom__hdr.decode_text(function_arguments);
tout.decode_text(function_arguments);
client__id.decode_text(function_arguments);
http__pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_tx_request(");
url.log();
TTCN_Logger::log_event_str(", ");
method.log();
TTCN_Logger::log_event_str(", ");
body.log();
TTCN_Logger::log_event_str(", ");
binary__body.log();
TTCN_Logger::log_event_str(", ");
content__type.log();
TTCN_Logger::log_event_str(", ");
custom__hdr.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
http__pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__http__tx__request(url, method, body, binary__body, content__type, custom__hdr, tout, client__id, http__pars);
TTCN_Runtime::function_finished("f_http_tx_request");
return TRUE;
} else if (!strcmp(function_name, "f_http_rx_response")) {
HTTPmsg__Types::HTTPMessage_template exp;
FLOAT tout;
INTEGER_template client__id;
BOOLEAN keep__connection;
exp.decode_text(function_arguments);
tout.decode_text(function_arguments);
client__id.decode_text(function_arguments);
keep__connection.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_rx_response(");
exp.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
keep__connection.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__http__rx__response(exp, tout, client__id, keep__connection);
TTCN_Runtime::function_finished("f_http_rx_response");
return TRUE;
} else if (!strcmp(function_name, "f_http_transact")) {
CHARSTRING url;
CHARSTRING method;
CHARSTRING_template body;
OCTETSTRING_template binary__body;
CHARSTRING content__type;
HTTPmsg__Types::HTTPMessage_template exp;
FLOAT tout;
HTTPmsg__Types::HeaderLines custom__hdr;
INTEGER_template client__id;
BOOLEAN keep__connection;
HTTP__Adapter__Params_template http__pars;
url.decode_text(function_arguments);
method.decode_text(function_arguments);
body.decode_text(function_arguments);
binary__body.decode_text(function_arguments);
content__type.decode_text(function_arguments);
exp.decode_text(function_arguments);
tout.decode_text(function_arguments);
custom__hdr.decode_text(function_arguments);
client__id.decode_text(function_arguments);
keep__connection.decode_text(function_arguments);
http__pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_http_transact(");
url.log();
TTCN_Logger::log_event_str(", ");
method.log();
TTCN_Logger::log_event_str(", ");
body.log();
TTCN_Logger::log_event_str(", ");
binary__body.log();
TTCN_Logger::log_event_str(", ");
content__type.log();
TTCN_Logger::log_event_str(", ");
exp.log();
TTCN_Logger::log_event_str(", ");
tout.log();
TTCN_Logger::log_event_str(", ");
custom__hdr.log();
TTCN_Logger::log_event_str(", ");
client__id.log();
TTCN_Logger::log_event_str(", ");
keep__connection.log();
TTCN_Logger::log_event_str(", ");
http__pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__http__transact(url, method, body, binary__body, content__type, exp, tout, custom__hdr, client__id, keep__connection, http__pars);
TTCN_Runtime::function_finished("f_http_transact");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
